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'm starting to learn both Python and wxPython and as part of the app I'm doing, I need to have a simple browser on the left pane of my app. I'm wondering how do I do it? Or at least point me to the right direction that'll help me more on how to do one. Thanks in advance! EDIT: a sort of side question, how much of wxPython do I need to learn? Should I use tools like wxGlade?
false
1,962,592
0.066568
0
0
1
You can take a look at the wxPython examples, they also include code samples for almost all of the widgets supported by wxPython. If you use Windows they can be found in the Start Menu folder of WxPython.
0
6,299
0
4
2009-12-26T04:02:00.000
python,wxpython
How do I make a simple file browser in wxPython?
0
1
3
1,962,595
1
0
0
I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions. Is it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import <mymodule>? Or even better, from <mymodule> import <function>? Edit: I can do PyRun_SimpleString("from mymodule import myfunction") just after Py_Initialize(); - I was just wondering if there is another way of doing this..? Edit 2: In other words, I have an application written in C which embeds a Python interpreter. That application provides some functionality which I want to expose to the users so they can write simple Python scripts for the app. All I want is to remove the need of writing from mymodule import myfunction1, myfunction2 because, since it is very specialized app and the script wont work without the app anyway, it doesn't make sense to require to import ... all the time.
false
1,963,453
0.119427
1
0
3
Even if you implement a module in Python, the user would have to import it. This is the way Python works, and it's actually a good thing - it's one of the great pluses of Python - the namespace/module system is robust, easy to use and simple to understand. For academic exercises only, you could of course add your new functionality to Python itself, by creating a custom interpreter. You could even create new keywords this way. But for any practical purpose, this isn't recommended.
0
697
0
1
2009-12-26T14:05:00.000
python,c,import,python-c-api,python-embedding
Extending Python: pre-load my C module
0
2
5
1,963,510
1
0
0
I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions. Is it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import <mymodule>? Or even better, from <mymodule> import <function>? Edit: I can do PyRun_SimpleString("from mymodule import myfunction") just after Py_Initialize(); - I was just wondering if there is another way of doing this..? Edit 2: In other words, I have an application written in C which embeds a Python interpreter. That application provides some functionality which I want to expose to the users so they can write simple Python scripts for the app. All I want is to remove the need of writing from mymodule import myfunction1, myfunction2 because, since it is very specialized app and the script wont work without the app anyway, it doesn't make sense to require to import ... all the time.
false
1,963,453
0
1
0
0
Nope. You could add it to the Python interpreter itself, but that would mean creating a custom Python version, which, I guess, is not what you want. That import <mymodule> is not just for loading the module, it's also for making this module visible in the (main|current) namespace. Being able to do that, w/o hacking the actual Python interpreter, would run against "Explicit is better than implicit" very strongly.
0
697
0
1
2009-12-26T14:05:00.000
python,c,import,python-c-api,python-embedding
Extending Python: pre-load my C module
0
2
5
1,963,505
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
-0.028564
0
0
-1
If you're used to a more command line approach, this would be a bad idea. Responding to user input is a completely different paradigm, and you're not likely to get it right the first time. If you're just talking about the difference between wxPython and another GUI, don't worry about it.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,967,976
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
0
0
0
0
Since you are new to GUI programming, your approach is perfectly valid. It will likely result in a less than optimal UI, but that's OK for now. And in fact, there are some very successful multi-million dollar commercial projects that are built this way. Arguably a better approach is to first design the UI since that is the most important part. After that is completel you can then create a back-end that can support that UI. This approach still results in separate front- and back-ends but puts the emphasis on the needs of the user, where it should be.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,970,144
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
-0.028564
0
0
-1
What level of interactivity do you need? If you need rich feedback and interaction, then you need an OO program model, then you can ad the GUI on top of the objects. If you just have filters and functions (no real feedback, or just a results window) than a library or component model would be better. Either way, you are better off coding your logic separate to the GUI, so you can test it more easily.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,967,968
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
0.028564
0
0
1
Separation of the user interface from the engine code is the unixy way to do it and there's a lot of merit to doing it that way. It results in modular re-usable programs and code that can play nicely with other programs and fit into a larger tool chain. Having said that, such an approach tends to discount the value of creating a really usable UI experience. It's very difficult and rare for a program's internal model to match the user model when you design your program's functionality first and then the user interface later. As a result, you need to impedance-match the two sides after creating them independently. This results in either creating a compromise in usability (your ui becomes nothing more than a front-end to the command line switches your program takes) or a large glue layer between the UI and the core program which tends to be messy and buggy. If your program is primarily designed to be run through a user interface interactively with a user, then it probably makes sense to design the user interface in parallel with your actual functionality. So: it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app If your UI is the main means of operating your program, then that UI is part of the program design. Not something to be painted over the program when its done.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,968,045
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
0.057081
0
0
2
That depends on the problem domain. An image processing tool would be rather difficult to implement without reference to a GUI. For most apps, though, I would argue strongly in favour of separating the two parts. It is much, much easier to develop, test and evolve a UI-free back-end. The gains will vastly outweigh the cost of defining a clean API between the front and back end. In fact, the process of defining the API will yield a better design overall.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,967,904
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
false
1,967,888
0
0
0
0
IMHO, that would rather be a better idea. To keep the underlying business logic not tied down to the UI is a better approach that we can worry more about the underlying logic than bogging down too much about the interface. At the same time, it is also important to have some basic design for your interface so that it helps you have an idea about what kind of inputs and outputs are involved, and making the underlying logic support a wide range of inputs/outputs or simply wide range of interfaces.
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,967,905
1
0
0
Is it better to do it all at once? I'm very new to wxPython and I'm thinking it would be better to write the program in a way familiar to me, then apply the wxPython gui to it after I'm satisfied with the overall design of the app. Any advice?
true
1,967,888
1.2
0
0
16
This is a viable approach. In fact, some programmers use it for the advantages it brings: Modular non-GUI code can then be tied in with different GUIs, not just a single library It can also be used for a command-line application (or a batch interface to a GUI one) It can be reused for a web application And most importantly: it can make unit-testing of the code easier. However keep in mind that it requires some careful design. You'll want your "logic code" to be free from GUI constraints, and sometimes it is difficult (especially when the code relies on GUI idioms like an event loop).
0
724
0
12
2009-12-28T03:53:00.000
python,wxpython
Is it a bad idea to design and develop a python applications backend and then once finished try to apply a GUI to it?
0
7
7
1,967,900
1
0
0
I have downloaded python 2.5. I would like to know if Tkinter is included with python or is it a separate download?
false
1,994,760
0
0
0
0
If you are using linux just open your terminal and type python and in the python interpreter type from Tkinter import* if it doesn't show any error messages you are good to go. You can try this to check every package of python like Pygame just replace Tkinter by Pygame
1
1,047
0
0
2010-01-03T11:58:00.000
python,tkinter
Is Tkinter included with Python 2.5?
0
1
2
27,392,691
1
0
0
I am currently writing a fsm editor with tkinter. But, I stuck on connecting two states. I have two questions: 1) How can make the transition arrow growable according to mouse movement? 2) How can I stick the starting point of the arrow on a state and the end point of the arrow on another state? PS. Do you think the documentation of tkinter is good enough?
false
1,996,377
0.291313
0
0
3
Tkinter is perfectly fine for this sort of application. In the past I've worked on tools that were boxes connected with arrows that stayed connected as you move the boxes around (which is what I think you are asking about). Don't let people who don't know much about Tkinter sway you -- it's a perfectly fine toolkit and the canvas is very flexible. The solution to your problem is simple math. You merely need to compute the coordinates of the edges or corners of boxes to know where to anchor your arrows. To make it "grow" as you say, simply make a binding on mouse movements and update the coordinates appropriately. To make the line growable all you have to do is adjust the coordinates of the line each time the mouse moves. The easiest thing to do is make liberal use of canvas tags. With the tags you can know which arrows connect to which boxes so that when you move the box you adjust the coordinates of any arrows that point to or from it.
0
2,543
0
3
2010-01-03T21:25:00.000
python,tkinter,fsm
How to connect two state circles with an arrow in tkinter?
0
1
2
1,997,043
1
0
0
Can anyone tell me why my app quits with: pygame error: display Surface quit.
false
1,997,710
0.088656
0
0
4
Replace if event.type == pygame.quit(): by if event.type == pygame.QUIT:
0
28,022
0
8
2010-01-04T05:49:00.000
python,pygame
Pygame error: display surface quit: Why?
0
3
9
52,403,647
1
0
0
Can anyone tell me why my app quits with: pygame error: display Surface quit.
false
1,997,710
0.044415
0
0
2
Make sure if you write pygame.QUIT: and not pygame.quit(): I know it sounds weird, but I had the same problem.
0
28,022
0
8
2010-01-04T05:49:00.000
python,pygame
Pygame error: display surface quit: Why?
0
3
9
59,687,711
1
0
0
Can anyone tell me why my app quits with: pygame error: display Surface quit.
false
1,997,710
1
0
0
11
I had similar problem and discovered that Surface objects don't like to be deepcopied. When I used copy.deepcopy() on such object and then accessed the copy, I got that strange error message (without calling pygame.quit()). Maybe you experience similar behavior?
0
28,022
0
8
2010-01-04T05:49:00.000
python,pygame
Pygame error: display surface quit: Why?
0
3
9
4,317,744
1
0
0
I have a wxPython application that uses pyinotify (via ThreadedNotifier) to check when a certain file gets modified. When this happens, the application stops watching the file and does some stuff. Everything works fine, except that often the call to ThreadedNotifier.stop() takes a noticeable time, about 4 seconds... Other times, it exits immediately. Anyone else experienced this? Is this expected? (Xubuntu 9.04)
true
2,005,443
1.2
0
0
1
Could it be that it is a polling mechanism with a timeout of about 4 seconds? And that the thread is only really stopped when it is entering the run() stage? That might have something to do with the threading library. You could test that by using a notifier with a different timeout.
0
408
0
0
2010-01-05T10:46:00.000
python,inotify,pyinotify
Slow pyinotify.ThreadedNotifier.stop()
0
1
1
2,005,571
1
0
0
I'm working on a project that has a glade GUI. I need the main window to have 2 section, divided by a gtk.Hpaned widget (horizontal panes). The left pane would have a tool-bar like layout of buttons, maybe 3 or more. What I need is a way to create different windows and display them on the right pane of the main window. This way, when I click button 1, subwindow1 will appear in the right pane. Click button2, subwindow2 will appear on the right pane. Instead of having windows pop-up left and right, I want to reparent them to the right pane of this gtk.Hpaned widged. How do you do this in python with pygtk?
false
2,007,299
0
0
0
0
Instead of creating windows you could put a notebook in the right pane. Then create all the previous windows as pages. Click on the button can then show the appropriate page in the notebook.
0
1,643
0
2
2010-01-05T16:09:00.000
python,pygtk
pygtk: cannot set parent on toplevel widget
0
1
3
2,016,770
1
0
0
I'm trying to make a cherrypy application with a wxpython ui. The problem is both libraries use closed loop event handlers. Is there a way for this to work? If I have the wx ui start cherrypy is that going to lock up the ui?
false
2,022,376
0.049958
0
0
1
One way to decouple them would be to start them up as two separate processes and have them communicate via some kind of IPC mechanism. You might have to write a small adaptor to have them speak a common protocol. Since you're doing CherryPy, you might also be able to expose a control interface via HTTP which the wx GUI can use to drive your server.
1
1,519
0
7
2010-01-07T17:48:00.000
python,wxpython,cherrypy
cherrypy and wxpython
0
1
4
2,022,467
1
0
0
I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?
true
2,028,025
1.2
0
0
2
So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k. PIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI. That's where the widgets toolkits come in: You would have to pick a toolkit platform that can offer you buttons, images, load and save the image files, maybe some specialzed widgets you can use to create your color swatches, etc. both GTK+ and QT4.5 have a liberal license, are very complete and very unpythonic on their use :-( (While you are at it, when using these libraries and toolkits our app can easily be multiplatform: you don't have to make it windows specific, it is equally easy to create an app that will run on Windows, Linux and Mac using python and either GTK+ or Qt4) One thing I would suggest is for you to learn to proper use GIMP: it is an Image editor, and certainly it will lack a lot of tools you are needing for sprites: but you can expand it's capabilities with Python plug-ins. On the other hand GIMP does have thousands of features that you'd no longer will need to create for your stand-alone app. (think on layer support, color filters, image rotation etc...) Check around on how to install GIMP with Python support on Windows, then spend some hours learning the app, with some book-like text around preferably so you can find the hidden features. Ah, ok, finally: If you want a very simple thing, just for the taste of "i did it" - you can use Pygame: You have to do all the drawing on the window, including text - but have straighter access to pixels, colors, mouse clicks and coordinates than with GTK+ or Qt, in a sense it would be a lot less of overhead for you to learn in terms of API's and internal working.
1
8,722
0
6
2010-01-08T14:01:00.000
python,image-editor
Creating an image editing application in Python
0
2
4
2,029,356
1
0
0
I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?
false
2,028,025
1
0
0
6
You just need a gui toolkit (gtk, qt, wx) a image library (PIL) and 500 hours of free time ...
1
8,722
0
6
2010-01-08T14:01:00.000
python,image-editor
Creating an image editing application in Python
0
2
4
2,028,056
1
0
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
false
2,034,932
0
0
0
0
A project I wish someone would write: a friendly GUI that wraps around the scanner library and the PDF library, and lets the user easily scan and file documents. It would have a toolbar with big buttons: "scan letter", "scan brochure", "scan photo". These would respectively choose high-resolution black-and-white, medium-resolution color, and high-resolution color. The user would plop down the document and hit one of those buttons. Python would wake up the scanner and have it scan, and then would use Python Image Library or something to auto-detect the size of the actual scanned document and auto-crop down to minimal size. For "scan photo" you would get a JPEG. For the others, you would get a PDF. And it would have an option where you could scan several pages and then select the scanned pages, and say "group" and it would make a single PDF out of them. Other useful toolbar buttons would be: "Copy Letter", "Copy Brochure", "Copy Photo". These would scan and then immediately print on an appropriate output device (or just on the default output device for your first version). If you want to go crazy, you could add an OCR function to try to recover searchable text from the scanned images, and put that in the PDF as tags or something. Someday I will write this if nobody else does...
0
44,661
0
7
2010-01-09T21:00:00.000
python
What are some good projects to make for a newbie Python (but not new to programming) developer?
0
4
9
2,035,429
1
0
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
false
2,034,932
0.066568
0
0
3
Do the next project you intended to program with your prefered language with Python.
0
44,661
0
7
2010-01-09T21:00:00.000
python
What are some good projects to make for a newbie Python (but not new to programming) developer?
0
4
9
2,035,296
1
0
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
false
2,034,932
0.022219
0
0
1
Write a simple Text Editor. That was one of the projects i started when i first learned python. It gets you used to the GUI framework, file IO, many types, OOP, lots... It's something that you can grow over time as your confidence builds and it's cross platform so it's handy.
0
44,661
0
7
2010-01-09T21:00:00.000
python
What are some good projects to make for a newbie Python (but not new to programming) developer?
0
4
9
2,035,019
1
0
0
I'm downloading Python 3.1.1 and that comes with the IDLE correct? I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python. What projects should I try to make in order to grasp some of the goodies Python brings to the table? Thanks a bunch SO.
false
2,034,932
0.022219
0
0
1
If you are new to python, why not start with some simpler command line projects? I know you said you are not new to development, but maybe you should spend some time with the core python stuff before tacking on a GUI framework. Just a suggestion. Also, I would point out that Python 3+ code looks a bit different than a lot of the python 2.x code samples you will see around the internet. I have found Python 3 to be not the best in terms of backward compatibility. You might want to start out with a 2.x version of Python to get the most out of the plethora of Python tutorials on the internet, then move to Python 3 if you need it.
0
44,661
0
7
2010-01-09T21:00:00.000
python
What are some good projects to make for a newbie Python (but not new to programming) developer?
0
4
9
2,034,997
1
0
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
false
2,035,249
0.16514
0
0
5
As other posters mentioned, the key issue is making sure you never touch a different non-Qt non-cross-platform API. Or really even a different non-Qt crossplatform API, if you use Qt you kind of need to commit to it, it's a comprehensive framework and for the most part sticking with Qt is easier than going to anything else. There's some nice advantages as the basic primitives in your program will work the same way all over the place. (i.e. a QString in your networking code will be the same as a QString in your interface code.) Portability-wise, if you stay within the API Qt provides you, it should work on multiple platforms. There will be areas where you may need to call some Qt functions which provide specific cross-platform tweaks more important to some platforms than others (e.g. dock icons) and you won't immediately have a polished application on all three platforms. But in general, you should remain very close to an application that compiles and runs on all three. (Try to use qmake or a similar build system too, as the build process for Qt applications varies depending on the platform. Different flags, etc.) There's some odd issues that come up when you mix Qt with other APIs like OpenGL, in particular the way windows locks GL contexts differs from the way OS X and Linux does, so if you intend to use OpenGL with multiple threads, try to periodically compile on the other platforms to make sure nothing is completely busted. This will also quickly point out areas where you might have inadvertently used a non-cross-platform system API. I've used Qt with a team to build a multi-threaded 3-d multiplayer real-time networked game (read: non-trivial application that fully utilized many many areas of Qt) and we were nothing but blown away by the effectiveness of Qt's ability to support multiple platforms. (We developed on OS X while targeting Windows and I regularly made sure it still ran on Linux as well.) We encountered only a few platform specific bugs, almost all of which arose from the use of non-Qt APIs such as OpenGL. (Which should really tell you something, that OpenGL was more of a struggle to use cross platform than Qt was.) At the end of the experience we were pleased at how little time we needed to spend dealing with platform-specific bugs. It was surprising how well we could make a GUI app for windows given almost none of the team actually used it as a primary development platform through the project. But do test early and often. I don't think your approach of writing an entire application and then testing is a good idea. It's possible with Qt, but unlikely if you don't have experience writing portable code and/or are new to Qt.
0
1,271
1
5
2010-01-09T22:40:00.000
python,qt,cross-platform
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
5
6
2,040,550
1
0
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
false
2,035,249
0.033321
0
0
1
Generally - as long as you don't use code that is not covered by Qt classes - yes. I have several time just recompiled applications I wrote in Linux(64bit) under Windows, and the other way arround. It works for me every time. Depends on your needs, you might also find compiler problems, but I am sure you will know how to work around them. Other people mentioned some issues you should look for, just read the other posts in the question.
0
1,271
1
5
2010-01-09T22:40:00.000
python,qt,cross-platform
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
5
6
2,035,284
1
0
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
false
2,035,249
0
0
0
0
It might run well, but it will take some testing, and of course Qt only handles the GUI portability, not the myriad of other things that might cause portability problems. Qt apps generally don't fit in very well on MacOS because they don't have Applescript support by default and don't necessarily have the right keybindings. But if you do the work to fix those issues, they work, but not nicely. On the Mac, it's far better to build a native UI. If this is an in-house app, Qt is probably OK, but if it's for sale, you won't make many sales and will create yourself some support hassles.
0
1,271
1
5
2010-01-09T22:40:00.000
python,qt,cross-platform
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
5
6
2,035,265
1
0
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
true
2,035,249
1.2
0
0
8
Yes. No. Maybe. See also: Java and "write once, run anywhere". Filesystem layout, external utilities, anything you might do with things like dock icons, character encoding behaviors, these and more are areas you might run into some trouble. Using Qt and Python, and strenuously avoiding anything that seems tied to Windows-specific libraries or behaviors whenever possible will make running the application on Mac and Linux much easier, but for any non-trivial application, the first time someone tries it, it will blow up in their face. But through careful choice of frameworks and libraries, making the application work cross-platform will be much more like bug fixing than traditional "porting".
0
1,271
1
5
2010-01-09T22:40:00.000
python,qt,cross-platform
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
5
6
2,035,272
1
0
0
I'm under the impressions that Python runs in the Triforce smoothly. A program that runs in Windows will run in Linux. Is this sentiment correct? Having said that, if I create my application in QT For Windows, will it run flawlessly in Linux/Mac as well? Thanks.
false
2,035,249
0
0
0
0
As the others said, everything which is done using Qt-Functionality will most likely run quite flawlessly, WHEN you dont use platform specific functionality of qt. There isnt that much (most of it has to do with window-manager stuff) , but some things might not work on other systems. But such things are surely mentiond in the documentation of Qt. Still there are things which cant be done using Qt, so you will have to do that yourself using plain Python... Yeah "Python" itself is platform-independent (well it should), but there are lots of other things involved ... well mainly the OS. And how the OS reacts you will plainly have to findout yourself by testing the application on all target OS. Recently i wrote an quite simple GUI-application, while it ran flawlessy on Windows, it didnt run on Linux, because on Linux Python interpreted files encoded in unicode differently than on Windows. Additionally a small script which should return the hostname of the machine, which it did on Windows, only returned "localhost" on Linux, which was obviously not what i wanted.
0
1,271
1
5
2010-01-09T22:40:00.000
python,qt,cross-platform
If I use QT For Windows, will my application run great on Linux/Mac/Windows?
0
5
6
2,035,601
1
0
0
I try to explain the situation: I have a QT application written in C++ and QT. This QT application starts a separate console C++ application that runs in the background. These two communicate using perhaps sockets, don't know yet. Console C++ application needs to start and stop my gnuradio python script. Also it needs to send parameters to it. Once started, this gnuradio script runs independedly in infinite loop sending information to either the console or the QT application using sockets perhaps. My console application needs to stop this gnuradio script from running when the order is given by the QT application. The question is how can I stop this separate python script from my C++ console application ? Also is there anything I could do to make this more simple ? Regards, Spitz
false
2,040,769
0.132549
0
0
2
Spawn python script as a new process using fork() and execv(). execv() (or any other function of the exec family) lets you pass arguments to the Python script. Use the child process ID to send a kill signal when you are done with the Python script.
0
903
0
3
2010-01-11T09:05:00.000
c++,python,qt,gnuradio
Best way to start, stop and send parameters to separate Python script from C++ application?
0
1
3
2,040,813
1
0
0
Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error. Inspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i have a hunch that OCC only likes 32bit numbers still. So my question is, is there any way to control the range of the winId that Qt return? Thanks Henrik
false
2,053,949
0
0
0
0
Looking in Qt's source code, in the file src/gui/kernel/qwindowdefs.h, you'll find that WId is typedef'd to long for 64-bits OSX (it's int for 32-bits OSX). A long on 64-bits OSX is 8 bytes long (or 64 bits), and therefore 4318283408 is a valid value. If you want to force winId() to return a 32 bits value, you will need to link to a 32-bits version of the Qt's library.
0
394
0
0
2010-01-13T02:16:00.000
python,qt,pyqt4
Qt winId() forcing 32bit values
0
1
1
2,060,398
1
0
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences? I know this has been asked before, but I want to revive the conversation.
true
2,058,492
1.2
0
0
8
We were recently thinking about using PySide, but we haven't found any information about whether it is supported by py2exe. That's why we kept to PyQt. If you need to develop for Windows, it's safer to use good ol' PyQt :-)
0
9,387
0
18
2010-01-13T16:45:00.000
c++,python,qt,pyqt,pyside
PyQt vs PySide comparison
0
3
3
2,058,512
1
0
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences? I know this has been asked before, but I want to revive the conversation.
false
2,058,492
-0.066568
0
0
-1
PySide currently does not run on Windows, which limits your capability. If you were developing on Linux and needed to avoid pure GPL, then PySide is a candidate. From an API standpoint, I find the signal/slots capability feels more "Pythonic".
0
9,387
0
18
2010-01-13T16:45:00.000
c++,python,qt,pyqt,pyside
PyQt vs PySide comparison
0
3
3
2,058,548
1
0
0
I currently develop many applications in a Qt heavy C++/Python environment on Linux, porting to PC/Mac as needed. I use Python embedded in C++ as well as in a stand alone GUI. Qt is used fro xml parsing/event handling/GUI/threading and much more. Right now all my Python work is in PyQt and I wanted to see how everyone views PySide. I'm interested because it is in house and as such should support more components with hopefully better integration. What are your experiences? I know this has been asked before, but I want to revive the conversation.
false
2,058,492
0
0
0
0
As of PySide 1.0 beta (Qt 4.7.1), there is an official Windows installer that works. It doesn't include QtDesigner and other tools, only uic.
0
9,387
0
18
2010-01-13T16:45:00.000
c++,python,qt,pyqt,pyside
PyQt vs PySide comparison
0
3
3
4,828,827
1
0
0
I am using PyGTK to build a GUI application. I want to update the textview widget from another thread but the widget is not getting updated everytime i try an update. What should i do to get a reliable GUI updating?
false
2,066,767
-0.049958
0
0
-1
the same may be achieved using gobject.idle_add method whose syntax is same as above,you have to import the module gobject
0
3,639
0
8
2010-01-14T19:04:00.000
python,multithreading,pygtk
GUI not updated from another thread when using PyGtk
0
2
4
2,069,788
1
0
0
I am using PyGTK to build a GUI application. I want to update the textview widget from another thread but the widget is not getting updated everytime i try an update. What should i do to get a reliable GUI updating?
false
2,066,767
-0.049958
0
0
-1
What Johannes said is correct, however since GTK is a wrapper for the glib and gobject things, you would actually want to use gtk.idle_add(). No need for the unnecessary imports.
0
3,639
0
8
2010-01-14T19:04:00.000
python,multithreading,pygtk
GUI not updated from another thread when using PyGtk
0
2
4
3,030,804
1
0
0
I don't know if this is a stupid question, but is there any way to not show focus in wxPython? For example, I built a simple GUI with a few buttons and I don't want the dotted rectangle to show up on the button I have just clicked. If I remember correctly in Excel VBA you could just set TakeFocusOnClick tag to False. What would be the equivalent in wxPython?
false
2,069,739
0
0
0
0
You could also give the focus to another control in your event handler for the buttons. Just call the SetFocus() method on any other control. This might make your application more usable as a side effect if you for example return focus to a text field that is likely to be typed in next.
0
197
0
0
2010-01-15T05:46:00.000
wxpython,focus
Not showing focus in wxPython?
0
1
2
2,135,083
1
0
0
I have a wxPython window. How can I check its event handler table? (i.e. which handler is handling each event.)
true
2,088,175
1.2
0
0
1
Even though you got your answer from the mailing list, we may as well replicate the answer here: Robin Dunn wrote: There isn't a way to access the event table currently, although I've often thought that it would be a good idea. Shame.
0
230
0
1
2010-01-18T18:13:00.000
event-handling,wxpython,wxwidgets
Listing the event handlers for a wxPython window
0
1
1
2,097,941
1
1
0
We embed ironpython in our app sob that scripts can be executed in the context of our application. I use Python.CreateEngine() and ScriptScope.Execute() to execute python scripts. We have out own editor(written in C#) that can load ironpython scripts and run it. There are 2 problems I need to solve. If I have a print statement in ironpython script, how can i show it my editor(how will I tell python engine to redirect output to some handler in my C# code) I plan to use unittest.py for running unittest. When I run the following runner = unittest.TextTestRunner() runner.run(testsuite) the output is redirected to standard output but need a way for it to be redirected to my C# editor output window so that user can see the results. This question might be related to 1 Any help is appreciated G
false
2,089,998
1
1
0
6
You can provide a custom Stream or TextWriter which will be used for all output. You can provide those by using one of the ScriptRuntime.IO.SetOutput overloads. Your implementation of Stream or TextWriter should receive the strings and then output them to your editor window (potentially marshalling back onto the UI thread if you're running the script on a 2ndary execution thread).
0
4,586
0
4
2010-01-18T23:31:00.000
ironpython
Streaming Ironpython output to my editor
0
1
3
2,090,745
1
0
0
In a game that I am writing, I use a 2D vector class which I have written to handle the speeds of the objects. This is called a large number of times every frame as there are a lot of objects on the screen, so any increase I can make in its speed will be useful. It is pretty simple, consisting mostly of wrappers to the related math functions. It would be quite trivial to rewrite in C, but I am not sure whether doing so will make any significant difference as all it really does is call the underlying math functions, add, multiply or divide. So, my question is under what circumstances does it make sense to rewrite in C? Where will you see a significant speed boost, and where can you see a reasonable speed boost without rewriting an extensive amount of the program?
false
2,096,334
1
1
0
9
First measure then optimize
1
429
0
4
2010-01-19T19:19:00.000
python,c,optimization
When Does It Make Sense To Rewrite A Python Module in C?
0
1
5
2,096,358
1
0
0
I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app. I'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external "agents"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? Also, are there any other interpreted languages I can use other than Python?
false
2,103,728
0
1
0
0
you could probably create an embedded language using C++ templates and operator overloading, see for example ublas or ftensor matrix languages. i do not think python or other interpreted languages of is suitable for having numbercrunching/data processing.
0
2,474
0
7
2010-01-20T18:04:00.000
c++,python,perl,performance,lua
Selecting An Embedded Language
0
3
7
2,103,784
1
0
0
I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app. I'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external "agents"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? Also, are there any other interpreted languages I can use other than Python?
false
2,103,728
0.028564
1
0
1
For millions of calls (from I'm assuming c++, because you mentioned boost) into python, yes: you will notice a performance hit. This may or may not be significant - perhaps the speed gain of trying out new 'agents' would be greater than the hit. Python does have fast numerical libraries (such as numpy) that might help, but you'll still incur overhead of marshalling data, calling into python, the gil, etc. Yes, you can embed many other languages: check out lua. Also, check out swig.org, which can connect to many other languages besides python.
0
2,474
0
7
2010-01-20T18:04:00.000
c++,python,perl,performance,lua
Selecting An Embedded Language
0
3
7
2,103,831
1
0
0
I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app. I'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external "agents"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable? Also, are there any other interpreted languages I can use other than Python?
false
2,103,728
0.141893
1
0
5
Tcl was designed from the ground up to be an embedded language.
0
2,474
0
7
2010-01-20T18:04:00.000
c++,python,perl,performance,lua
Selecting An Embedded Language
0
3
7
2,104,152
1
0
0
I successfully installed PyQt in both mac and PC. To do so I had to install mingw (on PC), Xcode (on MAC) and Qt4.6 library. Now that I have PyQt working perfectly, I would like to uninstall mingw, Xcode and Qt Library from both mac and PC. I know I can remove Xcode and mingw, but what care should I take before removing Qt library. I know PyQt is still using it but it is not using whole 1.5Gig of files installed by Qt installer. So which files should I copy before removing Qt and where should I copy it to.
true
2,106,178
1.2
0
0
1
You can remove the demos and examples directories inside your qt installation directory... they take up over 1GB of space and are not required. I would leave the rest there, unless you are really worried about space. If you do try to clean up the QT installation directory, start by renaming larger files/directories (e.g. add a .old suffix to the name), and see if the features you use in QT still function. If it breaks, just rename the files/directories back (remove .old).
1
148
0
3
2010-01-21T00:50:00.000
python,pyqt4
PyQt post installation question
0
1
1
2,184,315
1
0
0
I'm writing an application working with plugins. There are two types of plugins: Engine and Model. Engine objects have an update() method that call the Model.velocity() method. For performance reasons these methods are allowed to be written in C. This means that sometimes they will be written in Python and sometimes written in C. The problem is that this forces to do an expensive Python function call of Model.velocity() in Engine.update() (and also reacquiring the GIL). I thought about adding something like Model.get_velocity_c_func() to the API, that would allow Model implementations to return a pointer to the C version of their velocity() method if available, making possible for Engine to do a faster C function call. What data type should I use to pass the function pointer ? And is this a good design at all, maybe there is an easier way ?
true
2,106,324
1.2
1
0
1
The CObject (PyCOBject) data type exists for this purpose. It holds a void*, but you can store any data you wish. You do have to be careful not to pass the wrong CObject to the wrong functions, as some other library's CObjects will look just like your own. If you want more type security, you could easily roll your own PyType for this; all it has to do, after all, is contain a pointer of the right type.
0
366
0
0
2010-01-21T01:29:00.000
python,c,function-pointers
Passing C function pointers between two python modules
0
1
1
2,106,391
1
0
0
In the 'old days' when there was just cpython, most extensions were written in c (as platform independent as possible) and compiled into pyd's (think PyCrypto for example). Now there is Jython, IronPython and PyPy and the pyd’s do not work with any of them (Ironclad aside). It seems they all support ctypes and that the best approach MIGHT be to create a platform independent dll or shared library and then use ctypes to interface to it. But I think this approach will be a bit slower than the old fashion pyd approach. You could also program a pyd for cpython, a similar c# dll for IronPython and a java class or jar for Jython (I'm not sure about PyPy. But while this approach will appeal to platform purists it is very labor intensive. So what is the best route to take today?
false
2,114,627
0.099668
1
0
1
If you're wrapping an existing native library, the ctypes is absolutely the way to go. If you're trying to speed up the hot spots in a Python extension, then making a custom extension for each interpreter (and a pure-Python fallback) is tractable because the bulk of the code is pure Python that can be shared, but undesirable and labour-intensive, as you said. You could use ctypes in this case as well.
0
501
0
4
2010-01-22T02:44:00.000
python,ironpython,jython
Python extensions that can be used in all varieties of python (jython / IronPython / etc.)
0
2
2
2,119,710
1
0
0
In the 'old days' when there was just cpython, most extensions were written in c (as platform independent as possible) and compiled into pyd's (think PyCrypto for example). Now there is Jython, IronPython and PyPy and the pyd’s do not work with any of them (Ironclad aside). It seems they all support ctypes and that the best approach MIGHT be to create a platform independent dll or shared library and then use ctypes to interface to it. But I think this approach will be a bit slower than the old fashion pyd approach. You could also program a pyd for cpython, a similar c# dll for IronPython and a java class or jar for Jython (I'm not sure about PyPy. But while this approach will appeal to platform purists it is very labor intensive. So what is the best route to take today?
true
2,114,627
1.2
1
0
2
Currently, it seems the ctypes is indeed the best approach. It works today, and it's so convenient that it's gonna conquer (most of) the world. For performance-critical APIs (such as numpy), ctypes is indeed problematic. The cleanest approach would probably be to port Cython to produce native IronPython / Jython / PyPy extensions. I recall that PyPy had plans to compile ctypes code to efficient wrappers, but as far as I google, there is nothing like that yet...
0
501
0
4
2010-01-22T02:44:00.000
python,ironpython,jython
Python extensions that can be used in all varieties of python (jython / IronPython / etc.)
0
2
2
2,116,557
1
0
0
I am attempting to create my first OS-level GUI using wxPython. I have the book wxPython in Action and have looked at the code demos. I have no experience with event-driven programming (aside from some Javascript), sizers, and all of the typical GUI elements. The book is organized a little strangely and assumes I know far more about OS GUI programming than I actually do. I'm fairly recent to object-oriented programming, as well. I'm aware that I am clearly out of my depth. My application, on the GUI side, is simple: mostly a set of reminder screens ("Turn on the scanner," "Turn on the printer," etc) and background actions in Python either in the filesystem or from hitting a web service, but it is just complex enough that the Wizard class does not quite seem to cover it. I have to change the names on the "Back" and "Next" buttons, disable them at times, and so forth. What is the standard process for an application such as mine? 1) Create a single wxFrame, then put all of my wxPanels inside of it, hiding all but one, then performing a sequence of hides and shows as the "Next" button (or the current equivalent) are triggered? 2) Create multiple wxFrames, with one wxPanel in each, then switch between them? 3) Some non-obvious fashion of changing the names of the buttons in wxWizard and disabling them? 4) Something I have not anticipated in the three categories above.
true
2,119,067
1.2
0
0
1
I don't have a good understanding of your application, but trying to force wxWizard to suit your needs sounds like a bad idea. I suggest checking out the Demos available from the wxPython website. Go through each demo and I bet you'll find one that suits your needs. I've personally never used wxWizard as I find it too cumbersome. Instead, I create a sequence of dialogs that do what I need.
0
290
0
3
2010-01-22T17:16:00.000
python,wxpython
In wxPython, What is the Standard Process of Making an Application Slightly More Complex Than a Wizard?
0
1
1
2,120,967
1
0
0
I am looking for a way to lock the window. I found window.set_resizable(False), but that resizes the window to its requested size and then locks it. I would like to be able to resize my window, and then lock it into the size I have resized it to.
true
2,124,296
1.2
0
0
3
Perhaps you could set_size_request() with the current window size (from window_get_size()) before you call set_resizable()?
0
1,153
0
0
2010-01-23T18:58:00.000
python,gtk,window,pygtk,resizable
PyGTK, how can I lock a window so it cannot be resized?
0
2
2
2,124,325
1
0
0
I am looking for a way to lock the window. I found window.set_resizable(False), but that resizes the window to its requested size and then locks it. I would like to be able to resize my window, and then lock it into the size I have resized it to.
false
2,124,296
0
0
0
0
You can use this: window.set_geometry_hints(window, min_width, min_height, max_width, max_height)
0
1,153
0
0
2010-01-23T18:58:00.000
python,gtk,window,pygtk,resizable
PyGTK, how can I lock a window so it cannot be resized?
0
2
2
15,961,711
1
0
0
I'm using Pygame/SDL's joystick module to get input from a gamepad. Every time I call its get_hat() method it prints to the console. This is problematic since I use the console to help me debug and now it gets flooded with SDL_JoystickGetHat value:0: 60 times every second. Is there a way I can disable this? Either through an option in Pygame/SDL or suppress console output while the function calls? I saw no mention of this in the Pygame documentation. edit: This turns out to be due to debugging being turned on when the SDL library was compiled.
false
2,125,702
0.049958
0
0
2
I use pythonw.exe (on Windows) instead of python.exe. In other OSes, you could also redirect output to /dev/nul. And in order to still see my debug output, I am using the logging module.
1
97,342
0
47
2010-01-24T02:43:00.000
python,sdl,pygame
How to suppress console output in Python?
0
1
8
5,063,983
1
0
0
I have a application written in PyGtk. I need to convert a particular line number into its corresponding window co-ordinates in a GtkTextView. How can this be done?
false
2,137,517
0
0
0
0
It can't be done, in general. If you're talking about a line of your pygtk program, then you would need an API for your IDE (development environment) to find out where a particular source code line is currently displayed on the screen, if anywhere. If by "line number" you mean something else, then as Ignacio says, you'll need to provide a lot more detail.
0
131
0
0
2010-01-26T04:26:00.000
python,pygtk,gtk
Convert Line Number Into its corresponding co-ordinates
0
1
2
2,137,653
1
0
0
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Designer, Assistant and Linguist run fine. I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed. Edit: I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
false
2,140,836
0.024995
0
0
1
PyQt installation also depends on the version of python installed on your platform.Python3.+ is incompatible with Python version < 3.x. I was facing the same problem as I have Python 2.7 installed on my machine but I downloaded the latest binary which was PyQt-Py3.2-x86-gpl-4.9.exe. If you see here the binary has python version also mentioned in name after PyQt which is Py3.2. I uninstalled PyQt and installed PyQt-Py2.7-x86-gpl-4.9.exe which points to Python 2.7 and it fixed the problem. Probably they could have mentioned the naming convention online or in some documentation to be more simpler.
1
24,135
0
11
2010-01-26T16:33:00.000
python,windows,pyqt,importerror
PyQt 4.7 - ImportError after installing on Windows
0
5
8
10,279,385
1
0
0
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Designer, Assistant and Linguist run fine. I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed. Edit: I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
false
2,140,836
0.049958
0
0
2
Just wanted to chime in that I had the same problem on a WinXP install of: python 2.7 Qt 4.7.1 (10.05) PyQt 4.8.1 I used the windows installer version of all 3 of those items. Copying the contents of the C:\Python27\Lib\site-packages\PyQt4\bin folder up to the main PyQt folder (C:\Python27\Lib\site-packages\PyQt4) stopped the 'dll not found' errors that python was throwing.
1
24,135
0
11
2010-01-26T16:33:00.000
python,windows,pyqt,importerror
PyQt 4.7 - ImportError after installing on Windows
0
5
8
4,452,810
1
0
0
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Designer, Assistant and Linguist run fine. I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed. Edit: I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
false
2,140,836
0
0
0
0
I think there are at least two possible error conditions 1. ImportError: DLL load failed: The specified module could not be found. then you have to check your PyQT version is comptible with your python. In other words, if you use python 3.3, then you can only use PyQT for python3.3 and python 3.3 will not work with PyQT for python3.4 This was the problem I met. I solved it with re-install it 2. Import Error: DLL load failed: %1 then something strange on a different encoding Win32. then it would be a OS problem. If you use 32bit Python then you have to use 32bit PyQt, so do 64bit
1
24,135
0
11
2010-01-26T16:33:00.000
python,windows,pyqt,importerror
PyQt 4.7 - ImportError after installing on Windows
0
5
8
27,086,381
1
0
0
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Designer, Assistant and Linguist run fine. I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed. Edit: I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
false
2,140,836
0.024995
0
0
1
I had the same problem. I got my program running from within Eclipse but when I tried running it directly from the command line I still got the same error. I solved it by renaming the C:\Users\Me\AppData\Roaming\Python\Python27\site-packages\PyQt4 directory. (I'm guessing leftovers from a previous PyQt install) I am using ActivePython.
1
24,135
0
11
2010-01-26T16:33:00.000
python,windows,pyqt,importerror
PyQt 4.7 - ImportError after installing on Windows
0
5
8
11,774,820
1
0
0
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui. ImportError: DLL load failed: The specified module could not be found. I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there. I can't run any of the examples, but the Designer, Assistant and Linguist run fine. I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed. Edit: I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
false
2,140,836
0.024995
0
0
1
Also chiming in. I installed both python 2.6 and PyQt 4.8.3 on a Windows 7 machine using the windows installers (I did NOT run 'python setup.py install'). I tried to run spyder (which requires PyQt 4.4 or greater) and failed because it couldn't find the PyQt .dlls. I copied all the .dlls from the \Lib\site-packages\PyQt4\bin folder to the \Lib\site-packages\PyQt4 folder, and spyder launches just fine.
1
24,135
0
11
2010-01-26T16:33:00.000
python,windows,pyqt,importerror
PyQt 4.7 - ImportError after installing on Windows
0
5
8
5,795,870
1
0
0
How can I convert a .wav file to some other format such as .mp3 in pygame? Update: Why not Gstreamer or Pygame: I want to use native Windows environment to install a package that can do this (i.e. don't want to install cygwin). I am searching for a package which has a binary installer available for windows (with Python 2.6) or atleast where I can do "python setup.py install" without a need to install any dependencies.
false
2,141,315
-0.197375
0
0
-2
Pygame is an SDL wrapper. Not a multimedia framework. Why do you want to do audio format conversions in Pygame? Can't you use something else like maybe the gstreamer bindings for Python?
1
410
0
3
2010-01-26T17:39:00.000
python,pygame
pygame saving audio files
0
1
2
2,141,369
1
0
0
I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and random.setstate() and neither seem to reliably reproduce results. Oddly, I'll sometimes get the same level a few times in a row if I reuse a seed, but it's never completely 100% reliable. Should I just save the level normally (as a file containing its information)? Edit: Thanks for the help everyone. It turns out that my problem came from the fact that I was randomly selecting sprites from groups in Pygame, which are retrieved in unordered dictionary views. I altered my code to avoid using Pygame's sprite groups for that part and it works perfectly now.
false
2,143,463
0
0
0
0
At the point when you want another level, you should initially create another levelRandom object, and give that object to a level-generator to produce the level (if you are using one)
0
2,510
0
4
2010-01-26T23:19:00.000
python,random,pygame
What's the easiest way to reproduce a randomly generated level in Python?
0
2
4
64,776,255
1
0
0
I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and random.setstate() and neither seem to reliably reproduce results. Oddly, I'll sometimes get the same level a few times in a row if I reuse a seed, but it's never completely 100% reliable. Should I just save the level normally (as a file containing its information)? Edit: Thanks for the help everyone. It turns out that my problem came from the fact that I was randomly selecting sprites from groups in Pygame, which are retrieved in unordered dictionary views. I altered my code to avoid using Pygame's sprite groups for that part and it works perfectly now.
false
2,143,463
0.049958
0
0
1
Best would be to create a levelRandom class with a data slot for every randomly produced result when generating a level. Then separate the random-generation code from the level-construction code. When you want a new level, first generate a new levelRandom object, then hand that object to the level-generator to produce your level. Later, to get the same level again, you can just reuse the levelRandom instance.
0
2,510
0
4
2010-01-26T23:19:00.000
python,random,pygame
What's the easiest way to reproduce a randomly generated level in Python?
0
2
4
2,143,490
1
0
0
Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems in it. When the user clicks one of the checkboxes the menu closes. I'd like for the user to be able to check a series of checkboxes without the menu closing each time. I've looked at using the activate callback to show the menu but this doesn't seem to work. Any suggestions?
false
2,150,899
-0.099668
0
0
-1
Try digging into source and it's documentation. I have found this to be the easiest way and best shortcut.
0
749
0
6
2010-01-27T22:46:00.000
python,menu,gtk,pygtk
Making a Python/GTK CheckMenuItem, when clicked, not close the menu
0
1
2
2,152,012
1
0
0
In my Python2_6/include directory is a folder with pygame headers. I assumed that my python C module can access pygame stuff directly in C. Is this the case? How do I integrate a C module that wants to use pygame, with a python script using pygame? Right now my brain sees: pygame <-- MyCModule <-- MyScript --> pygame ie. Two pygame instances. So is it possible to integrate them so that my module and my app use the same instance? Why are there pygame headers in my python include directory, can I use those somehow, for direct access? Thanks for any help.
false
2,171,746
0
0
0
0
I assumed that my python C module can access pygame stuff directly in C. Is this the case? No, that stuff is most likely just there because it was necessary to compile the pygame Python extension. I don't understand what you mean when you say you see 2 pygame instances. There are as many instances as you create, no more, no less. If you have script that creates pygame objects, and your extension also creates pygame objects, then of course you will have 2 sets of objects. As the writer of the application you need to decide which part of it will have responsibility for interfacing with pygame. If the other part requires access to those pygame objects, then you pass them in as arguments.
0
390
0
1
2010-01-31T13:07:00.000
python,module,pygame
Integrating pygame with a C module
0
1
2
2,176,010
1
0
0
I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own. My only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme. I really don't know where to start so any advice would be much appreciated, thanks :)
false
2,174,873
0
0
0
0
Just for the record, if you are going to create something similar to a gtk.Notebook, I'll recomment you to subclass gtk.Notebook to save a lot of work.
0
682
0
1
2010-02-01T05:43:00.000
python,coding-style,tabs,pygtk
PyGTK: How do I make a custom widget look like a gtk.Notebook tab?
0
2
2
2,786,548
1
0
0
I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own. My only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme. I really don't know where to start so any advice would be much appreciated, thanks :)
true
2,174,873
1.2
0
0
0
I solved the problem eventually by getting the colours from gtk.Notebook's style.
0
682
0
1
2010-02-01T05:43:00.000
python,coding-style,tabs,pygtk
PyGTK: How do I make a custom widget look like a gtk.Notebook tab?
0
2
2
2,212,682
1
0
0
I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this problem -- either a configuration change I can make in Eclipse or some addition I can make to the GUI code?
false
2,174,904
0
0
0
0
The best kludge I found was the Kubuntu global shortcut "Ctrl-Shift-Space". This moves a window to the other screen, mitigating the hassle of dragging with the mouse.
0
441
0
0
2010-02-01T05:50:00.000
python,eclipse,wxpython
Making wxPython GUI launch on a different screen from Eclipse
0
2
3
2,182,198
1
0
0
I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this problem -- either a configuration change I can make in Eclipse or some addition I can make to the GUI code?
true
2,174,904
1.2
0
0
0
Kludge #2: If I run the code from Eclipse on screen 2 then click someplace on screen 1 before the GUI appears, the GUI will appear on screen 1.
0
441
0
0
2010-02-01T05:50:00.000
python,eclipse,wxpython
Making wxPython GUI launch on a different screen from Eclipse
0
2
3
2,189,730
1
0
0
Often times when we're drawing a GUI, we want our GUI to update based on the data changing in our program. At the start of the program, let's say I've drawn my GUI based on my initial data. That data will be changing constantly, so how can I redraw my GUI constantly?
false
2,192,993
0
0
0
0
You could create a thread to update the GUI constantly, just pass to it references to the graphical widgets that need to be updated
1
1,096
0
1
2010-02-03T15:21:00.000
python,pyqt
How to start a "drawing loop" in PyQt?
0
1
2
2,193,028
1
0
0
QGraphicsView is often hooked up to a QGraphicsScene. What if I want to swap that QGraphicsScene for a new one? How can I accomplish this? Doing it right now is just drawing over the old one.
false
2,194,829
0
0
0
0
To swap the scene just call your view's setScene() again with a different QGraphicsScene object.
0
249
0
1
2010-02-03T19:31:00.000
python,pyqt
How to swap the QGraphicsScene from a QGraphicsView?
0
1
1
2,194,899
1
0
0
Is there a trick to sizing controls for wx.lib.CUstomTreeCtrl? I've been trying to create my own custom controls (just panels with sub-controls in them) and add them as items in my CustomTreeCtrl, but when the tree renders, it's as if the panels aren't expanded to the appropriate size. I can set the panel size manually by using SetSize() but if I do that, the tree doesn't seem to be aware of the size (the rows aren't scaled to the appropriate size) and the items are rendered on top of each other. I've tried to override DoGetBestSize() but it seems to not have any effect.
false
2,219,514
0
0
0
0
Can you put a self contained sample code and we can try to fix that. Have you tried adding custom items which return correct height for your panel?
0
143
0
0
2010-02-08T04:05:00.000
python,wxpython
Sizing controls for items in wx.lib.CustomTreeCtrl
0
1
1
2,309,469
1
0
0
I'm trying to write a small gui app in pygtk which needs an html-rendering widget. I'd like to be able to use it in a windows environment. Currently I'm using pywebkitgtk on my GNU/Linux system, and it works extremely well, but it seems it's not possible to use this on Windows at this time. Can anyone give me any suggestions on how to proceed? Do I need to work out how to embed IE using COM objects under Windows, and stick with pywebkitgtk on GNU/Linux? I'm at an early stage, and am prepared to jettison pygtk in favour of another toolkit, say pyqt, if it affords a simpler solution (though I'd sooner stick with pygtk if possible).
true
2,227,770
1.2
0
0
2
In my experience, having developed cross-platform applications with both PyQt and PyGTK, you should consider moving to PyQt. It comes with a browser widget by default which runs fine on all platforms, and support for non-Linux platforms is outstanding compared to PyGTK. For PyGTK, you will have to be prepared building PyGObject/PyCairo/PyGTK, or even the full stack, yourself on Windows and Mac OS X.
0
1,076
0
0
2010-02-09T08:48:00.000
python,cross-platform,pyqt,pygtk,html-rendering
cross-platform html widget for pygtk
0
1
2
2,227,957
1
0
0
I'm having a class library. I'm able to access that assembly from iron python console as normal. My goal is to create a Silverlight class library which uses a python script to access that WPF class library what I'm having. Is it possible? Is there any other way to achieve this or any work around. I can provide a sample of what I'm doing now, If more details are needed. Thanks
true
2,251,296
1.2
0
0
2
You will not be able to use the class library unless its code is compatible with Silverlight libraries and is re-compiled targeting the Silverlight ones.
1
433
0
1
2010-02-12T11:05:00.000
c#,silverlight,ironpython
How to access WPF class library from Silverlight using iron python. Is it possible?
0
1
1
2,253,386
1
0
0
I have a treeview and I am watching for the cursor-changed and row-activated signals. The problem is that in order to trigger the row-activate I first have to click on the row (triggering cursor-changed) and then do the double click, requiring 3 clicks. Is there a way to respond to both signals with 2 clicks?
false
2,256,794
0.291313
0
0
3
The cursor-changed signal is emitted even when single clicking on the same (selected) row. Still, the row-activated signal is emitted when you double click on a row, whether it was selected before the double click or not. Thus you don't need 3 clicks to trigger a row-activated. As Jon mentioned, you want to connect to the selection's changed signal in stead of cursor-changed.
0
3,862
0
1
2010-02-13T07:09:00.000
python,gtk,pygtk,gtktreeview
GtkTreeView's row-activated and cursor-changed signals
0
1
2
3,100,214
1
0
0
I am writing a timer program in Python using PyGTK. It is precise to the hundredths place. Right now, I am using a constantly updated label. This is a problem, because if I resize the window while the timer is running, Pango more often than not throws some crazy error and my program terminates. It's not always the same error, but different ones that I assume are some form of failed draw. Also, the label updates slower and slower as I increase the font size. So, I am wondering if there is a more correct way to display the timer. Is there a more stable method than constantly updating a label?
false
2,259,386
0.197375
0
0
2
Updating a label should work perfectly reliably, so I suspect you're doing something else wrong. Are you using threads? What does your code look like? How small can you condense your program (by removing functionality, not by obfuscating the code), without making the problem go away?
0
1,048
0
1
2010-02-13T22:41:00.000
python,gtk,pygtk,pango
How should I display a constantly updating timer using PyGTK?
0
1
2
2,259,437
1
0
0
I need to write a code that runs similar to normal calculators in such a way that it displays the first number I type in, when i press the operand, the entry widget still displays the first number, but when i press the numbers for my second number, the first one gets replaced. I'm not to the point in writing the whole code yet, but I'm stuck at the point where when I press the 2nd number(s), the first set gets replaced. I was thinking about if key == one of the operands, than I set the num on the entry as variable first, then I do ent.delete(0,end) to clear the screen and ent.insert(0,first) to display the first num in the entry widget. Now I don't know what to do to clear the entry widget when the 2nd number(s) is pressed.
true
2,264,371
1.2
0
0
2
What you need here is a concept of state. Each time a key is pressed, you check the state and determine what action to take. In the initial state, you take input of numbers. When an operand button is pressed, you store the operand, and change the state. When another number is pressed, you store the number, clear the numeric input, and start the number input again. Then when the equals button is pressed, you perform the operation, using your stored number and operand with the current number in the numeric input. Note that with a dynamic language like Python, instead of using a variable and if statements to check the state, you can just change the function that handles key/button pressed depending on what the state is.
1
1,214
0
1
2010-02-15T06:41:00.000
python,user-interface,calculator
Creating a GUI Calculator in python similar to MS Calculator
0
1
1
2,264,618
1
0
0
I'm working on a PyQt application. Currently, there's a status panel (defined as a QWidget) which contains a QHBoxLayout. This layout is frequently updated with QPushButtons created by another portion of the application. Whenever the buttons which appear need to change (which is rather frequently) an update effect gets called. The existing buttons are deleted from the layout (by calling layout.removeWidget(button) and then button.setParent(None)) and the new buttons are added to the layout. Generally, this works. But occasionally, when I call button.setParent(None) on the button to delete, it causes it to pop out of the application and start floating in its own stand-alone frame. How can I remove a button from the layout and ensure it doesn't start floating?
false
2,264,482
0.197375
0
0
2
Try calling QWidget::hide() on the button before removing from the layout if you don't want to delete your button.
0
304
0
3
2010-02-15T07:26:00.000
python,qt,qt4,pyqt,pyqt4
How do I prevent Qt buttons from appearing in a separate frame?
0
1
2
2,265,975
1
0
0
I would like to create an application that has 3-4 frames (or windows) where each frame is attached/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the edge of the screen where the frame is hidden, I would like it to come back into focus. The application is written in Python (using wxPython for the basic GUI aspects). Does anyone know how to do this in Python? I'm guessing it's probably OS dependent? If so, I'd like to focus on Windows first. I don't do GUI programming very often so my apologies if this makes no sense at all.
false
2,268,315
0
0
0
0
I think you could easily just make a window that is the same size as the desktop then do some while looping for an inactivity variable based on mouse position, then thread off a timer for loop for the 4 inactivity variables. I'd personally design it so that when they reach 0 from 15, they change size and position to become tabular and create a button on them to reactivate. lots of technical work on this one, but easily done if you figure it out
0
877
0
1
2010-02-15T19:11:00.000
python,animation,wxpython,mouseevent
Can you auto hide frames/dialogs using wxPython?
0
2
3
44,916,099
1
0
0
I would like to create an application that has 3-4 frames (or windows) where each frame is attached/positioned to a side of the screen (like a task bar). When a frame is inactive I would like it to auto hide (just like the Windows task bar does; or the dock in OSX). When I move my mouse pointer to the position on the edge of the screen where the frame is hidden, I would like it to come back into focus. The application is written in Python (using wxPython for the basic GUI aspects). Does anyone know how to do this in Python? I'm guessing it's probably OS dependent? If so, I'd like to focus on Windows first. I don't do GUI programming very often so my apologies if this makes no sense at all.
false
2,268,315
0
0
0
0
Personally, I would combine the EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW that FogleBird mentioned with a wx.Timer. Then whenever it the frame or dialog is inactive for x seconds, you would just call its Hide() method.
0
877
0
1
2010-02-15T19:11:00.000
python,animation,wxpython,mouseevent
Can you auto hide frames/dialogs using wxPython?
0
2
3
9,066,380
1
0
0
When starting up a new project, as a beginner, which would you use? For example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most/least hassle?
false
2,268,853
0.066568
0
0
1
If I understood your question correctly, updating the GUI has a little to do with the way you programmed it. From my experience, it's easier to design a main window (or whatever your top level object is) in Designer, and add some dynamically updated content in a widget(s) created in your code. In most cases, it saves your time spent on digging through QT documentation, and additionally, you are able to visually inspect positioning, aligning etc. You don't lose anything by using a Designer, every part of the GUI can be modified in your code afterwards, if it needs some custom behavior. Having said that, without knowing all the details of your project is hard to tell which option (QT or in-code) is faster.
1
445
0
2
2010-02-15T20:58:00.000
python,user-interface,pyqt
QtDesigner or doing all of the Qt boilerplate by hand?
0
3
3
2,271,799
1
0
0
When starting up a new project, as a beginner, which would you use? For example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most/least hassle?
false
2,268,853
0
0
0
0
Your right threading is your answer. Use the QT threads they work very well. Where I work when people start out using QT a lot of them start with designer but eventually end up hand coding it. I think you will end up hand coding it but if you are someone who really likes GUIs you may want to start with Designer. I know that isn't a definitive answer but it really depends.
1
445
0
2
2010-02-15T20:58:00.000
python,user-interface,pyqt
QtDesigner or doing all of the Qt boilerplate by hand?
0
3
3
2,269,180
1
0
0
When starting up a new project, as a beginner, which would you use? For example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there will be some QObjects that will be used to updated parameters within that infinite loop. So these need to be on separate threads, if I'm not mistaken. Which choice would give the most/least hassle?
false
2,268,853
0
0
0
0
First of all, the requirements that you've mentioned don't (or shouldn't) have much affect on this decision. Either way, you're going to have to learn something. You might as well investigate both options, and make the decision yourself. Write a couple of "Hello, World!" apps, then start adding some extra widgets/behavior to see how each approach scales. Since you asked, I would probably use Qt Designer. But I'm not you, and I'm not working on (nor do I know much of anything about) your project.
1
445
0
2
2010-02-15T20:58:00.000
python,user-interface,pyqt
QtDesigner or doing all of the Qt boilerplate by hand?
0
3
3
2,269,317
1
0
0
I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python. I am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. Just from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true? If C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others? Thanks!
false
2,278,228
0.197375
0
0
4
I think it depends how proficient you are in C++. The Mat interface does appear more modern than the old IPLImage C interface. The problem I'm having is that most of the examples you'll find on the web, or even here on stackoverflow are for the C interface (e.g. cvCvtColor), not for the C++ interface. So I'm really struggling to port the C examples to C++.
0
7,757
0
27
2010-02-17T04:04:00.000
c++,python,c,opencv
OpenCV Image Processing -- C++ vs C vs Python
0
3
4
10,057,553
1
0
0
I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python. I am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. Just from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true? If C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others? Thanks!
true
2,278,228
1.2
0
0
13
The Python interface is still being developed whereas the C++ interface (especially with the new Mat class) is quite mature. If you're comfortable in C++, I would highly recommend using it - else, you can start using Python and contribute back any features you think OpenCV needs :)
0
7,757
0
27
2010-02-17T04:04:00.000
c++,python,c,opencv
OpenCV Image Processing -- C++ vs C vs Python
0
3
4
2,278,331
1
0
0
I was thinking of trying OpenCV for a project and noticed that it had C, C++ and Python. I am trying to figure out whether I should use C++, C or Python -- and would like to use whatever has the best OpenCV support. Just from looking at the index page for the various documentation it looks like the C++ bindings might have more features than the others? Is this true? If C++ has more bindings, it seems that would be a more obvious choice for me, but I was just curious if it really has more features, etc than the others? Thanks!
false
2,278,228
0.049958
0
0
1
Even if you're very proficient in C or C++, you should use python to speed up your development (I should guess a 4x factor). Performance are really quite the same.
0
7,757
0
27
2010-02-17T04:04:00.000
c++,python,c,opencv
OpenCV Image Processing -- C++ vs C vs Python
0
3
4
16,210,061
1
0
0
How can I set a gtk.Button enabled or disabled in PyGTK?
false
2,281,373
0
0
0
0
If you don't want to see the object then you could button.set_visible(False) to hide it or button.set_visible(True) to show it. This will prevent users from seeing the button.
0
12,047
0
18
2010-02-17T14:23:00.000
python,pygtk
Enable or disable gtk.Button in PyGTK
0
1
2
70,261,450
1
0
0
I've a PyQt 4 installed (I can't find PyQt 3 for Windows) and I would like to open a QtDesigner ui file which has been created with QtDesigner 3.3. When I open this file I've the following message: Please use uic3 -convert to convert to Qt4 Unfortunately, I don't see the uic3 tool in the bin folder of my install. Does anybody know how can I can convert this file to QtDesigner 4? Additional quastion: Where to download PyQy3 binaries for Windows? Thanks in advance
false
2,294,956
0.099668
0
0
1
Try finding pyuic3 or rather pyuic4. Since you are using PyQt all your qt tools have py in front (like pyrcc4 or pyuicc4). I am not sure, that there are pyqt3 binaries for windows. Are you sure that Phil Thompson did PyQt3 also for windows at the time? If so, they would be on riverbank site, I guess, but I can't find them there. Tried compiling the source yourself?
0
900
0
0
2010-02-19T08:41:00.000
python,qt,pyqt,qt-designer
How to open a Pyqt 3.3 ui file with QtDesigner 4?
0
1
2
2,296,460
1
0
0
If Python was so fast as C, the latter would be present in python apps/libraries? Example: if Python was fast as C would PIL be written completely in Python?
false
2,303,683
0.099668
1
0
2
It makes sense to use C modules in Python for: Performance Libraries that won't be ported to Python (because of performance reasons, for example) or that use OS-specific functions Scripting. For example, many games use Python, Lua and other languages as scripting languages. Therefore they expose C/C++ functions to Python. As to your example: Yes, but Python is inherently slower than C. If both were equally fast, it would make sense to use Python because C code is often more prone to attacks (buffer overflows and stuff).
1
196
0
1
2010-02-20T20:55:00.000
python,c,performance,bytecode
Is there any purpose for a python application use C other than performance?
0
3
4
2,303,703
1
0
0
If Python was so fast as C, the latter would be present in python apps/libraries? Example: if Python was fast as C would PIL be written completely in Python?
false
2,303,683
0
1
0
0
To access hardware.
1
196
0
1
2010-02-20T20:55:00.000
python,c,performance,bytecode
Is there any purpose for a python application use C other than performance?
0
3
4
2,303,876
1
0
0
If Python was so fast as C, the latter would be present in python apps/libraries? Example: if Python was fast as C would PIL be written completely in Python?
true
2,303,683
1.2
1
0
7
To access "legacy" C libraries and OS facilities.
1
196
0
1
2010-02-20T20:55:00.000
python,c,performance,bytecode
Is there any purpose for a python application use C other than performance?
0
3
4
2,303,685
1
0
0
In Python using tkinter, what is the difference between root.destroy() and root.quit() when closing the root window? Is one prefered over the other? Does one release resources that the other doesn't?
false
2,307,464
1
0
0
30
root.quit() causes mainloop to exit. The interpreter is still intact, as are all the widgets. If you call this function, you can have code that executes after the call to root.mainloop(), and that code can interact with the widgets (for example, get a value from an entry widget). Calling root.destroy() will destroy all the widgets and exit mainloop. Any code after the call to root.mainloop() will run, but any attempt to access any widgets (for example, get a value from an entry widget) will fail because the widget no longer exists.
0
35,380
0
39
2010-02-21T21:09:00.000
python,tkinter
What is the difference between root.destroy() and root.quit()?
0
2
4
42,928,131
1
0
0
In Python using tkinter, what is the difference between root.destroy() and root.quit() when closing the root window? Is one prefered over the other? Does one release resources that the other doesn't?
false
2,307,464
0
0
0
0
My experience with root.quit() and root.destroy() ... I have a dos python script, which calls a tkinter script (to choose from set of known values from combobox), then returns to the dos script to complete other things. The TKinter script I've added onto the parent script. I may convert all to tkinter, but a combo works for the time being. It works in the following way: To get rid of the windows box after selection was implemented, I needed to 1) root.quit() inside the callback function where all my keypresses were being processed. 2) root.destroy() after mainloop to destroy the windows box. If I used root.destroy() inside the callback, I got an error message saying tkinter objects were no longer accessable. Without the root.destroy() after mainloop, the windows box STAYED ONSCREEN until the whole parent script had completed.
0
35,380
0
39
2010-02-21T21:09:00.000
python,tkinter
What is the difference between root.destroy() and root.quit()?
0
2
4
61,423,826
1
0
0
I would like to try to write a GUI application in Python. I found out that there are a lot of ways to do it (different toolkits). And, in this context, I have several basic (and I think simple) question? Is it, in general, a good idea to write a GUI application in Python? What is the standard (easiest and most stable) way to create a GUI applications in Python? Does anybody can give me a link to a simple Hello World GUI application written in Python?
false
2,310,130
0.066568
0
0
2
As an answer for #1: Yes. It is quite good for this; scripting languages with GUI toolkits are often a good way to put a GUI on an application. They can also be used to wrap applications written in low level languages such as C or C++. Python offers good integration to quite a few toolkits. The posting linked above gives a pretty good cross section of the options with code samples. For #2: TkInter comes with the standard distribution. It is easy to use but not as sophisticated as (say) QT or WxWidgets.
1
20,880
0
11
2010-02-22T10:11:00.000
python,user-interface
How to write GUI in Python?
0
1
6
2,310,200
1
0
0
I would like to use NLTK (Natural Language Toolkit) for Python using IronPython and call from an exisiting WPF/c# project. Is it possible to reference NLTK from within WPF in this way. For example to use Named Entity Recognition from NTLK? Any advice or guidance appreciated.
false
2,318,335
0.379949
0
0
2
It definitely is possible, as long as NLTK doesn't use any C extensions. It will be much easier if you use VS2010 though, because of the dynamic keyword. Look at the Microsoft.Scripting.Hosting library from IronPython, it will get you started towards loading the NLTK code and executing methods on it.
0
1,242
0
5
2010-02-23T13:16:00.000
wpf,nltk,ironpython
NLTK in IronPython from WPF
0
1
1
2,320,322
1
0
0
How would I print contents of a Python Tkinter.Canvas widget? I've read that it's possible to print to a postscript printer from this control but examples are hard to come by. So, any ideas what is needed to print the contents (including images)? If you've got a cross-platform method all the better!
false
2,326,753
0
0
0
0
AFAIK it can only be done using the postscript method from the Canvas. This generates a postscript file with the canvas contents. Check the documentation for details about this method.
0
1,143
0
1
2010-02-24T14:40:00.000
python,printing,tkinter-canvas
How to print contents of a tkinter.Canvas widget?
0
1
1
2,326,802
1
0
0
So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?
false
2,398,800
0.049958
0
0
3
in pyqt5 to convert from a ui file to .py file pyuic5.exe youruifile.ui -o outputpyfile.py -x
0
135,115
0
83
2010-03-08T01:27:00.000
python,user-interface,qt,pyqt,qt-designer
Linking a qtDesigner .ui file to python/pyqt?
0
2
12
54,119,368
1
0
0
So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?
false
2,398,800
0
0
0
0
Using Anaconda3 (September 2018) and QT designer 5.9.5. In QT designer, save your file as ui. Open Anaconda prompt. Search for your file: cd C:.... (copy/paste the access path of your file). Then write: pyuic5 -x helloworld.ui -o helloworld.py (helloworld = name of your file). Enter. Launch Spyder. Open your file .py.
0
135,115
0
83
2010-03-08T01:27:00.000
python,user-interface,qt,pyqt,qt-designer
Linking a qtDesigner .ui file to python/pyqt?
0
2
12
52,304,139
1
0
0
Is there a way to create a 'kiosk mode' in wxpython under Windows (98 - 7) where the application disables you from breaking out of the app using Windows keys, alt-tab, alt-f4, and ctrl+alt+delete?
false
2,399,812
0
0
0
0
wxPython alone cannot be done with that. You need to do Low Level Keyboard Hook with C/C++ or with equivalent ctypes, for Windows keys, alt-tab, alt-f4, but Ctrl-Alt-Del, I don't think so for Windows XP and above.
0
753
0
0
2010-03-08T07:12:00.000
python,wxpython,mode,kiosk
Kiosk mode in wxpython?
0
1
2
2,399,853
1
0
0
Some friends and I wanted to develop a game. Any language will do. I've been programming in C for years, but never wrote a game before. One of us knows SDL a little bit. It would also be a nice excuse to learn Python+pygame. We wish our game to be 'standalone'. By standalone, I mean most users (at least Linux, Mac and Windows) will not have to manually download and install anything else apart from a package. It is ok if the installation automatically handles missing dependencies. If the packages contain binaries, we wish to be able to generate them using cross-compilation from Linux. How should we package and structure the project, and what language is best suited?
false
2,401,599
0
0
0
0
For casual gaming I would recommend Flash
1
1,603
0
6
2010-03-08T13:34:00.000
python,c,cross-platform,packaging,cross-compiling
Game cross-compiling and packaging
0
1
6
2,467,317
1
1
0
Are there any UI widgets available to the python side of Google App Engine? I'd like something like the collapsed/expanded views of Google Groups threads. Are these type things limited to the GWT side?
false
2,402,128
0.197375
0
0
3
There is no difference in the amount of built in widgets available to the python and java sides of app engine. Neither side has any! App Engine is primarily a back end technology. It allows you to use pretty much whatever web framework you want for your presentation layer, subject to constraints that Alex mentions. GWT is completely unrelated to App Engine, besides being developed by Google. It is a client side toolkit, and can be used just fine with any web app as a backend, whether created in java, python or [your favorite language]. (Admittedly, you get a few bonus features if your backend is in java.)
0
2,260
0
5
2010-03-08T14:52:00.000
python,user-interface,google-app-engine
Google App Engine UI Widgets
0
1
3
2,404,551
1
0
0
I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look for ONLY this item with no variances at all. How can I do this? Oh and to explain my issue a bit further, I am writing a loop for a game, once a progress bar has reached 100% - it needs to allow the loop to finish (And start over again), however the progress bar is just a plain bar - so when sikuli looks for it on the screen, it finds the partially complete bar (Since apparently it matches different lengths/widths/sizes of the image it is looking for), and triggers.
false
2,407,212
0.148885
0
0
3
If you are using Sikuli IDE click image miniature, for which you want to change sensitivity. You will be presented screenshot of your desktop with and occurrences of pattern(your image). Below there is a slider witch changes sensitivity. While changing it you will notice that highlighted occurrences of the pattern increase or decrease accordingly. This method assumes that you have your game on screen (so windowed mode, not fullscreen), but even if you don't you still can adjust sensitivity, just you won't see 'live' results of search. If you call sikuli from Java code, you have to use Pattern(image.png).similar(y.xx) where the argument of simmilar is something between 0.00 and 1.00. I haven't used second method so you may need to experiment with it.
0
6,449
0
5
2010-03-09T07:10:00.000
python,sikuli
Change Sikuli's sensitivity?
0
2
4
3,884,131
1
0
0
I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look for ONLY this item with no variances at all. How can I do this? Oh and to explain my issue a bit further, I am writing a loop for a game, once a progress bar has reached 100% - it needs to allow the loop to finish (And start over again), however the progress bar is just a plain bar - so when sikuli looks for it on the screen, it finds the partially complete bar (Since apparently it matches different lengths/widths/sizes of the image it is looking for), and triggers.
true
2,407,212
1.2
0
0
7
You can do the following in the Sikuli IDE: Click on the image In Pattern Settings > Matching Preview, drag the Similarity bar to 1.0 (all the way to the right) Click OK
0
6,449
0
5
2010-03-09T07:10:00.000
python,sikuli
Change Sikuli's sensitivity?
0
2
4
3,885,229
1