No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Scientist - Experimental Psychologist
- PC Specs
- MacBook Pro/ OS X
37 Posted Topics
As a psychologist, it's useful to be able to time people's reactions in milliseconds. What kind of accuracy could I expect to get in this regard from Python? From what I've read so far, it doesn't look like I can hope to get precise enough timing to get reliable results, … | |
I'm frustrated by the nature of time.sleep(), which prevents the script from doing anything else during the allotted time period. For example, I have: [CODE]while True: checkSomething() time.sleep(0.1) print 'hello'[/CODE] In this case, "hello" is never printed. I really want to check something every few milliseconds, but I also need … | |
Okay, now that I consider myself to have decently mastered Python/Tkinter (or at least I'm no longer a complete noob), I'm turning my attention to the web. I'd love to be able to program applications that can be run easily via web sites (especially quick experiments). The easiest thing for … | |
I've realized that it would be very helpful to me to SET the mouse cursor to a particular location. Having done the usual internet searches, I can't seem to find anything on how to do it. Any ideas? (So I'm still set on converting to wx, but the project I've … | |
I'd like to make a bogus Windows window pop up asking the user to choose between energy settings (better performance vs. better energy savings). This is for a social psychological experiment about ecologically sustainable behavior, so it's completely legitimate; it's approved by an ethical board, and the participants will be … | |
I have a nice little Tkinter program but need to make the mouse cursor invisible for parts of it. I have seen ways to make the cursor change to other images, but I need it to actually be invisible. Any help? P.S. If you think it's impossible that would be … | |
Re: The easiest way to do this is to use python's inbuilt random library, with the randint function. This function takes two integers, which define the range between which you want to get a random number. You can use it like so: [CODE]from random import * def setStats(numberOfStats): stats = [] … | |
So far the move to wxPython has been going fairly smoothly. However, it's crucial that I be able to display items in the center of the screen (images, buttons, and radioboxes). I read about wx.ALIGN_CENTER_VERTICAL and wx.ALIGN_CENTER_HORIZONTAL, but the vertical option just doesn't seem to be working for me. Below … | |
So, as a scientist, I have plenty of geeky friends... and one of them is interested in creating a sound file from the brain waves she records. Essentially, she has a brain wave, and wants to feed it into a sound program to play it as if it were a … | |
Re: Here's how I write to a file: [CODE] import tempfile # The path for storing any files with randomly generated (temp) names. path = 'data' tempfile.tempdir = path # Generates a random filename not already in use. filename = tempfile.mktemp() # Writes the given text to the file. def write(text=""): … | |
Okay, so I'm thinking of taking the plunge into wxPython. But it's especially important to me to know if wxPython can do the following things easily and well: 1) Display a vertical array of radio buttons (or perhaps any buttons will do). They must have no labels, and I need … | |
I'd really like to be able to ask my program "where is the mouse pointer?" at any given time. Ideally I'll want people to click and hold a button, which will cause a stream of events to occur, and then (at varying points) the program should find out where their … | |
I'm having trouble unpickling a file -- it gives me ValueError: insecure string pickle. The trouble is, it is nearly identical to another file that I was able to unpickle just fine. For the life of me I cannot see what is strange or different about the new file -- … | |
Can python programs with GUIs (such as Tkinter) be embedded into web pages? I have looked into CGI programming before, but despite a search, I have found no books relating how to do this with python. Is it possible? Can anyone recommend a good book? If not, what would you … | |
I've been trying to get some .JPGs to show up in Tkinter but have had no luck so far. Up until now I was just using PhotoImage, which takes .GIFs, but it would be nice if I could expand and use other formats. Any ideas? Also, I know that wxPython … | |
I've been using Eclipse as my IDE for python programming, mostly because it's free. However, as far as I can tell, its debugger is not that great. All I ever get are notices of what line the error occurs on (and what the error type is) and, while this can … | |
I'd like to be able to make a slider widget without the knob that users can click and drag -- that is, I want the user to simply click somewhere on an empty slider and *then* have the knob appear where clicked. Is this possible with either Tkinter or wxPython? … | |
I was wondering if it's possible to show videos via a python GUI -- preferably quicktime videos, but any format would be a start. If it's not possible to play them from within the GUI, is it possible to at least have the person press a button that will automatically … | |
Re: You could do this: [CODE]while True: now = time.time() print now time.sleep(10)[/CODE] The main problem with this approach is that the program can't do anything else during the sleeping period. You could potentially make a separate thread (look up threading if you don't know what this is) that would run … | |
I've just downloaded and installed Vision Egg, a library built for python that displays various common scientific stimuli. While I was able to install it according to their specifications and get it to run from the command line (Terminal in my case), I have not been able to get it … | |
I'd like a program that reads through one or more weather web pages and records information from them on a daily (or even hourly) basis. Is this kind of thing possible at all to create with python? (Alternatively, if anyone knows of a program that already does this, or a … | |
I've been trying to use binding to a KeyPress/KeyRelease such that a particular function runs as long as the key is pressed and ceases when it is released. However, it seems like my major problem is that most keys are considered to continually activate as long as you hold them … | |
Does anyone out there happen to know much about Pydev? It's my preferred IDE (it's the only free IDE that received good reviews when I looked it up), but I'm getting frustrated trying to download some new modules and use them in it. I downloaded and installed the module tkSnack, … | |
Re: I think vegaseat is right -- it's much easier to make your program self-contained in the GUI. You can still easily print to the console (for viewing later), or write information to a file. I guess I just don't see what added functionality you are hoping to get from combining … | |
So I would really like to use Python to play some sound files -- it doesn't particularly matter what format, as they're just going to be basic "ping" type noises. However, it seems like whatever advice I find doesn't work out for my situation -- most modules seem to be … | |
Re: Okay, I have a question: Is there any way to resize an image using only Tkinter? This question stems from a deeper root problem -- I can't actually seem to get PIL to install. I keep getting the following error: unable to execute gcc: No such file or directory error: … | |
So, it would be nice to be able to insert scrollbars into my program (with Tkinter). Right now I'm using labels to display all my long blocks of text, and people flip through pages to get throught it all. I thought I'd try to add a scrollbar, but it doesn't … | |
So I'm at the final stages of my program -- it's a working experiment that creates a data file for each participant. My hope was that when I was done, it would be relatively easy to create an analysis program that searches through all the data files and create a … | |
Does anyone know if there's a way to make a larger entry box in Tkinter? I'm looking to allow users to enter comments at the end of my program, so there should be plenty of space. | |
So I have to enter a lot of text for display by Tkinter, and I've been rather miffed that I can't seem to find a way to get Eclipse (PyDev) to do any kind of auto-wrapping. Wrapping the lines myself with [inlinecode]"string1" + \ "string2"[/inlinecode] is, of course, beyond annoying. … | |
I want to be able to use scales to let the user answer various questions on screen. However, though I can get scales to work fine in other programs, in this one in particular they seem to have bugged out. What's happening is that, if I set [inlinecode]showvalue = False[/inlinecode], … | |
Re: There's one other way that I've found, although sometimes it feels like cheating: bind another function to the mouseclick of that button. For example: [code=python]button = Button(text="Two Functions", command=f1) button.pack() button.bind('<ButtonRelease-1>', f2) button.focus_force()[/code] Thus the usual command is to perform [inlinecode]f1[/inlinecode], while when the mouse has clicked the button and … | |
Here's something that I've wished for a number of times so far: the ability to create a function (taking X) that creates X variables, even if they are all initialized to the same value. For example, [inlinecode]f(3)[/inlinecode] would assign [inlinecode]var1 = 0[/inlinecode], [inlinecode]var2 = 0[/inlinecode], and [inlinecode]var3 = 0[/inlinecode]. My … | |
I want to have radiobuttons with text that is displayed underneath the actual buttons. Is there a way to do this (within the contents of the Radiobutton widget, that is, not resorting to labels)? I know this question is ridiculously simple, but I haven't been able to find anything in … | |
Thanks to mawe and Jeff for answering my first question. Next question: is there a way to get Tkinter to display the window without a title bar? I'm an experimental psychologist, and I don't want my participants to easily be able to exit my experiments... so hints on disabling alt-tab … | |
I've been having a lot of trouble with the [inlinecode]after[/inlinecode] method. What I want to do is show a series of images at the push of a button/press of a key -- each image should appear for 500ms, then be replaced by the next image, which should go on indefinitely … | |
Hi, I'm a noob Python/Tkinter user, and I'm finding that gathering information on the two is not as easy as I'd like... hopefully you guys will be able to help. My first question: I was just wondering if there's a way to tell Python, "take all the files in X … |
The End.