python脚本有什么问题?

python脚本有什么问题?,python,windows-xp,main,indentation,Python,Windows Xp,Main,Indentation,python脚本有什么问题 代码: 错误: Traceback (most recent call last): File "bb-freeze-script.py", line 8, in <module> load_entry_point('bbfreeze==0.97.3', 'console_scripts', 'bb-freeze')() File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-wi

python脚本有什么问题

代码:

错误:

Traceback (most recent call last):
  File "bb-freeze-script.py", line 8, in <module>
    load_entry_point('bbfreeze==0.97.3', 'console_scripts', 'bb-freeze')()
  File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\__init__.py", line 24, in main
    f.addScript(x)
  File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\freezer.py", line 410, in addScript
    s = self.mf.run_script(path)
  File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\modulegraph\modulegraph.py", line 241, in run_script
    co = compile(file(pathname, READ_MODE).read()+'\n', pathname, 'exec')
  File "C:\dtmp\main.py", line 14
    ^
IndentationError: expected an indented block

操作系统-Windows XP这里有一个关于如何读取回溯的快速演练。这很容易

查看您的代码,所有这些都是调用Python内置模块。可以肯定地说,它们没有导致错误,所以只剩下os.system调用了。果然,您是通过上述调用调用python的,为什么不导入要调用的模块呢

回溯确认错误在您正在调用的另一个Python中:

Traceback (most recent call last):
  File "bb-freeze-script.py", line 8, in <module>
    load_entry_point('bbfreeze==0.97.3', 'console_scripts', 'bb-freeze')()
直到你到达

File "C:\dtmp\main.py", line 14
IndentationError: expected an indented block

现在,错误出现在main.py的第14行,在那里您应该有一个缩进,但没有缩进。

main.py脚本中出现了一个缩进错误。您可以发布代码吗?是的,这是main.py脚本代码中的错误:导入操作系统,系统类目录:def Createself:dir=raw\u inputFolder name:os.mkdirdirdirdir打印创建的def Deleteself:dir=raw\u inputFolder name:os.rmdirdir打印删除的def退出:仅供参考,将您的冻结器脚本编写为可从命令行调用的Python模块会更好/更好/更好,因为这样您就可以导入bb_freeze并使用您将在其中编写的API。从Python代码调用Python代码实际上不应该通过os.system来完成。您不应该在路径中使用反斜杠。正斜杠适用于所有系统,包括Windows。如果你想保留它们,至少要使用生弦“r'C:\something”而不是逃避狂欢´'C:\\something'''''''''+1来教你如何钓鱼,而不是简单地提供晚餐。
File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\__init__.py", line 24, in main
    f.addScript(x)
File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\freezer.py", line 410, in addScript
    s = self.mf.run_script(path)
File "C:\Python27\lib\site-packages\bbfreeze-0.97.3-py2.7-win32.egg\bbfreeze\modulegraph\modulegraph.py", line 241, in run_script
    co = compile(file(pathname, READ_MODE).read()+'\n', pathname, 'exec')
File "C:\dtmp\main.py", line 14
IndentationError: expected an indented block