Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I call a command line argument? #9

Open
hackdefendr opened this issue Feb 6, 2018 · 1 comment
Open

How do I call a command line argument? #9

hackdefendr opened this issue Feb 6, 2018 · 1 comment

Comments

@hackdefendr
Copy link

I would like to do something like this, but currently this wrapper does not seem to accept sys.argv[1] to set variables. I tried with quotes and without quotes, the script just hangs. When I hard code the host variable, it works without issue.

import sys
import wmi_client_wrapper as wmi

wmic = wmi.WmiClientWrapper(
username="JIMBOB",
password="PASSWORD",
host="sys.argv[1]",
)

output = wmic.query("select FreeSpace from Win32_LogicalDisk where DeviceID='C:'")
print(output)

I even tried to use an input function to ask for host, but it doesn't like that either.

@jossef
Copy link

jossef commented Jan 8, 2019

instead of host="sys.argv[1]" use host=sys.argv[1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants