Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I compile a python file, I get a *.pyc file. When I try to run that, I get a message saying there is no program for running them. When I search for a program online via that option, it says there are none. Can anyone help me run there files?

share|improve this question
up vote 10 down vote accepted

Since your python file is byte compiled you need to run it through the from the python interpreter

python yourfile.pyc

The reason you can run your .py files work directly is because you have the line

#!/usr/bin/python

or something similar on the first line in the .py files. This tells your shell to execute the rest of the file with the python interpreter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.