【发布时间】:2017-08-21 11:45:41
【问题描述】:
我的代码很吃力。现在我的老师想让我用这个做一个函数,我真的很努力,但我想不通。 所以我需要从中创建一个函数,然后再进一步调用它。有人可以帮我或给我一些建议吗:) :)
opengraph = False
while opengraph is not True:
if len(sys.argv) == 2:
name = sys.argv[1]
g = openmap(name)
opengraph = True
else:
try:
name = raw_input('Please enter a file: ')
g = openmap(name)
opengraph = True
except:
print 'Not able to read the file you wrote, try another time.'
origdest = raw_input('Enter origin and destination (quit to exit): ')
【问题讨论】:
-
阅读任何教程的“功能”部分?