问题描述:

I have a sent.py file, and in this file I have a function getProcessing(), when I call this function I want to call a function (createmrjob) from another python file (processing.py).

Im trying to do this with code below and it is working fine, but after I call this function getProcessing() when user choose option 2, it is created a processing.pyc file. It is normal? There is a way that this file its not created?

def getProcessing():

from processing import createmrjob

def nav():

print ""

while True:

response_options = {'1': Choice(msg="User Managment", callback=userManagment), '2': Choice(msg="processing", callback=getProcessing)}

result = make_choice(response_options)

if result is None:

print "Selected option not available."

else:

result.callback()

网友答案:

Yes, it is normal. The *.pyc file contains compiled version of your module.

网友答案:

That is normal. Python tries to optimize by generating a .pyc version of the .py, which is pre-compiled.

You can avoid this by environment variables, command-line parameters, or from inside the program. See this post

.

网友答案:

It is normal. It is byte code file, which is generated by the Python interpreter and is executed by Python's virtual machine.

相关阅读:
Top