Possible Duplicate:
Python Application does nothing
#Dash Shell
import os
import datetime
class LocalComputer:
pass
def InitInformation():
Home = LocalComputer()
#Acquires user information
if (os.name == "nt"):
Home.ComputerName = os.getenv("COMPUTERNAME")
Home.Username = os.getenv("USERNAME")
Home.Homedir = os.getenv("HOMEPATH")
else:
Home.ComputerName = os.getenv("HOSTNAME")
Home.Username = os.getenv("USER")
Home.Homedir = os.getenv("HOME")
return Home
def MainShellLoop():
print ("--- Dash Shell ---")
Home = InitInformation()
userinput = None
currentdir = Home.Homedir
while (userinput != "exit"):
rightnow = datetime.datetime.now()
try:
userinput = input(str(Home.ComputerName) + "\\" + str(Home.Username) + ":" + str(rightnow.month) + "/" + str(rightnow.day) + "/" + str(rightnow.year) + "@" + str(currentdir))
except:
print("Invalid Command specified, please try again")
MainShellLoop()
input()
应该执行,它在更改了我不记得的内容后停止工作
它是在python3.1.2和windows7下编写的,我知道Unix Hostname全局变量是错误的
我知道userinput
什么都不做,我想在继续之前让这部分工作
谢谢
它什么也不输出
我想你需要打电话给
MainShellLoop
。你知道吗相关问题 更多 >
编程相关推荐