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


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

looking into python...

Started bycrankypuss <invalid@invalid.invalid>
First post2016-03-02 15:00 -0700
Last post2016-03-04 11:03 -0500
Articles 6 — 4 participants

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


Contents

  looking into python... crankypuss <invalid@invalid.invalid> - 2016-03-02 15:00 -0700
    Re: looking into python... Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 09:20 +1100
      Re: looking into python... crankypuss <invalid@invalid.invalid> - 2016-03-03 03:45 -0700
        Re: looking into python... Steven D'Aprano <steve@pearwood.info> - 2016-03-04 00:39 +1100
          Re: looking into python... crankypuss <invalid@invalid.invalid> - 2016-03-04 03:53 -0700
          Re: looking into python... Terry Reedy <tjreedy@udel.edu> - 2016-03-04 11:03 -0500

#103903 — looking into python...

Fromcrankypuss <invalid@invalid.invalid>
Date2016-03-02 15:00 -0700
Subjectlooking into python...
Message-ID<nb7nke$egg$1@dont-email.me>
"Python code can be packaged into stand-alone executable programs for 
some of the most popular operating systems, allowing the distribution of 
Python-based software for use on those environments without requiring 
the installation of a Python interpreter." (wikipedia)

How correct is that?  Which "most popular operating systems" are those?

Is there a good site to read for a quick overview of how one would use 
python with a qt binding to write some GUI utilities?

Thanks.

-- 
http://totally-portable-software.blogspot.com
  [Mon Feb 29: "Addresses - What Good Are They?"]

[toc] | [next] | [standalone]


#103907

FromBen Finney <ben+python@benfinney.id.au>
Date2016-03-03 09:20 +1100
Message-ID<mailman.121.1456957508.20602.python-list@python.org>
In reply to#103903
crankypuss <invalid@invalid.invalid> writes:

> "Python code can be packaged into stand-alone executable programs for 
> some of the most popular operating systems, allowing the distribution of 
> Python-based software for use on those environments without requiring 
> the installation of a Python interpreter." (wikipedia)
>
> How correct is that?  Which "most popular operating systems" are
> those?

Python's web site covers this. The Python environment is available for
download <URL:https://www.python.org/downloads/> for all major operating
systems.

Python is used in a huge range of fields, in organisations large and
small <URL:https://www.python.org/about/success/>.

> Is there a good site to read for a quick overview of how one would use
> python with a qt binding to write some GUI utilities?

GUI programming is covered at the Python wiki
<URL:https://wiki.python.org/moin/GUI%20Programming%20in%20Python>.

-- 
 \           “I prayed for twenty years but received no answer until I |
  `\          prayed with my legs.” —Frederick Douglass, escaped slave |
_o__)                                                                  |
Ben Finney

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


#103957

Fromcrankypuss <invalid@invalid.invalid>
Date2016-03-03 03:45 -0700
Message-ID<nb94es$6jv$1@dont-email.me>
In reply to#103907
Ben Finney wrote:

> crankypuss <invalid@invalid.invalid> writes:
> 
>> "Python code can be packaged into stand-alone executable programs for
>> some of the most popular operating systems, allowing the distribution
>> of Python-based software for use on those environments without
>> requiring the installation of a Python interpreter." (wikipedia)
>>
>> How correct is that?  Which "most popular operating systems" are
>> those?
> 
> Python's web site covers this. The Python environment is available for
> download <URL:https://www.python.org/downloads/> for all major
> operating systems.

Looking at https://www.python.org/downloads/release/python-344/
it appears that "all major operating systems" includes "Mac OS X", 
"Windows", and "Source release".  I'm seeing nothing about Android, or 
BlackBerry OS-10, or mainframes, or linux.  Presumably the source code 
has been pre-built for linux in various distro repositories.  Maybe I'm 
missing the obvious as usual.

> Python is used in a huge range of fields, in organisations large and
> small <URL:https://www.python.org/about/success/>.

So are paper-clips.

>> Is there a good site to read for a quick overview of how one would
>> use python with a qt binding to write some GUI utilities?
> 
> GUI programming is covered at the Python wiki
> <URL:https://wiki.python.org/moin/GUI%20Programming%20in%20Python>.

I found that yesterday after posting, thank you for the validation.

Referring back to the wikipedia quote at the start of the post, I'm 
interested in how Python code is packaged into stand-alone executables.

I've done some work along those lines with PHP, which amounted to 
building a source-code linker to make sure that all the required 
functions are included in one file.  It was my intent to build a 
slightly-modified version of PHP to act as a front-end, appending all 
the required functions to that copy of the interpreter.  Alas what I 
find is that when statically linked that front-end is a bit over 15 
megabytes in size, which I consider impractical for distribution.

The plan all along has been to convert the PHP code to another language, 
so that aspect of the project seems to be escalating itself in the 
priority queue.

Do you think conversion from procedural PHP (PHP that does not use the 
PHP OO facilities) to Python is a practical idea, or are the languages 
too different?

Thank you.

-- 
http://totally-portable-software.blogspot.com
  [Mon Feb 29: "Addresses - What Good Are They?"]

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


#103963

FromSteven D'Aprano <steve@pearwood.info>
Date2016-03-04 00:39 +1100
Message-ID<56d83e7f$0$1601$c3e8da3$5496439d@news.astraweb.com>
In reply to#103957
On Thu, 3 Mar 2016 09:45 pm, crankypuss wrote:

> Ben Finney wrote:
> 
>> crankypuss <invalid@invalid.invalid> writes:
>> 
>>> "Python code can be packaged into stand-alone executable programs for
>>> some of the most popular operating systems, allowing the distribution
>>> of Python-based software for use on those environments without
>>> requiring the installation of a Python interpreter." (wikipedia)
>>>
>>> How correct is that?  Which "most popular operating systems" are
>>> those?
>> 
>> Python's web site covers this. The Python environment is available for
>> download <URL:https://www.python.org/downloads/> for all major
>> operating systems.
> 
> Looking at https://www.python.org/downloads/release/python-344/
> it appears that "all major operating systems" includes "Mac OS X",
> "Windows", and "Source release".  I'm seeing nothing about Android, or
> BlackBerry OS-10, or mainframes, or linux.  Presumably the source code
> has been pre-built for linux in various distro repositories.  Maybe I'm
> missing the obvious as usual.

Yes, all the major Linux distros (Red Hat, Centos, Fedora, Debian, Ubuntu,
Mint, Suse, ...) will either install Python by default or at least provide
it through their official package management software.

Likewise, FreeBSD and OpenBSD certainly have Python available.

I doubt Blackberry has Python available, but that's hardly a major or
important platform.

For Android, the answer is mixed. I don't have an Android device to try it
on, but I'm told that it is possible to install Python on Android, but it
may be difficult. Probably the easiest way is to install Kivy:

https://kivy.org/

Kivy is a cross-platform Python development system that runs on OS X, Linux,
Windows, iOS (iPad, iPhone) and Android.

For mainframes, the answer is maybe". If your mainframe supports the C89
standard, it will probably work. If it can run x86 machine code, or emulate
it in a VM, that's probably the way to go.

Some older versions of Python supported mainframes like VMS, but in 2011,
support for OS\2, VMS and Windows 2000 was dropped:

http://blog.python.org/2011/05/python-33-to-drop-support-for-os2.html

There is a Nokia project called PyS60 that runs Python on Nokia Series 60
mobile phones. I don't know if it is still maintained.

Classic Mac OS (System 9 and older) was supported in older Python versions,
but not the more recent ones.

I don't think there has ever been a version of Python that ran on DOS :-)



> Referring back to the wikipedia quote at the start of the post, I'm
> interested in how Python code is packaged into stand-alone executables.

I'm only really familiar with the situation on Linux. On Linux, you usually
wouldn't bother. Since Python is almost always already installed on the
system, and even if it is not, it's usually only a single command away
(like `yum install python`, say), there's very little point in packaging
your scripts or applications up in a stand-alone exe file.

Somewhat intermediate between stand-alone exe applications and a directory
full of scripts is to create a package, compress it into a zip file, and
run that zip file with the Python interpreter installed on your system.
Since it relies on there being an external Python interpreter, it's not
exactly stand-alone, but it may be close enough for what you're doing.

Python packages are dead-simple: create a directory called "foo", and put a
file inside it called "__init__.py". It can even be an empty file. That's a
package. Obviously there is more to it than that, but that's the basics.



-- 
Steven

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


#104024

Fromcrankypuss <invalid@invalid.invalid>
Date2016-03-04 03:53 -0700
Message-ID<nbbp93$fjj$1@dont-email.me>
In reply to#103963
Steven D'Aprano wrote:

> On Thu, 3 Mar 2016 09:45 pm, crankypuss wrote:
> 
>> Ben Finney wrote:
>> 
>>> crankypuss <invalid@invalid.invalid> writes:
>>> 
>>>> "Python code can be packaged into stand-alone executable programs
>>>> for some of the most popular operating systems, allowing the
>>>> distribution of Python-based software for use on those environments
>>>> without requiring the installation of a Python interpreter."
>>>> (wikipedia)
>>>>
>>>> How correct is that?  Which "most popular operating systems" are
>>>> those?
>>> 
>>> Python's web site covers this. The Python environment is available
>>> for download <URL:https://www.python.org/downloads/> for all major
>>> operating systems.
>> 
>> Looking at https://www.python.org/downloads/release/python-344/
>> it appears that "all major operating systems" includes "Mac OS X",
>> "Windows", and "Source release".  I'm seeing nothing about Android,
>> or
>> BlackBerry OS-10, or mainframes, or linux.  Presumably the source
>> code
>> has been pre-built for linux in various distro repositories.  Maybe
>> I'm missing the obvious as usual.
> 
> Yes, all the major Linux distros (Red Hat, Centos, Fedora, Debian,
> Ubuntu, Mint, Suse, ...) will either install Python by default or at
> least provide it through their official package management software.
> 
> Likewise, FreeBSD and OpenBSD certainly have Python available.
> 
> I doubt Blackberry has Python available, but that's hardly a major or
> important platform.

I'd say its importance depends on what kind of phone you carry. <g>

FWIW, "BlackBerry 10 is based on QNX, a Unix-like operating system that 
was originally developed by QNX Software Systems until the company was 
acquired by BlackBerry in April 2010."

from https://en.wikipedia.org/wiki/BlackBerry_10

> For Android, the answer is mixed. I don't have an Android device to
> try it on, but I'm told that it is possible to install Python on
> Android, but it may be difficult. Probably the easiest way is to
> install Kivy:
> 
> https://kivy.org/
> 
> Kivy is a cross-platform Python development system that runs on OS X,
> Linux, Windows, iOS (iPad, iPhone) and Android.
> 
> For mainframes, the answer is maybe". If your mainframe supports the
> C89 standard, it will probably work. If it can run x86 machine code,
> or emulate it in a VM, that's probably the way to go.
> 
> Some older versions of Python supported mainframes like VMS, but in
> 2011, support for OS\2, VMS and Windows 2000 was dropped:
> 
> http://blog.python.org/2011/05/python-33-to-drop-support-for-os2.html
> 
> There is a Nokia project called PyS60 that runs Python on Nokia Series
> 60 mobile phones. I don't know if it is still maintained.
> 
> Classic Mac OS (System 9 and older) was supported in older Python
> versions, but not the more recent ones.
> 
> I don't think there has ever been a version of Python that ran on DOS
> :-)

It sounds as though Python will run on pretty much anything that's close 
to POSIX-compliant?

>> Referring back to the wikipedia quote at the start of the post, I'm
>> interested in how Python code is packaged into stand-alone
>> executables.
> 
> I'm only really familiar with the situation on Linux.

That's where I'm from these days.

> On Linux, you
> usually wouldn't bother. Since Python is almost always already
> installed on the system, and even if it is not, it's usually only a
> single command away (like `yum install python`, say), there's very
> little point in packaging your scripts or applications up in a
> stand-alone exe file.

Nice, with PHP it isn't so easy; not only is there often no PHP 
interpreter, to install one you have to fiddle with a config file.

> Somewhat intermediate between stand-alone exe applications and a
> directory full of scripts is to create a package, compress it into a
> zip file, and run that zip file with the Python interpreter installed
> on your system. Since it relies on there being an external Python
> interpreter, it's not exactly stand-alone, but it may be close enough
> for what you're doing.

Reminds me of docker stuff.

> Python packages are dead-simple: create a directory called "foo", and
> put a file inside it called "__init__.py". It can even be an empty
> file. That's a package. Obviously there is more to it than that, but
> that's the basics.

Okay, thanks.

-- 
http://totally-portable-software.blogspot.com
  [Mon Feb 29: "Addresses - What Good Are They?"]

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


#104043

FromTerry Reedy <tjreedy@udel.edu>
Date2016-03-04 11:03 -0500
Message-ID<mailman.192.1457107470.20602.python-list@python.org>
In reply to#103963
On 3/3/2016 8:39 AM, Steven D'Aprano wrote:

> I don't think there has ever been a version of Python that ran on DOS :-)

Yep.  That is what I started with (1.3).  It ran fine with 2 megabytes 
of memory and a 10 or 20 MB disk.  No unicode module, database, or 
codecs.  Perhaps no tcl/tk/tkinter.  I don't remember when DOS was 
dropped.  Maybe a decade ago or so.

-- 
Terry Jan Reedy

[toc] | [prev] | [standalone]


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


csiph-web