python 简单的IPython脚本下载所有RasberryPi MagPi版本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 简单的IPython脚本下载所有RasberryPi MagPi版本相关的知识,希望对你有一定的参考价值。

# run with IPython to download all magpi editions
# run `ipython dl_magpi.py`
# need wget installed
# change current_edition to latest version

current_edition = 31
magpi_url = 'http://www.raspberrypi.org/magpi-issues/MagPi%s.pdf'

for edition in range(1, current_edition+1):
    # add a zero if edition number lower than 10
    if edition < 10 :
        temp = "0" + str(edition)
        edition_to_download = magpi_url  % temp
    
    if edition >  9 :
        edition_to_download = magpi_url % str(edition)
    
    print "Downloading ", edition_to_download
    !wget $edition_to_download

以上是关于python 简单的IPython脚本下载所有RasberryPi MagPi版本的主要内容,如果未能解决你的问题,请参考以下文章

如何安装ipython notebook

ipython及Python初体验

1python与ipython的下载与安装

ipython

将 Python 脚本退出到 IPython 命令行以进行调试

ipython在最新python版本中出现事件循环问题