From: Bayazee on
hi
can we hide a python code ?
if i want to write a commercial software can i hide my source code from
users access ?
we can conver it to pyc but this file can decompiled ... so ...!!
do you have any idea about this ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir

From: John Machin on

Bayazee wrote:
> hi
> can we hide a python code ?
> if i want to write a commercial software can i hide my source code from
^^^^^^^^^^^^^^^^^^^^^^^^[1]
> users access ?
> we can conver it to pyc but this file can decompiled ... so ...!!
> do you have any idea about this ...?
>
> ---------------------------------------
> First Iranian Open Source Community : www.python.ir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[2]


[1] and [2] don't seem to be compatible.

Really the only way to keep your code secret is not to distribute it --
provide the functionality from a web server.

If you want to distribute obfuscated code, consider writing it in perl
:-)

From: Bayazee on
hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...
but in python we easily open the program executable(ascii) file and
read source ....
i meen than any way to protect my code or convert it to executable
witch can not be decompiled (python code)....

From: John Machin on

Bayazee wrote:
> hi
> in compiled languages when we compile a code to an executable file it
> convert to a machine code so now we cant access to source ...
> but in python we easily open the program executable(ascii) file and
> read source ....
> i meen than any way to protect my code or convert it to executable
> witch can not be decompiled (python code)....

I know what you mean.

However consider this: There is no such thing as an executable which
cannot be decompiled; if the code can be executed, then anybody with
read access to the code can disassemble/decompile/whatever it -- there
is no theoretical difference between disassembling an .exe file and
decompiling a .pyc file. What's in a .pyc file is just the machine code
for a virtual machine ...

Consider changing your business plan: write crappy software, charge
heaps for support -- it's not a novel idea :-)

From: Steven D'Aprano on
On Thu, 10 Aug 2006 17:03:51 -0700, Bayazee wrote:

> hi
> in compiled languages when we compile a code to an executable file it
> convert to a machine code so now we cant access to source ...

There are disassemblers for machine code. If somebody really wants to see
how your code works, they can do it.

> but in python we easily open the program executable(ascii) file and read
> source ....

Yes. That is by design.

> i meen than any way to protect my code or convert it to executable witch
> can not be decompiled (python code)....

In your first email, you wrote:

"First Iranian Open Source Community : www.python.ir"

Hiding source code is incompatible with Open Source software. You can hide
code, or be Open Source, but not both.

What makes you think that your code is so special that it is worth
stealing? Do you have incredible secret algorithms that nobody has ever
seen before? Or are you just so ashamed of it that you don't want people
to see it?

Or maybe you've copied other people's code, and you don't want them to see
that? What are you hiding?

Whatever your reasons for hiding the source code, there are things which
you can do to obfuscate Python code which will make it difficult for
people to get to the source code. Google for "python obfuscate" for links.
But I'm guessing that, if you hide your source code, most people will
wonder what you are hiding and avoid your program.

If you really want something which compiles to machine code, then Python
is not the language for you. Use another language.



--
Steven D'Aprano

 |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11
Prev: PIL Image transform
Next: Tab delimited file