I am making an app in python on mac osx 10.8.5 I converted the python script into an app by using py2app
. But, within app, On Show Package Contents-->Contents-->Resources
original code is present. I don't want to show my code to others by distributing my app as security issue. I removed the (.py)code with (.pyc)code, in that case the app didn't work properly.
Please suggest some way for it.I search on other questions also, but didn't get the desired result. My setup.py is
from setuptools import setup
APP=['myapp.py']
DATA_FILES= [('',['config.cfg'])]
OPTIONS={'iconfile':'cc.icns','argv_emulation': True,'plist':{'CFBundleShortVersionString':'1.0'}}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app']
)
The easiest workaround is to move the code in myapp.py to another module and import that module in myapp.py.
Note that modules other than the main script are only byte-compiled (as .pyc files), and those files can still easily be turned into source code.
Byte-compiling the script file is on my todo list, but is more complicated that just replacing a .py file by a .pyc file as you noticted :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With