David M. Cotter, 26.07.2013 19:28:
> DOH! as my second thread, i had been using a sample script that i had
> copy-pasted without much looking at it. guess what? it prints the time. and
> yes, it did "from time import time", which explains it all.
Ah, and you were using the same globals dict f
DOH! as my second thread, i had been using a sample script that i had
copy-pasted without much looking at it. guess what? it prints the time. and
yes, it did "from time import time", which explains it all.
thanks for the hints here, that helped me figure it out!
--
http://mail.python.org/mai
no, there is no "time.py" anywhere (except perhaps as the actual python library
originally imported)
did you understand that the function works perfectly, looping as it should, up
until the time i run a second script on a separate thread?
--
http://mail.python.org/mailman/listinfo/python-list
In <965b463e-e5bf-4ccd-9a3c-b0cb964b3...@googlegroups.com> "David M. Cotter"
writes:
> ==
> 9: Traceback (most recent call last):
> 9: File "", line 10, in ?
> 9: File "", line 6, in main
> 9: AttributeError: 'builtin_function_or_method
Works for me.
Except that if I then do:
touch time.py
I get the same error as you do.
Can you figure out the problem now?
On Fri, Jul 26, 2013 at 11:57 AM, David M. Cotter wrote:
> okay, i have simplified it: here is the code
>
> ==
> import time
>
> d
okay, i have simplified it: here is the code
==
import time
def main():
while True:
print "i'm alive"
time.sleep(0.25)
#-
if __name__ == "__main__":
main()
===
David M. Cotter, 26.07.2013 08:15:
> in my app i initialize python on the main thread, then immediately call
> PyEval_SaveThread() because i do no further python stuff on the main thread.
>
> then, for each script i want to run, i use boost::threads to create a new
> thread, then on that thread