First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered Nov 19 '13

terrytian gravatar image

This is because the list sys.argv contains only one element, that is your python script name, 'E:\007\21.py'.

Since python index starts from 0, the list element sys.argv[1] is actually the second element of the list sys.arg.

so you should use the following:

case_root = os.path.splitext(sys.argv[0])[0]
click to hide/show revision 2
No.2 Revision

This is because the list sys.argv contains only one element, that is your python script name, 'E:\007\21.py'.

Since python index starts from 0, the list element sys.argv[1] is actually the second element of the list sys.arg.

so you should use the following:

case_root = os.path.splitext(sys.argv[0])[0]

oh, in that case you should use:

case_root = os.path.splitext(CASE)[0]