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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:41:38+00:00 2026-06-18T19:41:38+00:00

Imagine the following scenario: a script is started from the IPython shell and at

  • 0

Imagine the following scenario: a script is started from the IPython shell and at a break point the python debugger is called. Using the PDB commands one can analyze the code and variables at this point. But often it turns out that the values of the variables call for a deeper research.

Is it possible to export the value of a variable to the IPython shell?

My specific use case:
I struggle with a quite huge numpy array which does not seem to have the correct values. I know that I can run any python commands from the python debugger, but it would be helpful to save the values of the variable at different break points and to use all of them at IPython shell. I am imaging something like

ipdb> global var1; var1 = var
ipdb> continue
...
ipdb> global var2; var2 = var
ipdb> continue
... 
In [2]: abs(var1 - var2) # do some interesting calculations with IPython
  • 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-18T19:41:40+00:00Added an answer on June 18, 2026 at 7:41 pm

    You can use globals():

    ipdb>__name__
    'my_module'
    ipdb> get_var = 'a value'
    ipdb> globals()['myvar'] = get_var
    ipdb> q
    In [11]: my_module.myvar
    Out[11]: 'a value'
    

    This assumes the break point is set in my_module.py, so we are editing the globals of the module my_module.

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

Sidebar

Related Questions

Imagine the following scenario: some xml file is downloaded from server and stored on
Imagine the following scenario: I am using SQL Server 2005. I have a transaction
Imagine the following scenario: You are asked to develop a tool from scracth, by
Imagine the following scenario. User visits a site A (ASP.NET), authenticates using ADFS and
I'm using Jackrabbit/JCR 2.0. Imagine the following scenario: I add a node, then I
Imagine following scenario: We have a lot of parallel development going on in several
Imagine the following scenario: class MyClass extends OtherClass<String>{ String myName; //Whatever } class OtherClass<T>
Imagine the following table (called TestTable ): id somedate somevalue -- -------- --------- 45
Imagine the following scenario: template<class T> void myFunction(T *) { //do nothing } void
imagine the following scenario: class A: def __init__(self, arg1=3, arg2=5): pass def createA(arg1=None, arg2=None):

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.