Exporting application and removing the source folder

I have problems with exporting my sketch with Export Application option. When I export it I get 2 folders ( for 32bit and 64bit version) and if I click on 32bit version and run my .exe file everything works fine. But if I delete the source folder inside the 32bit folder, my .exe file just won’t work as intended. It only shows the splash image and then does nothing. This bothers me because i want to share my work with some people and I dont want to give them my code. I am using Processing 3.4 with python mode.

i guess, possibly
*.py are ever running in “python interpreter”
so you can not delete them.

in JAVA mode the

delete source directory

idea works.
if you are able to delete single files ( but not the .py )
to cripple the project so it is not so easy to recreate,
i don’t know.

but as i think open source ( and even open hardware ) is the right way
i am not very motivated to help you.

I don’t think that the Python mode exporter works that way. This is because Python mode is based on Jython, and Jython takes the python code as input then runs it on JVM. I’m not sure if Python mode can use Jython to run .pyc files instead – but even if it can, I don’t believe that it does. You might consider asking about this here:

…but be aware, distributing .pyc only won’t actually protect your code from someone who wants it. Decompiling .pyc files is pretty easy to do, e.g. with uncompyle. Python isn’t designed to keep code secret. If you want to do this, you might as well leave the .py files and obfuscate them before distribution, for example using pyminifier. The problem is that your code must reference the Processing API – so unless your sketch is quite complicated, there is only so much obfuscation possible, as rect() is rect().

A final option might be to hide the python script files inside the jar file.


You might need to alter Python mode to get them to load correctly – I’m not sure. This would make it appear that there were no .pyde / .py resources in the exported application.

However, again, a determined person could just unzip the jar and your code would be right there.

Personally, I would suggest embracing openness.