How to abort module evaluation?

2009-05-12 Thread mrstevegross
I have a python script that is pretty simple: when executed, it imports a bunch of stuff and then runs some logic. When *imported*, it defines some variables and exits. Here's what it looks like: === foo.py === if __name__ != '__main__': x = 1 exit_somehow import bar do_some_stuff... === EOF

Re: How to abort module evaluation?

2009-05-12 Thread Mike Driscoll
On May 12, 1:33 pm, mrstevegross mrstevegr...@gmail.com wrote: I have a python script that is pretty simple: when executed, it imports a bunch of stuff and then runs some logic. When *imported*, it defines some variables and exits. Here's what it looks like: === foo.py === if __name__ !=

Re: How to abort module evaluation?

2009-05-12 Thread Dave Angel
mrstevegross wrote: I have a python script that is pretty simple: when executed, it imports a bunch of stuff and then runs some logic. When *imported*, it defines some variables and exits. Here's what it looks like: === foo.py === if __name__ != '__main__': x = 1 exit_somehow import bar