941,498 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 467
  • Python RSS
Jun 6th, 2009
0

Moved code from a mac to windows code wont work

Expand Post »
Python Syntax (Toggle Plain Text)
  1. from psychopy import visual, core, misc, event
  2. import numpy #for maths on arrays
  3. from numpy.random import random, shuffle #we only need these two commands from this lib
  4. from random import *
  5. import math
  6.  
  7. win = visual.Window([1024,768], units='pix', monitor='testMonitor',rgb=(-1,-1,-1))
  8.  
  9. numbers = range(100) #range of stimuli to be generated or how many to generate
  10.  
  11. #Choose N, elementsize and filenames
  12.  
  13. for x in numbers:
  14.  
  15. N=85 #number to generate0
  16. #To choose which stimuli to generate uncomment the appropriate line
  17. #Contour length
  18. #elemSize = 2000/((N)*math.pi*2)#contour lentgth
  19. #elemSize = 2000/((50)*math.pi*2)#50CLcontrol
  20.  
  21. #Brightness controls
  22. # elemSize=math.sqrt(70000/((N)*math.pi))#...
  23. elemSize=math.sqrt(70000/((50)*math.pi...
  24.  
  25. #create empty list of locations
  26. locations=[]
  27.  
  28. i=1
  29. while i<=N :
  30. locations.append([randrange(int(elemSi...
  31. i=i+1
  32.  
  33. #build an array of circles according to the parameters
  34. globForm = visual.ElementArrayStim(win, nElements=N, units='pix',sizes=elemSize,fieldShape='s...
  35.  
  36. globForm.draw()
  37. win.flip(clearBuffer=False)#redraw the buffer
  38. win.getMovieFrame()
  39. win.flip(clearBuffer=True)
  40.  
  41. #adjustfilename as appropriate
  42. win.saveMovieFrames('B085.jpg')
  43. core.quit()
  44. event.clearEvents()#keep the event buffer from overflowing
  45.  

The error message im getting,

Running C:\Documents and Settings\Administrator\Desktop\NumberStu...
configured pyglet screen 0
Exception in thread Thread-3:
Traceback (most recent call last):
File "threading.pyc", line 460, in __bootstrap
File "PsychoPyIDE.py", line 181, in __run
File "threading.pyc", line 440, in run
File "PsychoPyIDE.py", line 1687, in _runFileAsImport
File "<string>", line 1, in <module>
File "C:\Documents and Settings\Administrator\Desktop\NumberStu... line 36, in <module>
File "psychopy\visual.pyc", line 2519, in draw
AttributeError: Window instance has no attribute '_progSignedTexMask'

To provide as much information as possible im using a script editor i think that what they would be called i know almost nothing about programming, called PsychoPy IDe which can be found here. Ive downloaded the windows versions of the psychopy ide and all the dependiences for python and python and im still gettting the same error message. Can anyone tell what is wrong with the code or possible a place that could "debug" it and tell me which line is causing the problem my professor wrote the code but knows only enough to write it and could possible fix it if someone could tell mewhat line is causing the error.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mindfad is offline Offline
7 posts
since Jun 2009
Jun 6th, 2009
0

Re: Moved code from a mac to windows code wont work

if more information is needed to solve this issue jsut let me know and i can [provide it to the best of my abilities
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mindfad is offline Offline
7 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Finding a word from a text/html file by position of previous word
Next Thread in Python Forum Timeline: a very gui mess





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC