Web Development
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Question
stringlengths 35
6.31k
| is_accepted
bool 2
classes | Q_Id
int64 5.14k
40.5M
| Score
float64 -1
1.2
| Other
int64 0
1
| Database and SQL
int64 0
1
| Users Score
int64 -6
163
| Answer
stringlengths 19
4.91k
| Python Basics and Environment
int64 0
1
| ViewCount
int64 12
475k
| System Administration and DevOps
int64 0
1
| Q_Score
int64 0
346
| CreationDate
stringlengths 23
23
| Tags
stringlengths 6
68
| Title
stringlengths 12
138
| Networking and APIs
int64 0
1
| Available Count
int64 1
31
| AnswerCount
int64 1
35
| A_Id
int64 5.3k
72.3M
| GUI and Desktop Applications
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 |
I have a simple Python script that loads a GUI (created with Tkinter) when run. I used py2app to convert the Python script into a double-click app for OSX. When the app is clicked, Python executes the script. However, Python (and the GUI) load minimized. The user has to click on the Python icon in the tray in order to bring the GUI into the foreground.
I have tried adding lift() to the main Tkiner window but it doesn't seem to have any effect (I've tried similar methods with no success in bringing the window to the foreground). After the app is double-clicked, it is hard for users to tell what's going on if the GUI doesn't pop-up (especially if they are expecting some kind interface to appear). I am running Lion and didn't have this problem on Leapord.
Any help would be greatly appreciated.
Thanks.
| false | 9,083,687 | 0.26052 | 0 | 0 | 4 |
I just faced the same issue and found the general cause. The problem with all the published workarounds is that they either don't work for a py2app-built executable (the '-topmost' workaround doesn't) or have serious side effects (the iconify/deiconify works but causes all future modal windows from the app to stop being dismissible, including tkMessageBox and tkFileDialog).
The problem is caused by the argv_emulation of py2app, which is enabled by default. That option puts some OSX-specific Carbon event code in the boot loader of the app, which can be found at dist/appname/Contents/Resources/__ boot __.py of your built application bundle. I don't need the argv_emulation so for now I just disabled the feature by changing argv_emulation to False in the OPTIONS dictionary of the setup.py built by py2applet:
OPTIONS = { 'argv_emulation' : False }
| 0 | 1,769 | 0 | 1 |
2012-01-31T17:02:00.000
|
python,user-interface,tkinter,osx-lion
|
Python Tkinter GUI Always loads minimized
| 0 | 1 | 3 | 32,492,044 | 1 |
0 | 0 |
IDLE is being very dodgy as to when it will actually show an Auto-complete menu. As of late it hasn't been working at all, or, more specifically, only works during an interactive session.
I've been using Code Blocks for C, and have gotten really used to the very nice auto-complete features, so it's a bit frustrating not having them -- especially while trying to learn a new frame work and what class is associated with which methods, etc, etc..
Is there an easy fix to get IDLE auto-complete working again? I'm using python version 2.7.
Is there perhaps a simple editor I should look into? I've tried Vim, which was a little too heavy for my simple needs, Ninja, which I couldn't get to work for anything, and Sublime text 2, which I couldn't get my wxpython stuff to play with. What would a nice option be? Anything similar to Code Blocks would be cool, although, I'd be perfectly happy with IDLE if it would consistently work!
REQUESTED CLARIFICATION:
OK, so it seems I may have some of my terminology backwards. By non-interactive, I mean, for instance, right clicking on a python file and selecting "edit with IDLE". This brings up what I guess could be described as a text editor. You can enter all you code here. Once ready, you then hit F5, or select Run, and it launches (what I've been referring to as) the interactive terminal. It's here that you can type in code, press return, and instantly have that code evaluated.
What my question is referring to it the former, the part of IDLE where you edit the code. Sometimes while typing, after a . it will display the available methods, or after an open parenthesis it'll give hints as to the values expected. but the thing is, sometimes it does these things, sometimes it doesn't.
| false | 9,089,476 | 1 | 0 | 0 | 12 |
I had the same problem with IDLE, because I want to learn Qt and therefore autocompletion is very useful.
As it says in the settings of IDLE, you can trigger the autocomplete with "Control + Space", e.g. after a "QtGui.". Then a menu opens where you can arrow-scroll through the entries.
| 1 | 52,127 | 0 | 19 |
2012-02-01T01:22:00.000
|
python,autocomplete,codeblocks,python-idle
|
Python IDLE. Auto-complete/Show completions not working
| 0 | 4 | 5 | 16,467,896 | 1 |
0 | 0 |
IDLE is being very dodgy as to when it will actually show an Auto-complete menu. As of late it hasn't been working at all, or, more specifically, only works during an interactive session.
I've been using Code Blocks for C, and have gotten really used to the very nice auto-complete features, so it's a bit frustrating not having them -- especially while trying to learn a new frame work and what class is associated with which methods, etc, etc..
Is there an easy fix to get IDLE auto-complete working again? I'm using python version 2.7.
Is there perhaps a simple editor I should look into? I've tried Vim, which was a little too heavy for my simple needs, Ninja, which I couldn't get to work for anything, and Sublime text 2, which I couldn't get my wxpython stuff to play with. What would a nice option be? Anything similar to Code Blocks would be cool, although, I'd be perfectly happy with IDLE if it would consistently work!
REQUESTED CLARIFICATION:
OK, so it seems I may have some of my terminology backwards. By non-interactive, I mean, for instance, right clicking on a python file and selecting "edit with IDLE". This brings up what I guess could be described as a text editor. You can enter all you code here. Once ready, you then hit F5, or select Run, and it launches (what I've been referring to as) the interactive terminal. It's here that you can type in code, press return, and instantly have that code evaluated.
What my question is referring to it the former, the part of IDLE where you edit the code. Sometimes while typing, after a . it will display the available methods, or after an open parenthesis it'll give hints as to the values expected. but the thing is, sometimes it does these things, sometimes it doesn't.
| false | 9,089,476 | 0 | 0 | 0 | 0 |
using the 'IDLE Editor window', you need to save and execute your code first.
The application running, turn back to the Editor window to use the auto-completion.
| 1 | 52,127 | 0 | 19 |
2012-02-01T01:22:00.000
|
python,autocomplete,codeblocks,python-idle
|
Python IDLE. Auto-complete/Show completions not working
| 0 | 4 | 5 | 50,496,493 | 1 |
0 | 0 |
IDLE is being very dodgy as to when it will actually show an Auto-complete menu. As of late it hasn't been working at all, or, more specifically, only works during an interactive session.
I've been using Code Blocks for C, and have gotten really used to the very nice auto-complete features, so it's a bit frustrating not having them -- especially while trying to learn a new frame work and what class is associated with which methods, etc, etc..
Is there an easy fix to get IDLE auto-complete working again? I'm using python version 2.7.
Is there perhaps a simple editor I should look into? I've tried Vim, which was a little too heavy for my simple needs, Ninja, which I couldn't get to work for anything, and Sublime text 2, which I couldn't get my wxpython stuff to play with. What would a nice option be? Anything similar to Code Blocks would be cool, although, I'd be perfectly happy with IDLE if it would consistently work!
REQUESTED CLARIFICATION:
OK, so it seems I may have some of my terminology backwards. By non-interactive, I mean, for instance, right clicking on a python file and selecting "edit with IDLE". This brings up what I guess could be described as a text editor. You can enter all you code here. Once ready, you then hit F5, or select Run, and it launches (what I've been referring to as) the interactive terminal. It's here that you can type in code, press return, and instantly have that code evaluated.
What my question is referring to it the former, the part of IDLE where you edit the code. Sometimes while typing, after a . it will display the available methods, or after an open parenthesis it'll give hints as to the values expected. but the thing is, sometimes it does these things, sometimes it doesn't.
| false | 9,089,476 | 0.039979 | 0 | 0 | 1 |
Sometimes it has to do with the time you have to wait to get a suggestions.
When you go to options > extensions > general at completions popup wait you can change it to about 500ms.
In my case it was 2000ms by default.
| 1 | 52,127 | 0 | 19 |
2012-02-01T01:22:00.000
|
python,autocomplete,codeblocks,python-idle
|
Python IDLE. Auto-complete/Show completions not working
| 0 | 4 | 5 | 49,978,980 | 1 |
0 | 0 |
IDLE is being very dodgy as to when it will actually show an Auto-complete menu. As of late it hasn't been working at all, or, more specifically, only works during an interactive session.
I've been using Code Blocks for C, and have gotten really used to the very nice auto-complete features, so it's a bit frustrating not having them -- especially while trying to learn a new frame work and what class is associated with which methods, etc, etc..
Is there an easy fix to get IDLE auto-complete working again? I'm using python version 2.7.
Is there perhaps a simple editor I should look into? I've tried Vim, which was a little too heavy for my simple needs, Ninja, which I couldn't get to work for anything, and Sublime text 2, which I couldn't get my wxpython stuff to play with. What would a nice option be? Anything similar to Code Blocks would be cool, although, I'd be perfectly happy with IDLE if it would consistently work!
REQUESTED CLARIFICATION:
OK, so it seems I may have some of my terminology backwards. By non-interactive, I mean, for instance, right clicking on a python file and selecting "edit with IDLE". This brings up what I guess could be described as a text editor. You can enter all you code here. Once ready, you then hit F5, or select Run, and it launches (what I've been referring to as) the interactive terminal. It's here that you can type in code, press return, and instantly have that code evaluated.
What my question is referring to it the former, the part of IDLE where you edit the code. Sometimes while typing, after a . it will display the available methods, or after an open parenthesis it'll give hints as to the values expected. but the thing is, sometimes it does these things, sometimes it doesn't.
| false | 9,089,476 | 0.039979 | 0 | 0 | 1 |
In my case, I had to open Options menu -> Extensions tab on the editor and look to make sure AutoComplete and other relevant options were enabled. They actually were, but by just clicking on 'Apply' even though I dint have to change anything did the trick for me.
| 1 | 52,127 | 0 | 19 |
2012-02-01T01:22:00.000
|
python,autocomplete,codeblocks,python-idle
|
Python IDLE. Auto-complete/Show completions not working
| 0 | 4 | 5 | 39,969,989 | 1 |
0 | 0 |
In Pygame, you can set repeated (held down) Key detection with pygame.key.set_repeat().
In my case, I want to mix keys that can be held down and keys that will only be recognized once. Specifically, I want to be able to Move (by holding down key(s)), but I want to require one key press per Fire Missile.
To be clearer, I want to recognize held-down key presses for movement keys (Up, Down, Left, Right, etc.) only. Other keys, when held down, should only be recognized once.
| true | 9,091,073 | 1.2 | 0 | 0 | 2 |
You can keep a state tracker for the keys you only want to recognize once per press - set a flag to True when you see a KEYDOWN event, and then set it to False again when you see a matching KEYUP. Then only respond to a KEYDOWN event if the flag wasn't already True.
The other option is that you can keep a state tracker for the keys you do want to repeat and just poll that state every so often (e.g. every X milliseconds, see if the key is marked as 'down' and if so, do whatever should be done for that keypress).
| 0 | 727 | 0 | 3 |
2012-02-01T05:05:00.000
|
python,key,pygame,keypress
|
Pygame Mixing Repeated Key Presses and Singular Key Presses
| 0 | 1 | 1 | 9,091,093 | 1 |
0 | 0 |
how to pickle wx.frame(python GUI) object and unpickle it?
| false | 9,095,796 | 0.099668 | 0 | 0 | 1 |
Instead of pickling the object, pickle the necessary attributes of the object required to reconstruct a new instance of the object.
| 0 | 460 | 0 | 0 |
2012-02-01T12:27:00.000
|
python,wxpython,python-2.5
|
how to pickle wx.frame(python GUI) object and unpickle it?
| 0 | 1 | 2 | 9,095,942 | 1 |
0 | 0 |
I want to set an array into a wxListCtrl.
Similar to the Set function when using wx.ListBox or the SetItems function when using wx.ComboBox.
On the wxpython API there only seems to be an Append function.
| true | 9,097,097 | 1.2 | 0 | 0 | 1 |
I don't see an easy way to do this in the API other than just using a loop. There is a weird example in the wxPython demo for the ListCtrl where they somehow set a dict as the data for the list control. You might like that. Alternatively, I enjoy using the ObjectListView widget (http://pypi.python.org/pypi/ObjectListView) as I find it easier to use anyway.
In wxPython 2.9, there's the new DVC_ListCtrl, but it also probably needs a loop.
| 0 | 186 | 0 | 0 |
2012-02-01T14:05:00.000
|
python,wxpython,wxwidgets
|
How to set an array to ListCtrl
| 0 | 1 | 1 | 9,097,809 | 1 |
0 | 0 |
I am writing a Python program and want at some point to load HTML pages from the web and display them, in particular the support forum section/news section of my program. How can I easily integrate that into my program?
| false | 9,099,618 | 0 | 0 | 0 | 0 |
Tkinter has no native support for displaying HTML. With a little bit of work you can download the raw html, do a little text manipulation (assuming it's mostly plain text and a few tags for bold, headers, etc), and display it in a text widget. If it's well formed xhtml you can use an xml parser to pull out the relevant data and give it appropriate formatting.
If the pages have embeded images, or use css or javascript, the problem becomes exponentially harder to the point of not being practical.
| 0 | 720 | 0 | 2 |
2012-02-01T16:41:00.000
|
python,browser,tkinter
|
How do i integrate a browser in my tk application?
| 0 | 2 | 2 | 9,101,909 | 1 |
0 | 0 |
I am writing a Python program and want at some point to load HTML pages from the web and display them, in particular the support forum section/news section of my program. How can I easily integrate that into my program?
| true | 9,099,618 | 1.2 | 0 | 0 | 3 |
It would be easier to switch toolkits - Gtk+/Qt both have support for WebKit rendering engine. Both toolkits also have Python bindings support.
| 0 | 720 | 0 | 2 |
2012-02-01T16:41:00.000
|
python,browser,tkinter
|
How do i integrate a browser in my tk application?
| 0 | 2 | 2 | 9,133,448 | 1 |
0 | 0 |
How can I find out when the text has been changed in a text view widget in the GTK3 framework? I think there must be a signal associated with it, but could not find it.
For example, there is an ontextchanged signal in qt4, so there should be a similar signal in GTK. I am using Python.
| false | 9,113,717 | 1 | 0 | 0 | 11 |
Every TextView widget is associated to a TextBuffer object. The signal you are looking for is changed but of the associated text buffer. If you create a TextView without an associated buffer, a default one is created for you and you can retrieve it with textview.get_buffer()
| 0 | 1,337 | 0 | 5 |
2012-02-02T14:07:00.000
|
python,gtk3
|
Text changed signal for Text View widget in GTK3
| 0 | 1 | 1 | 9,114,062 | 1 |
0 | 0 |
I am working on cloud storage project and want to build GTK client for it. Possible choices found are pygtk/glade and vala. For the moment I am not familiar neither with pygtk nor with vala. Some googling showed that vala is quite a good choice. But I know python and completely new to vala. So I am looking for very strong arguments for vala in order to decide whether to use it or not. Any help is appreciated.
| false | 9,121,255 | 0.379949 | 0 | 0 | 2 |
A lot of Gnome apps are currently being rewritten in vala. This gives better performance and a better integration with the gtk libraries.
I personally think the language is pretty good, for a compiled language, but no doubt it is not as powerful or widely used as python.
If you are building an open source app (or something other people are going to maintain), you might want to go with the language that more people use. However there are also many benefits on being on the new, officially pushed wagon, like integration and a "coolness" factor.
| 1 | 2,190 | 0 | 3 |
2012-02-02T22:55:00.000
|
python,gtk,pygtk,vala
|
GTK GUI: pygtk vs vala
| 0 | 1 | 1 | 9,122,595 | 1 |
0 | 0 |
I have a bunch of widgets and right now I am using Hide() and Show() to each widget individually when I flip through different sections/pages of my program.
Because I did this, You can see each widget leaving/showing one by one (which kinda sucks).
Is there anyway to group all these widgets and then be able to Hide() and Show() this group, to avoid this "one by one" habit?
| false | 9,136,567 | 0.099668 | 0 | 0 | 1 |
Put your group of widgets organized in a sizer in the same parent container (p.e. a panel) and hide the parent. All the widgets disappear with the parent.
Note that sometimes hiding (for example) buttons or checkboxes is not the best solution. Available functionality for the user can be also modulated using widget.Disable()
| 0 | 346 | 0 | 1 |
2012-02-03T22:48:00.000
|
python,wxpython,wxwidgets
|
Assiociate Widgets into Groups, for Hide and Show, wxpython
| 0 | 2 | 2 | 9,137,127 | 1 |
0 | 0 |
I have a bunch of widgets and right now I am using Hide() and Show() to each widget individually when I flip through different sections/pages of my program.
Because I did this, You can see each widget leaving/showing one by one (which kinda sucks).
Is there anyway to group all these widgets and then be able to Hide() and Show() this group, to avoid this "one by one" habit?
| true | 9,136,567 | 1.2 | 0 | 0 | 3 |
Try using Freeze/Thaw/Layout when you are showing and hiding the widgets. This way they should all appear/disappear at the same time.
| 0 | 346 | 0 | 1 |
2012-02-03T22:48:00.000
|
python,wxpython,wxwidgets
|
Assiociate Widgets into Groups, for Hide and Show, wxpython
| 0 | 2 | 2 | 9,143,928 | 1 |
0 | 0 |
I have a question.
There are two classes: A and B. A creates object of type B. So from A, it is easy to access methods of B, but how can I access methods of object A from object B? I am trying to use bidirectional signal-slot mechanism in Qt. A can easily have a slot for a signal in B, but B cannot see signals in A.
I have a vague idea that somehow the creator class can be referenced as a 'member' while an object is being created, but I am not sure how to do code this.
Thanks in advance.
| false | 9,148,782 | 0 | 0 | 0 | 0 |
There's no way to do this automatically. You'll just have to give each B a reference to A when you create it, something like b_instance.parent = a_instance.
| 1 | 298 | 0 | 0 |
2012-02-05T11:17:00.000
|
python,pyqt4,python-2.7
|
How to reference creator object in Python?
| 0 | 1 | 2 | 9,148,796 | 1 |
0 | 0 |
I have a disabled button, and it does not receive clicks when I use EVT_BUTTON on it. Is there a way to receive clicks even when it has been Disabled()?
| true | 9,152,827 | 1.2 | 0 | 0 | 2 |
The whole point of disabling a button is so that the EVT_BUTTON event is not fired. I'm sure you could create create an ugly hack using EVT_LEFT_DOWN and detecting where the mouse is in your app as a workaround, but why bother? This is intended behavior.
| 0 | 97 | 0 | 1 |
2012-02-05T20:41:00.000
|
python,wxpython
|
How to get clicks on disabled buttons with wxpython?
| 0 | 2 | 2 | 9,161,998 | 1 |
0 | 0 |
I have a disabled button, and it does not receive clicks when I use EVT_BUTTON on it. Is there a way to receive clicks even when it has been Disabled()?
| false | 9,152,827 | 0 | 0 | 0 | 0 |
Perhaps wxpython has a mechanism similar to pygtk.
In pygtk you create a input-only (that is transparent) window over the widget you want to get clicks for and get your clicks there.
| 0 | 97 | 0 | 1 |
2012-02-05T20:41:00.000
|
python,wxpython
|
How to get clicks on disabled buttons with wxpython?
| 0 | 2 | 2 | 9,160,600 | 1 |
0 | 0 |
I want to know if it is possible to incorporate Buttons in a ListCtrl in report mode on each line in a column.
| false | 9,159,368 | 0 | 0 | 0 | 0 |
If you use the UltimateListCtrl, then yes. The normal ListCtrl widget does not support that.
| 0 | 142 | 0 | 0 |
2012-02-06T11:23:00.000
|
wxpython,listctrl
|
Buttons in a wx.ListCtrl in wxPython
| 0 | 1 | 1 | 9,162,017 | 1 |
0 | 0 |
I'm using Python's CTypes to bind to a shared library; I have a callback registered with this library, which is called in the context of a thread that the library itself creates. I've found that if I call libc.malloc() (libc = cdll.LoadLibrary('libc.so.6')) from within my callback, that it returns bogus values. Not NULL, but an address which will cause a segfault if I dereference it.
Can anyone provide me with any insight to what may be happening, or alternatively, tell me that they call malloc() in the same way, and that it works for them.
| false | 9,160,294 | 0.099668 | 0 | 0 | 1 |
Are you properly anottating the malloc call so that ctypes know it should return pointers not integers? (Doubly so if you are working on a 64bit box?)
| 1 | 811 | 0 | 0 |
2012-02-06T12:44:00.000
|
python,multithreading,ctypes
|
Malloc failing when called via ctypes from a c thread
| 0 | 1 | 2 | 9,163,769 | 1 |
0 | 0 |
We are developing a small c server application. The server application does some data processing and responds back to the client. To keep the data processing part configurable and flexible we decided to go for scripting and based on the availability of various ready modules we decided to go for Python. We are using the Python-C api to send/receive the data between c and python.
The Algorithm works something like this:-
Server receives some data from client, this data is stored in a dictionary created in c. The dictionary is created using the api function PyDict_New(); from c. The input is stored as a key value pair in the dictionary using the api function PyDict_SetItemString();
Next, we execute the python script PyRun_SimpleString(); passing the script as a parameter. This script makes use of the dictionary created in c. Please note, we make the dictionary created in c, accessible to the script using the methods PyImport_AddModule(); and PyModule_AddObject();
We store the result of the data processing in the script as a key value pair in the same dictionary created above. The c code can then simply access the result variable(key-value pair) after the script has executed.
The problem
The problem we are facing is in the case of concurrent requests coming in from different clients. When multiple requests come in from different clients we tend to object reference count exceptions. Please note, that for each request which comes in for a user, we create an independent dictionary for that user alone. To overcome this problem we encompassed the call to PyRun_SimpleString(); within PyEval_AcquireLock(); and PyEval_ReleaseLock();, but doing this has resulted in the script execution being a blocking call. So if a script is taking long time to execute, all the other users are also waiting for a response.
Could you please suggest the best possible approach or give pointers to where we are going wrong. Please ping me for more information.
Any help/guidance will be appreciated.
| false | 9,175,940 | 0.066568 | 0 | 0 | 1 |
I suggest you investigate the multiprocessing module.
| 1 | 615 | 0 | 5 |
2012-02-07T12:03:00.000
|
python,c,multithreading,thread-safety,python-c-api
|
Python-C api concurrency issue
| 0 | 1 | 3 | 9,177,358 | 1 |
0 | 0 |
My application has a custom dialog box that enables the user to set options on creating a new document. The main window has a toolbar, and even after dismissing the dialog, the toolbar buttons don't return to an active state. I've seen if fileDialog.ShowModal() == wx.ID_OK:
to get the return value, but is there something else that enables the buttons again? Just sending dialog.Destroy() doesn't seem to do it.
| false | 9,178,342 | 0 | 0 | 0 | 0 |
Well, if you have a "fileDialog" and a "dialog" object open, then you probably need to Destroy them both. If you set the toolbar buttons into a Disabled state, you'll want to Enable them after you dismiss the dialogs.
| 0 | 328 | 0 | 0 |
2012-02-07T14:50:00.000
|
wxpython,modal-dialog,toolbar
|
properly exiting custom modal dialog in wxpython
| 0 | 1 | 1 | 9,178,527 | 1 |
0 | 0 |
I am planning to write a card game in python, and now looking for a GUI (I'm new to Python).
I have so far tried out two GUI's :TK(inter) and wxPython.
Neither of them seem to be able , and correct me if I'm wrong, to do this :
dragging a panel with an image of a Card in it
And it's not even about the dragging. This is the situation
I want to place the Card in a container. It should be able to show both front and backside of the card so I want each card to be a panel rather than a bare image.
The image should be able to have transparent areas (card corners are rounded)
The panel (container) should be able to be transparant (So the card can be dragged over different backgroundcolors, the table other cards,....)
TKinter : can't do 3 as I understand it
wxPython : can't do 2 as I understand it.
I can go along and discover GUI after GUI, but this is kind of time-consuming, so my questions are :
Is it so that TKinter and wxPython have these shortcomings?
If so, what GUI to go to?
I've heard of pygame, but it's really not that much I am asking of the GUI. Swing (java) could do it, and that's not gaming centered either.
| false | 9,180,803 | 0.049958 | 0 | 0 | 1 |
Tkinter can handle transparent gifs. Your "container" requirements are a bit hard to understand, though. I don't understand what transparency has to do with the ability to drag it over different colored backgrounds.
Certainly you can group objects (images, rounded retangles, ec) together on a canvas, and those objects can have blank spaces between / around them, and you can certainly draw round corners and drag objects.
| 0 | 8,471 | 0 | 3 |
2012-02-07T17:23:00.000
|
python,user-interface,wxpython,tkinter
|
Python GUI for cardgame
| 0 | 1 | 4 | 9,183,516 | 1 |
0 | 0 |
I'm writing my first gedit plugin, a directory browser for the sidebar.
Show sidepanel with content of the cwd.
self._side_widget = self.get_dir() #returns a Gtk.Treestore obj
self.side_panel = self.window.get_side_panel()
self.side_panel.add_item(self._side_widget, "dir-browser", "Directory
Browser", None)
self.side_panel.activate_item(self._side_widget)
With a double click on a file, i open the document in gedit.
With a double click on a directory I change the directory and I want to update the content of the side panel.
I can build the a new treestore from the current working directory with self.get_dir() but I don't know how to update self.side_panel.
| true | 9,212,350 | 1.2 | 0 | 0 | 1 |
Either empty the current tree store and fill it again from the new directory, or call set_model(new_treestore) on the tree view widget. It will update itself.
| 0 | 543 | 0 | 0 |
2012-02-09T14:09:00.000
|
python,pygtk,gedit,pygobject
|
Update Gedit side panel
| 0 | 1 | 1 | 9,213,736 | 1 |
0 | 0 |
I am creating a program using wxpython which entails the need to create many sub-windows for each of menubar items. I am currently creating those sub-windows by writing different class definition for each and instantiating those classes for each event. Is this better than to have wx.window? How does two compare and what are the situations where they should be used?
| true | 9,216,792 | 1.2 | 0 | 0 | 0 |
If each toolbar item is to open a new "window", then I would recommend a wx.Frame or wx.Dialog. You almost never need to use wx.Window directly. wx.Window is the parent of wx.Frame and wx.Dialog. As such, wx.Frame and wx.Dialog potentially add additional functionality.
Dialogs are modal and should be used when you want program execution to stop while the dialog is dealt with (like when you need to get special information to complete some task). Frames are used when you don't need to stop program execution.
| 0 | 938 | 0 | 0 |
2012-02-09T18:41:00.000
|
python,user-interface,wxpython,wxwidgets
|
creating child windows in wxpython
| 0 | 1 | 1 | 9,217,489 | 1 |
0 | 0 |
When using wx.grid for creating table with wxpython, how can I automatically extend the number of rows and columns in the table once the user resizes the frame?
If I create 5*5 table(grid) to fit on my frame and user resizes the frame( say, makes it bigger), how can I implement automatic increase to the number of rows and/or column which responds to increase in frame size?
| true | 9,222,734 | 1.2 | 0 | 0 | 1 |
Sadly there is no builtin way to do this that I'm aware of. You'll need to catch the frame's EVT_SIZE and then use AppendRows and AppendCols as necessary with the grid. You'll need to take into account how much the frame size has changed and only append when it gets bigger, not smaller.
| 0 | 522 | 0 | 1 |
2012-02-10T04:34:00.000
|
python,user-interface,event-handling,wxpython,wxwidgets
|
automatic resizing of table in wx
| 0 | 1 | 1 | 9,230,043 | 1 |
0 | 0 |
I'm currently using the C/Python API to read data from a large binary file.
This result in Python is not as efficient as the pure C result (time x2) because, I think, of the time took to wrap things up into a PyObject. Typically, I store 42-elements tuples in a PyArrayObject. To do this, I use:
PyObject *r = Py_BuildValue("(f, I, i, K, f, K, K, etc..)", a, b, c, etc...) ;
My question is the following: Is there a more efficient way to do it (quicker execution time)?
For example: will PyTuple_Pack(n, args) do it more quickly ?
| false | 9,228,771 | 0 | 1 | 0 | 0 |
For time critical code, I create a tuple of the desired length and then create the components individually and stuff them into the tuple.
| 0 | 796 | 0 | 0 |
2012-02-10T13:51:00.000
|
python,c
|
C/Python API : efficiency of Py_BuildValue use
| 0 | 1 | 2 | 9,231,111 | 1 |
0 | 0 |
I've got a quick question that I hope someone can help me with.
I'm in the process of creating/planning an app that needs to run cross platform and use a com library from Windows. In the past I've used win32py to run these com objects in a python app, I've been doing a bunch of research finding a solution on Mac but I've had no luck. Ideally I'd like to stay in Python as I already have working code for Python 2.7 working with this library. If there is a solution in another language however, I would like to hear it.
I realize that this sounds almost sort of backwards, but to make a long story short I have to make this com library work on Mac. I'm going to be doing some automated testing of some iOS stuff with the iOS SDK simulator.
| true | 9,233,461 | 1.2 | 0 | 0 | 7 |
COM is Windows only. COM requires extensive use of the Windows registry and WinAPI. I've seen some frameworks emulate or mock COM behavior on other operating systems (e.g. MainWin on Linux/Solaris), but I don't know of one for Mac.
The win32py module is just a wrapper around WinAPI calls. So if the WinAPI isn't available, win32py won't work.
Is the logic you need something you can wrap a service around? In other words, can you host a service on a Windows box and have the Mac application invoke the service?
| 0 | 19,626 | 0 | 5 |
2012-02-10T19:14:00.000
|
python,ios,macos,winapi,com
|
Pywin32 (com objects) on Mac
| 0 | 1 | 1 | 9,234,067 | 1 |
0 | 0 |
I have a Python program that is mostly complete, and there is one thing that I'd like to change, which may or may not be possible.
This program uses PyQT to display a GUI and I have it pretty much pinned up so I was wondering if I can make Python not open up a termianl when I open the program.
I am using Windows XP right now, but the machines it will run on will be Windows 7. I generally work with Linux, so I'm not terribly familiar with Windows.
If the terminal has to be there, it's no big deal, but I feel like it's extraneous at this point.
Thanks!
| true | 9,246,204 | 1.2 | 0 | 0 | 5 |
Use the python extension .pyw.
E.g program.pyw
This causes your program to be run with pythonw.exe instead of python.exe which suppresses the terminal.
| 0 | 1,931 | 0 | 2 |
2012-02-12T03:35:00.000
|
windows,python-3.x,pyqt4
|
How to make a Python PyQT program not open the command line in Windows
| 0 | 1 | 1 | 9,246,252 | 1 |
0 | 0 |
This is quite an essential part of my program and I need to have sorted out as soon as possible so anything would be a massive help.
My program consists of three modules which are imported to each other. One module consists of my user interface for which I am using tkinter. The user inputs data on a canvas which is sent to a second program to be processed and is then sent to the third module which contains the algorithm which I intend to step through with the user.
The "first" and "third" modules can interact with each other and during certain points in explaining the algorithm I change the appearance of the canvas and some text on the interface. The third module should then pause (for which I'm currently using a basic sleep method), and wait (ideally it will wait for the user to press the "Next Step" button on the user interface). It is during this step that my interface decides that it wants to freeze.
Is there any way I can stop this?
Many thanks in advance.
Edit: I've found a way to fix this. Thank you for all the suggestions!
| false | 9,250,624 | 0 | 0 | 0 | 0 |
A GUI program is always waiting for some action to occur. When actions do occur, the event code corresponding to that action is executed. Therefore, there is no need to call sleep(). All you need to do is set it up so that the third program is executed from the appropriate event.
| 1 | 4,892 | 0 | 2 |
2012-02-12T16:53:00.000
|
python,tkinter
|
stop tkinter window from freezing while program is sleeping
| 0 | 2 | 3 | 9,252,989 | 1 |
0 | 0 |
This is quite an essential part of my program and I need to have sorted out as soon as possible so anything would be a massive help.
My program consists of three modules which are imported to each other. One module consists of my user interface for which I am using tkinter. The user inputs data on a canvas which is sent to a second program to be processed and is then sent to the third module which contains the algorithm which I intend to step through with the user.
The "first" and "third" modules can interact with each other and during certain points in explaining the algorithm I change the appearance of the canvas and some text on the interface. The third module should then pause (for which I'm currently using a basic sleep method), and wait (ideally it will wait for the user to press the "Next Step" button on the user interface). It is during this step that my interface decides that it wants to freeze.
Is there any way I can stop this?
Many thanks in advance.
Edit: I've found a way to fix this. Thank you for all the suggestions!
| false | 9,250,624 | 0.066568 | 0 | 0 | 1 |
H.E.P -
The traditional way to do this does indeed involve using a separate thread and co-ordinating the work between the "worker" thread and the GUI thread using some sort of polling or eventing mechanism.
But, as Thomas K. points out, that can get very complex and tricky, especially regarding Python's use of the Global Interpreter Lock (GIL) etc. and having to also contend with Tkinter's processing loop.
(The only good reason to use a multi-threaded GUI is if you absolutely MUST ensure that the GUI remains responsive during a potentially long-running background task, which I don't believe is the issue in this case.)
What I would suggest instead is a generator-based "co-routine"-type architecture.
As noted in "The Python (2.7) Language Reference", Section 6.8, [the "yield" statement is used when defining a generator function and is only used in the body of the generator function. Using a yield statement in a function definition is sufficient to cause that definition to create a generator function instead of a normal function.]
(This effectively forms the basis of a co-routine architecture. (ed.))
[When a generator function is called, it returns an iterator known as a generator iterator, or more commonly, a generator. The body of the generator function is executed by calling the generator’s next() method repeatedly until it raises an exception.
When a yield statement is executed, the state of the generator is frozen and the value of expression_list is returned to next()‘s caller. By “frozen” we mean that all local state is retained, including the current bindings of local variables, the instruction pointer, and the internal evaluation stack: enough information is saved so that the next time next() is invoked, the function can proceed exactly as if the yield statement were just another external call.]
(Also see "PEP 0342 - Coroutines via Enhanced Generators " for additional background and general info.)
This should allow your GUI to call the next part of your algorithm specification generator, on demand, without it having to be put to sleep until the operator presses the "Next" button.
You would basically just be creating a little 'domain-specific language', (DSL), consisting of just the list of steps for your presentation of this particular algorithm, and the generator (iterator) would simply execute each next step when called (on demand).
Much simpler and easier to maintain.
| 1 | 4,892 | 0 | 2 |
2012-02-12T16:53:00.000
|
python,tkinter
|
stop tkinter window from freezing while program is sleeping
| 0 | 2 | 3 | 9,265,601 | 1 |
0 | 0 |
I am currently working on a GUI for a science experiment. I am using wxPython.
I have done the design part and also the data logging in an SQLite database. Is it possible for the GUI to behave as a web-client and write data onto a website. I have a Kodingen account. Can this GUI write to my homepage everytime I run it?
| false | 9,260,561 | 0 | 0 | 0 | 0 |
You should be able to use httplib or similar to communicate with your website and use wxPython as the front-end. When you hit you're Submit button or whatever, you would call httplib or a similar library to post the data to your website. You might need to use threads to keep the GUI responsive.
| 0 | 260 | 0 | 0 |
2012-02-13T12:31:00.000
|
wxpython,client,web
|
wxPython GUI as a web-client
| 0 | 1 | 1 | 9,261,900 | 1 |
0 | 0 |
import wx
Traceback (most recent call last):
File "", line 1, in
import wx
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in
from wx._core import *
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in
import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application
I have tried python2.6 and python2.7 with several wxpython versions,they all turned out to be like this.All the versions are win64 as well as my OS,please hep!
| false | 9,277,875 | 1 | 0 | 0 | 17 |
As mentioned by the other fellow, make sure you have a 64-bit Python AND a 64-bit wxPython version downloaded. If one or the other is 32-bit, it won't work. Personally, I have never had any problems installing wxPython on Windows.
| 0 | 20,396 | 0 | 18 |
2012-02-14T13:40:00.000
|
wxpython
|
DLL load failed: 1% is not valid win32 application
| 0 | 2 | 3 | 9,294,892 | 1 |
0 | 0 |
import wx
Traceback (most recent call last):
File "", line 1, in
import wx
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in
from wx._core import *
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in
import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application
I have tried python2.6 and python2.7 with several wxpython versions,they all turned out to be like this.All the versions are win64 as well as my OS,please hep!
| false | 9,277,875 | 0.132549 | 0 | 0 | 2 |
I had this problem in windows 7 with Python2.7 as I have installed 32bit wx version earlier. Try installing 64bit and it will work fine.If you are in 64 bit system and trying to install 32bit wx you will get some error at the beginning. So try 64bit wx.
| 0 | 20,396 | 0 | 18 |
2012-02-14T13:40:00.000
|
wxpython
|
DLL load failed: 1% is not valid win32 application
| 0 | 2 | 3 | 18,842,884 | 1 |
0 | 0 |
I am trying to modify an exe (of mine) with a hex editor. It was originally written in Python using wx and turned into an exe via py2exe. I lost the source code (ugh) and need to change one of the items in a dropdown menu. It's a simple one character change, from a "6" to a "9". (Makes me think of Jimi Hendrix)
I have used several hex editors, and I can find the string and make the change and save the file. However, when I open the modified exe, the drop down entry has not changed. I can verify that the exe is different by opening it in the hex editor again and checking, and the string is set to the new value I need. It just doesn't display that way when running the app.
I obviously don't play with hex editors (or hex, for that matter) much. What am I missing? TIA.
| false | 9,283,788 | 0 | 0 | 0 | 0 |
You may find this next to impossible to do this way, since there could be thousands of characters like this in the exe. You'd probably be better off first searching for a less common item in your dropdown to give you a better chance of finding the "area" where it may be occurring. Then do a more localized search nearby for the "6". Even then, there's no guarantee these dropdown items will be located near each other in the executable (but I think it likely).
| 0 | 411 | 0 | 0 |
2012-02-14T20:34:00.000
|
python,exe,hex-editors
|
Hexedit of ASCII in exe not changing in app
| 0 | 1 | 2 | 9,284,042 | 1 |
0 | 0 |
Am wondering does twisted framework work well with wxPython GUI framework. From the docs its seems like twisted does not support wxPython well. The example given seems to be a bit shy on the details.
If not, what is the best way of using twisted with wxPython?
Which other non-blocking event-driven networking framework can i use with wxPython?
Thanks
Gath
| false | 9,296,393 | 0.099668 | 0 | 0 | 1 |
I'm using wxPython with Twisted on Linux, Mac and Windows without any crazy things happening.
| 0 | 762 | 0 | 1 |
2012-02-15T15:42:00.000
|
python,wxpython,twisted
|
Does Python Twisted work with wxPython?
| 0 | 1 | 2 | 9,319,541 | 1 |
0 | 0 |
I'm building a database front-end with python and glade. I need to present SQL query results in the form of database tables inside my app's window (schema followed by tuples/records). Both the schema and the database entries are dynamic because the schema could be that of a join operation or in general altered and the number of tuples could be any valid number.One possible solution could be to format a given table with python, create a text object in my GUI and change its' value to that produced by python. Advices and suggestions are very welcome.
| true | 9,299,934 | 1.2 | 0 | 1 | 3 |
Given that the number and name of the columns to display isn't known beforehand, you could just create a gtk.TreeView widget in glade and modify it as you need in the application code.
This widget could be updated to use a new model using gtk.TreeView.set_model and the columns could be adapted to match the information to be dsplayed with the gtk.TreeView.{append,remove,insert}_column columns.
Regarding the model, you coud create a new gtk.ListStore with appropriate columns depending on the results from the database.
I hope this helps.
| 0 | 2,104 | 0 | 3 |
2012-02-15T19:28:00.000
|
python,user-interface,gtk,pygtk,glade
|
GUI for database tables with pygtk and glade
| 0 | 1 | 1 | 9,302,750 | 1 |
0 | 0 |
I'm starting getting into PyQt. Therefore I would need some good tutorials. I searched a bit but didn't find any good. Most tutorials only post "full" applications but don't go into detail.
Can you advise me some?
Currently im programming in Notepad++. Are there better lightweight editors or simple IDEs for python in combination with PyQt?
| false | 9,319,878 | 0.039979 | 0 | 0 | 1 |
The C++ docs for QT are actually a pretty good reference for PyQT. Last time I used PyQT (> 5 years ago), they were actually the best available reference.
| 1 | 28,223 | 0 | 20 |
2012-02-16T22:11:00.000
|
python,user-interface,pyqt
|
Good PyQt tutorial needed
| 0 | 1 | 5 | 9,319,895 | 1 |
0 | 0 |
(first question on StackOverflow, glad to be there :))
I am using IronPython 2.7.1 and C# .net 4.0.
I use C# to launch my python script.
I have about 20 personal modules that are imported a lots of time.
E.g :
If I have module1.py, module2.py, module3.py, module4.py
and main_script.py.
main_script.py imports module1 and module2
Both module1 and module2 import module3.
module1 and module3 import module4
etc.
Modules can have a large amount of code lines.
What I see is when I execute my main_script.py, it takes about 4-5 sec to just import modules.
I tried to use pyc.py to compile all my modules in a dll, and then used ngen on it, but I saw no differences when adding this dll using myEngine.Runtime.LoadAssembly().
Then I wanted to use py_compile.py to get the pyc files, but is seems not working as the IronPython.Runtime.FunctionCode type is not supported in the IronPython.Modules.MarshalWriter class (function WriteObject(object o). (I got "unmarshallable object" exception when trying to compile).
I am not very familiar with Python nor IronPython, and maybe I did not understood all the subtleties of the language (I think so, actually). I was searching the net for a solution, but it seems I am stuck right now.
Any idea to improve the import performance ?
| true | 9,327,606 | 1.2 | 1 | 0 | 3 |
Taking 4-5 seconds to do imports, especially for large modules, is not unexpected for IronPython 2.7.1. I would pyc.py to improve it, but I also think that it isn't as useful as it once was - IronPython's imports are a lot faster than they used to be, so pyc.py is less useful.
The thing is, IronPython does a lot more than Python does when it imports a module[1]. Python has to parse it and produce bytecode which it then executes. IronPython has to produce DLR trees which are then converted to interpreter instructions - and possibly also IL if they trip the compilation limit, which means running the .NET JIT to produce machine code.
All of that work is wasted if the script only takes a few seconds to run; IronPython is better for long-running processes. However, the short Python script is extremely common, and IronPython is extremely poor for those sorts of scripts.
There are two ways we're working at solving this, one of which you alluded to. Work is being done to support standard .pyc files with an interpreter optimized for startup time but not throughput - short scripts will benefit, but long-running code will suffer. Second, porting IronPython to mobile platforms requires disabling dynamic code generation, so making the DLR interpreter fast will be very important; this work will make uncompiled code faster to start as well.
The one thing we cannot overcome is the fact that .NET processes generally take longer to start than plain C ones. That overhead can be reduced, but it requires some fairly deep optimization that probably won't be done for a while.
[1] Python's import process is so fast that the stat calls to find the file are much greater than the time to parse & compile it.
| 1 | 1,258 | 0 | 1 |
2012-02-17T11:41:00.000
|
import,module,ironpython
|
Import module in IronPython 2.7.1 very slow
| 0 | 1 | 1 | 9,332,166 | 1 |
0 | 0 |
I am making a battleship game for a project. While I have completed the logic and the game works with text input. I was hoping make a (very basic) GUI while still use the methods created for the text.
The two options I've been looking at are PyGame and Tkinter. PyGame does not seem to have a text output/label function. Tkinter does, but it doesn't seem as easy (i feel) as PyGame is.
Though I would love to give either of these frameworks the time they deserve, I have just over 60hrs before this is due.
I wanted to know if anyone one has any experience or insights and if it is a realistic option.
Thanks as always!
| true | 9,345,307 | 1.2 | 0 | 0 | 2 |
This is a fairly trivial thing to do in Tkinter. A battleship game shows an array of coordinates which you can display as a grid of checkbuttons.
| 0 | 2,309 | 0 | 0 |
2012-02-18T23:53:00.000
|
python,tkinter,pygame
|
Opinion on GUI for a Battleship game in Python
| 0 | 1 | 5 | 9,345,389 | 1 |
0 | 0 |
How can I activate autocompletion feature for wx classes in pyDev? I cannot find anything to prompt me to change that will activate this feature from PyDev>Preference>Autocompletion. How can I get autocompletion from packages like wx and other third-party packages?
Update:
I added wx path in configuration to pyDev and it now shows autocompletion for wx. However, I cannot see the method arguments and properties. For example if I seek for wx.Button, I just get autocompletion to complete writing Button but I want to know the required arguments for wx.Button as wx.Button(,....,size,pos...) etc. This works for the other methods of built-in methods when I press Ctrl+Space but I don't know how should I configure to get that from wx and other third party packages?
| true | 9,350,183 | 1.2 | 0 | 0 | 0 |
Regarding missing parameters on the constructor for wx.Button, unfortunately that's currently expected. Please create a bug report for PyDev specifying that.
| 0 | 324 | 0 | 1 |
2012-02-19T14:46:00.000
|
java,c++,python,eclipse,wxpython
|
Autocompletion in Pydev- Eclipse for wxpython
| 0 | 1 | 1 | 9,363,014 | 1 |
0 | 0 |
I will start a project ( not commercial, just for learning ) but I would like to choose to work with the right tools as I would if I were doing it for a company.
First of all small description of what I will need.
It would be a server-client(s) application.
For the server:
- GUI for Windows
- ORM
- Database without installation (sqlite ???)
- GUI builder (RAD Tool)
- Ability to create easily REST Services
Clients would be android devices
- GUI for android mobile
Clients would connect to the server and get some initial settings and then start to
send information to the server.
Server should be able to display properly the information collected from the clients and
edit them if needed.
Open source technologies are mandatatory.
First I am thinking to use sqlite ( I should not make any installation except the programm). Any alternatives here?
For the server maybe python with a gui library and sql alchemy. What about Camelot?
And for the clients (android) java. I think there are no other options here.
Can you make some comments on the above choices?
Maybe you can suggest something different which will make the development faster...
| false | 9,354,695 | 0 | 0 | 1 | 0 |
As you have asserted: client is java only.
On server:
GUI for Windows : WPF
ORM - Database without installation : SQLCE 4.0 - Maybe use codefirst
GUI builder (RAD Tool) : Visual Studio lets you do that for WPF apps
Ability to create easily REST Services : Use WCF
hope that helps
| 0 | 657 | 0 | 0 |
2012-02-20T00:15:00.000
|
android,python,client-server
|
Right tools for GUI windows program
| 0 | 1 | 2 | 9,354,732 | 1 |
1 | 0 |
I am trying to write server code for my python computer and make the android phone a client. The client needs to be able to send its location as well as be able to get data from the server and should run in the background and start itself every 5 minutes or so and send location data to the server. The python side should just receive and send messages as I want to. Can you guys point me in the write direction. I would like to have a GUI for this so should I use the SL4A for the android?
| true | 9,355,779 | 1.2 | 0 | 0 | 2 |
You are talking about Client-Server to set the location of your client. You have to create one server which will be provide you a webservice to submit your data.
You can you any web service like xmlrpc, soap ... to fulfill your needs. Python provide the module to develop this services.
You have to use SL4A to develop a client script which will be sending data to the server every 5 min.
| 0 | 604 | 0 | 2 |
2012-02-20T03:19:00.000
|
android,python,sl4a
|
Python Computer -to- Android Phone
| 0 | 1 | 1 | 9,356,229 | 1 |
0 | 0 |
Looking at the API there doesn't seem to be a way to center a wx.BusyInfo message to the center of the screen like with other pop up modals by using Center().
Is there a way to center wx.BusyInfo()?
| false | 9,370,794 | 0 | 0 | 0 | 0 |
Little late: but you can center a busyInfo window by specifying a parent. It will center on the parent, otherwise it will center on the screen.
| 0 | 485 | 0 | 1 |
2012-02-21T01:11:00.000
|
python,wxpython,wxwidgets
|
How to center a wx.BusyInfo() - wxpython?
| 0 | 2 | 2 | 13,944,075 | 1 |
0 | 0 |
Looking at the API there doesn't seem to be a way to center a wx.BusyInfo message to the center of the screen like with other pop up modals by using Center().
Is there a way to center wx.BusyInfo()?
| true | 9,370,794 | 1.2 | 0 | 0 | 1 |
not with wx.BusyInfo, as far as I know (although it should be already centered by default... have you tried not giving a parent window to the wx.BusyInfo?).
Alternatively, you may want to try wx.lib.agw.PyBusyInfo instead: if it doesn't do exactly what you need, you can always hack it to suit your needs (it's pure Python).
Hope this helps.
Andrea.
| 0 | 485 | 0 | 1 |
2012-02-21T01:11:00.000
|
python,wxpython,wxwidgets
|
How to center a wx.BusyInfo() - wxpython?
| 0 | 2 | 2 | 9,374,668 | 1 |
0 | 0 |
A good example is MS OneNote. It has the option to be fixed to one side of the screen and pushes all other windows to the side. When maximizing or resizing other windows, they can only expand up to the edge of OneNote. Does Python have this capability using Tkinter or another module? Thank you for any assistance.
| false | 9,371,916 | 0 | 0 | 0 | 0 |
Tkinter has very little control over the behavior of the rest of the windows on the OS. There's no built-in cross-platform function for this.
| 0 | 528 | 0 | 4 |
2012-02-21T03:49:00.000
|
python,winapi,pywin32
|
How can I set up a dedicated screen area for an application in Python?
| 0 | 2 | 3 | 9,372,040 | 1 |
0 | 0 |
A good example is MS OneNote. It has the option to be fixed to one side of the screen and pushes all other windows to the side. When maximizing or resizing other windows, they can only expand up to the edge of OneNote. Does Python have this capability using Tkinter or another module? Thank you for any assistance.
| true | 9,371,916 | 1.2 | 0 | 0 | 2 |
The win32 feature you're looking for is called Application Desktop Toolbars - it allows your application to cooperate with the shell and reserve space along the side, similar to the taskbar.
If you want to implement this yourself, you'll likely need to use Win32 somehow.
It looks like there's a python wrapper for this, however: searching for python and appbar turned up wxAppBar which seems to be a python wrapper for it.
| 0 | 528 | 0 | 4 |
2012-02-21T03:49:00.000
|
python,winapi,pywin32
|
How can I set up a dedicated screen area for an application in Python?
| 0 | 2 | 3 | 9,375,993 | 1 |
0 | 0 |
I have created a grid wit n*n column with wxpython using wx.grid.Grid class. I want to use some of the cells of the grid as a drop-down list and some as buttons. How can widgets be implemented as a part of grid class in wxpython?
| true | 9,372,107 | 1.2 | 0 | 0 | 0 |
The wxPython demo shows how to put checkboxes in it. The event you want is probably wx.grid.EVT_GRID_CELL_LEFT_CLICK, so when you click on the cell, you could check which cell you clicked on and react appropriately. Even if you can't use a custom cell renderer, you could create a little frame with the widget you need over the cell you clicked on.
| 0 | 710 | 0 | 0 |
2012-02-21T04:17:00.000
|
python,user-interface,wxpython
|
using cells in grid as buttons and drop-down list
| 0 | 1 | 1 | 9,397,106 | 1 |
0 | 0 |
I am working on a proof of concept for an in-memory database. I do know about stuff like redis and love things like intersecting sets but that is not enough. I want to find out how to implement a service which is like the parstream database or the drawntoscale solutions.
And therefore I like to have a daemon which keeps stuff in the memory.
I did a prototype with pyro which does what it should: generate a random bitmap index and accept an bitmap mask as input from a pyro client and return all primary keys which match the bitmap mask.
But iterating over the index is too slow by some magnitudes which is obvious since it is python. I would like to use an C extension which does the index scan. Therefore the bitmap index shoud be kept in memory inside the c extension.
The very next step would be to keep the same data in the gpu ram iterate over inside my gpu.
Having no experience writing c extensions and pyOpenCL my question is: can I keep data inside my C Extension and use python ( pyro daeomon or maybe even flask/tornado ) just for receiving and returning the queries without copying the whole bitmap index all the time?
Regards
Christian
| false | 9,385,251 | 0 | 0 | 0 | 0 |
Yes, C extensions can have internal structures allocated, but be sure to destroy your data properly when needed.
You can also write your code as a C/C++ DLL and use the ctypes python extension to access C functions directly and pass them C variables (ints, char *, etc.).
| 0 | 167 | 0 | 0 |
2012-02-21T21:12:00.000
|
python,c,database,daemon,opencl
|
python c extension / opencl daemon
| 0 | 1 | 1 | 9,497,466 | 1 |
0 | 0 |
I'm kinda new to programming, and I wanna write a simple program that needs to OCR a particular window. Currently, I'm using (w.GetForegroundWindow()), but that gets me the current window which would always be the Python shell, since that is the one that is active when I run it, even if it is for a split second only.
After searching around for a bit, I found the .Getwindows function, but not much of it on Python. What does it do, and what are the parameters? Will i be able to target a particular process (=window) with it? If not, what can I use then?
This is using the pywin32 module on Python 2.7 in Windows
I'm in Windows, Python 2.7 . The GetWindows function comes with the module pywin32, if im not wrong
| false | 9,414,906 | 0 | 0 | 0 | 0 |
The usual way is to call EnumWindows with a callback and then get information about each hwnd - for example name, title or window class. Check that against what you are looking for and save the matched hwnd. After EnumWindows returns, check that you found a valid hwnd and use that for your program.
It's not pleasant - there's not much support for this kind of thing in windows. I've heard that using accessibility features is better but I have no experience using that.
| 0 | 815 | 1 | 0 |
2012-02-23T14:25:00.000
|
python,process,window,pywin32
|
What are the parameters for .GetWindow function in python?
| 0 | 1 | 1 | 9,429,657 | 1 |
0 | 0 |
I'm working on a program that outputs a text procedure file, based on user input. ie, the user will have a few options they can select from, and I'd like for them to be able to add them, reorder them, etc. into a custom order, and have it output that list into a text file.
I'd like to write this in python, and I am familiar with wxWidgets, but not tied to that. Any ideas?
| true | 9,423,127 | 1.2 | 0 | 0 | 0 |
If you're talking about some kind of list box with strings in it, then you might want to look at the EditableListBox, which is in wx.gizmos.EditableListBox. See the wxPython demo for more info.
Otherwise you'll have to roll your own, which really shouldn't be that hard.
| 0 | 189 | 0 | 0 |
2012-02-23T23:29:00.000
|
python,wxpython,wxwidgets
|
Widget to add, remove, and sort entries in a wxpython program
| 0 | 1 | 1 | 9,432,185 | 1 |
0 | 0 |
I'm new to PySide and Qt at all, and now need to create an application which has a tree view with styled items. Each item needs two lines of text (different styles), and a button. Many items are supposed to be in the view, so I chose QTreeView over QTreeWidget. Now I managed to add simple text items (non-styled) to the QTreeView and have almost no idea about how to place several widgets on one item. Could you please give me an example of how to create such design?
I've found some samples on the Internet, that are similar to what I want, but they all are in C++, and it's not obvious how to convert delegates and other things to Python. I'm now really confused about it all...
| true | 9,431,870 | 1.2 | 0 | 0 | 1 |
I'd recomend you use simple QTreeWidget and insert complex widgets with setItemWidget. While Qt's widhets are alien, they are not so heavy to draw, but:
You shouldn't create delegates.
You shouldn't handle events (If you are going to place button in view and draw it using delegates, you had to handle all its events, such as mouseOver, focus changing, etc. It is a lot of work.
| 0 | 1,305 | 0 | 0 |
2012-02-24T13:53:00.000
|
python,qt,customization,pyside,qtreeview
|
Customize QTreeView items
| 0 | 1 | 1 | 9,434,264 | 1 |
0 | 0 |
I'm doing a little user/password emulator with a super simple visual interface (using Tkinter) and I need to hide the characters when the user is typing his password.
I need to hide them by that kind of dots that all the systems use when you are going to login into somewhere.
Thanks in advance.
| true | 9,452,318 | 1.2 | 0 | 0 | 1 |
TKinter's Entry widget has a show option. If you set this option to a single character (e.g. *), this character is displayed instead of the actual characters.
If you don't want the asterisk (*) character, you can try the the bullet (•, "\u2022" in Python).
| 1 | 1,068 | 0 | 0 |
2012-02-26T10:24:00.000
|
python,login
|
Hiding characters in Python by dots
| 0 | 1 | 1 | 9,452,378 | 1 |
0 | 0 |
I have a program that receives serial data and uses matplotlib to graph it using Tkinter. I have this working currently, but I've had to use the .after() function to poll a queue for data. In other UI frameworks I've used in the past (different projects in C) there has been a way to ask the UI framework to call a function given to it from the mainloop (either after some amount of time, during idle, etc). If I try to use .after() on a thread which isn't the mainloop, it doesn't work and complains at me.
Is there a way to call a user supplied function, provided on a thread which isn't the mainloop, from the mainloop? Or, is there a way to instruct the mainloop to wake up and do some work if a Queue gets some data?
Thanks.
| true | 9,457,170 | 1.2 | 0 | 0 | 1 |
I've heard that you can call event_generate from the non-GUI thread. If you do call event_generate, I've read that you should give the value of tail to the when parameter.
I've personally only done this in one project, but it seemed to work fine.
| 1 | 269 | 0 | 1 |
2012-02-26T21:08:00.000
|
python,multithreading,tkinter
|
Is there a way to request a function to be called on Tkinter mainloop from a thread which is not the mainloop?
| 0 | 1 | 1 | 9,457,843 | 1 |
0 | 0 |
Does anyone know if it's possible to add a label to a single tool in a wx.ToolBar? I've found a global setting but no option to set it for a single tool.
| true | 9,463,565 | 1.2 | 0 | 0 | 1 |
I have a feeling that's a limitation of the native widget. It's an all or nothing affair. You could make the label a part of the image on the tool item though. Or you might be able to do it with FlatMenu which has a Toolbar widget equivalent that's written in pure Python, so you can hack it. See the wxPython demo for an example of its API.
| 0 | 172 | 0 | 0 |
2012-02-27T10:36:00.000
|
python,wxpython
|
Can I add a label to a single tool in a wxPython toolbar?
| 0 | 1 | 1 | 9,466,460 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 1 | 0 | 0 | 43 |
Tell PyInstaller to create a console-mode executable. This gives you a working console you can use for debugging.
At the top of your main script, even before the first import is run, add a print "Python Code starting". Then run your packaged executable from the command line. This way you can get a clear picture whether the time is spent in PyInstaller's bootloader or in your application.
PyInstaller's bootloader is usually quite fast in one-dir mode, but it can be much slower in one-file mode, because it depacks everything into a temporary directory. On Windows, I/O is very slow, and then you have antiviruses that will want to double check all those DLL files.
PyQt itself is a non-issue. PyQt is generated by SIP which generates very fast lazy bindings; importing the whole PyQt is faster than any other GUI library because it basically does nothing: all bindings to classes/functions are dynamically created when (and if!) you access them, saving lots of memory too.
If your application is slow at coming up, that will be true without PyInstaller as well. In that case, your only solution is either a splash screen (import just PyQt, create QApplication, create a display the splashscreen, then import the rest of your program and run it), or rework your code. I can't help you much without details.
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 9,474,575 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 1 | 0 | 0 | 13 |
I agree with above answers. My Qt python program needed about 5 seconds to start up on a decent PC when using onefile mode. After I change to --onedir, it only took around one second to start; almost immediately after user double clicks the exe file. But the drawback is that there are many files in that directory which is not so neat.
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 15,892,172 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 1 | 0 | 0 | 66 |
I suspect that you're using pyinstaller's "one file" mode -- this mode means that it has to unpack all of the libraries to a temporary directory before the app can start. In the case of Qt, these libraries are quite large and take a few seconds to decompress. Try using the "one directory" mode and see if that helps?
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 9,470,393 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| true | 9,469,932 | 1.2 | 0 | 0 | 1 |
I have 'compiled' a few wxPython apps using py2exe and cx_Freeze, None of them take more than 4 seconds to start.
Are you sure sure it's not your code ?
maybe some network or some I/O resource call holding your app ?
Have you tried other machine than yours? Even the fastest hardware can be slow sometimes with the wrong software config, apps or OS, try it.
Try timing it with timeit module.
I never used pyQT, but with wxPython the startup speed is OK, and after the first initialize if I close and open again, it's faster than the first time.
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 9,470,332 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 0.085505 | 0 | 0 | 3 |
For my application, the long startup time almost entirely was caused by the antivirus system. Switching it off reduced the startup in my case from 3 minutes to less than 10secs!
To bring these measurements into perspective: My application was bundled with extra data files (about 150 files with a payload of 250MB), besides carrying around Qt and numpy (that may depend on Intel MKL, which alone adds another 200MB to the bundle!) dependencies. It even didn't help much that the tested system was running with a solid state drive...
In conclusion: if you have a large application with lots of dependencies, the startup time may be affected strongly by the antivirus system!
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 49,350,571 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 0.085505 | 0 | 0 | 3 |
In case anyone is still have this issue, I resolved mine by running the exe locally and not on any sharedrives. This took the startup time from over a minute to under 10 seconds.
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 57,366,288 | 1 |
0 | 0 |
I have an application written in Python and 'compiled' with PyInstaller. It also uses PyQt for the GUI framework.
Running this application has a delay of about 10 seconds before the main window loads and is shown. As far as I can tell, this is not due to slowness in my code. Instead, I suspect this is due to the Python runtime initializing.
The problem is that this application is started with a custom laucncher / taskbar application. The user will click the button to launch the app, see nothing appear to happen, and click elsewhere on another application. When my application shows it's window, it cannot come to the foreground due to the rules for SetForegroundWindow.
I have access to the source for the PyInstaller win32 loader, the Python code, and even the launcher code.
My questions are:
How can I make this application start faster?
How can I measure the time spend i the first few seconds of the process's lifetime?
What is the generally accepted technique for reducing time until the first window is shown?
I'd like to avoid adding a splash screen for two reasons - one, I expect it won't help (the overhead is before Python code runs) and two, I just don't like splash screens :)
If I need to, I could probably edit the PyInstaller loader stub to create a window, but that's another route i'd rather not take.
| false | 9,469,932 | 0.028564 | 0 | 0 | 1 |
I solved this by adding an exception to the anti-virus monitoring software (F-Secure). It removed the wait of several minutes before running.
| 1 | 58,999 | 0 | 71 |
2012-02-27T18:08:00.000
|
python,windows,performance,pyinstaller
|
App created with PyInstaller has a slow startup
| 0 | 7 | 7 | 68,760,139 | 1 |
1 | 0 |
I'm using QWebKit to render a a pdf-page. Untill now, I used setHtml(), to feed the html code to the QMainFrame and then render() to print the content or export it to pdf. So far so good, but I want to use setContent() to include inline-svg-images to the frame, which get not displayed, using setHtml().
But setContent() only accepts QByteArray, and the html-Code is in unicode. How do I feed the unicode string to setContent()?
| true | 9,470,170 | 1.2 | 0 | 0 | 1 |
The way to get a byte array out of a unicode is to encode it.
| 0 | 284 | 0 | 0 |
2012-02-27T18:25:00.000
|
python,pyside,qwebpage
|
Using QWebFrame.setContent() with unicode (Python+PySide)
| 0 | 1 | 1 | 9,470,209 | 1 |
0 | 0 |
To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast.
However. PyGame is constantly being used, updated, reused by lots of people and seems to have quite a following. Pyglet hasn't been updated since January 2010. Most works of art are never finished, only abandoned - but two years and it's still on v 1.1.4 seems troubling.
So while I might be specifically asking about Pyglet vs. PyGame, I'm also not, because it leads me wonder about other ghostly modules that might be lurking out there, that had promise once upon a time but, for some reason, got dropped or shoved in a corner and aren't really relevant. Are such abandoned projects not worth the time and brain-space investment?
| false | 9,472,750 | 0.039979 | 0 | 0 | 1 |
To paraphrase Monty Python
No no he's not stagnant, he's, he's restin'!
Open source maintainers move on or get busy with other things. If you feel Pyglet is a good choice for your application create a clone of the repo, put your changes up on insert code hosting flavor of the month, and get some work done. There are benefits to having a community to ask for help or fix bugs.
However, if something is open source and a good fit for your project the lack of a maintainer should be seen as an opportunity and not a problem.
| 0 | 2,144 | 0 | 6 |
2012-02-27T21:42:00.000
|
python,pyglet
|
Python - Is it worthwhile to invest time in apparently stagnant modules?
| 0 | 2 | 5 | 9,473,902 | 1 |
0 | 0 |
To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast.
However. PyGame is constantly being used, updated, reused by lots of people and seems to have quite a following. Pyglet hasn't been updated since January 2010. Most works of art are never finished, only abandoned - but two years and it's still on v 1.1.4 seems troubling.
So while I might be specifically asking about Pyglet vs. PyGame, I'm also not, because it leads me wonder about other ghostly modules that might be lurking out there, that had promise once upon a time but, for some reason, got dropped or shoved in a corner and aren't really relevant. Are such abandoned projects not worth the time and brain-space investment?
| true | 9,472,750 | 1.2 | 0 | 0 | 10 |
as the owner of a "dormant" package, my own take is:
a more popular package is going to have better support from the community. for many people i think this overrides any other consideration. it's often better to have support for a mediocre package than battle with an awesome package no-one else is using.
and it may well be popular because it's better. obviously i am biased towards the underdog (see above) here, but it has to be said that if a package never gained many users, perhaps it wasn't a good match to the market.
BUT
if the package is mature and working, and it does what you want, why not use it? especially when open source means you can fix bugs yourself, forking if necessary.
so, it depends. all other things being equal - use the popular choice. if you need support - use the popular choice. but if a package happens to exactly scratch an itch, and it's open source and out there, i would still consider it.
important qualification: this is for personal projects - for work i have a responsibility to use popular projects so that others can support the code i have written.
python specific rider: one additional thing to worry about is python 3 support. if a dormant package is stuck on python 2 i would think twice because long-term there's a real chance it will stop working on default python installs.
| 0 | 2,144 | 0 | 6 |
2012-02-27T21:42:00.000
|
python,pyglet
|
Python - Is it worthwhile to invest time in apparently stagnant modules?
| 0 | 2 | 5 | 9,472,827 | 1 |
0 | 0 |
I wrote a python GUI in Tkinter for a time-clock system. The micro machine is wall mounted and the employees only have access to the touchscreen menu I programmed and a barcode swipe. I know how to get the script to start on startup, but how do I prevent them from exiting out or opening other menus? Basically the sole purpose of this console is to run the time-clock GUI.
If it cant be done in Ubuntu, is there another flavor of linux it can be done in?
| false | 9,484,724 | 0.066568 | 0 | 0 | 1 |
Don't start a window manager. Only start your program, e.g. from xinitrc. Make the program full-screen
| 0 | 224 | 1 | 1 |
2012-02-28T15:27:00.000
|
python,user-interface,ubuntu,tkinter,restriction
|
How do I limit a Ubuntu machine to a Python GUI?
| 0 | 1 | 3 | 9,489,644 | 1 |
0 | 0 |
This question isn't about how to grab the keypress, i'm using accelators for that(but fi thats the wrong way by all means correct me)
Once i start my program, i press ESC to hide it with window.hide_all().
the user may then do other things in other programs, etc, but I want to make it so whenever the user presses, for example, alt + backspace, my program comes back to visibility
Very much like in unix system, pressing alt + f2 fires up the GUI launcher.
bonus: plus what happens if the key combination i set (alt + backspace) is already a shortcut for something in the user's system?
| true | 9,509,958 | 1.2 | 0 | 0 | 3 |
You'll need to arrange that in the window manager. If the program doesn't have the input focus, it doesn't even receive keystrokes.
| 0 | 65 | 0 | 0 |
2012-03-01T02:52:00.000
|
python,pygtk
|
How can I bring a pyGTK program to visibility, at any time, with a keypress?
| 0 | 1 | 1 | 9,511,745 | 1 |
0 | 0 |
I have some C++ code that delivers events to Python objects. Observers are kept as weak_ptrs, so they don't have to deregister.
This works in C++, but bridging weak pointers and Python weak references is troublesome (I also want Python event handlers not being kept alive by subscriptions, same as in C++ code). In order to have a live observer, something needs to have a shared pointer to it while the object is alive, so it boils down to having an observer in Python land control the lifetime of a C++ observer object.
The approaches I've come up with so far involve a fair amount of boilerplate and intermediate objects (e.g. creating another PyTypeObject for a type that keeps a C++ observer and a weak reference to the Python observer and setting it as a member of Python observer, so it dies with it).
The question is, is there any obvious way to do it?
| false | 9,577,314 | 0 | 1 | 0 | 0 |
I would write a python wrapper over the C++ module and dispatch to python observers in the python wrapper. Would that be enough?
When you mention that something needs to have a shared pointer, would it be enough if that shared pointer is on the stack until given observer returns?
| 0 | 107 | 0 | 4 |
2012-03-06T02:59:00.000
|
c++,python,weak-references
|
Track the lifetime of a CPython object from C extension
| 0 | 1 | 1 | 9,737,868 | 1 |
0 | 0 |
I am working on an Desktop application built with wx Python. I would like the application to visualize maps(shapefiles) like a GIS software and provide interactions with the map. I was looking through arcpy and arcgisscripting but I am not sure if it help me render the shapefile on the Panel. Please do let me know if it is possible?
| false | 9,628,257 | 0 | 0 | 0 | 0 |
ArcGIS has it's own rendering engine. You would need to create an ArcPy tool or script or add-in for something like ArcGIS Explorer or the paid version ArcMap. You could also look into making an ArcPy tool, script, or add-in for their ArcGIS Runtime.
| 0 | 1,086 | 0 | 0 |
2012-03-09T02:44:00.000
|
wxpython,arcgis,arcpy
|
wxPython and ARCGIS
| 0 | 1 | 2 | 19,055,227 | 1 |
0 | 0 |
I am trying to use twisted but when i try to run some of the example code provided with the twisted package, it seems to always crash when i use "twistd" instead of "python"
for example, using the example code given with twisted,
if i run to command : twisted -ny echoserv.py
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 652, in run
runApp(config)
File "/usr/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 23, in runApp
_SomeApplicationRunner(config).run()
File "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 386, in run
self.application = self.createOrGetApplication()
File "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 451, in createOrGetApplication
application = getApplication(self.config, passphrase)
--- ---
File "/usr/lib/python2.7/site-packages/twisted/application/app.py", line 462, in getApplication
application = service.loadApplication(filename, style, passphrase)
File "/usr/lib/python2.7/site-packages/twisted/application/service.py", line 405, in loadApplication
application = sob.loadValueFromFile(filename, 'application', passphrase)
File "/usr/lib/python2.7/site-packages/twisted/persisted/sob.py", line 211, in loadValueFromFile
value = d[variable]
exceptions.KeyError: 'application'
Failed to load application: 'application'
Could not find 'application' in the file. To use 'twistd -y', your .tac
file must create a suitable object (e.g., by calling service.Application())
and store it in a variable named 'application'. twistd loads your .tac file
and scans the global variables for one of this name.
Please read the 'Using Application' HOWTO for details.
I was using Twisted version 11.0.0 but then i tried 12.0.0 but i have the same problem.
The version of python i am using is 2.7.2
Any ideas on what to do would be helpful. I have been trying to deal with this problem for a few days now. thanks!
| false | 9,649,879 | 0 | 0 | 0 | 0 |
To use 'twistd -y', your .tac file must create a suitable object (e.g., by calling service.Application()) and store it in a variable named 'application'. twistd loads your .tac file and scans the global variables for one of this name.
Please read the 'Using Application' HOWTO for details.
| 0 | 528 | 1 | 0 |
2012-03-10T20:24:00.000
|
python,twisted,twistd
|
stack dump in twisted app.py 'application' error when using twistd but works with python?
| 0 | 1 | 2 | 9,650,823 | 1 |
0 | 0 |
1: i create main window in QtCreator.
how i use this form in my python code in eclipse.
2: can write python and build complete python application in QtCreator ? (How).
thanks.
| false | 9,657,333 | 0 | 0 | 0 | 0 |
You need PyQt or PySide to use Qt in your Python script.
To generate python script from ui file run pyuic -x form.ui
| 1 | 238 | 0 | 0 |
2012-03-11T17:51:00.000
|
python
|
How To Add .ui Files To Python
| 0 | 1 | 2 | 9,657,438 | 1 |
0 | 0 |
I'm writing a pathfinding visualizer in python and Pygame. I intend to write a visualizer that can simultaneously simulate multiple pathfinding algorithms. I have two possible approaches
I write a server part of the application, that will calculate path and will send it to client part, that will use pygame to draw grid and render simulation.
I write a master thread, that will do pathfinding and will send information to grid thread using pipes.
Which approach should I use?
| true | 9,661,063 | 1.2 | 0 | 0 | 2 |
You're overthinking this. Either method is fine, but you probably don't want to use threads for CPU-bound operations. Use the multiprocessing module instead if you're shooting for concurrency.
But really, the pygame code should be negligible in terms of processing. Focus on making your pathfinding efficient (perhaps implemented in C?) instead.
| 1 | 626 | 0 | 0 |
2012-03-12T02:31:00.000
|
python,pipe,pygame,path-finding
|
Pathfinding Visualizer in python
| 0 | 1 | 1 | 9,667,720 | 1 |
0 | 0 |
Short version:
How can I get the address that a ctypes pointer points to?
Long version:
I have registered a python function as a callback with a C library. The C library expects function signature of void (*p_func)(char stat, char * buf, short buf_len) so I register an appropriate python function. When I get into the python function, I want to know the memory address pointed to by buf. How can I do this?
| true | 9,687,002 | 1.2 | 0 | 0 | 16 |
I have fixed this myself by reading the documentation.
I wanted to know the memory location of a block of memory allocated by a library. I had the ctypes pointer that pointed to said block. To get the memory address of the block I used ctypes.addressof(p_block.contents).
The confusion arose around my understanding that p_block.contents != p_block.contents, but then I realised all p_block.contents objects have the same underlying buffer. The address of the underlying buffer is obtained with ctypes.addressof.
| 0 | 12,060 | 1 | 11 |
2012-03-13T15:26:00.000
|
python,ctypes
|
Get the memory address pointed to by a ctypes pointer
| 0 | 1 | 2 | 9,784,508 | 1 |
1 | 0 |
I am building a Titanium mobile project.
I have some folders with some .JS files in the Resources folder. The problem I ran into is that I need to exclude some of the folder while building for iphone but those folder are needed in my android build.
I looked into the python files in the SDK folder and found out that there are separate file i.e. builder.py for iphone and android.
While building for android or ios all of my JS files gets build, which i dont want as it increases my app size.
As for now i have successfully edited the builder.py file so that it copies the selected folder into my iphone resources folder. It runs fine on simulator but when i tried running on the device i got error saying .js file missing.
I know that my copied .Js files were not archived
Can anyone help me in configuring that builder.py so that we can exclude some folders from getting build.
| false | 9,700,623 | 0 | 0 | 0 | 0 |
Ajeet, I believe you can create a directory for android and iphone inside the resources folder that you can keep your platform-specific code/assets in. I think the compiler recognizes this.
| 0 | 332 | 0 | 1 |
2012-03-14T11:00:00.000
|
python,build,titanium,titanium-mobile,appcelerator-mobile
|
Avoid folders in Resources folder from being build or compile
| 0 | 1 | 1 | 9,706,293 | 1 |
0 | 0 |
In Python using wxPython, how can I set the transparency and size of a window based on the proximity of the mouse relative to the application's window, or frame?
Eg. similar to a hyperbolic zoom, or The Dock in MAC OS X? I am trying to achieve this effect with a png with transparency and a shaped window.
Any libraries or code snippets that do this would be great too. Thanks.
| false | 9,705,201 | 0.197375 | 0 | 0 | 2 |
I don't think it can be done that easily if the mouse is outside the main frame. That said, you can always do the following:
1) Start a timer in your main frame and poll it every 50 milliseconds (or whatever suits you);
2) Once you poll it in your OnTimer event handler, check the mouse position via wx.GetMousePosition() (this will be in screen coordinates);
3) In the same OnTimer method, get the screen position of your frame, via frame.GetScreenPosition();
4) Compare the mouse position with the frame position (maybe using an euclidean distance calculation, or whatever suits you). Then you set your frame transparency accordingly to this distance (remember to put it fully opaque if the mouse is inside the frame rectangle).
I did just it for the fun of it, it shouldn't take more than 5 minutes to implement.
Hope this helps.
Andrea.
| 0 | 2,043 | 0 | 4 |
2012-03-14T15:45:00.000
|
wxpython,mouseevent,proximity,shaped-window
|
Capturing mouse events outside wx.Frame in Python
| 0 | 1 | 2 | 9,716,353 | 1 |
1 | 0 |
I would like to bind the wx.html2.WebView.New widget with wx.EVT_LEFT_UP however it doesnt work (it doesnt get noticed, nothing happens).
Is there anything i am missing?
| false | 9,730,769 | 0 | 0 | 0 | 0 |
I don't think you are missing anything, this hasn't yet been implemented. Mouse and keyboard events are high on my todo list though, I will update this question when they have been added.
| 0 | 419 | 0 | 2 |
2012-03-16T01:49:00.000
|
python,wxpython,wxwidgets
|
Binding a wx.html2.WebView.New Widget?
| 0 | 1 | 1 | 9,742,560 | 1 |
0 | 0 |
I have some big mysql databases with data for calculations and some parts where I need to get data from external websites.
I used python to do the whole thing until now, but what shall I say: its not a speedster.
Now I'm thinking about mixing Python with C++ using Boost::Python and Python C API.
The question I've got now is: what is the better way to get some speed.
Shall I extend python with some c++ code or shall I embedd python code into a c++ programm?
I will get fore sure some speed increment using c++ code for the calculating parts and I think that calling the Python interpreter inside of an C-application will not be better, because the python interpreter will run the whole time. And I must wrap things python-libraries like mysqldb or urllib3 to have a nice way to work inside c++.
So what whould you suggest is the better way to go: extending or embedding?
( I love the python language, but I'm also familiar with c++ and respect it for speed )
Update:
So I switched some parts from python to c++ and used multi threading (real one) in my c modules and my programm now needs instead of 7 hours 30 minutes :))))
| false | 9,746,586 | 0.197375 | 1 | 0 | 2 |
In my opinion, in your case it makes no sense to embed Python in C++, while the reverse could be beneficial.
In most of programs, the performance problems are very localized, which means that you should rewrite the problematic code in C++ only where it makes sense, leaving Python for the rest.
This gives you the best of both world: the speed of C++ where you need it, the ease of use and flexibility of Python everywhere else. What is also great is that you can do this process step by step, replacing the slow code paths by the by, leaving you always with the whole application in an usable (and testable!) state.
The reverse wouldn't make sense: you'd have to rewrite almost all the code, sacrificing the flexibility of the Python structure.
Still, as always when talking about performance, before acting measure: if your bottleneck is not CPU/memory bound switching to C++ isn't likely to produce much advantages.
| 0 | 2,903 | 0 | 1 |
2012-03-17T01:56:00.000
|
c++,python,embedding,extending
|
Speed - embedding python in c++ or extending python with c++
| 0 | 1 | 2 | 9,746,618 | 1 |
0 | 0 |
Is there any way to bind two windows from seprate processes together using Python/Pygame? By binding I mean in two possible ways:
A large window that contains two smaller windows
Two separate windows which appear side to side (perhaps using OS environment variables?)
| true | 9,748,915 | 1.2 | 0 | 0 | 3 |
You might try running two separate programs. I just ran two of my pygame programs separately, they work fine. Run one using the other, maybe? Or, if that doesn't work, put use two surfaces as screens, and draw one into the other.
| 0 | 531 | 0 | 2 |
2012-03-17T09:43:00.000
|
python,user-interface,pygame
|
Possibility of binding multiple PyGame windows
| 0 | 2 | 2 | 9,751,549 | 1 |
0 | 0 |
Is there any way to bind two windows from seprate processes together using Python/Pygame? By binding I mean in two possible ways:
A large window that contains two smaller windows
Two separate windows which appear side to side (perhaps using OS environment variables?)
| false | 9,748,915 | 0 | 0 | 0 | 0 |
Interprocess communication is probably the simplest. The issue though is that SDL is fundamentally not set up for multiple windows.
Probably the best long-term solution is to set up with wxPython, and then use PyGame inside of it. This will let you have all manner of windows with PyGame renderers.
| 0 | 531 | 0 | 2 |
2012-03-17T09:43:00.000
|
python,user-interface,pygame
|
Possibility of binding multiple PyGame windows
| 0 | 2 | 2 | 9,855,904 | 1 |
0 | 0 |
I'm trying to get this program to print the contents of a .csv file onto a GUI.
I've created in Tkinter. It mostly works, but I can't figure out a way to get each button to print the contents of the file it's linked to.
At the moment I've created a variable that links to just one of the files, which shows that it works.
The variable is "loadFiles", and the project it's set to open is "a_P.csv". Is there any way I can make the buttons link this variable to the relevant .csv file?
The code is in this pastebin link: http://pastebin.com/ZP2pPvKA
The program searches for files ending in "_P.csv" in the same folder as it, so you may have to create a .csv with 7 objects in it.
| false | 9,754,056 | 0.099668 | 0 | 0 | 1 |
you can use a lambda function in order to pass an argument to your load function. Unfortunately pastebin ist down right now so i cannot have a look at your code. The idea is something like this:
for filename in filenames:
...Button(...,command=lambda i=filename:loadFile(i),...
so in your loadFile function you have the filename as first parameter
| 0 | 2,189 | 0 | 3 |
2012-03-17T21:48:00.000
|
python,user-interface,csv,tkinter
|
How to make a button open a specific .csv file using Python Tkinter?
| 0 | 1 | 2 | 9,754,842 | 1 |
0 | 0 |
I'm creating python app using relatively big SQL database (250k rows). Application needs GUI where most important part of it would be to present results of SQL queries.
So I'm looking for a best way to quickly present data in tables in GUI.
Most preferably I'd be using wx - as it has seamless connection to main application I'm working with. And what I need is least effort between SQL query a and populating GUI table.
I used once wx.grid, but it seemed to be limited functionality. Also I know of wx.grid.pygridtablebase - what is the difference?
What would be easiest way to do this?
| false | 9,762,841 | 0.197375 | 0 | 1 | 1 |
You could use wx.grid or one of the ListCtrls. There's an example of a grid with 100 million cells in the wxPython demo that you could use for guidance on projects with lots of information. For ListCtrls, you would want to use a Virtual ListCtrl using the wx.LC_VIRTUAL flag. There's an example of that in the demo as well.
| 0 | 420 | 0 | 1 |
2012-03-18T22:22:00.000
|
python,sqlite,user-interface,wxpython,wxwidgets
|
Most seamless way to present data in gui
| 0 | 1 | 1 | 9,771,997 | 1 |
0 | 0 |
I am writing an application where I am coding all of my front-end and GUI with python library (wxpython specifically). For this application, I would like to write the model class with C and use python to use the compiled C code? How can this be implemented in python?
I know this is little vague question but I am struggling with the starting point.
| false | 9,776,206 | 0.066568 | 0 | 0 | 1 |
You could strictly seperate design(python part) and code(c++ part) like this:
Write a complete c++ programm that works in the terminal/console and then make the python-application call these c++-terminal programm via os.Popen.
So if your programm is a calculator it does this:
(python gui) 5 + 5 -> my_c_programm.exe "5 + 5" -> (returns) 10 -> (python gui) display
that way you can use your programm with and without gui.
Its easier and faster than embedding Python in your c++ programm or extending Python with C++.
I basically do the same thing on my current project, but like this:
php: my webinterface
python: for structure and logic and easy operation
c++: for heavy calculations and where I need speed
so php -> python -> c++
and it works very well for me :)
| 0 | 894 | 0 | 0 |
2012-03-19T18:59:00.000
|
c++,python,c,wxpython
|
Using C compiled code from python GUI
| 0 | 1 | 3 | 9,777,740 | 1 |
0 | 0 |
I have a small question hoping someone will help me.
Is there any way to hook into other applications WNDPROC?
The situation is that I want to insert a menu in the other app menubar and I want to define the commands for every menu item.
I was able to insert the menu with menu items using some Win32 API
functions (user32.dll), but I can't set the commands of that menu item so that it actually does something if clicked.
With some googling, I got some information about wndprocess, and I should intercept the ID Command sent and trigger some function, but I'm stuck.
Can anyone help me?
| true | 9,795,645 | 1.2 | 0 | 0 | 2 |
You are going about this the wrong way. If you think about it, you'll realize that responding to menu events with your custom "actions" must require some code to run in the process that you're targeting. This means you'll need to inject code into the other process in order to achieve what you want.
Since you're going to need to inject code anyway, I strongly suggest you look at DLL-injecting into the other process (search "Dll Injection example"). This will bootstrap your code into the other process, and you can construct your menu there.
This also has the advantage that the foreign app won't be reliant on your app being responsive - it'll all be in-process.
| 0 | 1,449 | 1 | 7 |
2012-03-20T21:58:00.000
|
python,winapi,wndproc
|
hook into wndproc of another application?
| 0 | 1 | 1 | 10,608,464 | 1 |
0 | 0 |
I'm trying to create a simple word processor for starters to learn Python a bit better.
I'm using the Tkinter Text widget for the main editing program, the only problem is the height and width are defined by characters.
This creates a problem when I change fonts, for not all fonts are the same width.
Every time the font is changed, the Text widget re-sizes, although technically it is the same width and height. This looks ridiculous when trying to type up something, I'm trying to make the word processor as nice as possible.
Is there a way to define the width and height in pixels?
the .grid_propagate(False) is not useful for the size is technically not changing, only the character width.
I'm trying to stay away from wxPython for now, since everything I've done up to this point has been in Tkinter.
I have done endless hours of extensive googling but have found no solutions.
| false | 9,833,698 | 0 | 0 | 0 | 0 |
..tested this: this works on the frame size, but not on the (scrolled)text-widgets size.
my setup is a bit more complicated, with a masterframe for 2 sites, mainframes for each site and frames with various content, i.a. a scrolledtext widget.
adding grid_propagate, *_row- and *_columnconfigure warded the masterframe from resizing, even with adding grid options to main- and contentframes, what results in warding the mainframe to resize.. when changing the font, the widgetsize also changes - and, in the last example, the scrolledtext-widget disappears behind the frame on its right side (containing other widgets)..
| 0 | 8,150 | 0 | 6 |
2012-03-23T03:09:00.000
|
python,text,fonts,resize,tkinter
|
How to stop Tkinter Text widget resize on font change?
| 0 | 2 | 3 | 56,558,354 | 1 |
0 | 0 |
I'm trying to create a simple word processor for starters to learn Python a bit better.
I'm using the Tkinter Text widget for the main editing program, the only problem is the height and width are defined by characters.
This creates a problem when I change fonts, for not all fonts are the same width.
Every time the font is changed, the Text widget re-sizes, although technically it is the same width and height. This looks ridiculous when trying to type up something, I'm trying to make the word processor as nice as possible.
Is there a way to define the width and height in pixels?
the .grid_propagate(False) is not useful for the size is technically not changing, only the character width.
I'm trying to stay away from wxPython for now, since everything I've done up to this point has been in Tkinter.
I have done endless hours of extensive googling but have found no solutions.
| false | 9,833,698 | 0 | 0 | 0 | 0 |
Use the pack geometry manager to pack the widgets.
I was creating a notepad and wanted the font sample area to display the font size.
So I created a label frame and added a label in it - i.e. AabYyZz - to display the font sample.
When I increased the font size the size of the label frame also increased, so I've tried the .pack_propagate method and it worked.
| 0 | 8,150 | 0 | 6 |
2012-03-23T03:09:00.000
|
python,text,fonts,resize,tkinter
|
How to stop Tkinter Text widget resize on font change?
| 0 | 2 | 3 | 62,726,391 | 1 |
0 | 0 |
Howdo,
I've just started getting into Python and QT. I have a very simplistic question. I wanted to create a Qt window to display the output and accept input from a program that I am attempting.
My question is, in Qt Designer I have made said window, but I'm not sure if I have to set the signals and slots in designer or in python. For the output I had used a QtextBroswer widget and a QPlainTextEdit for the input. Are those the correct choices for my uses.
Also do I need to muck about with setting slots and signals in Designer, or no?
Any and all help would be greatly appreciated.
| false | 9,858,228 | 0.379949 | 0 | 0 | 2 |
Set the signals and slots in Python. When you export the ui to Python using pyuic4 or pyside-uic, the signals and slots are set using python anyways.
| 0 | 277 | 0 | 2 |
2012-03-25T06:00:00.000
|
python,qt,pyqt
|
Qt and Python, where to configure signals and slots
| 0 | 1 | 1 | 9,858,246 | 1 |
0 | 0 |
I wrote a Python GUI script with Tkinter, and now I want to convert it to a standalone .exe.
I have already used py2exe on another pc with WinXP, but on my own pc, where I use Win7 32bit, I can't indtall it. I took the original installer from py2exe.org for 32bit, but when I start it, after half a minute or so it says "py2exe doesn't work anymore" and then the installer crashes.
What did I do wrong?
EDIT: I figured it out. I had to run the installer as Admin, not as normal user.
| true | 9,860,591 | 1.2 | 0 | 0 | 1 |
You can always try using Pyinstaller. It worked better than py2exe in my case to make a standalone .exe from Tkinter
| 1 | 426 | 0 | 1 |
2012-03-25T13:42:00.000
|
python,crash,installation,py2exe
|
py2exe Installer crashes
| 0 | 1 | 1 | 9,870,016 | 1 |
0 | 0 |
Salut, community!
Briefly.
I wrote usual model over QAbstractTableModel and using it in usual way for QTableView. But I think I need to use some columns of this model for the few QListViews in QWizard to fill main table in the right way (for user).
For example: use the column2 as the QListView's model on the page1 of the wizard; column3 for page2 for its QListView etc.
Please, help me to understand just two things:
Am I on the right way?
If yes then how can I make it simply and explicitly?
| true | 9,864,843 | 1.2 | 0 | 0 | 2 |
Set the QTableModel as the model for each QListView, and use QListView.setModelColumn to choose which column they each display.
| 0 | 371 | 0 | 2 |
2012-03-25T23:01:00.000
|
python,qt,model,pyqt,pyqt4
|
QAbstractTableModel as a model for one QTableView and few QListViews
| 0 | 1 | 1 | 9,864,880 | 1 |
0 | 0 |
Can someone give me some direction as to the proper control to use to update the items in a combobox if a certain item is selected in another combobox? Thanks.
| true | 9,872,984 | 1.2 | 0 | 0 | 2 |
If you need to update a list in a combobox, use it's SetItems(myNewList) method. I would keep a dictionary of the various lists you need and use that to populate the second combobox based on the selection in the first.
| 0 | 119 | 0 | 0 |
2012-03-26T13:25:00.000
|
combobox,wxpython
|
What is the proper control for updating a combobox
| 0 | 1 | 1 | 9,874,476 | 1 |
1 | 0 |
I am currently developing a Android Application. I couldn't install the Android Python APKs like the sl4a.apk and the PythonInterpreter.apk on my Android x86 emulator. I read that it is possible to recompile the APKs with NDK but I have not found a closer decription, yet. Has anybody experience with this and could provide a small tutorial?
Best Regards
| false | 9,892,351 | 0.197375 | 0 | 0 | 3 |
Try the official Android emulator. If the APKs include native libraries, chances are those are compiled for ARM only. Google's emulator emulates the ARM instruction set.
To make sure, rename the APK to ZIP and look inside. The structure of the lib folder, if any, will give you an idea.
| 0 | 1,441 | 0 | 0 |
2012-03-27T15:12:00.000
|
android,python,sl4a
|
SL4A Android x86 installation
| 0 | 1 | 3 | 9,892,477 | 1 |
0 | 0 |
Quick to learn is pretty important, but I need just some basic GUI tools, for Ubuntu OS but would be nice to have multi-OS compatibility. Any suggestions?
The basic dynamics of the intended game just include a text input and some set reaction
frames.
Thanks in advance.
| false | 9,894,979 | 0 | 0 | 0 | 0 |
For basic toolkit, I think tkinter which comes with python is okay. If you want to have graphical toolkit with more functionality, I would suggest you to take a look at wxpython which is cross-platform compatible.
| 0 | 1,725 | 0 | 1 |
2012-03-27T17:59:00.000
|
python,user-interface,text-based
|
Python GUI Toolkit for Text-Based Game?
| 0 | 1 | 3 | 9,895,140 | 1 |
0 | 0 |
Hi in my application I have several gui developped with QT4.7, in some of them I use QToolButton for interaction, everything work nicely, except that when I click over each of the QToolButton, the slot linked to his triggered signal is called twice,
I have no more Ideas about a olution to that, can you help me please, thanks in advance
| false | 9,905,587 | 0 | 0 | 0 | 0 |
Thank you, I solved, when clicked the QtoolButton send two different triggered signal, then my slot ran twice, it was enough to add decorator before the definition of the slot
@pyqtSignature("")
| 0 | 305 | 0 | 0 |
2012-03-28T10:26:00.000
|
python,qt4.7
|
trigger signal of QToolButton autorepeat the action
| 0 | 1 | 1 | 9,910,376 | 1 |
0 | 0 |
I have two images (JPGs). Both are the same width but image2 is shorter than image1. I want to paste image2 on top of image1 (top aligned) and for each row in image2 I want to blend into image1 with a different alpha transparency value (to make it smoothly blend from bottom to top ).
I'm using Python PIL and because I'm new to it can't figure out the best way to do this. Any suggestions?
| true | 9,917,327 | 1.2 | 0 | 0 | 2 |
Make a mask which is the same size as the image2, mode 'L'. Fill it with gray values from 0 to 255, representing the alpha transparency you want. Use paste to put image2 into image1, using the gray image as the mask parameter.
| 0 | 2,127 | 0 | 0 |
2012-03-28T23:54:00.000
|
python,image-processing,python-imaging-library
|
Blending two images with PIL: Different sizes and different alpha transparency per row
| 0 | 1 | 1 | 9,917,381 | 1 |
0 | 0 |
I am creating a copy of the game Pig. I have got a text based version of the game working. I am just updating it to pygame, adding graphics and sounds.
I will eventually add in mouse toggles, but for now I am trying to update a score.
I have display a 'player1 score', 'player2 score' out. I am trying to see how will it work to display text that is not constant.
i got
player1_text = font.render('player1 score', True,(0,0,0))
same for player2
I am assuming maybe that the first parameter -->'player1 score'
I can pass a variable and if I update the variable. When i call pygame.update() it should work as I think it should.
Just want some conformation or a tip on actually doing it.
| true | 9,917,464 | 1.2 | 0 | 0 | 0 |
You're on the right track!
Use a variable.
| 0 | 1,013 | 0 | 0 |
2012-03-29T00:10:00.000
|
python,text,pygame
|
Pygame: How would I go about setting a text object, BUT the text is meant to keep changing?
| 0 | 2 | 2 | 9,917,557 | 1 |
0 | 0 |
I am creating a copy of the game Pig. I have got a text based version of the game working. I am just updating it to pygame, adding graphics and sounds.
I will eventually add in mouse toggles, but for now I am trying to update a score.
I have display a 'player1 score', 'player2 score' out. I am trying to see how will it work to display text that is not constant.
i got
player1_text = font.render('player1 score', True,(0,0,0))
same for player2
I am assuming maybe that the first parameter -->'player1 score'
I can pass a variable and if I update the variable. When i call pygame.update() it should work as I think it should.
Just want some conformation or a tip on actually doing it.
| false | 9,917,464 | 0.197375 | 0 | 0 | 2 |
Pygame Font objects are not meant to be updated and changed constantly. You will need to call render(text) each time your text changes. Render() will return a new surface, so you will need to blit that to your screen to make the change.
| 0 | 1,013 | 0 | 0 |
2012-03-29T00:10:00.000
|
python,text,pygame
|
Pygame: How would I go about setting a text object, BUT the text is meant to keep changing?
| 0 | 2 | 2 | 10,002,172 | 1 |
0 | 0 |
This might seem as silly question but I am thinking there might be the simple solution for this problem. I have a python script which does some mathematical calculation which is command-line-based. I don't want to make any major modification to the code which I have right now. What should be my approach now to create a GUI ( I use wxpython) which uses that script as its model while leaving model to function as stand-alone python script as it is right now. I know it is the question of inheritance and polymorphism but I am not clear about the approach I should take. Any guidelines will be greatly appreciated.
| false | 9,928,711 | 0.099668 | 0 | 0 | 1 |
Let's say your command line executable is:
% compute -flag1 -flag2 datafile outputfile
In WxPython you could use check boxes to choose whether flag1 and/or flag2 are used, a file chooser widget for datafile, a text input field for outputfile and 'execute' button. When execute is clicked create a command line in a string and pass it to one of the methods in the subprocess module.
| 0 | 2,037 | 0 | 2 |
2012-03-29T15:36:00.000
|
python,wxpython
|
Converting existing command-line script to GUI in python
| 0 | 1 | 2 | 9,931,233 | 1 |
0 | 0 |
I've been toying with wxPython, but it seems mostly geared at 'standard' applications -- things with native looking file menu systems and toolbars and whatnot.
My needs are pretty simple. I just need to be able play some mp3s, show some images, and be able to package it down to an .exe and .dmg. Also, being able to play an small mp4 would be grand.
Unfortunately, I realize that there is no definitive answer to this question, and therefore doesn't exacltly fit the stack overflow format, but a nudge in the right direction would be greatly appreciated!
| true | 9,935,224 | 1.2 | 0 | 0 | 3 |
Pyqt/pyside/Qt has the newer declarative QML which seems to have a application geared to a kiosk type interface. You can basically design something in Photoshop and use it as your custom UI
| 0 | 835 | 0 | 3 |
2012-03-29T23:47:00.000
|
python,user-interface,wxpython
|
Is there a preferred framework for non-standard, non-native kiosk style GUI applications?
| 0 | 1 | 2 | 9,935,305 | 1 |
0 | 0 |
I wish to emulate or most media players' sliders - where clicking anywhere on the slider widget skips the video to that position. How can I get the slider's value under the mouse click and set the value to that?
By default, when clicked on the slider, it only scrolls by a Pagesize at a time, not scrolls to the position user clicked.
| false | 9,961,456 | 0 | 0 | 0 | 0 |
Create a new control by inheritance from the slider. The only change from the base slider control is that you override the method that handles mouse click events, Your method needs to do two things: call the routine that you use to 'skip the video to the mouse click' and call the base slider control mouse click handler so it can look after the visual feedback details.
| 0 | 1,615 | 0 | 3 |
2012-04-01T02:30:00.000
|
python,wxpython,wxwidgets
|
Get wxpython slider's value under mouse click
| 0 | 1 | 2 | 9,963,895 | 1 |
0 | 0 |
I need to have a pygame window check if the user right clicked (I can do) and then make a popup menu to display options using TKinter (?). Is this possible?
| false | 9,963,806 | 0 | 0 | 0 | 0 |
Import tkinter as you would usually do so, and create your popup. It would be best to stay within pygame though, using tkinter and pygame would end up being pretty complicated.
| 0 | 338 | 0 | 0 |
2012-04-01T10:51:00.000
|
python
|
Pygame using TKinter to make a popup menu?
| 0 | 1 | 1 | 9,965,553 | 1 |
0 | 0 |
What is the most efficient way in terms of speed to access the pixel data of a PIL image from a C extension? I only need read-only access to it, if that makes a difference.
| false | 9,996,105 | 0 | 1 | 0 | 0 |
C-level bindings for PIL are available, but there is very little documentation for them. You will need to consult the source for usage information.
| 0 | 456 | 0 | 4 |
2012-04-03T15:06:00.000
|
python,python-imaging-library,python-c-extension
|
Accessing PIL image data from C extension
| 0 | 1 | 2 | 9,996,422 | 1 |
0 | 0 |
I am writing my own GUI with .NET (C#) and I want to use a python script to click buttons for me automatically and read from text boxes etc. I've tried the Google searches but nothing really helpful. Is there a library that I need to download for .NET or is there a module in python that will do what i"m looking for. I'm sure it can be done, I just don't know where yo start
| true | 9,996,435 | 1.2 | 1 | 0 | 1 |
It sounds like you might be looking for a test automation tool, to script GUI events. I looked into using Ranorex for that a while back, and it looked very capable, but it was too expensive and overkill for my needs.
| 0 | 793 | 0 | 0 |
2012-04-03T15:23:00.000
|
c#,.net,python,user-interface
|
Python script to control GUI?
| 0 | 1 | 2 | 9,999,447 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.