此代碼不再做任何事情後,我改變了什麼,我已經不記得Python應用程序什麼也不做
#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()
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()
編輯:大聲笑對不起你們忘了說,它應該運行輸入
我收到關於'os.getenv()'的投訴,因爲它需要一個參數。 – 2010-08-02 20:38:09
@Indebi:你甚至不會去猜測你爲了做到這一點而改變了什麼? – 2010-08-02 20:38:39
這是您應該使用源代碼管理的一個原因,即使是非常小的項目。不起作用?只需回滾到一個版本,看看有什麼變化! – 2010-08-02 20:46:44