See code below:
#!/opt/rh/python33/root/usr/bin/python
import sys
print( sys.argv[1:-1] )
if ( len( sys.argv ) < 5 or len( sys.argv ) % 3 != 2 ) :
print( '''Oy vey! You need to input: <1lib name> <1schematic name > <nview name> .. <nlib name> <nschematic name > <nview name> <output fname>''' )
exit ( 1 )
print( len( sys.argv[1:-1] ) )
for lib_name,cell_name,view_name in sys.argv[1:-1] :
print( "lib is:" + lib_name )
print( "cell is:" + cell_name )
print( "view is:" + view_name )
This code should be very simple. I am running the code, and I get an error:
~]./run_automated_block.py ko lo pm do
['ko', 'lo', 'pm']
3
Traceback (most recent call last):
File "~/run_automated_block.py", line 8, in <module>
for lib_name,cell_name,view_name in sys.argv[1:-1] :
ValueError: need more than 2 values to unpack
[~]$
I don't get it. The length of the slice is 3. There are 3 variables in the for loop.
argparse?