Re: [Tutor] Silly question: Modifying code while the script is running

2008-02-20 Thread Luke Paireepinart
Scott Wolcott wrote: > Okay, I've got this ircbot that i wrote in python, and while we were > all making Terminator jokes, it occurred to me that it would actually > be reletively easy to have redqueen (that's the bot) write code into > another file. Then you just have to specify the file and im

Re: [Tutor] Silly question: Modifying code while the script is running

2008-02-18 Thread Michael Langford
import sys code = """import datetime print 'This is a pile of arbitrary code to execute' print sys.argv print datetime.datetime.now()""" if len(sys.argv) > 2: exec(code) else: print "Fooless" --Michael On Feb 18, 2008 5:17 PM, Scott Wolcott <[EMAIL PROTECTED]> wrote: > Okay, I've

[Tutor] Silly question: Modifying code while the script is running

2008-02-18 Thread Scott Wolcott
Okay, I've got this ircbot that i wrote in python, and while we were all making Terminator jokes, it occurred to me that it would actually be reletively easy to have redqueen (that's the bot) write code into another file. Then you just have to specify the file and import the code and run it. It sou