Re: Can .py be complied?

2005-05-01 Thread John J. Lee
Steve Holden [EMAIL PROTECTED] writes:

 John J. Lee wrote:
[...]
  I'm hesitant to label everybody who disagrees with you (and me) on
  that a zealot.  Though I tend to take the same side you do, I'm not
[...]
 Well, we appear to agree. Please note I wasn't labelling anyone a
 zealot, simply implying that I didn't want the discussion to descend
 to blind repetitions of principle with no supporting arguments.
[...]

Sorry, I wasn't reading carefully.

I suppose really my thought was directed more at the programming world
in general, which often feels free to label free software advocates as
loonies (I've been guilty of this myself, I'm sure).  Of course, lots
of them *are* loonies, but that's beside the point. ;-)


John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-30 Thread Steve Holden
John J. Lee wrote:
Steve Holden [EMAIL PROTECTED] writes:
[...]
There's nothing wrong with open source projects catering to a market,
and there's nothing wrong with running open source software on a
proprietary operating system. To behave otherwise might reduce the
growth opportunities for Python and its community.
no-zealotry-please-ly y'rs  - steve
[...]
I'm hesitant to label everybody who disagrees with you (and me) on
that a zealot.  Though I tend to take the same side you do, I'm not
entirely sure it's not just laziness on my part that I think that way.
Seems to me that holding opinions such as it's a bad thing to support
open source software on closed source systems, and you should not do
it, for the common good is far from crazy, even though I don't
currently happen to hold that view.
Well, we appear to agree. Please note I wasn't labelling anyone a 
zealot, simply implying that I didn't want the discussion to descend to 
blind repetitions of principle with no supporting arguments.

I have no problem with others taking a different view from mine on this 
issue, though I reserve the right to disagree with them. My own view is 
that open source (Python included) wouldn't be anywhere near as advanced 
and popular as it is if it hadn't been ported to the majority platform, 
and that this actually positions it better for eventual world domination 
:-). There's a reason Microsoft are fighting Linux with FUD.

Let's also not forget that at PyCon, (I am told) when Jim Hugunin asked 
for a show of hands as to who principally developed for Windows 
platforms, *Guido* raised his hand.

regards
 Steve
--
Steve Holden+1 703 861 4237  +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-30 Thread Peter Dembinski
[EMAIL PROTECTED] (John J. Lee) writes:

[snap]

 Until they install the next program that does this.

If we talk about _real_ users from the _real_ world, the most of them
would just kill the app (or what is the name for stopping running
program in w32) when the download begins[1] :)

[1] 'hey, is that a spyware or what?  what takes so darn long?'

-- 
http://www.pdemb.prv.pl 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-30 Thread Mike Meyer
jfj [EMAIL PROTECTED] writes:

 /* small program in C in self extracting archive
   */
 if (have_application (Python)) {
have_python:
system (python.exe my_application.py)
 } else {
printf (This software requires python. Wait until all the
 necessary components are being installed\n);
download_python_from_python_org();
system (install_python.exe);
goto have_python;
 }

Goto. Ugh.

if (!have_application(Python)) {
printf (This software requires python. Wait until all the
 necessary components are being installed\n);
download_python_from_python_org();
system (install_python.exe);
}
system(python.exe my_application.py);

   mike
-- 
Mike Meyer [EMAIL PROTECTED]  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-29 Thread Simon Brunning
On 28 Apr 2005 07:01:50 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 IMO the fact that so many people ask
 
 How can I create executables in Python on Windows
 
 indicates that standard batteries included Windows Python
 distribution is missing a vital battery.

It indicates to *me* that people aren't reading the FAQ. ;-)

-- 
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-29 Thread Steve Holden
steve.leach wrote:
python -o foo.exe foo.py
at the command line, and get an executable, without any further effort.

Hence making the resulting program useless to users of most operating 
systems.
Let's ignore for the moment whether including py2exe as a battery is a 
desirable thing from an abstract point of view. We may legitimately 
differ about that.

We should not forget in our enthusiasm for open source that while users 
of most operating systems might not find py2exe useful, most users of 
operating systems may well, since Windows users outnumber the rest 
several times.

There's nothing wrong with open source projects catering to a market, 
and there's nothing wrong with running open source software on a 
proprietary operating system. To behave otherwise might reduce the 
growth opportunities for Python and its community.

no-zealotry-please-ly y'rs  - steve
--
Steve Holden+1 703 861 4237  +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-29 Thread John J. Lee
Steve Holden [EMAIL PROTECTED] writes:
[...]
 There's nothing wrong with open source projects catering to a market,
 and there's nothing wrong with running open source software on a
 proprietary operating system. To behave otherwise might reduce the
 growth opportunities for Python and its community.
 
 no-zealotry-please-ly y'rs  - steve
[...]

I'm hesitant to label everybody who disagrees with you (and me) on
that a zealot.  Though I tend to take the same side you do, I'm not
entirely sure it's not just laziness on my part that I think that way.

Seems to me that holding opinions such as it's a bad thing to support
open source software on closed source systems, and you should not do
it, for the common good is far from crazy, even though I don't
currently happen to hold that view.


John

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


Re: Can .py be complied?

2005-04-29 Thread John J. Lee
jfj [EMAIL PROTECTED] writes:
[...]
 /* small program in C in self extracting archive
   */
 if (have_application (Python)) {
have_python:
system (python.exe my_application.py)
 } else {
printf (This software requires python. Wait until all the
 necessary components are being installed\n);
download_python_from_python_org();
system (install_python.exe);
goto have_python;
 }
 
 
 Seriously, people who want executables wouldn't notice the difference.

Until they install the next program that does this.


John

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


Re: Can .py be complied?

2005-04-28 Thread monkey
Thx very much, I got the point now ( ;

 The latter.  It's not completely self contained, there is an
 ..exe and some dll files that need to be distributed together.
 It's explained very clearly by the py2exe web site:

   http://starship.python.net/crew/theller/py2exe/

 Never used google before?  Just go to www.google.com and type
 in py2exe.  Click search.  It's the first hit.

 -- 
 Grant Edwards   grante Yow!  Is something
VIOLENT
   at   going to happen to a
visi.comGARBAGE CAN?


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


Re: Can .py be complied?

2005-04-28 Thread Pajo
I've just tried to build both console and windows exe and
it works just fine

monkey wrote:
Thx very much, I got the point now ( ;

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


Re: Can .py be complied?

2005-04-28 Thread beliavsky
IMO the fact that so many people ask

How can I create executables in Python on Windows

indicates that standard batteries included Windows Python
distribution is missing a vital battery. There are tools such as
py2exe, but this functionality should be built-in, so that a newbie to
Python can just download it, type

python -o foo.exe foo.py

at the command line, and get an executable, without any further effort.

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


Re: Can .py be complied?

2005-04-28 Thread steve.leach
python -o foo.exe foo.py
at the command line, and get an executable, without any further effort.
Hence making the resulting program useless to users of most operating 
systems.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-28 Thread jfj
[EMAIL PROTECTED] wrote:
IMO the fact that so many people ask
How can I create executables in Python on Windows
indicates that standard batteries included Windows Python
distribution is missing a vital battery. There are tools such as
py2exe, but this functionality should be built-in, so that a newbie to
Python can just download it, type
python -o foo.exe foo.py
at the command line, and get an executable, without any further effort.

Since this is about windows and windows users just want everything in
.exe form (no matter if it also contains spyware), and they don't care
about the size of it (they just want the damn exe) and since there is
zero chance that python will be included in the next windows
distribution but these people still want the exe (they do, really),
I think I have a convenient solution to give it to them.
/* small program in C in self extracting archive
 */
if (have_application (Python)) {
  have_python:
  system (python.exe my_application.py)
} else {
  printf (This software requires python. Wait until all the
necessary components are being installed\n);
  download_python_from_python_org();
  system (install_python.exe);
  goto have_python;
}
Seriously, people who want executables wouldn't notice the difference.
jfj
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-28 Thread Maurice LING
steve.leach wrote:
python -o foo.exe foo.py
at the command line, and get an executable, without any further effort.

Hence making the resulting program useless to users of most operating 
systems.
In close sourced development, which most corporates may prefer, yes, the 
resulting program is useless to users of most operating systems.

In open sourced developement, it is still a good feature to have. At 
least for distribution to end users or as trial.

To end users, they don't care, as long as they can click and run the 
program they need.

To developers, if the codes are close source, nothing can be done anyway 
even if you have the codes, licensing agreements and contracts usually 
forbids everything. If the codes are open source, you will get the codes 
 anyway and do according to the limits of the licence.

maurice
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-28 Thread monkey
 python -o foo.exe foo.py


Is that a real command that can be use?


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


Re: Can .py be complied?

2005-04-27 Thread Filip Dreger

U¿ytkownik monkey [EMAIL PROTECTED] napisa³ w wiadomo¶ci 
news:[EMAIL PROTECTED]

 If using Jython to complie, is the end-user need JRE instead of 
 Python
 installed, or need both of them?

Only JRE. Just like Java.

 I don't know the exact details, but try using the compiled Python
 scripts (bytecode). I believe they are semi-optimized and platform
 independent. They are the .pyc and .pyo files generated when the 
 script
 is run.
 Is that means a .py convert to .pyc or .pyo, without the need of 
 make file
 as using py2exe?

.pyc files are generated every time a module (any .py file can be a 
module) is imported. So if you have a program, say, example.py, you 
just start the python interpreter and write:
 import example
And then example.pyc will appear beside example.py. This new file does 
not require example.py (you can even delete it), and works on any 
computer with Python installed (on Windows you can just double-click 
it)
If you start the Python interpreter using:
python -OO (if you are using Windows, you shoud start the interpreter 
from the command line, probably something like:
c:
cd \
python24\python -OO)
and then import your example.py, you will get a file example.pyo, 
which is also stripped of any documentation strings (a bit harder to 
decode).

regards,
Filip Dreger 


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


Re: Can .py be complied?

2005-04-27 Thread Kent Johnson
monkey wrote:
It is generally not very easy or straight-forward.
For now, you can use pyfreeze to snap the application.
If your application does not use any C modules, you can try to use
Jython instead.
Cheers
Maurice

If using Jython to complie, is the end-user need JRE instead of Python
installed, or need both of them?
The end-user needs the JRE, not Python.
Kent
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-27 Thread Lucas Raab
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I don't know the exact details, but try using the compiled Python
scripts (bytecode). I believe they are semi-optimized and platform
independent. They are the .pyc and .pyo files generated when the
script
is run.

Okay, I found this documentation
http://fux0r.phathookups.com/programming-tutorials/Python/tut/node43.html.
It hides the source but you still need Python installed on the system
running the bytecode.
But those files can be decompyled.
--
--
Lucas Raab
lvraab@earthlink.net
dotpyFE@gmail.com
AIM:Phoenix11890
MSN:dotpyfe@gmail.com
IRC:lvraab
ICQ:324767918
Yahoo:  Phoenix11890
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-27 Thread Maksim Kasimov

Maurice LING [EMAIL PROTECTED] wrote:
news:[EMAIL PROTECTED]
 If your application does not use any C modules, you can try to use
 Jython instead. Program in python but use jythonc to convert it into
 Java source files and package it into Java JAR files, then you will only
 need to release the JAR files without needing to release your codes.

using Jython will not helps to hide your sources - jar-files are also easy
to decompile and to receive the source code (it will even looks like
original).
To avoid releasing your java-code (as far as it possible), the jar-files are
also necessary for processing by obfuscators


--
Best regards,
Maksim Kasimov
mailto: [EMAIL PROTECTED]


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


Re: Can .py be complied?

2005-04-27 Thread monkey
 And then example.pyc will appear beside example.py. This new file does
 not require example.py (you can even delete it), and works on any
 computer with Python installed

Filip, you can read through my mind (-: You just told me what I want to know
exactly, even I can't ask the question correctly. Thx..

 python24\python -OO)
 and then import your example.py, you will get a file example.pyo,
 which is also stripped of any documentation strings (a bit harder to
 decode).

Is .pyo still not secure for serious purpose? The -OO function refer to
which area of python that I can read a doc in details?

 The end-user needs the JRE, not Python.

 Kent

Actually I still not dare to touch Jython, because I am still digging python
now. But the JRE may not attract end-user, because it is still associate
with slow and eating much system resource, although Java is sure a
respectfully programming language. What do you think?


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


Re: Can .py be complied?

2005-04-27 Thread monkey

 But those files can be decompyled.


Hi, so which way to go?


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


Re: Can .py be complied?

2005-04-27 Thread Grant Edwards
On 2005-04-27, monkey [EMAIL PROTECTED] wrote:

 Yes, I want more options. Since the python doc mentioned
 py2exe only, and it is difficult to understand how it
 work.(may be you guys know C and make file, but I am still
 foolish here...)

py2exe has nothing to do with C or make files.  You create a
setup.py file containing a couple lines of python.  You run
that python program, and you end up with an .exe file and some
associated .dll files.  I typically use inno-setup to create an
installer.exe that creates a desktop icon and start-menu entry,
but that's optional.

 Is that means a .py convert to .pyc or .pyo, without the need
 of make file as using py2exe?

Huh?  You don't need a make file for py2exe.

-- 
Grant Edwards   grante Yow!  I'd like TRAINED
  at   SEALS and a CONVERTIBLE on
   visi.commy doorstep by NOON!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-27 Thread monkey
 py2exe has nothing to do with C or make files.  You create a
 setup.py file containing a couple lines of python.  You run
 that python program, and you end up with an .exe file and some
 associated .dll files.  I typically use inno-setup to create an
 installer.exe that creates a desktop icon and start-menu entry,
 but that's optional.

Is py2exe used to make a .exe file to install .py, or make the self-contain
.exe file of the program itself?


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


Re: Can .py be complied?

2005-04-27 Thread Grant Edwards
On 2005-04-27, monkey [EMAIL PROTECTED] wrote:

 py2exe has nothing to do with C or make files.  You create a
 setup.py file containing a couple lines of python.  You run
 that python program, and you end up with an .exe file and some
 associated .dll files.  I typically use inno-setup to create
 an installer.exe that creates a desktop icon and start-menu
 entry, but that's optional.

 Is py2exe used to make a .exe file to install .py, or make the self-contain
 .exe file of the program itself?


The latter.  It's not completely self contained, there is an
..exe and some dll files that need to be distributed together.
It's explained very clearly by the py2exe web site:

  http://starship.python.net/crew/theller/py2exe/

Never used google before?  Just go to www.google.com and type
in py2exe.  Click search.  It's the first hit.
  
-- 
Grant Edwards   grante Yow!  Is something VIOLENT
  at   going to happen to a
   visi.comGARBAGE CAN?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-27 Thread steve.leach
Harlin Seritt wrote:
Hi monkey,
Not a stupid question especially if you're trying to create commercial
software and don't want to reveal your source. At any rate, you can use
py2exe to create a .exe file. It does have some cons to it since you
Some very severe cons considering that would mean his code would only 
run on a certain infamous legacy operating system that will remain 
unnamed.  The last I checked, .exe files were rather useless on most 
operating systems.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-26 Thread Harlin Seritt
Hi monkey,

Not a stupid question especially if you're trying to create commercial
software and don't want to reveal your source. At any rate, you can use
py2exe to create a .exe file. It does have some cons to it since you
are compiling an interpreted script but it works fine in this capacity.
If you would like to obfuscate your code (disguise it) without an
executable you can try pyobfuscate as well. Just Google for these two
and you'll find easily.

Harlin Seritt

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


Re: Can .py be complied?

2005-04-26 Thread Maurice LING
monkey wrote:
Hi all, I am new to programming, already have a glace on introduction of
c++, java and finally decided on python. But I found that the .py file is
just like the source file, how can I make a program without revealing its
source? (may be my question is a little bit stupid)

It is generally not very easy or straight-forward. The developers of 
CPython had generally intended that the source codes be the actual 
distribution, and is not likely to change. (see the thread on bytecode 
non-backcompatibility)

For now, you can use pyfreeze to snap the application, which is to 
bundle your application to a python interpreter (bootstrapping) as a 
package but this will not create a portable application. You can only 
run the application on the native system that it is frozen on. For 
example, if i freeze my application on Mac OSX, I won't be able to run 
that on MS Windows. Freezing bootstraps the system's python onto the 
application.

If your application does not use any C modules, you can try to use 
Jython instead. Program in python but use jythonc to convert it into 
Java source files and package it into Java JAR files, then you will only 
need to release the JAR files without needing to release your codes.

Cheers
Maurice
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can .py be complied?

2005-04-26 Thread [EMAIL PROTECTED]
I don't know the exact details, but try using the compiled Python
scripts (bytecode). I believe they are semi-optimized and platform
independent. They are the .pyc and .pyo files generated when the script
is run.

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


Re: Can .py be complied?

2005-04-26 Thread [EMAIL PROTECTED]

[EMAIL PROTECTED] wrote:
 I don't know the exact details, but try using the compiled Python
 scripts (bytecode). I believe they are semi-optimized and platform
 independent. They are the .pyc and .pyo files generated when the
script
 is run.

Okay, I found this documentation
http://fux0r.phathookups.com/programming-tutorials/Python/tut/node43.html.
It hides the source but you still need Python installed on the system
running the bytecode.

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