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 8782805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:39:49+00:00 2026-06-13T20:39:49+00:00

Not sure how to go about an issue I have. I execute my code

  • 0

Not sure how to go about an issue I have. I execute my code in through command line in format:

python program.py arg1 arg2

Which is fine in most cases, but I just got iPython and I want to launch the code in iPython to use it for debugging. However, I cant find the best way to pass arguments.

executable('program') isn’t sufficient for this

and kind of having trouble with subprocess, cant make it work

subprocess.call([sys.executable, 'program.py','arg1'])
  • 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-06-13T20:39:51+00:00Added an answer on June 13, 2026 at 8:39 pm

    You should be able to just run ipython program.py arg1 arg2. If you then want to interact with the program after the script runs, do ipython -i program.py arg1 arg2. The -i flag works the same for ipython as it does for python.

    If you are already inside ipython and want to run your script, you can use the ipython magic function to run a script with run program.py arg1 arg2. You also use the -m option with the run function, and it will work similar to the -m option on regular python to run a module by name rather than a script path.

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

Sidebar

Related Questions

I am not sure about the exact purpose of the following Rampion's code .
I am not sure about some things in OOP. If I have Class1 ,
I know similar questions have been asked, but I'm not sure about the answers
I have a strange issue that I'm not too sure on how to fix
I believe this is some scope/variable access issue but I am not sure about
I am not sure about how NSSet's anyObject work. What does it mean that
I'm not sure about clarity of the STAR word. I'm implementing a search method
I'm not sure about one thing. There are two things in object oriented programming.
I'm new to MVC (MVC3) so not sure about the best way to implement
I am relatively new to OOP so I am not sure about the terminology.

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.