Posts: 4,580
Threads: 1,472
Joined: Sep 2016
write a script that is to be run as a command under either version of python and run itself under the other version and print "hello" the run itself again under the original version and print "world" and stop.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,580
Threads: 1,472
Joined: Sep 2016
Dec-07-2017, 02:26 AM
(This post was last modified: Dec-07-2017, 02:26 AM by Skaperen.)
that's not running itself, it's running a command string. "itself" means the file, not a command string, and not some other file. running itself is to run the script file. if i run the script under python3 then it should run itself under python2, and while running under python2, print "hello", then run itself under python3, and while running under python3, print "world", then do nothing more. if i run the script under python2 then it should run itself under python3, and while running under python3, print "hello", then run itself under python2, and while running under python2, print "world", then do nothing more.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.