Python Forum

Full Version: py_compile spouted this weird output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I found that simply importing the module wasn't reliable, so I tried py_compile, and...
py_compile.compile("info.py")
'__pycache__\\info.cpython-34.pyc'
I looked and found a folder named __pycache__ but my file wasn't in it! What happened? What should I do? I'm really confused.
EDIT: Problem solved!
(Dec-12-2017, 10:27 PM)Klar Wrote: [ -> ]I found that simply importing the module wasn't reliable
Would you like to elaborate on this?
No? All I meant by that was that most of the time, when you import something,it doesn't create a .pyc. Anyway, help on this?
EDIT: Problem solved!
Thinking you need a .pyc usually means you don't actually know what a .pyc is.
Why do you think you need one?
I don't need one right now, I'm just testing if py_compile works.
A .pyc file is basically a .py file that has been compiled, and when clicked on it launches the module in the interpreter. Pretty nifty.
EDIT: Problem solved!