WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 02-20-2008, 01:30 PM
RedSpikeyThing RedSpikeyThing is offline
Member
 
Join Date: Feb 2008
Posts: 9
Quote:
Originally Posted by farshizzo View Post
What is the problem with your "while True:" loop? Are you yielding to other threads in the loop by issuing a time.sleep(...) call?

Are you talking about a custom threading event or a Vizard event?
The code I am using is supposed to spew out number until the program stops:
Code:
import viz
import threading

class ThreadedClass (threading.Thread):
	def run(self):
		i = 0
		while True:
			i = i + 1
			print i

t = ThreadedClass()
t.setDaemon(True)
t.start()

viz.go()
This code should just print successive numbers until the program is terminated. The output I get, however, is as follows:

1
2
<you get the idea>
1051
** Load Time: 0.12 seconds
1052
1053
<you get the idea>
1066

No matter how long the program is run for, it terminates at 1066. Also, the numbers 1052 to 1056 do not appear in the output window until the main program is stopped. It appears as if the thread is not running past a certain number of iterations.

I've been looking around for resources on how to do this, but I am having difficulty finding any. Do you have any references so that I don't have to post for every problem I encounter?

As always, thanks I appreciate the help.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vizard won't run wouters Vizard 5 02-05-2008 12:12 PM
Fall 2007 release of Vizard R3 3 D Announcements 0 10-15-2007 05:50 PM
McAfee Privacy Service 8.1 causes Vizard not to run mspusch Vizard 0 03-01-2007 09:24 PM
Matlab and Vizard brystewa Vizard 1 09-18-2006 04:11 PM
wxPython with Vizard farshizzo Vizard 18 09-29-2005 09:49 AM


All times are GMT -7. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC