E
erikwickstrom
Hi all,
I'm sorry about the newbie question, but I've been searching all
afternoon and can't find the answer!
I'm trying to get this bit of code to work without triggering the
IndexError.
import shutil, os, sys
if sys.argv[1] != None:
ver = sys.argv[1]
else:
ver = '2.14'
Of course, whenever I run it, I get list index out of range.
I'm coming from the php world where I can do:
if $_GET['var'] != Null {
$ver = $_GET['var'];
} else {
$ver = '2.14';
}
Can anyone tell me how to make this work in python?
Thanks!
Erik
I'm sorry about the newbie question, but I've been searching all
afternoon and can't find the answer!
I'm trying to get this bit of code to work without triggering the
IndexError.
import shutil, os, sys
if sys.argv[1] != None:
ver = sys.argv[1]
else:
ver = '2.14'
Of course, whenever I run it, I get list index out of range.
I'm coming from the php world where I can do:
if $_GET['var'] != Null {
$ver = $_GET['var'];
} else {
$ver = '2.14';
}
Can anyone tell me how to make this work in python?
Thanks!
Erik