Jump to content

Arguments to external script


Recommended Posts

I'm a little confused as to how an external script is supposed to get its arguments 

 

 

My script looks like this:

#!/usr/local/bin/python

import urllib2,json,os,sys
import xml.etree.ElementTree as ET


query = sys.argv[1]

And i'm getting no arguments.

 

When i run the same code as an internal python script i have ZERO issues.  Is there something i'm missing on how you are supposed to pass arguments into an external script?

Link to comment

Ok so here is my script:

 

I tried without the 

 #!/usr/local/bin/python

But i get "the script may not exist or doesn't have execute permission error - even though it has permission 777

 

Screen_Shot_2016_06_20_at_8_39_13_AM.png

 

 

And when I try to run `pb1 test`

 

Screen_Shot_2016_06_20_at_8_39_23_AM.png

 

 

I'm just having ZERO luck getting my arguments to pass in.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...