473,387 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Re: Another (perhaps similar) import question

Dan Yamins wrote:
>
What is the principle behind this? And, is there some simple
way (other than restarting the interpreter) of "reloading"
that wipes out the old attributes associated with a given name
so that spurious attributes do not remain?
No.

Conclusion: Don't use reload (ever). A dozen years of Python
programming, and I've never used it even once. If there is a
good use case for reload, you are probably years from being there.

Gary, thanks very much for your help. I suspected it was something
like this. I still can quite tell however if the problem you describe
here is the same type of issue that was behind my first problem
(posted just before) with the package imports.

I guess the think is, feel that I basically _have_ to have some way
to reload. I'm trying to code an application that allows users to
load new "mathematical operations" into a list of operations, and then
be able to update them after trying them out on some data variables
loaded into memory. If every time they change the functions in the
modules to get them to produce the right results, they have to restart
the interpreter, they'll always lose the data variables that they've
loaded and operated on. I need to find some way that they can
reload to access the modified version without having to re-do all the
command-line things they've done so far. The reload command seems
like the only (and natural) way to do this.

Thanks,
Dan
Please keep responses to python-list discussion on python-list, not my
personal mail box. -- Thanks.
I'd suggest using modules for your system's code, and exec (or execfile)
to read and parse user supplied code snippets. The result of an exec
of user supplied code will be very similar to a module import, and it
will be using import and exec as they were intended.

Gary Herron

Jun 27 '08 #1
0 730

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stian Søiland | last post by:
all examples performed with: Python 2.3+ (#2, Aug 10 2003, 11:09:33) on linux2 (2, 3, 0, 'final', 1) This is a recursive import:
12
by: Ryan Spencer | last post by:
Hello Everyone, I want to have a row of periods, separated by small, say, .5 second intervals between each other. Thus, for example, making it have the appearance of a progress "bar". ...
3
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
2
by: MLH | last post by:
I created a database and imported a report from another mdb file. In the first database, I had created a custom toolbar & invoked it with the following line... DoCmd ShowToolbar "Custom...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
3
by: Mark Reed | last post by:
Hi all, I have been asked to look at an existing Access 2002 DB tasked with adding some more features and improving the speed at which it runs. It is a split fe/be application with around 30,000...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
17
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
17
by: beginner | last post by:
Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very handy...
0
by: Gary Herron | last post by:
Dan Yamins wrote: Because loading (and reloading) assigns values to variables (called binding a value in Python), but does not go on a hunt to find variables to *unbind*. Once a variable is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.