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?

Programming


Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 06-08-2017   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 12 December 2017, 9:09 AM EST
Location: Aachen, Germany
Posts: 11,782
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
Quote:
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.

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

Quote:
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
    #9  
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: 11 December 2017, 5:38 PM EST
Location: Saskatchewan
Posts: 22,546
Thanks: 1,159
Thanked 4,286 Times in 3,955 Posts
Quote:
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
Closed

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 10:10 AM.