Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7677823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:30:36+00:00 2026-05-31T17:30:36+00:00

I am using python 3.2 currently and I wanted to do write a code

  • 0

I am using python 3.2 currently and I wanted to do write a code that generates 3 instances of command prompt in windows. I then need to access a different server in each of these command prompts using Plink (putty) and run a time consuming program in each of these command prompts in parallel. While I was able to create three instances of command prompts, I was not able to send commands to these prompts. Is there any method to do so? Should I use multiprocessing/ multithreading for this purpose?

I wrote the following code for creating the command prompts. Is there any way to pass commands to each of these prompts?

def Plink():
    name = multiprocessing.current_process().name
    proc = subprocess.Popen("C:\\Windows\\System32\\cmd.exe")

if __name__ == '__main__':
    Plink_1 = multiprocessing.Process(name='Plink 1', target=Plink)
    Plink_2 = multiprocessing.Process(name='Plink 2', target=Plink)
    Plink_3 = multiprocessing.Process(name='Plink 3', target=Plink)

    Plink_1.start()
    Plink_2.start()
    Plink_3.start()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:30:38+00:00Added an answer on May 31, 2026 at 5:30 pm

    Um, what?

    import subprocess
    def make_shells(n):
        for i in range(n):
             subprocess.Popen(["cmd.exe"])
    

    What you want to do isn’t what is generally referred to as “multi-processing”…

    Using Paramiko

    Here’s how you can use paramiko to connect to a remote SSH server and run a command.

    import paramiko
    def run_ls_la():
        client = paramiko.SSHClient()
        client.connect("myssh.server.org", username="foo", password="bar")
        stdin, stdout, stderr = client.exec_command("ls -la")
        print(stdout.read())
    

    You can also have it use public key auth, check the docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using hbase with my Python apps and wanted to try out Amazon
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I'm currently using Python 2.7 + wxPython 2.8.11 on my windows machine. While trying
I'm currently learning Python using Zelle's Introductory text, and I'm trying to recreate one
How do I authenticate against AD using Python + LDAP. I'm currently using the
Is there a way to determine programmatically, using Python, which web page is currently
Is there a way to determine programmatically, using Python, which web page is currently
I'm currently using the toprettyxml() function of the xml.dom module in a Python script
I'm currently launching a programme using subprocess.Popen(cmd, shell=TRUE) I'm fairly new to Python, but
I'm new to Python, and I wanted to make sure that I overrode __eq__

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.