From: W. eWatson on
On 8/6/2010 10:31 AM, geremy condra wrote:
> On Fri, Aug 6, 2010 at 8:00 AM, W. eWatson<wolftracks(a)invalid.com> wrote:
>>
>>>> I would think there are some small time and big time Python players who
>>>> sell
>>>> executable versions of their programs for profit?
>>>
>>> Yes. What's your point?
>>
>> That someone must know how to distribute them without having the source code
>> ripped off.
>
> I've never seen a code obfuscation scheme I thought did the job the
> whole way, including compiling C, and Python bytecode is significantly
> easier to turn back into something resembling the original source
> (YMMV, I suppose). Also, if you don't know about common tools like
> distutils, the odds are pretty good that it isn't your code itself
> that is valuable to you- you're probably more interested in protecting
> your idea about what the code should do. At least for now, that's
> outside of the scope of technical solutions- discuss it with a lawyer,
> not a programmer.
>
>>>
>>>> disutils. Sounds familiar. I'm pretty sure I was using Py2Exe, and
>>>> disutils
>>>> might have been part of it.
>>>
>>> distutils.
>>>
>>> http://docs.python.org/library/distutils.html
>>
>> I don't see ;how distutils is going to solve this problem. Are you
>> suggesting the program should be packaged? Why? I can just send it to him as
>> py code. distutils looks like it's for library modules, e.g., functions like
>> math.
>
> ...no. Distutils is handy because you could just bundle your
> dependencies and hand them an easy-to-install package, which would be
> a quick way to get everybody on the same page. Of course, depending on
> the licenses those dependencies are under you might want to do even
> more talking to a lawyer than I've previously suggested before you go
> about trying to sell that bundle- I'm sure you wouldn't want to 'rip
> off' great free projects like python and numpy.
>
> Geremy Condra
Yes, code reversal programs have been around for many, many decades. Try
one on MS Word or Adobe Acrobat. :-)

Is there a complete illustration of using disutils? Our only
dependencies are on Python Org material. We use no commercial or
licensed code.
From: Peter Otten on
W. eWatson wrote:

> So you think Python is part of open software in terms of distributing a
> "product"? So I should stick to C, where one can distribute programs w/o
> revealing code details, and having a customer compile the code? It's

No, I'm trying to make you reconsider what you're going to protect rather
than how. Aren't your customers more interested in using your software
rather than tinker with it?
From: CM on
On Aug 5, 9:50 pm, "W. eWatson" <wolftra...(a)invalid.com> wrote:
> In my on-again-off-again experience with Python for 18 months,
> portability seems an issue.
>
> As an example, my inexperienced Python partner 30 miles away has gotten
> out of step somehow. I think by installing a different version of numpy
> than I use. I gave him a program we both use months ago, and he had no
> trouble. (We both use IDLE on 2.5). I made a one character change to it
> and sent him the new py file. He can't execute it. I doubt he has
> changed anything in the intervening period.

I'm curious: what was the one character change? And does your
original
program still work for him? Why did he install a different version
of
numpy if things were working for him?

By the way, posting "x doesn't work" on a forum never gets you
any help, because clairvoyance is not real :D. Posting actual error
messages sample code does.

> A further example. Months ago I decided to see if I could compile a
> program to avoid such problems as above. I planned to satisfy that need,
> and see if I could distribute some simple programs to non-Python
> friends. I pretty well understand the idea,and got it working with a
> small program. It seemed like a lot of manual labor to do it.

As someone mentioned, you don't "compile" anything in Python. You
can make a .exe file, though, using, as you know, py2exe. I find
using
GUI2Exe (which requires you have wxPython) to make things much easier
and then if you want to be even fancier, use InnoSetup to make an
installer.
Once you get a working script in py2exe/GUI2Exe, it is usually a snap
to
make a new version of your .exe after changing your code a bit.

As far as then updating your .exe files with your non-Python friends,
you
should search this newsgroup for Esky, which seems like a very nice
idea
for doing this very thing.

Che

From: CM on
> As an example, my inexperienced Python partner 30 miles away has gotten
> out of step somehow. I think by installing a different version of numpy
> than I use. I gave him a program we both use months ago, and he had no
> trouble. (We both use IDLE on 2.5). I made a one character change to it
> and sent him the new py file. He can't execute it. I doubt he has
> changed anything in the intervening period.

I'm curious: what was the one character change? And does your
original program still work for him? Why did he install a different
version of numpy if things were working for him?

By the way, posting "x doesn't work" on a forum never gets you
any help, because clairvoyance is not real :D. Posting actual error
messages sample code does.

> A further example. Months ago I decided to see if I could compile a
> program to avoid such problems as above. I planned to satisfy that need,
> and see if I could distribute some simple programs to non-Python
> friends. I pretty well understand the idea,and got it working with a
> small program. It seemed like a lot of manual labor to do it.

As someone mentioned, you don't "compile" anything in Python.
You can make a .exe file, though, using, as you know, py2exe.
I find using GUI2Exe (which requires you have wxPython) to make
things
much easier and then if you want to be even fancier, use InnoSetup to
make an installer.

Once you get a working script in py2exe/GUI2Exe, it is usually a snap
to make a new version of your .exe after changing your code a bit.

As far as then updating your .exe files with your non-Python friends,
you should search this newsgroup for Esky, which seems like a very
nice idea for doing this very thing.

Che
From: Steven D'Aprano on
On Fri, 06 Aug 2010 08:00:55 -0700, W. eWatson wrote:

>>> I would think there are some small time and big time Python players
>>> who sell executable versions of their programs for profit?
>>
>> Yes. What's your point?
> That someone must know how to distribute them without having the source
> code ripped off.

That's what copyright law is for.

If you think that distributing object code (instead of source code) is
going to deter a serious hacker, you're deluded.

Besides, I don't mean to be rude, but what makes you think anyone would
care about stealing your code? If you think people are interested in
stealing your code, you're almost certainly wrong. The world is full of
coders who think their two-bit text editor or re-implementation of PacMan
is the most precious, precious software in existence. The vast majority
of them are wrong.


--
Steven