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

  • Home
  • SEARCH
  • 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 5940029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:54:40+00:00 2026-05-22T15:54:40+00:00

printbob.py: import sys for arg in sys.argv: print arg getbob.py import subprocess #printbob.py will

  • 0

printbob.py:

import sys
for arg in sys.argv:
    print arg

getbob.py

import subprocess
#printbob.py will always be in root of getbob.py
#a sample of sending commands to printbob.py is:
#printboby.py arg1 arg2 arg3   (commands are seperated by spaces)

print subprocess.Popen(['printbob.py',  'arg1 arg2 arg3 arg4']).wait()

x = raw_input('done')

I get:

  File "C:\Python27\lib\subprocess.py", line 672, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 882, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

What am I doing wrong here?
I just want to get the output of another python script inside of another python script.
Do I need to call cmd.exe or can I just run printbob.py and send commands to it?

  • 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-22T15:54:41+00:00Added an answer on May 22, 2026 at 3:54 pm
    proc = subprocess.Popen(['python', 'printbob.py',  'arg1 arg2 arg3 arg4'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    print proc.communicate()[0]
    

    There must be a better way of doing it though, since the script is also in Python. It’s better to find some way to leverage that than what you’re doing.

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

Sidebar

Related Questions

from TurtleWorld import * import math bob = Turtle() print(bob) draw_circle(turtle, r): d =
I'm trying to print a JFrame using the PrintUtilities Class: package util; import java.awt.*;
ok back at another issues in as3 printing //Function to print entire screen function
I am currently trying to create a function which will allow me to pass
I'm trying to print some text using my flying saucer ( https://xhtmlrenderer.dev.java.net ). The
private void printCard() { PrinterJob printjob = PrinterJob.getPrinterJob(); printjob.setJobName(Label); Printable printable = new Printable()
I have an list of objects (PrintJob) that I bind to a DataGridView. Here
I have the following: declare @PrintJob TABLE ( PageNumber Int, Copies Int ) INSERT
when i run this code : Process printjob = new Process(); printjob.StartInfo.FileName = file.html;
Does anyone have any insight on what's going on here? Here is my clientside

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.