0

Hi dears.
I am playing windows commands with python scripts.
for example I did:

import os
print os.system("ipconfig -a")

but there is a problem with some commands.for example see this:

>netsh
netsh>dhcp
netsh>dhcp>scope 192.168.100.10

after playing the first one script, I have to come back to shell and play second one and ...
but how can I do it and also how can I do it in linux?

Edited by funfullson: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Beat_Slayer
0

sorry I can not write eng well.
we can play command line's commands in python.
for example in cmd you can play "cls" to clear command line.
and in python we do it like below code:

import os
os.system("cls")

it will play well.but some of commands are that you have to return again to command line and play a new command.

for example:

c:\>

manualy at first you have to type nslookup.then you have to wait.you will see second line that apear like below:

nslookup>

after you have to enter another command.for example:

nslookup>server 127.0.0.1

now I can not play such instructions.I have to return to command line again and play second command.but python will wait for command line.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.