Python and Eclipse: How to use interactive console after running a module, with the module variables and functions


Let's consider 3 situations:


1) I write a pyhon module
in Eclipse (pydev) and run it Ctrl-F11. The module runs and I don't
have any control or access (AFAIK) to the module variables and
functions.


2) I have defined a python interpreter as an
external tool in Eclipse, so I can run it within Eclipse. It works
fine, but it does not have tab completion.


3) I open my
module with python IDLE (not eclipse) and press f5 (run). It runs on
the IDLE opened window and when it finishes I have all the variables
and functions form the module to play with.


So I have 2
questions:
a) how to enable, if possible, tab compl

In interactive python I'd like to import a module that is in, say,


C:ModulesModule1module.py


What I've been able
to do is to create an empty

/>C:ModulesModule1\__init__.py

and then
do:


>>> import sys
>>>
sys.path.append(r'C:ModulesModule1')
>>> import
module

And that works, but I'm having to append
to sys.path, and if there was another file called module.py that is in
the sys.path as well, how to unambiguously resolve to the one that I
really want to import?


Is there another way to impor

Programming Languages

Let's consider 3 situations:


1) I write a pyhon module
in Eclipse (pydev) and run it Ctrl-F11. The module runs and I don't
have any control or access (AFAIK) to the module variables and
functions.


2) I have defined a python interpreter as an
external tool in Eclipse, so I can run it within Eclipse. It works
fine, but it does not have tab completion.


3) I open my
module with python IDLE (not eclipse) and press f5 (run). It runs on
the IDLE opened window and when it finishes I have all the variables
and functions form the module to play with.


So I have 2
questions:
a) how to enable, if possible, tab compl

Programming Languages

I know it can be done, but I never remember how.


How
can you reimport a module in python?
The scenario is as follows:
I import a module interactively and tinker with it, but then I face an
error. I fix the error in the .py file and then I want to reimport the
fixed module without quitting python. How can I do it ?

Programming Languages

Sorry for the confusing title, I tried to fit as much of the
problem in the title.


The scenario:

I have a
module(say ModuleA) which contains class definitions of
some Tkinter GUI elements.
These elements also have certain
events/functions bound/binded with them(such as
'<Button-1>','<Button-2>'....

/>

Now there's another module(say ModuleB). This is the
main(core of the) program. In this module I import
ModuleA to use its objects. The objects of
ModuleA have a place in an array(say
Array1); and also there is another array(say

Web Design

After going through every possible resources I came to conclusion
that I need an urgent help to pass global variables from a function to
others inside a Module in Python.


Actually I am writing a
small UI in Autodesk Maya2010, here is a brief about the
problem.


In the following code I have got two Module
Level Global Variables, I am assigning values to them inside a
function. Now if I pass these variables directly(i.e. without
converting the function call and assigning it as a string) then the
code works fine, however since the Command Flag of the Button Function
only allows a string or a function name hence I am stuck with this way
of calling the

Programming Languages
Is there anything that is made to generate web pages which have
charts
similar to the yahoo finance stock charts? Not looking to
graph stocks
specifically, but anything. I like how you can zoom
on each axis, and maybe
click to see numerical values and
such.
If there isnt anything in Python, what do people typically
use for that
kind of stuff, or is it all hand-rolled? />thanks,
MB
Jul 18 05
#1 Post Reply Share this
Question 3 Replies (adsbygoogle =
window.adsbygoogle || [])
Development

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow