相关疑难解决方法(0)

如何在Windows中添加到pythonpath?

我有一个托管所有Django应用程序的目录(C:\My_Projects).我想将此目录添加到我的PYTHONPATH所以我可以直接调用这些应用程序.

我尝试从Windows GUI()添加C:\My_Projects\;到我的Path变量My Computer > Properties > Advanced System Settings > Environment Variables.但它仍然没有读取coltrane模块并生成此错误:

错误:没有名为coltrane的模块

python windows environment-variables pythonpath

347
推荐指数
17
解决办法
129万
查看次数

在ipython中添加换行符

如果在iPython或任何多行命令中引入for循环,我该如何返回并向其添加行?我跑了这个:

for row in table.find_all('tr'):
    cells = row.find_all('td')
    for c,cell in enumerate(cells):
        print c,":",cell.get_text().strip()
    try:
        this = cells[0]
        that = cells[1]
        the_docket = cells[2]
        other_thign = cells[3]
        jumble = re.sub('\s+',' ',str(cells[5])).strip()            
    except:
        "Nope"
Run Code Online (Sandbox Code Playgroud)

并意识到我需要为它添加一行,但我不能只是在运行命令的iPython,b/c中点击"输入".那么我可以在iPython中编辑那个多行命令吗?

python ipython

52
推荐指数
7
解决办法
3万
查看次数