Sponsored Content
Operating Systems OS X (Apple) Back on python for the AMIGA again and discovered this little gem... Post 303036669 by wisecracker on Sunday 7th of July 2019 10:21:35 AM
Old 07-07-2019
Back on python for the AMIGA again and discovered this little gem...

I am back on Python for the AMIGA again and discovered this little gem that exits the program:-
(If you search GOOGLE as 'os.sys.exit()' python nothing seems to appear.)

Code:
import os
os.sys.exit()

I know of the other four and how they apply but I have no idea whether this creates any zombies or memory holes or whatever.
Code:
import os
import sys
"""
sys.exit()
os._exit()
exit()
quit()
"""

Just thought you might like to know guys as I still code for the lowly AMIGA and its latest version of Python is an unreliable Version 2.4.6 and its earliest is 1.4.0 which I use a lot still...
The code in the top code block works from Version 1.4.0 on the AMIGA and an installed 3.5.2 on my MBP.
These 2 Users Gave Thanks to wisecracker For This Post:
 

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

A journey down memory lane - AMIGA...

Hi guys and gals... Who still plays with the AMIGA in any of its guises? I have a classic A1200(HD) on 24/7 and still build and code for it... Also _clones_ of the same machine using WinUAE and E-UAE... It still has that one major beauty for this 62 year old - moi - it is FUN! ;o) (2 Replies)
Discussion started by: wisecracker
2 Replies

2. What is on Your Mind?

Ah, the AMIGA, (another poem I wrote in 2005).

Well I wrote this in 2005 and uploaded to AMINET.as a commemoration of a machine that is still in use today. It is now 29 years since this machne came into being. Phenominal and it is still being supported- WOW! My A1200 is on 24/7 and I use it to test code developed on AMIGA emulators... ... (0 Replies)
Discussion started by: wisecracker
0 Replies

3. News, Links, Events and Announcements

GCC for tha AMIGA...

Hi guys... For the AMIGA fans out there... Not sure if this is the right forum but someone has done a successful working port of gcc for the classic AMIGA A1200. It contains a very large subset of *NIX commands and now AMIGA fanatics like me can include another platform, within the... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. OS X (Apple)

FFT for the AMIGA through ksh88 shell.

I don't know if anyone is interested but I have been meddling with FFT for the AMIGA. (Sadly we AMIGAns don't have these luxuries through any scripting language. Below is a Python snippet that uses the builtin 'cmath' module to work with the lowly Python 2.0.1 for the AMIGA. It is part of a... (0 Replies)
Discussion started by: wisecracker
0 Replies

5. What is on Your Mind?

The AMIGA, great or flop. Your memories...

Hi everybody... Anyone who sees posts from me see the word AMIGA on my machines' terminal prompts. AMINET is the oldest Internet SW repository and currently holds 82,800+ freely available SW packages. About Aminet - AminetWiki I am a member of LAG, (Linclonshire Amiga Group), in the... (5 Replies)
Discussion started by: wisecracker
5 Replies
PYTHON(1)						    BSD General Commands Manual 						 PYTHON(1)

NAME
python, pythonw -- an interpreted, interactive, object-oriented programming language SYNOPSIS
python ... pythonw ... DESCRIPTION
To support multiple versions, the programs named python and pythonw now just select the real version of Python to run, depending on various settings. (As of Python 2.5, python and pythonw are interchangeable; both execute Python in the context of an application bundle, which means they have access to the Graphical User Interface; thus both can, when properly programmed, display windows, dialogs, etc.) The current supported versions are 2.6 and 2.7, with the default being 2.6. Use % man python2.6 % man python2.7 % man pythonw2.6 % man pythonw2.7 to see the man page for a specific version. Without a version specified, % man pydoc and the like, will show the man page for the (unmodified) default version of Python (2.6). To see the man page for a specific version, use, for example, % man pydoc2.7 CHANGING THE DEFAULT PYTHON
Using % defaults write com.apple.versioner.python Version 2.7 will make version 2.7 the user default when running the both the python and pythonw commands (versioner is the internal name of the version- selection software used). To set a system-wide default, replace 'com.apple.versioner.python' with '/Library/Preferences/com.apple.versioner.python' (admin privileges will be required). The environment variable VERSIONER_PYTHON_VERSION can also be used to set the python and pythonw version: % export VERSIONER_PYTHON_VERSION=2.7 # Bourne-like shells or % setenv VERSIONER_PYTHON_VERSION 2.7 # C-like shells % python ... This environment variable takes precedence over the preference file settings. 64-BIT SUPPORT Versions 2.6 and 2.7 support 64-bit execution (which is on by default). Like the version of Python, the python command can select between 32 and 64-bit execution (when both are available). Use: % defaults write com.apple.versioner.python Prefer-32-Bit -bool yes to make 32-bit execution the user default (using '/Library/Preferences/com.apple.versioner.python' will set the system-wide default). The environment variable VERSIONER_PYTHON_PREFER_32_BIT can also be used (has precedence over the preference file): % export VERSIONER_PYTHON_PREFER_32_BIT=yes # Bourne-like shells or % setenv VERSIONER_PYTHON_PREFER_32_BIT yes # C-like shells Again, the preference setting and environmental variable applies to both python and pythonw. USING A SPECIFIC VERSION
Rather than using the python command, one can use a specific version directly. For example, running python2.7 from the command line will run the 2.7 version of Python, independent of what the default version of Python is. One can use a specific version of Python on the #! line of a script, but that may have portability and future compatibility issues. Note that the preference files and environment variable that apply to the python command, do not apply when running a specific version of Python. In particular, running python2.6 will always default to 64-bit execution (unless one uses the arch(1) command to specifically select a 32-bit architecture). SEE ALSO
python2.6(1), python2.7(1), pythonw2.6(1), pythonw2.7(1), arch(1) BSD
Aug 10, 2008 BSD
All times are GMT -4. The time now is 10:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy