Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92628 > unrolled thread

Creating .exe file in Python

Started bysubhabrata.banerji@gmail.com
First post2015-06-15 04:42 -0700
Last post2015-06-17 08:30 -0700
Articles 13 on this page of 33 — 9 participants

Back to article view | Back to comp.lang.python


Contents

  Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-15 04:42 -0700
    Re: Creating .exe file in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-15 13:07 +0100
      Re: Creating .exe file in Python sohcahtoa82@gmail.com - 2015-06-15 10:09 -0700
    Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-15 15:01 +0200
      Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-15 06:42 -0700
        Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-15 16:44 +0200
    Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-15 07:03 -0700
      Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-15 07:40 -0700
    Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-15 09:11 -0700
      Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-15 18:29 +0200
        Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-16 03:46 -0700
        Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-16 06:56 -0700
          Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-16 17:04 +0200
            Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-16 08:17 -0700
              Re: Creating .exe file in Python Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-16 10:00 -0600
              Re: Creating .exe file in Python Chris Angelico <rosuav@gmail.com> - 2015-06-17 02:03 +1000
                Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-16 09:23 -0700
                Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 06:10 -0700
                  Re: Creating .exe file in Python Chris Angelico <rosuav@gmail.com> - 2015-06-17 23:20 +1000
                    Re: Creating .exe file in Python hamilton <hamilton@nothere.com> - 2015-06-17 07:33 -0600
                      Re: Creating .exe file in Python Chris Angelico <rosuav@gmail.com> - 2015-06-17 23:52 +1000
                        Re: Creating .exe file in Python Steven D'Aprano <steve@pearwood.info> - 2015-06-18 01:39 +1000
                          Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 08:46 -0700
                          Re: Creating .exe file in Python Chris Angelico <rosuav@gmail.com> - 2015-06-18 01:58 +1000
                      Re: Creating .exe file in Python random832@fastmail.us - 2015-06-17 10:17 -0400
                        Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 07:30 -0700
                      Re: Creating .exe file in Python Chris Angelico <rosuav@gmail.com> - 2015-06-18 00:38 +1000
                    Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 06:33 -0700
                  Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-17 15:54 +0200
                    Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 07:04 -0700
    Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 07:16 -0700
      Re: Creating .exe file in Python Laura Creighton <lac@openend.se> - 2015-06-17 17:21 +0200
        Re: Creating .exe file in Python subhabrata.banerji@gmail.com - 2015-06-17 08:30 -0700

Page 2 of 2 — ← Prev page 1 [2]


#92745

FromChris Angelico <rosuav@gmail.com>
Date2015-06-17 23:52 +1000
Message-ID<mailman.549.1434549125.13271.python-list@python.org>
In reply to#92741
On Wed, Jun 17, 2015 at 11:33 PM, hamilton <hamilton@nothere.com> wrote:
> On 6/17/2015 7:20 AM, Chris Angelico wrote:
>>
>> On Wed, Jun 17, 2015 at 11:10 PM,  <subhabrata.banerji@gmail.com> wrote:
>>>
>>> Thank you all. It seems going fine now. I have one additional question if
>>> I run the .exe files created in Non Python Windows environment. Linux has
>>> Python builtin but in Non Python environment how may I run it? Is there any
>>> set of prequisites I have to follow. I am not finding much web help, if any
>>> one may kindly suggest.
>>>
>>
>> There have been some proposals to make an easy way to produce a single
>> package that has a Windows executable header, but can be easily
>> unpacked and run using a system-provided Linux or Mac OS Python.
>> However, I don't think any have been deployed yet. So the simple
>> answer is: You can't do what you're trying to do. Instead, take a step
>> back, and look at just getting your Python program to run on all
>> platforms... and that's easy, just distribute the .py files. Much MUCH
>> easier, more reliable, and simpler.
>>
>> ChrisA
>>
> Yes, this is easy.
>
> However, the python source can be read by anyone.
>
> As a .exe, the source can not be read.
>
> Just because the interpreter is open source,
> does not mean my application should be.

Actually, all you've done is obscure your code. This is a very common
fallacy; people think that since they cannot themselves read the code
out of what they're distributing, nor can anyone else. There's no way
to completely stop people from reading your code other than to not
give them the code.

If you truly want to protect your code from prying eyes, therefore,
there's only one way to do it: host it on a server, and let people
access the server without seeing the code. This is true of all
languages, not just Python, and it's always been the way. You can try
to put legal guards around your code ("opening this package
constitutes acceptance, blah blah, you agree that you will not reverse
engineer, disassemble, blah blah"), but that won't stop people. It's
best to either give them the code and let them see it clearly (open
source) or keep the code away from them in all forms (server-side
deployment).

ChrisA

[toc] | [prev] | [next] | [standalone]


#92763

FromSteven D'Aprano <steve@pearwood.info>
Date2015-06-18 01:39 +1000
Message-ID<558194a8$0$1672$c3e8da3$5496439d@news.astraweb.com>
In reply to#92745
On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote:

> If you truly want to protect your code from prying eyes, therefore,
> there's only one way to do it: host it on a server, and let people
> access the server without seeing the code.

Stop giving people ideas.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#92766

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 08:46 -0700
Message-ID<ba23b248-4a9d-45c1-a2cf-bca12190bf29@googlegroups.com>
In reply to#92763
On Wednesday, June 17, 2015 at 9:09:32 PM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote:
> 
> > If you truly want to protect your code from prying eyes, therefore,
> > there's only one way to do it: host it on a server, and let people
> > access the server without seeing the code.
> 
> Stop giving people ideas.
> 
> 
> 
> -- 
> Steven

Why sir?
Regards,
Subhabrata Banerjee. 

[toc] | [prev] | [next] | [standalone]


#92768

FromChris Angelico <rosuav@gmail.com>
Date2015-06-18 01:58 +1000
Message-ID<mailman.558.1434556742.13271.python-list@python.org>
In reply to#92763
On Thu, Jun 18, 2015 at 1:39 AM, Steven D'Aprano <steve@pearwood.info> wrote:
> On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote:
>
>> If you truly want to protect your code from prying eyes, therefore,
>> there's only one way to do it: host it on a server, and let people
>> access the server without seeing the code.
>
> Stop giving people ideas.

Not sure what the problem here is. There are plenty of servers that
run closed-source software. Yes, there are people like rms who believe
that *all* software should be free, but I don't agree. There are
people who wish to keep their code to themselves, and they should be
allowed to do that. I'm just pointing out that they then have to go to
the effort of making the *service* (rather than the software)
available.

ChrisA

[toc] | [prev] | [next] | [standalone]


#92752

Fromrandom832@fastmail.us
Date2015-06-17 10:17 -0400
Message-ID<mailman.553.1434550667.13271.python-list@python.org>
In reply to#92741
On Wed, Jun 17, 2015, at 09:33, hamilton wrote:
> However, the python source can be read by anyone.
> 
> As a .exe, the source can not be read.
> 
> Just because the interpreter is open source,
> does not mean my application should be.

Being readable isn't the same thing as being open source. If someone
steals your application, you can sue them.

[toc] | [prev] | [next] | [standalone]


#92755

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 07:30 -0700
Message-ID<d3a76974-7d4a-4573-bf13-1967e6219bff@googlegroups.com>
In reply to#92752
On Wednesday, June 17, 2015 at 7:47:59 PM UTC+5:30, rand...@fastmail.us wrote:
> On Wed, Jun 17, 2015, at 09:33, hamilton wrote:
> > However, the python source can be read by anyone.
> > 
> > As a .exe, the source can not be read.
> > 
> > Just because the interpreter is open source,
> > does not mean my application should be.
> 
> Being readable isn't the same thing as being open source. If someone
> steals your application, you can sue them.

Guido can create another Python. I know my limits. So I never steal or copy unnecessarily I learn. 

[toc] | [prev] | [next] | [standalone]


#92756

FromChris Angelico <rosuav@gmail.com>
Date2015-06-18 00:38 +1000
Message-ID<mailman.554.1434551929.13271.python-list@python.org>
In reply to#92741
On Thu, Jun 18, 2015 at 12:17 AM,  <random832@fastmail.us> wrote:
> On Wed, Jun 17, 2015, at 09:33, hamilton wrote:
>> However, the python source can be read by anyone.
>>
>> As a .exe, the source can not be read.
>>
>> Just because the interpreter is open source,
>> does not mean my application should be.
>
> Being readable isn't the same thing as being open source. If someone
> steals your application, you can sue them.

Right, though most people who look at obscuring their code are more
concerned with making it impossible (as opposed to illegal) to see the
source. And that's the one that doesn't work.

ChrisA

[toc] | [prev] | [next] | [standalone]


#92742

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 06:33 -0700
Message-ID<96672d23-c333-49e5-9f61-028a189bdc91@googlegroups.com>
In reply to#92740
On Wednesday, June 17, 2015 at 6:50:48 PM UTC+5:30, Chris Angelico wrote:
> On Wed, Jun 17, 2015 at 11:10 PM, wrote:
> > Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run it? Is there any set of prequisites I have to follow. I am not finding much web help, if any one may kindly suggest.
> >
> 
> There have been some proposals to make an easy way to produce a single
> package that has a Windows executable header, but can be easily
> unpacked and run using a system-provided Linux or Mac OS Python.
> However, I don't think any have been deployed yet. So the simple
> answer is: You can't do what you're trying to do. Instead, take a step
> back, and look at just getting your Python program to run on all
> platforms... and that's easy, just distribute the .py files. Much MUCH
> easier, more reliable, and simpler.
> 
> ChrisA

Dear Sir,

Thank you for your kind and prompt answer. I was about to explore another package. Regards, Subhabrata Banerjee.

[toc] | [prev] | [next] | [standalone]


#92746

FromLaura Creighton <lac@openend.se>
Date2015-06-17 15:54 +0200
Message-ID<mailman.550.1434549305.13271.python-list@python.org>
In reply to#92739
In a message of Wed, 17 Jun 2015 06:10:45 -0700, subhabrata.banerji@gmail.com w
rites:

>Dear Group,
>
>Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run it? Is there any set of prequisites I have to follow. I am not finding much web help, if any one may kindly suggest. 
>
>Regards,
>Subhabrata Banerjee.

If you use py2exe or PyInstaller (or whatever it is you used) to make
your exe, then all of this is handled for you.  Hand the windows users
the exe and they are good to go.  But the last time you posted here,
your py2exe wasn't working well.  You were getting Import Errors.
If you make a broken exe, well, it will be broken for the windows
users as well.

Laura

[toc] | [prev] | [next] | [standalone]


#92748

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 07:04 -0700
Message-ID<480c4ec4-ef15-420e-84a2-d66ff8da59eb@googlegroups.com>
In reply to#92746
On Wednesday, June 17, 2015 at 7:25:39 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 17 Jun 2015 06:10:45 -0700, w
> rites:
> 
> >Dear Group,
> >
> >Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non Python environment how may I run it? Is there any set of prequisites I have to follow. I am not finding much web help, if any one may kindly suggest. 
> >
> >Regards,
> >Subhabrata Banerjee.
> 
> If you use py2exe or PyInstaller (or whatever it is you used) to make
> your exe, then all of this is handled for you.  Hand the windows users
> the exe and they are good to go.  But the last time you posted here,
> your py2exe wasn't working well.  You were getting Import Errors.
> If you make a broken exe, well, it will be broken for the windows
> users as well.
> 
> Laura

Thanks. I will check. I am calling the .exe from C:\Python27\dist... would it run in non Python Windows Environment? Regards, Subhabrata Banerjee.

[toc] | [prev] | [next] | [standalone]


#92751

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 07:16 -0700
Message-ID<67f1c9b8-fa76-45ca-a6a1-dcb29208d333@googlegroups.com>
In reply to#92628
On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote:
> Dear Group,
> 
> I am trying to learn how to create .exe file for Python. I tried to work around 
> http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice.
> But if I try to make exe for larger programs with methods and classes I am getting error. 
> 
> If any one of the esteemed members may kindly suggest how to work out. 
> I am using Python2.7+ on Windows 7 Professional. 
> 
> Regards,
> Subhabrata Banerjee.

But if I am moving the file from Python environment and to another folder in C: drive it is not running, it is giving me following error messages,
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\tutorial>hello.exe
LoadLibrary(pythondll) failedThe specified module could not be found.
C:\tutorial\PYTHON27.DLL
C:\tutorial>

Regards,
Subhabrata Banerjee. 

[toc] | [prev] | [next] | [standalone]


#92761

FromLaura Creighton <lac@openend.se>
Date2015-06-17 17:21 +0200
Message-ID<mailman.557.1434554505.13271.python-list@python.org>
In reply to#92751
In a message of Wed, 17 Jun 2015 07:16:33 -0700, subhabrata.banerji@gmail.com w
rites:
>On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote:
>> Dear Group,
>> 
>> I am trying to learn how to create .exe file for Python. I tried to work around 
>> http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice.
>> But if I try to make exe for larger programs with methods and classes I am getting error. 
>> 
>> If any one of the esteemed members may kindly suggest how to work out. 
>> I am using Python2.7+ on Windows 7 Professional. 
>> 
>> Regards,
>> Subhabrata Banerjee.
>
>But if I am moving the file from Python environment and to another folder in C: drive it is not running, it is giving me following error messages,
>Microsoft Windows [Version 6.1.7601]
>Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>
>C:\tutorial>hello.exe
>LoadLibrary(pythondll) failedThe specified module could not be found.
>C:\tutorial\PYTHON27.DLL
>C:\tutorial>
>
>Regards,
>Subhabrata Banerjee. 

You have to distribute the DLL as well.
But at this point you need somebody who knows more about packaging
for windows than I do.  It's not something I do often, or well.

Laura

[toc] | [prev] | [next] | [standalone]


#92762

Fromsubhabrata.banerji@gmail.com
Date2015-06-17 08:30 -0700
Message-ID<610d75de-ee89-4149-b513-28dc2e69c19a@googlegroups.com>
In reply to#92761
On Wednesday, June 17, 2015 at 8:52:16 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 17 Jun 2015 07:16:33 -0700,  w
> rites:
> >On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, wrote:
> >> Dear Group,
> >> 
> >> I am trying to learn how to create .exe file for Python. I tried to work around 
> >> http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice.
> >> But if I try to make exe for larger programs with methods and classes I am getting error. 
> >> 
> >> If any one of the esteemed members may kindly suggest how to work out. 
> >> I am using Python2.7+ on Windows 7 Professional. 
> >> 
> >> Regards,
> >> Subhabrata Banerjee.
> >
> >But if I am moving the file from Python environment and to another folder in C: drive it is not running, it is giving me following error messages,
> >Microsoft Windows [Version 6.1.7601]
> >Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> >
> >C:\tutorial>hello.exe
> >LoadLibrary(pythondll) failedThe specified module could not be found.
> >C:\tutorial\PYTHON27.DLL
> >C:\tutorial>
> >
> >Regards,
> >Subhabrata Banerjee. 
> 
> You have to distribute the DLL as well.
> But at this point you need somebody who knows more about packaging
> for windows than I do.  It's not something I do often, or well.
> 
> Laura

Hi,
My need is done. But I can learn. I saw few .pyd files in dist folder.
Regards,
Subhabrata Banerjee. 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web