Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

python doesn't run script with 'python <script name>'

I'm gett a strange problem when running python script from linux, it doesn't seem to bother running the script file (I've put a print statement on the first line and it doesn't come out):

zl@o-xterm-71 h2bin> python main.py
Python 2.7.3 (default, Feb 4 2013, 18:00:47)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

The script runs fine on my laptop with 2.7.5, and even with 2.4.3 so I'd assume it's not a version problem. Should be something simple that I missed.. Anyone had this before? Thanks!

edit1:
dummy.py:

def main():
 print "it works"
if __name__ == '__main__':
 main()

output:

zl@o-xterm-71 h2bin> python dummy.py
Python 2.7.3 (default, Feb 4 2013, 18:00:47)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Typing 'python' gives the exact same thing.

Answer*

Draft saved
Draft discarded
Cancel

lang-py

AltStyle によって変換されたページ (->オリジナル) /