Launch Windows command window....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ernesto

    #1

    Launch Windows command window....

    I'm trying to launch a seperate telnet window from within my python
    program. The command I thought I was supposed to use is below:

    os.system("teln et.exe -f C:\Folder\outpu t.txt localhost 6000")

    This creates a telnet window inside the current window. This is not
    desirable. I need it to launch a seperate command window for telnet
    output. Any ideas ?

  • Ernesto

    #2
    Re: Launch Windows command window....

    I'm one step closer...

    subprocess.Pope n("telnet.exe -f C:\Folder\outpu t.txt localhost 6000")

    is improved, but still doesn't launch a SEPERATE window...

    Comment

    • jay graves

      #3
      Re: Launch Windows command window....

      Ernesto wrote:[color=blue]
      > subprocess.Pope n("telnet.exe -f C:\Folder\outpu t.txt localhost 6000")
      > is improved, but still doesn't launch a SEPERATE window...[/color]

      This should work but only lightly tested.
      subprocess.Pope n("start telnet.exe -f C:\Folder\outpu t.txt localhost
      6000",shell=Tru e)

      You don't say what you are trying to do but if you are trying to drive
      telnet maybe you want the pexpect module.
      Download Pexpect - Pure Python Expect-like module for free. Pexpect is a Python module for spawning child applications; controlling them;


      I've never had the need to use it myself so I can't offer any other
      advice.

      ....
      jay graves

      Comment

      • Ernesto

        #4
        Re: Launch Windows command window....


        jay graves wrote:[color=blue]
        >
        > This should work but only lightly tested.
        > subprocess.Pope n("start telnet.exe -f C:\Folder\outpu t.txt localhost
        > 6000",shell=Tru e)[/color]

        Thanks a lot, but this still didn't launch a seperate telnet window. I
        just want the telnet window to open up and do "it's thing" in the
        background. Thanks again.

        Comment

        • Ernesto

          #5
          Re: Launch Windows command window....

          wait a minute, that did work correctly. Thanks !

          Comment

          Working...