Unix/Linux Go Back    

Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Is this a Python 3.x.x bug?


Thread Tools Search this Thread Display Modes
Old Unix and Linux 06-08-2017   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Join Date: Jul 2012
Last Activity: 23 February 2018, 1:41 PM EST
Location: Aachen, Germany
Posts: 12,166
Thanks: 371
Thanked 3,752 Times in 3,447 Posts
Originally Posted by wisecracker View Post
Hi RudiC...

So one is allowed to execute code AFTER exit has been called even if it is an ASCII string inside a variable, from awk AND Python and I thought Python was strict, what about Perl and others?
You don't "execute code AFTER exit" - you add one (or more) routines to the sequence of tasks the programme has to perform before giving control back to the caller, e.g. closing files, releasing locks, freeing allocated memory. If it is a write, you'd mayhap do it before stdout is closed, if it is just a number, you reference it just on exiting.

Awk's exit is a statement and Python's is a function.
Both - whatever they are - start quitting the programme.

Maybe it is just me but this should never be allowed to happen if the RC is not an integer.
Pascal wouldn't allow non-integers, C mayhap would - python might be somewhere in between.
The Following User Says Thank You to RudiC For This Useful Post:
wisecracker (06-08-2017)
Sponsored Links
Old Unix and Linux 06-12-2017   -   Original Discussion by wisecracker
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
Join Date: Aug 2005
Last Activity: 23 February 2018, 11:35 AM EST
Location: Saskatchewan
Posts: 22,615
Thanks: 1,170
Thanked 4,302 Times in 3,969 Posts
Originally Posted by wisecracker View Post
Hi Corona688...
It was this, it always needs a redirection to a file for it to work however, so nothing like the other two and technically MUCH safer:-
Huh? That program is nonsense... Safer than what? And how?
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
**python** unable to read the background color in python giridhar276 Shell Programming and Scripting 1 08-05-2014 03:53 AM
"ssh suse-server 'python -V' > python-version.out" not redirecting Druonysus SuSE 3 02-13-2013 09:59 PM
Python: bash-shell-like less functionality in the python shell Narnie Programming 0 06-25-2010 03:11 PM
what is python? kprescod4158 Shell Programming and Scripting 1 11-20-2007 08:58 PM

All times are GMT -4. The time now is 02:44 PM.