On Friday, Apr 22, 2005, at 10:00 America/Chicago, Max Noel wrote:
Do you have a suggestion as to what can I give a module so it has
enough information to execute a function that resides in __main__?
Here is a visual of what is going on:
--__main__
def y1():
pass
import foo
foo.run(string
On Friday, Apr 22, 2005, at 03:52 America/Chicago, Just van Rossum -
[EMAIL PROTECTED] wrote:
Importing __main__ is a very silly thing to do anyway, if you ask me.
All comments from you, Bob, and Jack have been *very* helpful. I think
I understand better what is going on. What's got me scratch
###
def y1():
pass
def foo():
from __main__ import y1
pass
foo()
###
Here is a version of the code, stripped of the timeit code. The above
segment exhibits the same symptoms as the previously submitted one.
Even though I am running this as "__main__" it behaves as though it is
not _
On Tuesday, Apr 19, 2005, Lee Cullens wrote:
I assume you mean PythonIDE for Python 2.3 (I usually use 2.4 and
WingIDE). Here it is (indents screwed up with var font):
HTH,
Lee C
import timeit
def y1():
print ’y1 executed’
def y2():
print ’y2 executed’
for f in [y1,y2]:
n
I was recently trying to use the timeit module and although I was able
to do so without problem on a Windows machine, I get a "cannot import
y1" ImportError from the following script.
###
import timeit
def y1():
print 'y1 executed'
def y2():
print 'y2 executed'
for f in [y1,y2]: