Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
32
rated 0 times [  32] [ 0]  / answers: 1 / hits: 140276  / 2 Years ago, wed, august 24, 2022, 12:04:18

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?


More From » python

 Answers
0

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


python yourfile.pyc

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


#!/usr/bin/python

or


#!/usr/bin/env python

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


[#37421] Thursday, August 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
admin

Total Points: 459
Total Questions: 112
Total Answers: 109

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;