7

I'm not a programmer. I am doing a project for Biology where I will be conducting an experiment on reaction times. Briefly, the subject should click anywhere on the screen as soon as a dot or circle (some graphic) appears on the screen.

Details:

  1. Program must start at a set clock time (e.g. 16:03:00) which will be typed in every time
  2. Timer must start when program starts (t=0)
  3. Graphics will appear at the same point (coordinates) according to pre-determined times relative to start (e.g., 1.5s, 2s, 3.5s, ...) for 2 minutes.
  4. Each time the subject presses the mouse, the time relative to the timer must be recorded.

Afterward, I will just tabulate the data on a spreadsheet and calculate the time differences between the time the graphic appears and the time the subject presses the mouse.

I have very limited knowledge of Python. I've never done anything with graphics on Python. This is the best set up I can think of for my needs.

I did some research and this is what I've found so far:

  • For the graphics: Pyglet has a built in scheduling function (pyglet.clock.schedule_interval)
  • I can use either time.time or time.clock for measuring reaction times. I am kind of confused over which one to use. It seems there is some subtle difference that I'm not understanding.

Please also not that the program may be run on a windows 7 PC or a MacBook.

I don't need a complete answer. Just some suggestions and tips to point me in the right direction for further research. Thanks.

Jey
  • 2,199
  • 2
  • 14
  • 15
  • This sounds like a task that has been solved before. I suggest some googling. – Marcin Nov 12 '12 at 19:28
  • My situation is kind of more complicated. Please check this link for more info on my experiment set up (http://www.daniweb.com/hardware-and-software/threads/439985/connecting-one-mouse-to-two-laptops#) – Jey Nov 12 '12 at 19:44

1 Answers1

3

You can use Pygame for graphics (drawing a dot on screen etc).

You can use datetime to capture the start time:

from datetime import datetime

Time = datetime.now()

print(Time)

Pyhook will capture mouse movements.

huon
  • 94,605
  • 21
  • 231
  • 225
Ank
  • 6,040
  • 22
  • 67
  • 100
  • Well it won't. According do docs. But quick goggling gives few leads http://stackoverflow.com/questions/281133/controlling-the-mouse-from-python-in-os-x – Ank Nov 13 '12 at 18:35