Python Application does nothing

后端 未结 3 1911
野性不改
野性不改 2021-01-29 16:37

This code stopped doing anything at all after I changed something that I no longer remember

#Dash Shell
import os
import datetime

class LocalComputer:
    pass
         


        
相关标签:
3条回答
  • 2021-01-29 16:54

    You should better describe your problem. Does it print the input prompt? Does it output anything? Does it exit or just sit there? I noticed a few issues while reading over this code that might help. You should be using raw_input(), not input(). Also, you don't actually do anything with userinput unless it == 'exit'. Which is won't, because you are just using input(), not raw_input(), so the person would have to enter 'exit' (including quotes) or else the loop will never exit. (Assuming it's not Python 3 Code)

    0 讨论(0)
  • 2021-01-29 16:56

    It's doing nothing because there's no code to make it do anything. Try inserting a line like

    print("You entered:", userinput)
    

    at an appropriate place in your loop.

    0 讨论(0)
  • 2021-01-29 17:02

    os.getenv() must have at least one param. Try os.getenv("HOST") or something.

    0 讨论(0)
提交回复
热议问题