On 3/31/2023 10:14 AM, jkn wrote:
On Friday, March 31, 2023 at 1:09:12 PM UTC+1, Chris Angelico wrote:
On Fri, 31 Mar 2023 at 23:01, Jim Schwartz <jsc...@sbcglobal.net> wrote:

I want a windows installer to install my application that's written in
python, but I don't want the end user to have access to my source code.



Is that possible using python? I was using cx-freeze, but that has the
source code available. So does pyinstaller. I think gcc does, too.



Does anyone know of a way to do this?

Fundamentally no, it's not. Python code will always be distributed as
some form of bytecode. The only way to make it available without
revealing anything is to put it on a server and let people access it
without running it themselves.

But why is that a problem? Copyright law protects you from people
stealing your code and making unauthorized changes to it, and if
you're not worried about them making changes, there's no reason to
hide the source code (whatever you distribute would be just as
copiable). Are you concerned that people will see your bugs? We all
have them.

ChrisA

The OP is asking for source code not to be available, not bytecode.
There are obfuscating tools like PyArmor you might want to have a look at.

The byte code can be decompiled, though, so the attempt to hide the code won't be completely successful if someone wants to make the effort. The same is true, e.g., about Java. The class files don't include the source, but they can be decompiled.

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to