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'd like my wxPython application to support cut/copy/paste operations between different running instances of the application. Is it OK to simply pickle a data structure, copy it to clipboard as text, and then unpickle it for paste operations?
I know I'd have to check the data for some sign that it's from my app. Or could I just TRY to unpickle whatever is there? How robust is pickle at nicely failing if it tries to unpickle arbitrary text left on the clipboard?
Also, is there a practical limit to how much data could be copied this way?
I'm running on Windows and Linux today - have not tried Mac.
EDIT
I'm aware of that comment in the documentation. I don't really care about a malicious user trying to compromise his own instance of the software, if that's what people are worried about they should deprecate pickle. My questions are of practicality, not security. | false | 6,877,326 | 0.099668 | 0 | 0 | 1 | If applicable I suggest you to convert your data to and from json using one of the many python implementations.
Being plain text is easy to transfer using clipboard moreover there are no risks converting back a json object back to python.
One last thing: no risks of deprecation. | 0 | 261 | 0 | 2 | 2011-07-29T18:18:00.000 | python,wxpython,clipboard,pickle | Is it OK to pass complex data structures through the clipboard with wxPython? | 0 | 2 | 2 | 6,878,268 | 1 |
0 | 0 | I noticed that the width argument for the Tkinter entry widget is in characters, not pixels.
Is it possible to adjust the width in pixels? | true | 6,881,010 | 1.2 | 0 | 0 | 6 | You cannot specify the width in pixels using the '-width' option, but there are ways to accomplish the same thing. For example, you could pack an entry in a frame that has no border, turn off geometry propagation on the frame, then set the width of the frame in pixels. | 0 | 25,061 | 0 | 11 | 2011-07-30T04:04:00.000 | python,tkinter,widget,width,tkinter-entry | How do I set the width of an Tkinter Entry widget in pixels? | 0 | 1 | 3 | 6,883,301 | 1 |
1 | 0 | I am trying to get a Python script which I normally run on my PC to run on my Android phone (HTC Hero). I have SL4A running on my phone and have made a few tweaks to the Python script so that this does now run. The problem that I am having is how to pass parameters to the script. I have tried creating a sh script in SL4A which called the python file with the parameters, but this didn't work. I have also tried using the app TaskBomb to call through to the python file, but again this doesn't work when parameters are supplied. When no params are supplied the file loads correctly, but when I add -h to the filename it says it can no longer find the python file I am calling.
Is anybody able to provide assistance with how to this? | true | 6,882,218 | 1.2 | 1 | 0 | 1 | I used a round about method to circumvent the problem. First the python script needs to be modified to look for a text file containing the attributes. Now whenever I need to start the script, i have to push the txt file containing the attributes and then start the script. | 0 | 2,086 | 0 | 2 | 2011-07-30T09:17:00.000 | android,python,sl4a | Passing parameters to a python script using SL4A on Android | 0 | 1 | 2 | 10,452,996 | 1 |
0 | 0 | A friend of mine is making the jump from graphic designer to game developer, and I have decided to work with him in my free time. Neither of us have much development experience, but I am very interested in learning Python, and my friend wants to learn C++.
I have read that C++ is the common denominator in game programming, but related questions here on SO recommend that new users avoid more difficult languages like C++. My #1 concern is creating games that are portable between operating systems. I will be using Linux to develop and play-test the game, but we would like it to run on OSX and Windows as well. We have no interest in 3D game development since we don't have any experience with 3D graphics. I would be perfectly happy with graphics equivalent to a game like VVVVVV - very simple 2D with minimal (or zero) texturing.
Also, is it necessary to use OpenGL for 2D graphics, or do C++/Python have some graphics libraries capable of producing game-worthy graphics? Remember, by game-worthy I mean simple, pixelated graphics like Minecraft or VVVVVV.
We have some books on Python, C++, and OpenGL, and can dive into those if that's the right way to get started. What does everyone recommend? | false | 6,886,553 | 0.033321 | 0 | 0 | 1 | I agree with newlymintedcocoaguy something such as Pygame is the way to go in your situation. But to awnser your second question, you can make 2D games in C++ without the use of OpenGL/DirectX. I have done this in the past using the Windows libraries for bitmaps, RECTS etc. I assume Linux will have similiar functionality. Though if you want your game to be cross platform then OpenGL is probably the way to go. | 0 | 6,008 | 0 | 3 | 2011-07-30T23:22:00.000 | c++,python,opengl | 2D Game Programming for Linux, OSX, and Windows - C++/Python/OpenGL? | 0 | 3 | 6 | 6,886,657 | 1 |
0 | 0 | A friend of mine is making the jump from graphic designer to game developer, and I have decided to work with him in my free time. Neither of us have much development experience, but I am very interested in learning Python, and my friend wants to learn C++.
I have read that C++ is the common denominator in game programming, but related questions here on SO recommend that new users avoid more difficult languages like C++. My #1 concern is creating games that are portable between operating systems. I will be using Linux to develop and play-test the game, but we would like it to run on OSX and Windows as well. We have no interest in 3D game development since we don't have any experience with 3D graphics. I would be perfectly happy with graphics equivalent to a game like VVVVVV - very simple 2D with minimal (or zero) texturing.
Also, is it necessary to use OpenGL for 2D graphics, or do C++/Python have some graphics libraries capable of producing game-worthy graphics? Remember, by game-worthy I mean simple, pixelated graphics like Minecraft or VVVVVV.
We have some books on Python, C++, and OpenGL, and can dive into those if that's the right way to get started. What does everyone recommend? | false | 6,886,553 | 0 | 0 | 0 | 0 | As someone whose familiar with the "I'm new, I want to do X, what should I learn?" thing, having done it quite recently, I'd say stick with Python for now. As others have mentioned, there are some decent libraries like PyGame out there, and C++ is well, a little complex.
If you're learning both how to put the parts together to make a game and tangling with the language, it starts getting difficult to untangle which one is actually causing your particular problem. And its always possible, once you have a good feel for what you are doing to learn a new way to do it by picking up C++. | 0 | 6,008 | 0 | 3 | 2011-07-30T23:22:00.000 | c++,python,opengl | 2D Game Programming for Linux, OSX, and Windows - C++/Python/OpenGL? | 0 | 3 | 6 | 6,887,227 | 1 |
0 | 0 | A friend of mine is making the jump from graphic designer to game developer, and I have decided to work with him in my free time. Neither of us have much development experience, but I am very interested in learning Python, and my friend wants to learn C++.
I have read that C++ is the common denominator in game programming, but related questions here on SO recommend that new users avoid more difficult languages like C++. My #1 concern is creating games that are portable between operating systems. I will be using Linux to develop and play-test the game, but we would like it to run on OSX and Windows as well. We have no interest in 3D game development since we don't have any experience with 3D graphics. I would be perfectly happy with graphics equivalent to a game like VVVVVV - very simple 2D with minimal (or zero) texturing.
Also, is it necessary to use OpenGL for 2D graphics, or do C++/Python have some graphics libraries capable of producing game-worthy graphics? Remember, by game-worthy I mean simple, pixelated graphics like Minecraft or VVVVVV.
We have some books on Python, C++, and OpenGL, and can dive into those if that's the right way to get started. What does everyone recommend? | false | 6,886,553 | 0.033321 | 0 | 0 | 1 | i will recommend c++. Many people say that its difficult, true to some extent, but you can make a good 2d game in c++, without getting into the 'difficult' part. And for this you will need a library like SDL , SFML etc.
Its worth your time, if you learn C++, at least you will never run in performance problem. | 0 | 6,008 | 0 | 3 | 2011-07-30T23:22:00.000 | c++,python,opengl | 2D Game Programming for Linux, OSX, and Windows - C++/Python/OpenGL? | 0 | 3 | 6 | 6,888,494 | 1 |
0 | 0 | I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness.
Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia.
So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays?
Which one is easier to use, has more/better documentation? Are both still in active development?
Licensing isn't of much concern to me since I don't intend to write commercial applications. | true | 6,888,750 | 1.2 | 0 | 0 | 34 | Both toolkits are actively maintained, and by now more or less equal in features and quality. There are only few, rather unimportant differences.
Still, I'd recommend PySide for Python 2. It has a more reasonable API, mainly it doesn't expose Qt types, which have a direct equivalent in Python (e.g. QString, QList, etc.) or which are completely superfluous due to Python's dynamic nature, like QVariant. This avoids many tedious conversions to and from Qt types, and thus eases programming and avoids many errors.
PyQt also supports this modern API, and uses it by default for Python 3, but not for Python 2 to maintain backwards compatibility. | 0 | 57,758 | 0 | 72 | 2011-07-31T09:58:00.000 | python,pyqt,pyside | PyQt or PySide - which one to use | 0 | 5 | 6 | 6,889,577 | 1 |
0 | 0 | I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness.
Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia.
So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays?
Which one is easier to use, has more/better documentation? Are both still in active development?
Licensing isn't of much concern to me since I don't intend to write commercial applications. | false | 6,888,750 | 1 | 0 | 0 | 18 | I recently ported a significant code base (over 8,000 lines of code) from PyQt to PySide.
Right now I'd say PyQt is a much more mature, performant and stable project. I hit a number of bugs in PySide, and suspect that any big project will hit issues. Having said that, I reported a bug to the project and it was fixed and in a new release within a few weeks. I'm also having a problem where the app takes about 15 seconds to quit. I've not yet spent the time to find out why. However it's only a matter of time before there will be no reasons for choosing PyQt over PySide.
If you do decide to go with PyQt for now, make sure you use API v2 throughout. It is a better API, and will ease any future transition to PySide. Also if you do port, just follow the guidelines on the PySide wiki. Even for an 8+ kloc app consisting of about 20 source files it just took an afternoon. | 0 | 57,758 | 0 | 72 | 2011-07-31T09:58:00.000 | python,pyqt,pyside | PyQt or PySide - which one to use | 0 | 5 | 6 | 7,159,812 | 1 |
0 | 0 | I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness.
Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia.
So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays?
Which one is easier to use, has more/better documentation? Are both still in active development?
Licensing isn't of much concern to me since I don't intend to write commercial applications. | false | 6,888,750 | 1 | 0 | 0 | 25 | There is also the licensing difference. PySide is LGPL while PyQt is GPL. This could make a difference if you don't wish to make your project opensource. Although PyQt always has the propriety version available for a fairly reasonable price.
I tend to find the PySide documentation more intuitive. The API, in my opinion is slightly more Pythonic and the rate of bug fixes is quite impressive at the moment.
PyQt has the advantage of Python 3 support and incumbency. There is a lot more 3rd party documentation/tutorials for it. | 0 | 57,758 | 0 | 72 | 2011-07-31T09:58:00.000 | python,pyqt,pyside | PyQt or PySide - which one to use | 0 | 5 | 6 | 6,906,509 | 1 |
0 | 0 | I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness.
Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia.
So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays?
Which one is easier to use, has more/better documentation? Are both still in active development?
Licensing isn't of much concern to me since I don't intend to write commercial applications. | false | 6,888,750 | 0.16514 | 0 | 0 | 5 | I have a 20k line Python app that I unsuccessfully tried to convert to PySide.
Conversion is easy and most of the functionality works.
There are several methods that are not implemented because they are 'deprecated', so I had to fix those. That was OK.
On Windows, using PySide-1.1.2, the '==' operator is not implemented for many Qt objects. One workaround is to say: "if id(item1) == id(item2):".
The other observation is that PySide seemed noticeably slower. I did not isolate PySide as the cause of the slowness, but the problem went away when I reverted back to PyQt.
Lastly, as of now, the Android kit with PySide does not seem ready for prime time. | 0 | 57,758 | 0 | 72 | 2011-07-31T09:58:00.000 | python,pyqt,pyside | PyQt or PySide - which one to use | 0 | 5 | 6 | 17,322,123 | 1 |
0 | 0 | I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness.
Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia.
So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays?
Which one is easier to use, has more/better documentation? Are both still in active development?
Licensing isn't of much concern to me since I don't intend to write commercial applications. | false | 6,888,750 | 1 | 0 | 0 | 10 | Although they might have similar interface for Qt/C++ classes, their interface for Qt/C++ macros such as signal/slot/property are very different.
Porting one to another is not an easy job. It would be better to make the right decision at the very beginning.
Beyond the grammar/license differences, I just want to point out some deficiency of PyQt in language binding, which might be essential to write QML project in Python.
These differences finfally push me to PySide from PyQt.
qmlRegisterType
qmlRegisterType is essential to create runtime C++ binding with QML.
In PySide, it is part of PySide.QtDeclarative. And this works pretty well with Python.
In PyQt, qmlRegisterType does not exist. And I could not find an alternative approach.
I know some simple task could be done by setting QML context.
But if you really need runtime binding with qmlRegister and Q_INVOKABLE, I think PySide is the only choice at the moment.
Shiboken VS SIP
Both can wrap Qt/C++ into python plugin.
For Shiboken, I feel it is simpler and requires less coding.
Just create a typesystem xml including the NAME of classes you want to export, and that's all.
Shiboken does not require extra manual descriptions for the structure of the target classes.
For SIP, it would require more extra coding. We will have to create a SIP file that almost reimplements everything the C++ header.
It requires not only the NAME of the class, but also the DETAILS of what methods the target classes have.
If the C++ class is in good design using Pimp and we want to export all methods within it, SIP should provide a way of automatically export all class methods, which it cannot at the moment.
This would also add the burden for maintaining the consistency between the SIP and the C++ headers.
But I have to say that the documentation for Shiboken on Qt wiki is very bad and misleading.
Creating Python plugin with Shiboken on Windows do not necessarily require CMake at all.
generatorrunner is also not required.
I only use a windows cmd script to invoke shiboken, and a qmake pro for compiling the target plugin. | 0 | 57,758 | 0 | 72 | 2011-07-31T09:58:00.000 | python,pyqt,pyside | PyQt or PySide - which one to use | 0 | 5 | 6 | 12,804,098 | 1 |
1 | 0 | I'm looking for solutions that make it possible to create AJAX-enabled web applications without need to write JavaScript code manually. The requirements are:
Performance doesn't matter. It can be slow, JavaScript may be unoptimized, amount of code it generates may be large.
Platform doesn't matter as long as I can work with it on either Linux or Windows.
Language doesn't matter as long as it's Python, Java or C#.
I want to be able to create composite 'widgets' that can be updated dynamically using AJAX. For instance, I want to be able to load data dynamically and replace existing controls with the other ones when user clicks the button on that page.
As long as this solution provides concepts like 'Panel' (composite widget), 'EditBox' and 'Label', I don't care if it's hard to create my own controls.
What do you think? | false | 6,888,856 | 0.099668 | 1 | 0 | 2 | I'd recommend you GWT from Google. It is great, well done framework that allows creating Web 2.0 applications without dealing with HTML/JavaScript at all. | 0 | 217 | 0 | 0 | 2011-07-31T10:20:00.000 | c#,java,javascript,python | AJAX web applications with no hand-written JavaScript | 0 | 1 | 4 | 6,888,882 | 1 |
0 | 0 | in my Text widget I have here and there many tags, taking care of the text appearance (bold, italic etc).
Tkinter takes care by default of cut/copy/paste in the text widget, but only of the text content, not of the associated tags. Do you know if it is possible to implement it?
I anticipate some problems if I would cut in the middle a region where e.g. bold text appears: I would have to leave behind a tag marker for 'bold begin' so that the remaining text is still bold... | false | 6,895,545 | 0.379949 | 0 | 0 | 2 | Yes, it's possible to implement it. You can use the dump method of the text widget to get all the text and tags in a given range. To paste, you just have to use that information when inserting the text.
It gets somewhat complicated when you try to paste, say, italic text inside a range of already bolded text since you may have to retag the inserted text to have both bold and italic attributes. However, I know it can be done because I've done it with tcl/tk in the past. | 0 | 598 | 0 | 0 | 2011-08-01T07:49:00.000 | python,tkinter | python/tkinter: is it possible to copy paste text AND tags? | 0 | 1 | 1 | 6,897,584 | 1 |
0 | 0 | I have a C++ process running in the background that will be generating 'events' infrequently that a Python process running on the same box will need to pick up.
The code on the C side needs to be as lightweight as possible.
The Python side is read-only.
The implementation must be cross-platform.
The data being sent is very simple.
What are my options?
Thanks | false | 6,915,191 | 0.028564 | 1 | 0 | 1 | How complex is your data? If it is simple I would serialize it as a string. If it was moderately complex I would use JSON. TCP is a good cross-platform IPC transport. Since you say that this IPC is rare the performance isn't very important, and TCP+JSON will be fine. | 0 | 40,430 | 0 | 43 | 2011-08-02T16:17:00.000 | c++,python,cross-platform,ipc | Simple IPC between C++ and Python (cross platform) | 0 | 2 | 7 | 6,915,320 | 1 |
0 | 0 | I have a C++ process running in the background that will be generating 'events' infrequently that a Python process running on the same box will need to pick up.
The code on the C side needs to be as lightweight as possible.
The Python side is read-only.
The implementation must be cross-platform.
The data being sent is very simple.
What are my options?
Thanks | false | 6,915,191 | -0.085505 | 1 | 0 | -3 | I will say you create a DLL that will manage the communication between the two. The python will load DLL and call method like getData() and the DLL will in turn communicate with process and get the data.
That should not be hard.
Also you can use XML file or SQLite database or any database to query data. The daemon will update DB and Python will keep querying. There might be a filed for indicating if the data in DB is already updated by daemon and then Python will query.
Of course it depends on performance and accuracy factors! | 0 | 40,430 | 0 | 43 | 2011-08-02T16:17:00.000 | c++,python,cross-platform,ipc | Simple IPC between C++ and Python (cross platform) | 0 | 2 | 7 | 6,915,884 | 1 |
0 | 0 | I hope my title was clear. I'm using wxpython for making a GUI and I want it to be able to be opened, extracted, and have it work on all operating systems. I was able to include twill by finding a folder called twill inside the twill archive, which worked fine. However, I'm unable to figure out how to correctly package wxpython.
EDIT: I'm not using either. py2exe is only for windows, and bbfreeze doesn't seem to work on mac (so it's not cross platform) | false | 6,917,456 | 0.132549 | 0 | 0 | 2 | Unfortunately, there's just no one stop solution so that a single installable executable will work across all operating systems. The right solution is really to provide a different installer or executable for each OS; For windows, use py2exe, for mac, py2app is a good choice, and for linux you should just provide a tarball with a reasonable setup.py (that you will need for the first two, anyway). | 1 | 697 | 0 | 2 | 2011-08-02T19:25:00.000 | python,wxpython,packaging | How can I package my python application with external python libraries? | 0 | 1 | 3 | 6,921,159 | 1 |
0 | 0 | I've just bought a new computer with Lion on it. I've downloaded and installed both Python 2.7 and wxPython 2.8 (for 2.7). I know Python comes with the system, but I rather go with the official one.
Anyway, upon typing "import wx" on the IDLE, I get the following message:
Traceback (most recent call last):
File "", line 1, in
import wx
File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/init.py", line 45, in
from wx._core import *
File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in
import core
ImportError: dlopen(/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/core.so, 2): no suitable image found. Did find:
/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/core.so: no matching architecture in universal wrapper
I believe it happens because wxPython only supports 32-bit, but I can't figure out how to force python to run on 32-bit.
Anyone could help?
Thank you in advance. | false | 6,946,503 | 0.049958 | 0 | 0 | 1 | This may not work for python versions below 2.9. Running 'python' did not work for me...I am using 2.7 for compatibility. But figured out that 'python' may be an alias for a 64 bit mode and for some reason the arch command does not work.
So, here is what I have to use under Lion to get wx to work (this works for 2.6 or 2.7):
$ arch -i386 python2.7
Then when python loads:
import wx
works fine. You may have to call the specific python with the arch command, such as python2.7, or whatever version you are using. | 0 | 5,631 | 1 | 8 | 2011-08-04T18:16:00.000 | python,wxpython,osx-lion | Run wxPython on Lion | 0 | 1 | 4 | 8,763,927 | 1 |
0 | 0 | I have written a GTK app in Python (using PyGObject). I'm confused about how to handle deployment, specifically icons.
I understand that in most cases, I would be able to load my images from a specific path; however, the recommended way seems to be to register icons as named icons with the system, so they can be themed. In some cases, like Ubuntu's app indicators, it seems like using named icons is the only thing that is supported.
I have all this working; expect I'd like my app to work when just run from the source directory, without installing it system-wide. Surely this is possible somehow? | false | 6,973,774 | 0 | 0 | 0 | 0 | I know this isn't 100% what you're looking for but Gnome will also recognize icons installed at ~/.local/share/icons/. When the program is run from the source directory, the icons could be copied there. | 0 | 254 | 0 | 2 | 2011-08-07T15:42:00.000 | python,gtk,icons | GTK Named Icons: Load while running from source, during development | 0 | 1 | 2 | 6,974,550 | 1 |
0 | 0 | In my Group class, there must be an attribute particles which should be an array-like but resizable type that can only hold Particle-instances.
Both classes, Group and Particle are declared using cdef.
As Python-lists can carry any Python-object, I thought there might be a more performant way of declaring some kind of C-list that does only accept Particle-instances.
In C it would be something like List<Particle> particle = new List<Particle>(); i think.
Is there any equivalent for Cython or should I just stay with the Python-list ? | true | 6,997,102 | 1.2 | 0 | 0 | 1 | The question begs to be asked : why do you want this ?
is it for efficiency (looping over the array) or to lower memory footprint ?
do you need an array or a linked list would be enough ?
is your particle class a simple struct or something with behavior/method ?
Depending on these, the best solution goes from using a python array to numpy or a stl container.
( Note, for example, that looping over python list in cython could be quite efficient. ) | 1 | 4,416 | 0 | 3 | 2011-08-09T13:43:00.000 | python,list,cython | Cython, is there a way to create lists of only one type ? (Unlike Python-lists) | 0 | 1 | 4 | 7,010,304 | 1 |
0 | 0 | I'm using a module named spynner with python. spynner runs on a QApplication instance. I need to run functions using spynner asynchronously.
I have tried calling these functions in different threads, using something like:
thread.start_new_thread(function_using_spynner)
This works if I run just one function, but if I try to run 2 of them I get an error saying that QApplication can not be created outside of main thread. Is there a way to run functions asynchronously in the same thread? The functions return nothing, so just running them will be enough.
If not, is there a workaround for creating QApplication instances outside of main thread? I don't need a display. | false | 7,004,709 | 0 | 0 | 0 | 0 | You could run function_using_spynner in the main thread and do whatever else you need to do in the other thread. Alternatively, you could start the QApplication in spynner in the main thread before branching into multiple threads. | 1 | 1,045 | 0 | 0 | 2011-08-10T00:42:00.000 | python,qt,asynchronous,spynner | QApplication in threads | 0 | 1 | 1 | 7,005,338 | 1 |
0 | 0 | I'm unit-testing a python c module in Eclipse using PyDev unit-testing.
The development steps are:
I first write the python tests in Eclipse and then the c code that passes
the tests for the module in Codeblocks. Here is where a script is called
to create a dll and ctypes bindings for it. After that the “dll” and the
“py” code is copied to a directory where the module can be easily imported.
But sometimes I get the error:
IOError: [Errno 13] Permission denied: 'C:\...\pyCModule.dll'
I’ve haven’t found the reason for that (deactivating code analysis and code
completion haven’t helped). I’ve checked with the Process Explorer (from
sysinternals) and it shows that the eclipse process has python.exe as child
(I suppose that’s from PyDev) and that one is using my pyCModule.dll (and
not always releasing it).
Does someone have and idea of want could be done here? or what is wrong?
Thanks in advance !
Francis | false | 7,007,635 | 0.379949 | 1 | 0 | 2 | This happens because PyDev launches a shell that imports that dll (to do code-completion). You can do Ctrl+2 kill (with focus in a PyDev editor), to kill all the shells that PyDev may have spawned (that way you can update it).
Cheers,
Fabio | 0 | 260 | 0 | 1 | 2011-08-10T08:05:00.000 | python,unit-testing,dll,pydev | Dll from python module is not released in Eclipse / PyDev | 0 | 1 | 1 | 7,011,545 | 1 |
0 | 0 | In wxPython I'm trying to update an existing UI to use wxPropertyGrid instead of an array of individual UI elements. Currently the underlying object model is updated and validation is applied after each key press and I want to do the same with the PropertyGrid.
The problem I'm having is that there doesn't seem to exist a wxPropertyGridEvent which triggers on every key stroke like wx.EVT_TEXT, the closest is EVT_PG_CHANGED but that only triggers when you change between rows in the grid. I can get round this to an extent by binding wx.EVT_TEXT to the PropertyGrid but then I'm unable to use event.GetProperty() in order to access the property data as the event is not a PropertyGridEvent.
So the question is have I missed something and is there an existing event which I can use? Failing that any ideas on how I get around this problem? | true | 7,011,416 | 1.2 | 0 | 0 | 0 | Turns out you can capture EVT_CHAR events by binding directly to the text ctrl. As the text ctrl is only created when the property is selected however you can't do this when setting up the grid, rather you have to bind it following a EVT_PG_SELECTED event. | 0 | 377 | 0 | 0 | 2011-08-10T13:19:00.000 | python,wxpython,wxwidgets | How to capture events for each key press in wxPropertyGrid | 0 | 1 | 1 | 7,038,368 | 1 |
0 | 0 | I'm implementing a profiler in an application and I'm a little flummoxed about how to implement Python profiling such that the results can be displayed in my existing tool. The application allows for Python scripting via communication with the python interpreter.
I was wondering if anyone has ideas on how to profile Python functions from C++
Thank you for your suggestions :) | false | 7,033,612 | 0 | 1 | 0 | 0 | The usual technique for profiling already-existing functions that we use in Lua a lot is to overwrite the function with your own version that will start timing, call the original function, and stop timing, returning the value that the original function returned. | 0 | 447 | 0 | 2 | 2011-08-11T22:19:00.000 | c++,python,profiling | How can I "hook into" Python from C++ when it executes a function? My goal is to profile | 0 | 1 | 2 | 7,033,696 | 1 |
0 | 0 | I need an event for detecting if an user has moved the scrollbar position to another one.
In other words, if the user does scroll up/down, would it be possible to catch a signal so I can know the scroll has been changed its position?
I think it's not important, but the scrollbar I refer to is inside a QGraphicsView.
Regards.
Edit:
QGraphicsView is for displaying items in the screen, and if those items are too big it shows the scrollbars I refer to. What I need is to know when the user changes the position of those scrollbars. | true | 7,060,534 | 1.2 | 0 | 0 | 7 | Sliders have a sliderMoved(int value) signal, where value is the new position of slider. | 0 | 4,663 | 0 | 10 | 2011-08-14T23:47:00.000 | c++,python,qt,events,pyqt | A scrollbar event when scrolling? | 0 | 1 | 2 | 7,060,600 | 1 |
0 | 0 | I'm trying to write a python program with wxPython GUI. Program must to collect some information in background (infinite loop), but GUI should be active at this time. Like, if I click on the some button, some variable or another information must change, and at the new cycle this variable should be used instead of the old.
But I don't know, how to make it. I think that I must use threading, but I don't understand how to use it.
Anyone can suggest how to solve this problem?
Thanks in advance! | false | 7,082,529 | 0 | 0 | 0 | 0 | Have you considered having wxPython invoke an event handler of yours periodically, and perform the background processing in this? This depends on you being able to divide your work into discrete pieces, of course. Be aware that your background processing would have to be non-blocking so control would return to wxPython in a timely manner, to allow responsive GUI processing. Not sure what's the idiomatic way to implement such background processing in wxPython, but if I recall correctly the technique in (Py)Qt was to use a timer. | 1 | 4,727 | 0 | 3 | 2011-08-16T17:42:00.000 | python,loops,wxpython,infinite | Python: Infinite loop and GUI | 0 | 1 | 3 | 7,083,015 | 1 |
0 | 0 | Okay, I'm completely new to this.
I created a python script that imports tkinter. On my Ubuntu, I can execute the program from the terminal program. Till now there is no problem. However, my friends asked if I could deliver the program to them so that they could use it on their PC. They have 0 knowledge of programming and they use Windows -.-. So my question is, how I can create an executable file from Ubuntu so that it can run under Windows? I've already read something about py2exe, but I could not manage installing it. If | true | 7,087,529 | 1.2 | 0 | 0 | 3 | You can't use py2exe on plain Ubuntu. It needs to run from Windows. Right now, py2exe doesn't work well with Wine. Do you not have access to any Windows computers (maybe one of your friends')?
You can also get your friends to install Python on their Windows machines and teach them how to run your programs, if you're willing to put in the extra effort. | 0 | 245 | 1 | 0 | 2011-08-17T03:06:00.000 | python,executable | python executable file in windows | 0 | 1 | 1 | 7,087,550 | 1 |
0 | 0 | I want to use VTK together with Python on a Windows system.
It seems that I cannot use the windows installer but "have to compile VTK from source code using CMake and a native build system". So far I have installed CMake.
But now I wonder how to proceed? It seems that I need MS Visual Studio to create the project files?!
But I don't have Visual Studio. So what can I do? | false | 7,089,620 | 0.049958 | 0 | 0 | 1 | You can use VTK with python just installing pythonxy framework, it is just a python with many many libraries included VTK, ITK, Qt and many other, also it is very well documented, and also have many examples, all in python. I recommend it to you, I have worked a lot with it, and is very amazing.
Just make a try. All you have to do is in the installer wizard select among the tools, VTK, and it will be installed with vtk. | 1 | 1,416 | 0 | 6 | 2011-08-17T08:09:00.000 | python,compilation,cmake,vtk | VTK / Python / compile | 0 | 1 | 4 | 28,362,827 | 1 |
0 | 0 | I am working with a pressure-sensing mattress having a USB interface. The maker provides USB device drivers for Windows, and an API written in C++ which has functions to request data and set some parameters.
Currently, I cannot use this sensor for testing some Python data-visualization scripts directly, having had to ask my coworkers to write a text-logger for me, and then I read this information offline with Python.
Also, I cannot use Linux at all with the sensor, because there are not drivers for Linux, and I do not know where to start to "hack" the sensor, and that is why I am asking:
"If I were to try to read data from this sensor directly with Python and perhaps in Linux, what should I do first, or read first?"
EDIT: the device has an FTDI driver (FTD2XX.dll) if it helps.
Any help would be very welcome | false | 7,112,063 | 0.099668 | 1 | 0 | 1 | The FTDI chips have a linux driver. Just go to the FTDI website and download it. The driver creates a virtual serial port. You can use PySerial to interface with it.
Too bad I didn't see the post sooner! | 0 | 1,493 | 0 | 2 | 2011-08-18T18:12:00.000 | c++,python,usb,sensors,hardware-interface | Access USB hardware (pressure sensor matrix with native C++ API) using Python | 0 | 1 | 2 | 16,451,772 | 1 |
0 | 0 | This is about wxPython.
I would like to have 2 Panels laying one over the other:
PanelBG should be some sort of a "background", with its own GridBagSizer with subPanels, StaticTexts and so on;
PanelFG should be the "foreground" panel, also with its own GridBagSizer with some StaticTexts, Buttons... but a transparent background, in such a way that PanelBG is visible wherever PanelFG doesn't lay widgets.
I need both Panels to stretch to all the sides of the frame, even when resizing the window, though never changing the reciprocal proportions, that's why I'm not sure if there's a way to use absolute positioning.
In case you are wondering, the reason why I don't want to use a single Panel is that merging the 2 GridBoxSizers would require me to place many many more cells in the sizer, because rows and columns of foreground and background don't always coincide, and I should split them in many cells, with grid dimensions growing up to hundreds**2.
Since the content I want to put in the foreground needs to be updated and refreshed quite often, this would require redrawing all the cells every time, which would take 10 - 20 seconds to complete the operation (tested). Updating only the foreground would require just some hundredths of a second instead.
Thank you! | false | 7,113,605 | 0 | 0 | 0 | 0 | As I understand it, this is a calendar with rectangles for the days containing the events for the days.
The simple thing would be to use a wxGrid, with seven columns and four or five rows, to represent the months. You would then place the events into the grid cell for the correct date. The wxGrid widget would look after the details of refreshing everything properly.
Using wxGrid you might lose a little control over the exact appearance, though wxGrid is very flexible and feature rich once you learn its many methods, but you would save yourself having to write large amounts of code that would require significant effort to debug. | 0 | 1,387 | 0 | 2 | 2011-08-18T20:17:00.000 | python,wxpython,wxwidgets,panel,sizer | wxPython: how to lay one panel over another | 0 | 2 | 2 | 7,122,837 | 1 |
0 | 0 | This is about wxPython.
I would like to have 2 Panels laying one over the other:
PanelBG should be some sort of a "background", with its own GridBagSizer with subPanels, StaticTexts and so on;
PanelFG should be the "foreground" panel, also with its own GridBagSizer with some StaticTexts, Buttons... but a transparent background, in such a way that PanelBG is visible wherever PanelFG doesn't lay widgets.
I need both Panels to stretch to all the sides of the frame, even when resizing the window, though never changing the reciprocal proportions, that's why I'm not sure if there's a way to use absolute positioning.
In case you are wondering, the reason why I don't want to use a single Panel is that merging the 2 GridBoxSizers would require me to place many many more cells in the sizer, because rows and columns of foreground and background don't always coincide, and I should split them in many cells, with grid dimensions growing up to hundreds**2.
Since the content I want to put in the foreground needs to be updated and refreshed quite often, this would require redrawing all the cells every time, which would take 10 - 20 seconds to complete the operation (tested). Updating only the foreground would require just some hundredths of a second instead.
Thank you! | true | 7,113,605 | 1.2 | 0 | 0 | 1 | This would be at least partially a change of direction, but it might be worth examining what other rendering options you have.
In particular, I'm thinking of wxWebKit (http://wxwebkit.kosoftworks.com/), which would let you do layering, etc. using the WebKit browser rendering engine. I'm not sure whether it's at a stage that would provide everything you need since I haven't actually used it, but even if it doesn't work then it may be an approach worth trying - using HTML/CSS for part of your display, while wrapping the whole in a wxPython app. | 0 | 1,387 | 0 | 2 | 2011-08-18T20:17:00.000 | python,wxpython,wxwidgets,panel,sizer | wxPython: how to lay one panel over another | 0 | 2 | 2 | 7,123,083 | 1 |
0 | 0 | There is no tray in Unity under Ubuntu 11.04.
How can I make icon appear somewhere in Unity? wx.TaskBarIcon is not appear anywhere.
Thanks | false | 7,144,756 | 1 | 0 | 0 | 6 | With Ubuntu Unity desktop environment (i.e. Ubuntu 11.04 or 11.10), you need to "whitelist" your application.
There are different ways to do this using the 'gsettings' application from the command line.
I had to do this to get programs like Skype showing in the system tray again, not just for my own custom apps that use wxPython. | 0 | 1,293 | 1 | 3 | 2011-08-22T08:24:00.000 | python,ubuntu,wxpython,wxwidgets,ubuntu-unity | wx.TaskBarIcon on Ubuntu 11.04 | 0 | 1 | 3 | 8,073,276 | 1 |
0 | 0 | I am developing a python program (my native platform is Ubuntu) for which I would like to build a simple gui. I would like the GUI to be cross platform.I came across python-gtk/wxpython/qt. What is the best tool to use?
Thanks
suresh | true | 7,167,985 | 1.2 | 0 | 0 | 1 | I'm going to suggest tkinter. It's part of python, ridiculously easy to use, and of course is very cross platform.
Many people dismiss tkinter based on years-old knowledge, but tkinter has evolved a lot. Some say it looks ugly, but more often than not functionality and ease of use is more important. Tkinter is definitely the best pragmatic choice in my opinion.
That being said, however, there is no "best". Qt, Wx and Tk are all fine, all do pretty much the same, and are all more-or-less equally cross-platform. Pick any one of them and don't look back. Once you get experience with one of tnem you'll be in a position to decide for yourself which one is "best" | 0 | 549 | 0 | 1 | 2011-08-23T21:47:00.000 | python,user-interface,cross-platform | cross platform gui..which tool to use? | 0 | 3 | 3 | 7,168,535 | 1 |
0 | 0 | I am developing a python program (my native platform is Ubuntu) for which I would like to build a simple gui. I would like the GUI to be cross platform.I came across python-gtk/wxpython/qt. What is the best tool to use?
Thanks
suresh | false | 7,167,985 | 0 | 0 | 0 | 0 | As Matt already suggested, wxPython should be the most portable choice. On Windows it uses the native GUI toolkit, on Linux it will use Qt as backend (I dunno what it does on OSX though, but you can probably find out all of that on their website). | 0 | 549 | 0 | 1 | 2011-08-23T21:47:00.000 | python,user-interface,cross-platform | cross platform gui..which tool to use? | 0 | 3 | 3 | 7,168,033 | 1 |
0 | 0 | I am developing a python program (my native platform is Ubuntu) for which I would like to build a simple gui. I would like the GUI to be cross platform.I came across python-gtk/wxpython/qt. What is the best tool to use?
Thanks
suresh | false | 7,167,985 | 0.26052 | 0 | 0 | 4 | Your best bet would be either wxPython or Qt, although I'd lean strongly towards wxPython based on my previous use. Both of these have fairly good fidelity on both Windows and OSX and feel and look like native applications.
GTK has marginal Windows support and pretty bad support on OSX. I would recommend against it. | 0 | 549 | 0 | 1 | 2011-08-23T21:47:00.000 | python,user-interface,cross-platform | cross platform gui..which tool to use? | 0 | 3 | 3 | 7,168,005 | 1 |
0 | 0 | I am trying to display real-time text in Tkinter after a Button command calls a function. The function should display a "timestamp" when PycURL receives "HTTP/1.1 200 OK". The function POSTs energy data to a server every 2 minutes.
Pseudocode, a basic example, and/or general discussion should get me headed in the right direction. I have got the energy data POSTing OK. Now I need to get the GUI working.
Thanks - Brad | false | 7,182,084 | 0 | 0 | 0 | 0 | How are you trying to display real-time text in Tkinter after a button calls a function? What I get so far is, user presses button, function starts and every two minutes posts some data to a server, and tries to display some text somewhere after each post, but has a problem?
How does it try to display the text, and what's the problem?
(I dont know PycURL, so apologies if that would make everything clear) | 0 | 2,891 | 0 | 0 | 2011-08-24T20:49:00.000 | python,text,tkinter,real-time | Displaying real-time text in Tkinter after Button command calls function? | 0 | 1 | 2 | 7,182,219 | 1 |
0 | 0 | I can do the measure of text with tkFont, but I don't want a root window --> tk.Tk() | true | 7,193,798 | 1.2 | 0 | 0 | 3 | You did mean to ask: “How can I measure the width of a string rendering via tkFont without creating a window first?”
An the answer is: you can’t. Tk needs it’s root instance to do drawing and such.
you can however create it, measure your text, and immediately dispose it via .delete(). This is so fast that the window doesn’t appear for me. | 0 | 1,989 | 0 | 4 | 2011-08-25T16:17:00.000 | python,fonts,tkinter | How can I measure the width of a string rendering via tkFont without creating a window first? | 0 | 1 | 2 | 7,195,241 | 1 |
0 | 0 | I want a Excel like table widget in tkinter for a gui I am writing. Do you have any suggestions? | false | 7,208,961 | 0 | 0 | 0 | 0 | I had a similar problem trying to show a complete panda's DataFrame using tkinter.
My first option was to create a grid like suggested someone in the first answer, but it bacame too heavy for so many info.
I guess is beter to create a finite numbers of cells and show only a part of the DF, changing that part with the movement of the user | 0 | 36,436 | 0 | 11 | 2011-08-26T18:19:00.000 | python,tkinter,widget,tktable | Which widget do you use for a Excel like table in tkinter? | 0 | 1 | 3 | 69,322,875 | 1 |
0 | 0 | I'm running Python 2.7 on OS X Snow Leopard. I installed Python using Macports. Then, I installed py27-pyqt4 and py27-pyside, and I can't get them to work.
Python doesn't give errors when I import, but I get the following errors in the terminal when I test either:
pyside-uic : command not found
pyuic4 : command not found | false | 7,211,672 | 0.197375 | 0 | 0 | 1 | You are still using the default Mac OS Python and not using the new installed one.
Check the python version: python must be 2.7.
find the new
version (should be inside /usr/local/bin )
update your
.bash_profile PATH=/usr/local/bin/:$PATH
Try again and try to
import PyQt4 | 0 | 2,652 | 0 | 1 | 2011-08-27T00:09:00.000 | python,macos,pyqt4,pyside | pyside-uic/pyuic4: command not found | 0 | 1 | 1 | 7,352,201 | 1 |
0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point from a vector, hopefully leading to clearer type separation and an easier to understand API.
However, with Python's duck typing and the common practice of expecting a certain interface regardless of type, is it better just to use a Vec3? Is it more efficient? | false | 7,247,648 | 0.148885 | 0 | 0 | 3 | I don't think this is particularly unpythonic. It's not too unusual to distinguish types when they have the same domain, but when one has a particular frame of reference, such as a time zone, Since a point is the sum of a vector and the origin, it's reasonable to encode that in some way. | 1 | 751 | 0 | 0 | 2011-08-30T17:58:00.000 | python,math | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0 | 4 | 4 | 7,247,764 | 1 |
0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point from a vector, hopefully leading to clearer type separation and an easier to understand API.
However, with Python's duck typing and the common practice of expecting a certain interface regardless of type, is it better just to use a Vec3? Is it more efficient? | true | 7,247,648 | 1.2 | 0 | 0 | 3 | It seems superfluous. If you think about it, a point in cartesian space is entirely equivalent to a bound vector which begins at the origin. Sounds like you could be making a lot of work for yourself for nothing. | 1 | 751 | 0 | 0 | 2011-08-30T17:58:00.000 | python,math | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0 | 4 | 4 | 7,247,805 | 1 |
0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point from a vector, hopefully leading to clearer type separation and an easier to understand API.
However, with Python's duck typing and the common practice of expecting a certain interface regardless of type, is it better just to use a Vec3? Is it more efficient? | false | 7,247,648 | 0.049958 | 0 | 0 | 1 | I understand your argument. I, too, have always struggled with classes for points. In my experience it's better (although I guess perhaps not "more pythonic") to take a more functional approach and write your API in terms of functions that takes lists/tuples.
The main objection to this, I think, is that you probably want a compact way of writing simple algebraic operations (sums etc.), but for that I would suggest using numpy. Not only does numpy support element-wise addition, but it gives you efficiency where you are likely to need it in the future, with matrix operations and the like.
At the same time, while you say that you want a clean API, the differences you are adding to the API will be invisible, except in the documentation. And really, an invisible API is not that useful.
I know this is nothing like what you were originally asking, but I suspect it is the best design in the long term (i.e. as your library grows and you want to support more ambitious transformations of points, batch processing, etc., etc.). | 1 | 751 | 0 | 0 | 2011-08-30T17:58:00.000 | python,math | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0 | 4 | 4 | 7,248,651 | 1 |
0 | 0 | I'm writing some 3D math classes for Python. I'd like to make a Point3 class that is separate from Vec3 in the following respects:
Point3 - Point3 = Vec3
Point3 + Vec3 = Point3
Otherwise, all operations on Vec3 you can perform on Point3. The motivation for this is to separate the mathematical concept of a point from a vector, hopefully leading to clearer type separation and an easier to understand API.
However, with Python's duck typing and the common practice of expecting a certain interface regardless of type, is it better just to use a Vec3? Is it more efficient? | false | 7,247,648 | 0.049958 | 0 | 0 | 1 | Yes, this is poor design, as adding or subtracting two points has no conceptual meaning.
You can, however, add a vector to a point (obtaining a point) or add two vectors (obtaining a vector), so it sounds like you are just confusing points with vectors.
A point is not a vector, but it can be implemented in terms of one. In programming, we model "implemented-in-terms-of" relationships using composition - the Point class will contain a single private Vector instance, and use it to handle the logic of whatever methods it exposes.
In fact, because a Vector can already do all the same things a Point can (plus more), you may want to consider not even bothering to make the distinction, and using only the Vector class, with no Point class at all. Whether or not this is a good idea depends on what your API will be used for. | 1 | 751 | 0 | 0 | 2011-08-30T17:58:00.000 | python,math | Is the concept of a Point3 class, separate from a Vec3 class, unpythonic? | 0 | 4 | 4 | 7,249,813 | 1 |
0 | 0 | I have created some Python code which is really complicated but it basically asks for an input and then outputs a huge DNA sequence depending on the input given, along with some graphs and many equations. I would like to embed this code into the user interface that I will most likely make with wxPython or Tkinter. I don't understand how to plug my code into the user interface. Please Help! Thanks! | false | 7,259,001 | 0.049958 | 0 | 0 | 1 | The best advice for you is not to start trying to build the actual GUI. Learning GUI programming is not trivial and you should start slowly and work up to the real thing.
Pick a framework (Tkinter, wxPython, Qt) and start with the simplest tutorial you can find. Then try progressively harder tasks until you have enough experience to do a good job with your real task. | 0 | 2,928 | 0 | 0 | 2011-08-31T15:01:00.000 | python,user-interface,wxpython | Embedding a python code to a GUI | 0 | 1 | 4 | 7,262,848 | 1 |
0 | 0 | I'm developing a python application that uses a C-extension module I also developed myself. The extension module does some heavy number crunching and makes use of OpenMP.
I was recently adding some GUI components to my Python application using PyQt4. However, when I show a window, the application crashes before the window is fully drawn (The window shows up very shortly). I was able to track the problem down: When I compile my number-crunching C-extension without OpenMP support the Window shows up fine and everything works. I guess it has something to do with the threading stuff between OpenMP and Qt. Has anyone ever made a similar observation? | false | 7,273,779 | 0.066568 | 0 | 0 | 1 | As a workaround, you can create a stand alone program using openmp, and a Qt frontend program. and make them communicate by using tcp socket or something you familiar (dll is another option?).
the point is, isolate different modules, if one module fails, you know which part fails.
as one whole big program, it is hard to find one wild pointer... | 0 | 246 | 0 | 1 | 2011-09-01T17:01:00.000 | python,qt,pyqt,openmp,python-c-extension | Crash when showing a PyQt4 Window after importing a python extension that uses OpenMP | 0 | 2 | 3 | 7,441,730 | 1 |
0 | 0 | I'm developing a python application that uses a C-extension module I also developed myself. The extension module does some heavy number crunching and makes use of OpenMP.
I was recently adding some GUI components to my Python application using PyQt4. However, when I show a window, the application crashes before the window is fully drawn (The window shows up very shortly). I was able to track the problem down: When I compile my number-crunching C-extension without OpenMP support the Window shows up fine and everything works. I guess it has something to do with the threading stuff between OpenMP and Qt. Has anyone ever made a similar observation? | false | 7,273,779 | 0.066568 | 0 | 0 | 1 | Make sure that the OpenMP number crunching extension is free of race conditions.
Avoid updating windows or any other GUI operations from multiple threads - use #pragma omp single or #pragma omp master to this kind of stuff.
If you have a variable/callback to the python code, make sure that all threads have finished what they were supposed to before changing the variable or making the callback.
The threads from QT and the thread from OpenMP are completely different threads, so this shouldn't pose any problems. | 0 | 246 | 0 | 1 | 2011-09-01T17:01:00.000 | python,qt,pyqt,openmp,python-c-extension | Crash when showing a PyQt4 Window after importing a python extension that uses OpenMP | 0 | 2 | 3 | 7,467,392 | 1 |
0 | 0 | I have been tasked with inserting and re-sizing several hundred images to a powerpoint.
I need to use a particular source format that is similar to other power points used by our company.
I have been playing around with activepython's win32com API's and I have figured out how to open up a file and create a blank slide.
My question is how would I go about inserting an image and resizing it to whatever size I need(the images will be the only thing on each page). Also I am trying to use my company's theme for the background and title page but this is not as important as getting the images on page and re-sized.
any help would be greatly appreciated, thanks! | false | 7,284,658 | 0 | 0 | 0 | 0 | I agree with the accepted answer. I would like to point out that I needed to prefix the FileName string with an 'r' to treat the backslashes as literal characters. Escaping the backslashes by replacing single backslashes with double also works. @vestland this may be helpful | 0 | 6,999 | 0 | 3 | 2011-09-02T14:06:00.000 | python,powerpoint | Insert images to powerpoint slide using python (win32com.client) | 0 | 1 | 4 | 57,909,052 | 1 |
0 | 0 | All the examples I've seen seem very complicated.
Thanks! | true | 7,288,543 | 1.2 | 0 | 0 | 3 | The wx demo has an image example, under Using Images|Image. It shows how to convert and display a jpg, and other types as well. If you don't already have the demo, you can get it from the main wx download page. | 0 | 399 | 0 | 0 | 2011-09-02T19:47:00.000 | python,wxpython | What is the easiest way to display a JPG using wxPython? | 0 | 1 | 1 | 7,291,001 | 1 |
0 | 0 | Sorry if this question is incredibly easy to answer, or I sound like an idiot. I'm wondering how I would execute a script in one file, pygame event loop, blits, etc, then switch to another file, SelectWorld.py, which has it's own event loop, and blits, and etc. If I just call it's main function, does it create any slowdown because I still have the original file open, or am I fine just doing that? SelectWorld.transition() sort of thing. Thanks in advance. | false | 7,296,987 | 0.066568 | 0 | 0 | 1 | Here, what is wanted is to be able to share the variables between two different applications: 2 different scripts with event loops, blits, etc. So by definition, they should be on different process (if they must be running at the same time).
There is two major ways of doing this:
1 - Client-Server Architecture (like a Game server would be) (the server and client can both run on the same machine)
2 - Multiprocessing with 2 process running on the same machine with different ways of communicating and synchronize the variables. (Pipe Queue, Event, etc)
I understand that you're trying to do a kind of variables profiling of your game? If it is used to debug your game or test it. I consider that you need a lot of code to gain a little useful information (because the game might run too fast for you to analyse the variables)
You have those alternatives:
1 - import pdb, pdb.set_trace(): it will stop the process at the line where you called the function and, on the terminal, you can see the variables values.
2 - You can use Eclipse (with pyDev): Very good debugger (line by line)
3 - Unittest, Mock: Is something you should start to use, because it is useful, because you can easily see when you break some old code (with unittest) and/or testing new code...
I hope it helps you :) | 1 | 790 | 0 | 1 | 2011-09-04T02:02:00.000 | python,transition,pygame,blit | Python/Pygame transitioning from one file to another | 0 | 2 | 3 | 7,300,851 | 1 |
0 | 0 | Sorry if this question is incredibly easy to answer, or I sound like an idiot. I'm wondering how I would execute a script in one file, pygame event loop, blits, etc, then switch to another file, SelectWorld.py, which has it's own event loop, and blits, and etc. If I just call it's main function, does it create any slowdown because I still have the original file open, or am I fine just doing that? SelectWorld.transition() sort of thing. Thanks in advance. | true | 7,296,987 | 1.2 | 0 | 0 | 0 | Turns out the answer to this was painfully simple, and I asked this back when I was just learning Python. There is no speed downgrade from just calling a function from another file and letting it do all the work. Thanks for all the answers, guys. | 1 | 790 | 0 | 1 | 2011-09-04T02:02:00.000 | python,transition,pygame,blit | Python/Pygame transitioning from one file to another | 0 | 2 | 3 | 10,609,284 | 1 |
0 | 0 | I'm new to Python and PyQt. What is the best way to keep 4 QtTreeWidgets synchronized so that the items are the same as well as all the attributes of all the items? These widgets appear in different dialog boxes at different times during a session. For a number of reasons, I need to keep as much of the existing code, signals and layout as intact as possible. The Model/View division would be the obvious first place to go, but I don't want to touch any of the methods that are used to access or update the tree. I'm planning to refactor the whole thing in a few months, but I need something quickly to carry me until then.
Since each QTreeWidget is a convenience class, each has its own data. The UI is maintained in Qt Designer and I don't want to keep it that way.
When each dialog is initialized, the tree appears. The application has a singleton class that all dialogs can use to reference its variables/attributes.
In the initialization of each parent dialog, couldn't I check to see if a 'locationTree' attribute exists in the singleton. If not, I would need to populate it with its initial state and have the tree in the dialog use it or a copy of it. Any time the state of the dialog tree is altered in ways that I can trap, I'd like to update the singleton 'locationTree' to mirror the change. Although there's a clone method on a QTreeWidgetItem, I didn't see a corresponding method for the entire QTreeWidget.
How can I accomplish this with the least amount of change to the existing code base and GUI layout?
John | true | 7,297,507 | 1.2 | 0 | 0 | 3 | Yes using the MVC facilities is the way to go ...
Even though you are using QTreeWidget you are still working with a class derived from QAbstractItemView therefore the model() and setModel() calls are available. Take a model from one of the widgets that you are creating and then set it in the other widgets. Whenever you change the data in one of the widgets the other widgets will follow suit as they are using the same instance of model.
If you need to maintain the same selection state in all for widgets (which parts of the tree are open or close) that might be a little bit harder but it might actually work by using the same selectionModel selectionModel() and setSelectionModel() | 0 | 451 | 0 | 2 | 2011-09-04T05:06:00.000 | python,qt,pyqt,qtreewidget | Synchronized Qt TreeWidgets | 0 | 2 | 2 | 7,299,389 | 1 |
0 | 0 | I'm new to Python and PyQt. What is the best way to keep 4 QtTreeWidgets synchronized so that the items are the same as well as all the attributes of all the items? These widgets appear in different dialog boxes at different times during a session. For a number of reasons, I need to keep as much of the existing code, signals and layout as intact as possible. The Model/View division would be the obvious first place to go, but I don't want to touch any of the methods that are used to access or update the tree. I'm planning to refactor the whole thing in a few months, but I need something quickly to carry me until then.
Since each QTreeWidget is a convenience class, each has its own data. The UI is maintained in Qt Designer and I don't want to keep it that way.
When each dialog is initialized, the tree appears. The application has a singleton class that all dialogs can use to reference its variables/attributes.
In the initialization of each parent dialog, couldn't I check to see if a 'locationTree' attribute exists in the singleton. If not, I would need to populate it with its initial state and have the tree in the dialog use it or a copy of it. Any time the state of the dialog tree is altered in ways that I can trap, I'd like to update the singleton 'locationTree' to mirror the change. Although there's a clone method on a QTreeWidgetItem, I didn't see a corresponding method for the entire QTreeWidget.
How can I accomplish this with the least amount of change to the existing code base and GUI layout?
John | false | 7,297,507 | 0 | 0 | 0 | 0 | I'm sure you're right that using Model/View is the best approach.
But without an idea of roughly how many items your tree widgets will have, and how frequently they'll be updated, it's hard to weigh up alternative approaches. Also, what version of Qt are you using?
If the number of updates and items are not huge, one approach is to introduce a class that inherits QObject (so it has signals and slots), and make it responsible for keeping all your QTreeWidgets in sync.
By connecting signals and slots for each QTreeWidget to a single other object, you avoid the nightmare of having every tree widget know about every other one. | 0 | 451 | 0 | 2 | 2011-09-04T05:06:00.000 | python,qt,pyqt,qtreewidget | Synchronized Qt TreeWidgets | 0 | 2 | 2 | 7,298,076 | 1 |
0 | 0 | I am using MonkeyRunner to automate some UI test cases.
I need to collect logs from the device using tool like QXDM.
I see that win32com python module can be used to launch QXDM and collecting logs.
But when i use from win32com.client import Dispatch in python script which is passed as argument to MonkeyRunner, MonkeyRunner throws:
"Import Error: No Module named win32com".
I have installed win32com on my machine, and when i use win32com in a python script which ran using "python test.py" its working fine.
Do we need to install win32com python module on Android device also? or what need to be done to make this work? | false | 7,311,676 | 0.197375 | 1 | 0 | 1 | Monkeyrunner use Jython as its Python interface (jython.jar under tools\lib folder).
It uses 2.5.0 version. Now the latest Jython version is 2.5.2.
Either one does not support pywin32 or any other modules. It only supports standard Python modules in version 2.5. | 0 | 2,667 | 0 | 4 | 2011-09-05T18:40:00.000 | python,monkeyrunner | MonkeyRunner::How to install python modules? | 0 | 1 | 1 | 8,291,126 | 1 |
0 | 0 | I'm not using sharpdevelop or visual studio for ironpython app development. I have my reasons for not using them for app development. What are my console based options for compiling ironpython .exe file and packaging it manually ?
Is it possible to create executable app with ironpython and pack it using installer ? | false | 7,313,004 | 0.291313 | 0 | 0 | 3 | I use IronPython\Tools\Scripts\pyc.py to create .exe and then xcopy deployment instead of installer. | 1 | 653 | 0 | 2 | 2011-09-05T21:45:00.000 | .net,python,ironpython | Packing ironpython app into .exe and Installer | 0 | 2 | 2 | 7,317,306 | 1 |
0 | 0 | I'm not using sharpdevelop or visual studio for ironpython app development. I have my reasons for not using them for app development. What are my console based options for compiling ironpython .exe file and packaging it manually ?
Is it possible to create executable app with ironpython and pack it using installer ? | true | 7,313,004 | 1.2 | 0 | 0 | 1 | I've used pyc and InnoSetup to create my installers. You can also download and run WIX from the command line without using #Develop or Visual Studio. The key is make sure you include all of the DLL's you need and to NGEN them on install for shorter start times and better performance. | 1 | 653 | 0 | 2 | 2011-09-05T21:45:00.000 | .net,python,ironpython | Packing ironpython app into .exe and Installer | 0 | 2 | 2 | 7,324,311 | 1 |
0 | 0 | I've been wanting to get into mobile/tablet app development but I'm not sure whether to go with iOS or Android. Here are a few specific questions I had:
What would you recommend for someone who has a background in python and C++?
Is developing for the honeycomb os for tablets pretty much the same as android development?
This might be a silly question but I've also wanted to start developing GUI programs for windows and Mac OS. Is there any way to write something in python using PyQt or wxPython and make it usable on mobile operating systems as well? Just wondering. | true | 7,315,126 | 1.2 | 0 | 0 | 3 | What would you recommend for someone who has a background in python
and C++?
Android uses Java as the main programming language, iOS uses Objective-C.
IMHO Java is easier to learn and more consistent compared to Obj-C.
Is developing for the honeycomb os for tablets pretty much the same as
android development?
Honeycomb is Android version 3. So yes, developing for Honeycomb is developing for Android, albeit differences in UI guidelines.
This might be a silly question but I've also wanted to start
developing GUI programs for windows and Mac OS. Is there any way to
write something in python using PyQt or wxPython and make it usable on
mobile operating systems as well? Just wondering.
Mouse and keyboard interactions are pretty much different than touch screen interactions (assuming you're talking about touch screen smartphones). When I began mobile app development, I always use the wrong sizes for the buttons etc.
The nearest can be done is maybe using Adobe AIR that allows you to deploy to desktops and mobile phones using same code base. | 0 | 882 | 0 | 0 | 2011-09-06T05:00:00.000 | android,c++,python,ios | choosing between android and iOS for a programming novice | 0 | 3 | 3 | 7,315,189 | 1 |
0 | 0 | I've been wanting to get into mobile/tablet app development but I'm not sure whether to go with iOS or Android. Here are a few specific questions I had:
What would you recommend for someone who has a background in python and C++?
Is developing for the honeycomb os for tablets pretty much the same as android development?
This might be a silly question but I've also wanted to start developing GUI programs for windows and Mac OS. Is there any way to write something in python using PyQt or wxPython and make it usable on mobile operating systems as well? Just wondering. | false | 7,315,126 | 0.066568 | 0 | 0 | 1 | To be honest, your current skill set is insufficient for neither Android nor iOS. So, it doesn't matter which platform you decide. Either way, you will have some deep learning curve. However, you could write code in C++ for Android and iOS.
I'm not aware that Python supports both iOS and Android. There're a dozen of framework for that, like Flash. If you're not confident in Flash, you might as well develop GUIs for each indidivual platform. Remember, Android and iOS and PCs have very different UI design, any general framework for building an app for all platforms could be very limitied. | 0 | 882 | 0 | 0 | 2011-09-06T05:00:00.000 | android,c++,python,ios | choosing between android and iOS for a programming novice | 0 | 3 | 3 | 7,315,249 | 1 |
0 | 0 | I've been wanting to get into mobile/tablet app development but I'm not sure whether to go with iOS or Android. Here are a few specific questions I had:
What would you recommend for someone who has a background in python and C++?
Is developing for the honeycomb os for tablets pretty much the same as android development?
This might be a silly question but I've also wanted to start developing GUI programs for windows and Mac OS. Is there any way to write something in python using PyQt or wxPython and make it usable on mobile operating systems as well? Just wondering. | false | 7,315,126 | 0.132549 | 0 | 0 | 2 | What would you recommend for someone who has a background in python and C++?
I would recommend going for android development. As Android is an open source OS, in future more devices will have it installed for its cost effectiveness. Android development needs you to learn java, which unlike objective-C, will not restrict your development capability to one brand of OS. Also java and C++ are very similar syntactically, hence will be easier for you to learn it. Java is everywhere. So go with Android.
Is developing for the honeycomb os for tablets pretty much the same as android development?
Yes, its the same. There are a few new features in honeycomb dedicated to tablets, but creating some samples on honeycomb should get you started for both. | 0 | 882 | 0 | 0 | 2011-09-06T05:00:00.000 | android,c++,python,ios | choosing between android and iOS for a programming novice | 0 | 3 | 3 | 7,315,444 | 1 |
0 | 0 | I was hoping to find a tool similar to Borland Delphi or VisualBasic for Python. Basically, I want to be able to program Windows apps with ease, without actually having to code every single widget. Does such a software exist? Thanks! | false | 7,328,338 | -0.049958 | 0 | 0 | -1 | All these tools are light years behind Delphi or Lazarus in Pascal world. The sad truth is that there is no real RAD GUI tools comparable to Delphi in Python world. | 0 | 13,231 | 0 | 12 | 2011-09-07T02:40:00.000 | python,qt,user-interface,wxpython,pyqt4 | WYSIWYG tool for programming GUI in Python? | 0 | 1 | 4 | 56,841,168 | 1 |
0 | 0 | I am writing a python interface to a c++ library and am wondering about the correct design of the library.
I have found out (the hard way) that all methods passed to python must be declared static. If I understand correctly, this means that all functions basically must be defined in the same .cpp file. My interface has many functions, so this gets ugly very quickly.
What is the standard way to deal with this problem? Possibilities I could think of:
don't worry about it and use one looong .cpp file
compile into more than one library (.so file)
write a .cpp for each group of functions and #include that .cpp into the body of the main defining cpp file (the one with the PyMethodDef)
both of them seem very ugly | false | 7,330,279 | 0 | 1 | 0 | 0 | Why do you say that all functions called by Python have to be
static? It's usual for that to be the case, in order to avoid
name conflicts (since any namespace, etc. will be ignored
because of the extern "C"), but whether the function is static
or not is of no consequence.
When interfacing a library in C++, in my experience, it's
generally not a big problem to make it static, and to put all of
the functions in a single translation unit, because the
functions will be just small wrappers which call the actual C++,
and normally, will be automatically generated from some sort of
descripter file; you surely aren't going to write all of the
necessary boilerplate by hand. | 1 | 61 | 0 | 0 | 2011-09-07T07:30:00.000 | c++,python,interface | What is the pythonic structure of the code of a python-c++ interface with many functions? | 0 | 1 | 2 | 7,330,536 | 1 |
0 | 0 | I'm using glade interface designer for developing a simple application. I was actually following a tutorial which was based on libglade format. But I want to use the gtkbuilder format. So I switched to the gtkbuilder format. But I just want to know what is the exact difference between libglade format and gtkbuilder format.
Thanks in advance. | true | 7,343,714 | 1.2 | 0 | 0 | 3 | Libglade was a separate library. It since has been deprecated, and the functionnalities have been integrated in GTK, which uses the GTK builder format which is a bit different. Both formats allow almost the same things, but the GtkBuilder one is prefered. | 0 | 852 | 0 | 2 | 2011-09-08T06:00:00.000 | python,linux,gtk,glade | What is the difference between gtk builder file and libglade file when using Glade designer? | 0 | 1 | 1 | 7,347,414 | 1 |
0 | 0 | Is there any way way to create multiple screens in Pygame without redrawing to the screen every time. For example, if we want to create a splash screen, then a main menu with buttons. On clicking the 'Start Game' button, it would go to a new screen which is the actual game. What I mean is anything similar to the 'Form' on Visual Studio or the Activites on Android. | false | 7,376,479 | 0 | 0 | 0 | 0 | Just fill the screen with white and then draw the second screen onto the main screen. Then when you need the other screen, just refill the screen with black and then continue. It would help if both of your screens a function and you used a key like tab to "switch" between screens. | 0 | 6,820 | 0 | 2 | 2011-09-11T05:30:00.000 | python,pygame | Creating multiple screens in pygame | 0 | 2 | 2 | 31,993,464 | 1 |
0 | 0 | Is there any way way to create multiple screens in Pygame without redrawing to the screen every time. For example, if we want to create a splash screen, then a main menu with buttons. On clicking the 'Start Game' button, it would go to a new screen which is the actual game. What I mean is anything similar to the 'Form' on Visual Studio or the Activites on Android. | false | 7,376,479 | 1 | 0 | 0 | 9 | Depends on what you mean.
If you mean making multiple windows at the same time, no, you can't do that--it's a limitation of SDL (although you CAN fake it by using multiprocessing (not multithreading)).
If you mean changing one screen around, yes, you can do that, with multiple calls to pygame.display.set_mode(...). You can change the resolution, arguments, etc. If you're doing OpenGL stuff, that will remake the context too.
If you just mean drawing different things to the same window, of course! That's sorta the point of PyGame.
Other than that, you'll have to clarify. | 0 | 6,820 | 0 | 2 | 2011-09-11T05:30:00.000 | python,pygame | Creating multiple screens in pygame | 0 | 2 | 2 | 9,288,321 | 1 |
0 | 0 | I'm trying to figure out how i can have a 3 column layout where the (smaller) left and right columns are resizable with a draggable separator on each side of the center/main area. I've tried using splitwindow but that seems to only split in two parts.
Hope someone can give me pointers on how it can be done. | false | 7,389,417 | 0 | 0 | 0 | 0 | I susggest that you create three panels, side by side. When one of the panels is resized by the user, you will have to adjust the size of the other panels to compensate - so that there are no gaps or overlaps. You can do this by handling the resize event, probably in the parent windows of the three panels.
Another way, which requires you to write less code, would be to use wxGrid with one row and three columns and zero width labels for columns and rows. You will lose the flexibility of panels, but wxGrid will look after the resizing of the column widths for you. | 0 | 383 | 0 | 0 | 2011-09-12T14:25:00.000 | python,user-interface,wxpython,wxwidgets | WxWidget/WxPython; 3 column resizable layout | 0 | 1 | 1 | 7,389,557 | 1 |
0 | 0 | I need to compile my application for both PC and Mac, but I don't have access to Mac in my area (very rare, mostly PC). My application written in Python with 2 C++ modules, I used pyInstaller for Python and MinGW for C++ in PC, but question is for Mac?
What can I do? is there any OS emulator or something helpful out there? | false | 7,393,005 | 0.197375 | 0 | 0 | 2 | You can emulate Apple OS and any other OS on VMWare. | 1 | 391 | 0 | 0 | 2011-09-12T19:36:00.000 | python,compilation | How to compile executable for Mac, but from a PC? | 0 | 1 | 2 | 7,393,082 | 1 |
0 | 0 | There is a library for Python that enables the calling ability (can call functions in C++ format without extern "C". Please, could you remind me the name of the library? I forgot it's name and can't find it.
It's not Boost.Python.
Thank you very much. Your answer will be rewarded. | false | 7,393,672 | 0.049958 | 1 | 0 | 1 | SWIG, Boost.Python, SIP, Shiboken, PyBindgen, ...
SWIG and Boost.Python are most popular, i.e. they have the largest user base and the most active development teams. Which of these two to use is largely a matter of taste. So if you don't want to use Boost.Python, then SWIG is the obvious choice. | 0 | 496 | 0 | 1 | 2011-09-12T20:34:00.000 | c++,python,dll,shared-libraries | Library for Python: How to call C++ functions from Python program? | 0 | 1 | 4 | 7,400,723 | 1 |
0 | 0 | I've noticed that when you bind keys in tkinter (python3.2 winxp), the binds are case sensitive with the letter characters. In other words binding <Control-o> does not work if you press Control+o if caps lock is active. Does it mean I need to write two bindings for each case insensitive key combination with letter characters? Or is there any way to solve this?
Thanks for help :) | true | 7,402,516 | 1.2 | 0 | 0 | 5 | Yes, you have to make two bindings. | 0 | 1,371 | 0 | 4 | 2011-09-13T13:17:00.000 | python,tkinter,bind,case-sensitive | tkinter case insensitive bind | 0 | 1 | 2 | 7,403,049 | 1 |
0 | 0 | Is there a way to not block PyGTK while performing some expensive operation? I know threading would work but it would take a lot of code and setup.
Thanks, | false | 7,435,419 | 0 | 0 | 0 | 0 | Avoid threads, they don't work well at all with PyGTK. Some alternatives:
For IO/networking operations where you read from a file descriptor, use
glib.io_add_watch()
Move the operations to a separate process and
communicate with it using glib.spawn_async()
Twisted is a great library for doing networking, which is completely non-blocking and integrates well with the PyGTK mainloop, consider using that. | 1 | 734 | 0 | 1 | 2011-09-15T18:04:00.000 | python,pygtk | PyGTK nonblocking | 0 | 1 | 3 | 7,566,631 | 1 |
0 | 0 | I'm looking to create a window with two panels, with a collapsible folder browser in the left panel and a list of files in the right panel that are contained in the selected folder on the left (similar to nautilus or an older windows explorer). Both the folders on the left and files on the right need a check box beside them so users can make a selection of a mix of folders and files across their whole file system.
I've had a look around and found similar-ish built-in bits in wx like GenericDirCtrl but before I get started I wanted to ask if anyone had come across something like this before that's available or if there was a better starting point that GenericDirCtrl? | false | 7,443,076 | 0 | 0 | 0 | 0 | There isn't a built-in file explorer. The GenericDirCtrl or one of the other tree controls is a good place to start for the tree. Then use a ListCtrl (or ObjectListView) for the other panel. Something like that should give you the functionality you need. | 0 | 432 | 0 | 1 | 2011-09-16T10:04:00.000 | python,wxpython | Best starting point for multiple selection in file/folder tree structure wxPython | 0 | 2 | 2 | 7,446,240 | 1 |
0 | 0 | I'm looking to create a window with two panels, with a collapsible folder browser in the left panel and a list of files in the right panel that are contained in the selected folder on the left (similar to nautilus or an older windows explorer). Both the folders on the left and files on the right need a check box beside them so users can make a selection of a mix of folders and files across their whole file system.
I've had a look around and found similar-ish built-in bits in wx like GenericDirCtrl but before I get started I wanted to ask if anyone had come across something like this before that's available or if there was a better starting point that GenericDirCtrl? | true | 7,443,076 | 1.2 | 0 | 0 | 1 | I've got it all working now. I used CustomTreeCtrl for the tree and a list control that has multi inheritance from ListCtrl and CheckListCtrlMixin for the report like list with check boxes.
I can share the code if anyone's interested | 0 | 432 | 0 | 1 | 2011-09-16T10:04:00.000 | python,wxpython | Best starting point for multiple selection in file/folder tree structure wxPython | 0 | 2 | 2 | 7,485,064 | 1 |
0 | 0 | Is there a way to get and change the active row in a QTreeView (not QTreeWidget)? By active, I mean the row with the focus highlight, not the selected row. In the paint event, I can use QStyle.State_HasFocus to get the active row, but this doesn't seem to work elsewhere. | true | 7,462,054 | 1.2 | 0 | 0 | 4 | You can get/set the active row with the currentIndex() and setCurrentIndex() functions that you can find in both QTreeView and QItemSelectionModel (the latter is returned by QTreeView.selectionModel()).
And despite its name, the QItemSelectionModel handles the view current item, and the view selection independently. | 0 | 9,304 | 0 | 5 | 2011-09-18T14:20:00.000 | python,qt,pyqt,qtreeview,qabstractitemmodel | Get and set the active row in QTreeview programmatically (PyQt) | 0 | 1 | 3 | 7,463,100 | 1 |
0 | 0 | I'm having some undesired behavior with movable panels in wxpython. I'm using the wxpython Cocoa build 2.9.2.3 for Python 2.7 on Mac OS X 10.6.7. I'm importing wx.aui and trying to create dockable panels.
I have a panel that I've created a wx.aui.AuiManager on and have added two panels, one on top and one on below. For both of them I have disabled the close button. Right now, the panels can be dragged into different dockable positions on the frame or off of the frame to create a floating window. This window shows up as the Mac native MiniFrame with a disabled close button. I do not want users to be able to separate the panels from the main frame.
I have passed .Floatable(False) to each pane's PaneInfo, but this won't allow the panels to be moved around at all, even if I pass a .Dockable(True)
Can I have panes in AUI that are dockable and movable, but not floatable? | false | 7,474,916 | 0 | 0 | 0 | 0 | I don't know if there's a way to do that or not. It may be a limitation of wx.aui. You should ask on the wxPython mailing list. Or you could try the mostly drop-in replacement: wx.agw.aui (http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui). It fixes a bunch of bugs in the default wx.aui and is written in pure Python. | 0 | 456 | 0 | 2 | 2011-09-19T17:34:00.000 | macos,wxpython | wxpython AUI panels dockable but not floatable | 0 | 1 | 1 | 7,521,698 | 1 |
0 | 0 | i'm checking out pyglet, but, funny enough, i can't find how to do a simple button!
so
what is the standard way to create a standard button?
is there a standard way to create a Message-Box? open/save dialogs?
or am i missing the point of pyglet? isn't it yet-another gui toolkit
for creating (also) forms, windows, buttons, texts, standard widgets, etc. ?
i'm using Python 2.x on a windows PC if that matters. | true | 7,484,924 | 1.2 | 0 | 0 | 3 | I didn't use Pyglet yet, but is not a GUI library, it doesn't have to have widgets like buttons, or containers etc. It's a multimedia library like Pygame, it draws stuff on screen, plays sounds, and has some helper functions.
If you want to draw a button on screen, you should first draw a rectangle, print some text in it, and then listen mouse clicks to know if it's clicked on this rectangle.
See PyQT, PyGTK, WxPython for some examples of GUI libraries. | 0 | 6,713 | 0 | 3 | 2011-09-20T12:11:00.000 | python,pyglet | where is the button widget in pyglet ? | 0 | 1 | 3 | 7,485,069 | 1 |
0 | 0 | I am making some programs which includes while loops(to illustrate some number calculatings) and when I use Tkinter for GUI, the program windows is freezing until the loop finished. I want to add a stop button and I want the windows not to freeze. How can I do these two things?
Thank you | true | 7,491,777 | 1.2 | 0 | 0 | 3 | You'll have to use separate threads or processes. Tkinter uses a single thread to process display updates, and the same thread is used to do event callbacks. If your event handler blocks then no Tkinter code will execute until it completes.
If you have the Tkinter thread (the one that calls Tk.mainloop) and another thread for the rest of your application, then the event handlers running within the Tkinter thread can simply pass messages (possibly using Queue.Queue) to your application event handler. | 0 | 1,117 | 0 | 1 | 2011-09-20T21:06:00.000 | python,tkinter | Tkinter is freezing while the loop is processing, how can i prevent it? | 0 | 1 | 1 | 7,491,885 | 1 |
1 | 0 | Full question
Why did Google choose Java for the Android Operating System and not the X language?
Where X would be one of the below:
Python version 2.7 or version 3
which is equally as powerful as Java
has a lot of useful third party libraries
is faster to develop in thanks to it's dynamic nature
C/C++ or ObjC
which are harder to develop in but
run faster thanks to less overhead
would require less beefy hardware, especially RAM
are equally as robust as Java but are more prone to app-wide crashes when just one module fails
And so on. My main concern when I asked this question was why Java and not Python. I can add other elements (languages) of comparison later if anyone else is also interested.
Info: I'm not a full-blown developer.
EDIT I was very much aware that my question was going to be met with some opposition and bashing, that's why I said that I'm not a full-blown developer. I have my personal opinions to support me and just that but even thus, I still got great answers. I understand now, yes, Dalvik VM runs Java bytecodes on ARM devices, but how different is that Java from any other Oracle/Sun Java spec, I don't know. I've been playing with both Java and Python and wrote at least one useful program in both + GUIs (Swing and PySide) and at least one third party library used. The order I did this was Java, then Python which made me realize how much faster it was for me to write everything from scratch in Python than it was in Java. Even packages seemed much easier to manager than Java's way of importing packages (thank God for Eclipse and a few intuitive clicks)... and then how complex would embedded apps be that you'd need to take extra care for type checking and unit tests (and afaik, unit tests are supposed to be a must nowadays for any serious developer)... but anyway, thanks for the answers so far. It's a learning process. ;) | false | 7,497,199 | 1 | 1 | 0 | 10 | Google, as a company, uses Java a lot. The search features are written in Java. As far as I can tell from the outside, Google likes Java.
For most tasks, Java is faster than Python. I would rather work in Python, and I know how to write reasonably efficient Python, and yes PyPy is really shaking things up, but Google needed to provide a snappy experience on relatively underpowered phone processors so they likely didn't consider Python a contender.
Java, like Python, provides a great deal of isolation from details of the underlying hardware. I think all Android phones are ARM-based, but in theory you could make an Android phone based on an x86 chip or something completely different, and as long as you do a good job of porting the Dalvik VM, your code will run. (Aside from apps that have native ARM code compiled in, of course.)
Google likes the Java language, but they chose to write their own VM ("Dalvik") rather than license the Java VM. Compiled Java can be directly translated into Dalvik bytecodes. (Oracle sued Google over this. Oracle lost the lawsuit.) | 0 | 9,975 | 0 | 19 | 2011-09-21T09:02:00.000 | java,android,python | Why did Google choose Java for the Android Operating System? | 0 | 1 | 2 | 7,497,322 | 1 |
0 | 0 | I'm looking for a good cross platform (mac, windows & linux) python GUI framework / library that will make my life easier while writing a data analysis program. Since my data is represented by custom data classes, it would be great if the GUI framework / library could take away the burden of having to code input checks, validation, etc (i.e., create input dialogs that take care of checking for the correct data range / data type based on the data model). The only library that I've found so far is TraitsUI. Are there more (similar) libraries / frameworks out there? | true | 7,538,282 | 1.2 | 0 | 0 | 3 | Then Enthought Suite (not just TraitsUI) is the most complete as it provides everything from building the model to showing it including input validation. It plays nicely with numpy and scipy which is nice for a scientific app. Enthought UI can use Qt (via PySide or PyQt) or wx as backends.
You can also use Qt directly via PyQt or Pyside and embed plots using matplotlib or PyQwt. QtDesigner allows you to generate nice UI with very little effort. You can achieve the type of initialization, validation as with Traits but with more effort. | 0 | 1,209 | 0 | 2 | 2011-09-24T09:58:00.000 | python,user-interface,traits,enthought | python GUI frameworks / libraries suited for data analysis programs | 0 | 1 | 3 | 7,538,648 | 1 |
0 | 0 | Is there a way I can tell gtk to automatically call gtk.main_quit() when the last open window of the application is closed/destroyed?
If there is no direct feature offering this functionality, I could think of the following:
In the window's destroy method: get a list of open windows in the process, if its empty quit. Is there a way to get such a list?
The obvious solution would be to keep manually track of all open windows, but I would want to avoid this if possible. | false | 7,567,707 | 0.197375 | 0 | 0 | 2 | Use the method gtk.main_level() to get the current nesting level of the main loop. The nesting level is increased by calling the gtk.main() function and reduced by calling the gtk.main_quit() function | 0 | 3,003 | 0 | 5 | 2011-09-27T10:33:00.000 | python,gtk,window,pygtk,quit | How to quit a pygtk application after last window is closed/destroyed | 0 | 1 | 2 | 7,839,037 | 1 |
0 | 0 | Can I create a button with text with a background image? In wxPython, there are certain functions which create buttons such as wx.lib.buttons.GenBitmapTextButton and other functions like that. I'm wondering if I can create a button with a fancy background image, as well as label text. | true | 7,605,254 | 1.2 | 0 | 0 | 0 | There is no built-in button that allows a background image underneath the text. You can probably look at one of the generic button widgets though and use them as a template. Basically you just need to draw the bitmap on and then draw text on top, probably by using wx.DC or wx.GCDC or similar. The generic buttons include such things as wx.lib.buttons, wx.lib.agw.aquabutton and wx.lib.platebtn among others. | 0 | 707 | 0 | 0 | 2011-09-30T02:03:00.000 | image,button,wxpython,label,background-image | wxPython Button Background Image | 0 | 1 | 1 | 7,611,324 | 1 |
0 | 0 | I want to create a program that loads the RGB values of each pixel in a image and saves them in some kind of list/dictionary/tuple and then when I type in a value it tells me how much pixels in the image have that value. So far I have read through the whole PIL documentation trying to find a method that could fit my needs and I have tried several other approaches with for example the .getpixel() or the .load() function, but it is very difficult to save and evaluate that information for each pixel. | false | 7,625,984 | 0.148885 | 0 | 0 | 3 | New in version 1.1.5 of PIL is the method getcolors() which should do exactly what you're looking for. The documentation from the PIL web documentation follows:
getcolors
im.getcolors() => a list of (count, color) tuples or None
im.getcolors(maxcolors) => a list of (count, color) tuples or None
(New in 1.1.5) Returns an unsorted list of (count, color) tuples,
where the count is the number of times the corresponding color occurs
in the image.
If the maxcolors value is exceeded, the method stops counting and
returns None. The default maxcolors value is 256. To make sure you get
all colors in an image, you can pass in size[0]*size[1] (but make sure
you have lots of memory before you do that on huge images). | 1 | 2,218 | 0 | 3 | 2011-10-02T11:07:00.000 | python,python-imaging-library,pixel | Pixel Loading and Evaluating with PIL | 0 | 1 | 4 | 12,994,553 | 1 |
0 | 0 | Is there any way to make widgets with Python on Android?
I mean, that I know only Python, HTML, DOM, JS, maybe jQuery and nothing more (not C, Java or something).
Maybe it's simple?
I honestly searched stackoverflow but search returned no answers :(
Help me, please. Give me a hope. | true | 7,636,732 | 1.2 | 0 | 0 | 2 | Personally I wrote a google app engine app in python to collect and display the data, and then used an app called "meta widget" that allows you to turn a website's content into a widget. The app pulls the content from my GAE website and shows it in a widget on the android homescreen.
You might be able to do something completely local if you can make something to serve HTTP requests in sl4a python, then have meta widget go to a local http address. | 0 | 4,546 | 0 | 3 | 2011-10-03T14:56:00.000 | python,android-widget,android,sl4a | How to make android widgets using python? | 0 | 1 | 4 | 13,672,739 | 1 |
0 | 0 | I have a project where I have to show some sort of changing bar graph with results from a function. This bar graph should be in colour and 3d. I want it to look good since it's an open source educational program where it teaches the user about different voting systems and how they effect the outcome of an election. I would like to use python but I have no idea about using GUI frameworks since all my work in python has been command line based. Your help will be appreciated. | true | 7,637,199 | 1.2 | 0 | 0 | 2 | You might want to look at matplotlib, which is probably the most widely used library for doing graphs, including 3-D. | 0 | 228 | 0 | 2 | 2011-10-03T15:36:00.000 | python,qt,user-interface,pyqt | Picking a suitable GUI framework for project | 0 | 1 | 2 | 7,637,393 | 1 |
0 | 0 | I want to create an application in PYTHON with graphical interface (using pyqt), with a COM automation server.
So that COM clients could call this app using COM, and this would result in events in the main gui window. But I'm not sure how to integrate pyqt (signals/slots) to COM automation server (using pywin). | false | 7,650,348 | 0.197375 | 0 | 0 | 1 | Your software is built from three different parts:
The program core - what actually does the stuff.
The GUI - in this case built in pyqt.
The COM server - one more UI that has nothing to do with 2.
Let the COM client do its thing. The output can be doing stuff and updating the GUI interface.
What I am saying is that the two interfaces have nothing to do thin each other. | 0 | 441 | 0 | 2 | 2011-10-04T15:30:00.000 | python,com,pyqt,pywin | Using COM automation server and PyQt | 0 | 1 | 1 | 10,190,909 | 1 |
0 | 0 | I want to check whether the images is downloaded completely. Is there any library to use?
The images I want to verify including various formats such jpeg, png, bmp etc. | false | 7,674,580 | 0 | 0 | 0 | 0 | You can guess by attempting to load the image into memory (using PIL or somesuch), but it's possible that some images could be loaded ok without being complete - for example an animated GIF might load fine if you have the header and the first frame of the animation, and you won't notice that later frames of the animation were missing.
A more reliable approach would probably be to use some out-of-band communication, like rather than watching a folder and processing new files as soon as they exist, find some way of hooking into the downloader process and getting it to give you a signal when it decides it is ready. | 1 | 1,726 | 0 | 2 | 2011-10-06T13:01:00.000 | c++,python,image,boost,image-processing | How to verify the integrity of a image file in c++ or python? | 0 | 1 | 3 | 7,674,970 | 1 |
0 | 0 | I want to put a bunch of widgets into an MDIChildFrame , using wxpython, but i cant find much documentation on how to do so. has anyone created a child frame with alot going on it in so i can take a look at the source code? would be really Helpful
Cheers
Kemill | false | 7,690,324 | 0 | 0 | 0 | 0 | The wxPython demo has a fairly complicated window in their MDI with SashWindows demo. However, I keep seeing on the wxPython mailing list that MDI in general isn't usually recommended anyway. If I were you, I'd look at wx.lib.agw.aui. It's a pure python implementation of AUI and fixes a lot of the bugs in wx.aui. I know it's not quite the same, but at least it gets active development. | 0 | 317 | 0 | 0 | 2011-10-07T16:47:00.000 | wxpython,widget | Using wx.MDIChildFrame Widgets | 0 | 1 | 1 | 7,691,411 | 1 |
0 | 0 | I want to change the opacity or color of a gtk.IconView select box (I want actually to make the selection more visible).
I noticed that the gtk.IconView widget had style properties selection-box-alpha & selection-box-color but only accessible for reading.
The set_select_function() method of the gtk.TreeSelection class would have been useful to do what I want but it's used for a gtk.TreeView and I haven't found an equivalent for gtk.IconView
So, how can I do to have control over the selection and perform an action when the user select or unselect stuff ?
Edit :
In fact, change the values of selection-box-alpha and selection-box-color style properties wouldn't be a solution.
I don't really want to change the selection box opacity but the "opacity" of the pixbuf (by compositing with a color).
So, I need an equivalent method of set_select_function for a gtk.IconView widget. | false | 7,698,217 | 0.099668 | 0 | 0 | 1 | You might be able to set the pixmap opacity by implementing a custom gtk.CellRenderer that draws the pixmap according to the selection state, and replacing the gtk.IconView's default cell renderer with your own. | 0 | 735 | 0 | 0 | 2011-10-08T16:32:00.000 | python,gtk,pygtk | How to get the control over the selection in a gtk.IconView? | 0 | 1 | 2 | 7,705,370 | 1 |
0 | 0 | I've decided to try and create a game before I finish studies. Searching around the net, I decided to create the basic game logic in python (for simplicity and quicker development time), and the actual I/O engine in c# (for better performance. specifically, I'm using Mono with the SFML library).
After coming to grips with both languages and IDEs, I've gotten stuck on integrating the two, which leads me to three questions (the most important one is the second):
a. which module should encapsulate the other? should the python game logic call the c# I/O for input and then update it for output, or should it be the other way around?
b. whatever the answer is, how can I do it? I haven't found any specific instructions on porting or integrating scripts or binaries in either language.
c. Will the calls between modules be significantly harmful for performance? If they will, should I just develop everything in in one language?
Thanks! | false | 7,792,013 | 0.197375 | 1 | 0 | 2 | Have you considered IronPython? It's trivial to integrate and since it's working directly with .net the integration works very well. | 1 | 814 | 0 | 1 | 2011-10-17T09:48:00.000 | c#,python,mono | Integrating python and c# | 0 | 2 | 2 | 7,792,073 | 1 |
0 | 0 | I've decided to try and create a game before I finish studies. Searching around the net, I decided to create the basic game logic in python (for simplicity and quicker development time), and the actual I/O engine in c# (for better performance. specifically, I'm using Mono with the SFML library).
After coming to grips with both languages and IDEs, I've gotten stuck on integrating the two, which leads me to three questions (the most important one is the second):
a. which module should encapsulate the other? should the python game logic call the c# I/O for input and then update it for output, or should it be the other way around?
b. whatever the answer is, how can I do it? I haven't found any specific instructions on porting or integrating scripts or binaries in either language.
c. Will the calls between modules be significantly harmful for performance? If they will, should I just develop everything in in one language?
Thanks! | true | 7,792,013 | 1.2 | 1 | 0 | 2 | Sincerely, I would say C# is today gives you a lot of goods from Python. To quote Jon Skeet:
Do you know what I really like about dynamic languages such as Python, Ruby, and
Groovy? They suck away fluff from your code, leaving just the essence of it—the bits
that really do something. Tedious formality gives way to features such as generators,
lambda expressions, and list comprehensions.
The interesting thing is that few of the features that tend to give dynamic lan-
guages their lightweight feel have anything to do with being dynamic. Some do, of
course—duck typing, and some of the magic used in Active Record, for example—
but statically typed languages don't have to be clumsy and heavyweight.
And you can have dynamic typing too. That's a new project, I would use just C# here. | 1 | 814 | 0 | 1 | 2011-10-17T09:48:00.000 | c#,python,mono | Integrating python and c# | 0 | 2 | 2 | 7,792,064 | 1 |
0 | 0 | I wanted to say "best python GUI compared to Swing"... but was sternly told my question was "too subjective". I apologise to the deterministic ghost in the machine.
I'm currently using Jython... have been using it for maybe 6 months now following years of Java. I love Jython's ability to call on all the Java classes, and also to ease the transition from a Java way of doing things to a Python way.
But thinking about it I realise that by far the most common Java packages I'm using are the Swing ones. I have spent many years wrestling with Swing and finally think I have the beast under some kind of body-lock. I also think Swing is wonderful, by the way, and I have to say that I am something of a keyboard fanatic, for example, so wouldn't want to switch to a GUI where you don't have power akin to that lurking in ActionMap-InputMap, which maybe not many people care that much about. It would also be a shame really to turn my back on JTree and JTable, having spent so much time tearing out what was left of my hair about them. Seriously, they are fiendishly powerful...
But at the same time I'm fast becoming hooked on the Python way of doing things. I can and intend to stick with Jython. But I was just wondering what the various CPython GUIs are like... and specifically how their power and versatility compare with Swing?
added:
I have been asked to provide some specifics: OK, what about a tree GUI object sitting on a scroll pane where it is possible, if you want to, to control navigation and collapsing/expanding of nodes using the keyboard... where the scrolling happens automatically (if you want it to) and where you have control over look and feel, etc. Or tables where you have comprehensive control over resizing, over what happens when individual cells gain/lost focus. Where you can subclass renderers and editors. As I said in my comment, someone who is/was keen on, and a big user of, Swing but nonetheless made a transition to a CPython GUI and was happy/unhappy... might be the ideal person to answer this. | false | 7,798,393 | 0 | 0 | 0 | 0 | I think Python has many toolkit for GUI.
Java has Swing. If you want to develop
cross-platform friendly GUI,I suggest
wxPython. | 0 | 12,297 | 0 | 9 | 2011-10-17T19:15:00.000 | python,swing,user-interface,comparison,jython | python GUI compared to Swing? | 0 | 1 | 2 | 22,448,500 | 1 |
0 | 0 | I need to catch when a User moves the mouse over the GUI, but not when they're holding down the mouse button (which would do something different).
I can't find any conveniant method to do this,
except to periodically find the mouse position and check it to it's previous position...
Which would suck.
The mouseMoveEvent is only called when the mouse is moved whilst the left mouse button is pressed,
unless ofcourse the widget has 'mouse tracking'. Mouse tracking is not an option for me, because the GUI must behave differently when the mouse is moved and the left mouse button is pressed.
Are there any inbuilt methods to do this?
(or just any clever ideas?)
eg:
Is there a way to check if the left mouse button is being pressed at any time?
Or a 'mouse hover' event that can be applied to a QRect (coordinates)?
Muchas gracias.
Windows 7 (32)
python 2.7
PyQt4 | false | 7,829,829 | 0.099668 | 0 | 0 | 2 | call setMouseTracking(True) method first. Then mouseMoveEvent will be fired without any button pressed. | 0 | 20,559 | 0 | 9 | 2011-10-20T00:31:00.000 | python,pyqt,mouseevent,pyqt4,mouseover | PyQt4 MouseMove event without MousePress | 0 | 1 | 4 | 7,829,879 | 1 |
0 | 0 | I have a VB6 application running on a number of old 486 Windows 95 machines and sometimes the application is upgraded. The only way to accomplish this today is to use Hyperterminal and send the file over a null modem cable. Replacing the machines is not an option at this point.
I want to write an application that can take care of transferring the updating app over null modem without rewriting the VB6 app. This means I'm free to use anything I see fit. What alternatives are there?
These are the ones I can think of but I'd like to know if I'm wrong and any pros/cons. Also, I'd prefer to avoid C/C++ if at all possible.
Python with py2exe
Another VB6 app
C/C++
Edit: Some clarifications after reading the comments:
I want to make the process as easy as possible, today we have to remove and dismantle the computer, connect a keyboard and then fire up Hyperterminal to get going. That's why I want something more automatic. I'm open to suggestion of existing solutions but given the specific needs I didn't think there were any.
There is no ethernet on some of the computers either so the solution needs to be able to run RS232.
And again: Replacing the machines is not an option at this point. Just trust me on this. | false | 7,833,831 | 0.148885 | 0 | 0 | 3 | If you must use a null modem, how about the built in serial line networking support?
Then you can just use normal network methods (psexec, file share, etc) methods to do the update. | 1 | 547 | 0 | 3 | 2011-10-20T09:29:00.000 | python,vb6,native,windows-95 | Make new software for Windows 95 on 486 machines, what to use? | 0 | 2 | 4 | 7,835,341 | 1 |
0 | 0 | I have a VB6 application running on a number of old 486 Windows 95 machines and sometimes the application is upgraded. The only way to accomplish this today is to use Hyperterminal and send the file over a null modem cable. Replacing the machines is not an option at this point.
I want to write an application that can take care of transferring the updating app over null modem without rewriting the VB6 app. This means I'm free to use anything I see fit. What alternatives are there?
These are the ones I can think of but I'd like to know if I'm wrong and any pros/cons. Also, I'd prefer to avoid C/C++ if at all possible.
Python with py2exe
Another VB6 app
C/C++
Edit: Some clarifications after reading the comments:
I want to make the process as easy as possible, today we have to remove and dismantle the computer, connect a keyboard and then fire up Hyperterminal to get going. That's why I want something more automatic. I'm open to suggestion of existing solutions but given the specific needs I didn't think there were any.
There is no ethernet on some of the computers either so the solution needs to be able to run RS232.
And again: Replacing the machines is not an option at this point. Just trust me on this. | false | 7,833,831 | 0 | 0 | 0 | 0 | I guess the answer is pretty simple if you are happy using VB6 and the other app is already VB6, then use it.
That will do whatever serial comms you require quite adequately. Remember though you may want to update the application you write to do the updating in which case you are back to using hyperterminal! | 1 | 547 | 0 | 3 | 2011-10-20T09:29:00.000 | python,vb6,native,windows-95 | Make new software for Windows 95 on 486 machines, what to use? | 0 | 2 | 4 | 7,835,783 | 1 |
0 | 0 | I'm using a Tkinter Text box in my Python (using 2.7.2) script as an entry-type box -- when enter is pressed, it copies the contents into a different text box and then deletes it out of the entry one.
I've bound the necessary event to the Text box when the Enter key is pressed.
The only problem I have is that whenever I hit the Enter key, it seems to execute my event and then the widgets "default" binding: adding a newline. I'm not sure of a way to either delete the newline after it is added, or simply get rid of the widgets default binding.
Thanks a lot! | false | 7,842,538 | 0 | 0 | 0 | 0 | Returning 'break' at the end of your event handler will interrupt event propagation. | 0 | 889 | 0 | 0 | 2011-10-20T21:33:00.000 | python,binding,tkinter | Python Tkinter - Overwriting/Deleting "Default" Widget Bindings | 0 | 1 | 2 | 7,843,137 | 1 |
0 | 1 | I have to store/retrieve a large number of images to use in my program.
Each image is small: an icon 50x50, and each one has associated a string which is the path the icon is related to.
Since they are so small I was thinking if there is some library which allows to store all of them in a single file.
I would need to store both the image and the path string.
I don't know if pickle is a possible choice - I also heard about much more complicated libraries such as HDF5...
thanks for your help!
alessandro | false | 7,846,413 | 0 | 0 | 0 | 0 | You could pickle a dict that associates filenames to byte strings of RGBA data.
Assuming you have loaded the image with PIL, make sure they have all the same size and color format. Build a dict with images[filename] = im.tostring() and dump() it with pickle. Use Image.fromstring with the right size and mode parameters to get it back. | 1 | 165 | 0 | 2 | 2011-10-21T07:41:00.000 | python,database | python: container to memorize a large number of images | 0 | 1 | 3 | 7,847,894 | 1 |
0 | 0 | I want to create a 2D game on Python with heavy user interface: windows, buttons, text input, etc. So far I've been using PyGame for a few simple games.
The game is a 2D MUD, with the standard rendering loop to draw stuff on the screen. I need the user interface to interact with the game entities like sales, blacksmith, etc.
I am looking for something like a mix of Pygame and wxPython/pyQT/pyGTK.
Which libraries can I use? | false | 7,869,589 | 0.033321 | 0 | 0 | 1 | tkinter is one choice. It has a canvas widget that is very easy to use -- you can draw objects (lines, circles, etc) as well as embed images (for tiles, for example). And of course it comes with a standard collection of widgets (buttons, comboboxes, listboxes, menus, etc) that can either be embedded in a canvas or used in the more traditional sense. | 1 | 5,109 | 0 | 18 | 2011-10-23T22:08:00.000 | python,user-interface | Which Python user interface library can I use for 2D games? | 0 | 1 | 6 | 7,870,721 | 1 |
0 | 0 | How can I set a style for treeview widgets so that alternate rows have different background colors, for example, rows 1,3,5 have white backgrounds and rows 2,4,6 have light blue-grey backgrounds?
I'd also like to set gridlines. | false | 7,878,730 | 0.099668 | 0 | 0 | 3 | I realise this is an old question but just for the record configuring the tags just after creating the tree (i.e. when no items have yet been added to it) also works. As items get inserted later on they will be given the background colour appropriate to their 'oddrow' or 'evenrow' tag. | 0 | 27,341 | 0 | 15 | 2011-10-24T16:24:00.000 | python,tkinter,treeview,ttk | ttk treeview: alternate row colors | 0 | 1 | 6 | 32,121,255 | 1 |
1 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible. | false | 7,884,010 | 0.099668 | 0 | 0 | 4 | The only thing that’s necessary to make this work is a form of dynamic binding, e.g., message passing in Erlang or eval in many other languages.
If you have dynamic binding, then you can change the target of a message without affecting the message, or a message without affecting the target—provided that a target is defined when you try to send a message to it, and a message is defined for the targets to which you send it, when you send it.
When changing a target, all you have to do is serve messages to the previous version until the new version is in place, then do a small locked update to transition to the new version. Similarly, when changing a message, you just serve the old version till the new one is available.
Readily hot-swappable code must still be designed as such, however—the application must be modular enough that replacing the implementation of a component does not cause an interruption, and that can only come from careful programming. | 0 | 1,317 | 0 | 13 | 2011-10-25T02:20:00.000 | python,ruby,clojure,lua,livecoding | What programming language features are well suited for developing a live coding framework? | 0 | 3 | 8 | 7,898,079 | 1 |
1 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible. | false | 7,884,010 | 0.049958 | 0 | 0 | 2 | Smalltalk is probably the best bet for this. As unlike the others, it has a whole IDE for live coding, not just a REPL | 0 | 1,317 | 0 | 13 | 2011-10-25T02:20:00.000 | python,ruby,clojure,lua,livecoding | What programming language features are well suited for developing a live coding framework? | 0 | 3 | 8 | 36,677,720 | 1 |
1 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible. | false | 7,884,010 | 0.024995 | 0 | 0 | 1 | Tcl has such a thing already. For example, you can write a gui program that creates a separate window that has an interactive prompt. From there you can reload your code, type in new code, etc.
You can do this with any gui toolkit, though some will be much harder than others. It should be easy with python, though the indentation thing -- IMHO -- makes interactive use challenging. I'm reasonably certain most other dynamic languages can do this without too much trouble.
Look at it this way: if your toolkit lets you open more than one window, there's no reason why one of those windows can't be an interactive prompt. All you need is the ability to open a window, and some sort of "eval" command that runs code fed to it as a string. | 0 | 1,317 | 0 | 13 | 2011-10-25T02:20:00.000 | python,ruby,clojure,lua,livecoding | What programming language features are well suited for developing a live coding framework? | 0 | 3 | 8 | 7,897,130 | 1 |
0 | 0 | I am making programs that solve and show work for math problems. I would like to add a GUI, and I think wxPython will be best. If I use wxPython for the GUI, will the end user need wxPython on their computer in order to use the program with the GUI? If not, what would should I use?
These apps will be used on mostly Windows, but I would also like them to work on Macs and Linux. I'm not for sure if any Python GUI elements will work on Android through SL4A, but if you know any, that would be appreciated.
Also, I know Tkinter is bundled with Python, but is it a dying technique, as I have read?
Thanks! | false | 7,898,489 | 0.039979 | 0 | 0 | 1 | If your software is mostly about the complicated processing, with a fairly simple UI, tkinter is probably fine | 0 | 469 | 0 | 1 | 2011-10-26T03:37:00.000 | python,user-interface,wxpython,tkinter | Is wxPython Needed on the End User's Computer | 0 | 3 | 5 | 7,900,401 | 1 |
0 | 0 | I am making programs that solve and show work for math problems. I would like to add a GUI, and I think wxPython will be best. If I use wxPython for the GUI, will the end user need wxPython on their computer in order to use the program with the GUI? If not, what would should I use?
These apps will be used on mostly Windows, but I would also like them to work on Macs and Linux. I'm not for sure if any Python GUI elements will work on Android through SL4A, but if you know any, that would be appreciated.
Also, I know Tkinter is bundled with Python, but is it a dying technique, as I have read?
Thanks! | false | 7,898,489 | 0 | 0 | 0 | 0 | Tkinter comes with Python, so it can be handier in some respects just because of that. On the other hand, wxPython uses the native widgets of the OS (which has it's own set of pros and cons). I personally prefer wxPython. But no, Tkinter is not dead to my knowledge.
You can use py2exe to bundle up your app on Windows or you could use cx_freeze or bb_freeze. There's also PyInstaller, which I think can create some kind of Linux bundle, but the docs are kind of confusing. For Mac, see py2app.
I'm not aware of any specific Python GUI toolkits for Android. | 0 | 469 | 0 | 1 | 2011-10-26T03:37:00.000 | python,user-interface,wxpython,tkinter | Is wxPython Needed on the End User's Computer | 0 | 3 | 5 | 7,903,064 | 1 |
0 | 0 | I am making programs that solve and show work for math problems. I would like to add a GUI, and I think wxPython will be best. If I use wxPython for the GUI, will the end user need wxPython on their computer in order to use the program with the GUI? If not, what would should I use?
These apps will be used on mostly Windows, but I would also like them to work on Macs and Linux. I'm not for sure if any Python GUI elements will work on Android through SL4A, but if you know any, that would be appreciated.
Also, I know Tkinter is bundled with Python, but is it a dying technique, as I have read?
Thanks! | false | 7,898,489 | 0 | 0 | 0 | 0 | PyInstaller.
install and run.
cmd -> python pyinstaller.py NAMEOFSCRIPT.py --onefile --noconsole.
easy as 123. | 0 | 469 | 0 | 1 | 2011-10-26T03:37:00.000 | python,user-interface,wxpython,tkinter | Is wxPython Needed on the End User's Computer | 0 | 3 | 5 | 13,719,743 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.