looking into python...
"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?"] -- https://mail.python.org/mailman/listinfo/python-list
Re: looking into python...
Ben Finney wrote: > crankypuss 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 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 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 > 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?"] -- https://mail.python.org/mailman/listinfo/python-list
Re: looking into python...
Steven D'Aprano wrote: > On Thu, 3 Mar 2016 09:45 pm, crankypuss wrote: > >> Ben Finney wrote: >> >>> crankypuss 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 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. 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?"] -- https://mail.python.org/mailman/listinfo/python-list
Re: creating zipfile with symlinks
Larry Martell wrote: > I have a script that creates zip files of dirs containing symlinks. I > was surprised to find that the zipfiles have zipped the targets of the > links as opposed to the links themselves, which is what I wanted and > expected. Googling I found this: > > https://doeidoei.wordpress.com/2010/11/23/compressing-files-with-python-symlink-trouble/ > > Which I don't love as a solution. Anyone know a cleaner way to get > zipfile to zip the links? I don't even know what "zipfile" is, is that a Windows command? On linux the tar command's --dereference option causes the behavior you describe, which is not its default. Not sure if this is applicable to your situation, or not: http://www.gnu.org/software/tar/manual/html_node/dereference.html -- http://totally-portable-software.blogspot.com [Mon Feb 29: "Addresses - What Good Are They?"] -- https://mail.python.org/mailman/listinfo/python-list
Re: creating zipfile with symlinks
Grant Edwards wrote: > On 2016-03-04, crankypuss wrote: >> Larry Martell wrote: > [...] >>> Which I don't love as a solution. Anyone know a cleaner way to get >>> zipfile to zip the links? >> >> I don't even know what "zipfile" is, is that a Windows command? > > It's a module in the Python standard library. You see, this is a > Python newsgroup/mailing-list. > > Or you could just google "zipfile". It's the first flippin' link. > > [I've been trolled, right?] I don't know about that, but you've certainly shown that what I was told about this group being helpful and non-combative is bullshit. Okay, I've looked into Python, best luck all. -- http://totally-portable-software.blogspot.com [Mon Feb 29: "Addresses - What Good Are They?"] -- https://mail.python.org/mailman/listinfo/python-list