Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to change a script while it is running

Reply
Thread Tools

how to change a script while it is running

 
 
faxme
Guest
Posts: n/a
 
      07-07-2005
Hi, I would like to know if it is possible to change code on the fly on a
python interpreter. I want to have a python script running a multithread
server and be able to connect to this python script and change the
interpreter environment. Is this possible?
Ideally i would like to call python, load the script inside the python
command line and while the script works still be able to type other python
commands(that might change the running script).

Thanks


 
Reply With Quote
 
 
 
 
Do Re Mi chel La Si Do
Guest
Posts: n/a
 
      07-07-2005
Hi !

Try :


def ff(a):
print a*2

ff(111)

exec('''def ff(a):
print a*3
''',globals(),globals())

ff(111)



@-salutations

Michel Claveau





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Block execution of script while same script is already running MrBanabas@googlemail.com Ruby 2 12-17-2008 06:03 PM
how to change contents of web.sitemap while web app is running? yohan ASP .Net 0 05-18-2007 07:01 AM
Change aspx at design time while page is running Erik Moore ASP .Net 0 02-24-2006 06:10 PM
modify a long-running python script while it is running? Benjamin Rutt Python 2 12-20-2005 01:42 PM



Advertisments