Why won't my python code print anything?

前端 未结 6 948
梦如初夏
梦如初夏 2020-12-21 11:52

A program I wrote wasn\'t printing anything when I executed it out of the terminal, so I tried the ran the following code

import sys

#!/usr/bin/python

def          


        
6条回答
  •  臣服心动
    2020-12-21 12:33

    Python does not automatically call main() (and you'll need to use the sys library to get argv).

    #!/usr/bin/python
    
    import sys
    
    def main():
        print  "hell0\n"
    
    main()
    

提交回复
热议问题