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 am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet Which would you recommend and why?
false
279,912
0.088656
0
0
4
pyglet has a lot of nice extras included with it (like image loading and sound). If you're starting out, I'd try pyglet first, and then switch to PyOpenGL if you feel like you want to get closer to the metal. The real important question though is: what are you trying to accomplish?
0
18,513
0
25
2008-11-11T03:17:00.000
python,pyglet,pyopengl
PyOpenGl or pyglet?
0
5
9
279,942
1
0
0
I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet Which would you recommend and why?
false
279,912
0.088656
0
0
4
I promote pyglet because it has the nicest API I've yet seen on stuff like this. Pyglet has opengl API as well. But it's often nicer to use the recently added vertex list support. pyglet.gl
0
18,513
0
25
2008-11-11T03:17:00.000
python,pyglet,pyopengl
PyOpenGl or pyglet?
0
5
9
281,395
1
0
0
I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet Which would you recommend and why?
false
279,912
0.066568
0
0
3
I would recommend Pyglet because it is very easy to get started and have something basic running, and then you can add more advanced techniques at your own pace.
0
18,513
0
25
2008-11-11T03:17:00.000
python,pyglet,pyopengl
PyOpenGl or pyglet?
0
5
9
397,041
1
0
0
How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen.
false
306,456
0
0
0
0
The panel you are referring to is the GNOME panel. So this is a GNOME question, not a GTK question. There is not a well-defined concept of "multi-window application" in GNOME that I know of. The panel task list is probably build by querying the window manager for the list of windows and grouping the windows by their "class" property. There are also various window manager hints that must be taken into account, for example to ignore panels and other utility windows. In your place, I would look at the source code of the taskbar applet. There is maybe some documentation somewhere that covers the status-quo, but I do know where it would be.
0
368
1
2
2008-11-20T19:02:00.000
python,gtk,pygtk
How can I get a list of the running applications with GTK?
0
2
2
306,866
1
0
0
How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen.
true
306,456
1.2
0
0
3
I believe what you are looking for is libwnck
0
368
1
2
2008-11-20T19:02:00.000
python,gtk,pygtk
How can I get a list of the running applications with GTK?
0
2
2
307,046
1
0
0
I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?
false
310,224
0
0
0
0
Isn't the whole point of using wxPython being to use WxWidgets? Isn't the whole point of using THAT being to have a cross platform GUI library? In other words, forget about X11, and just use the native wxPython on windows. If you want to avoid requiring the user to install wxPython and its dependencies, consider writing an installer. Alternatively, investigate py2exe to "compile" python to an .exe file (plus supporting .zip and .dll files), which is much more ammendable to "installing by merely copying files".
1
3,640
0
4
2008-11-21T21:18:00.000
python,installation,wxpython,cygwin,compilation
How do you compile wxPython under cygwin?
0
3
4
4,467,468
1
0
0
I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?
false
310,224
0
0
0
0
I tried another solution for using wxPython in cygwin: I installed python27 and wxPython in Windows7 Did "echo 'export PATH=/cygdrive/c/Python27/:$PATH'>>~/.bashrc" Restart cygwin It works. Cheer! I don't know if any other Path should be added, but my program was executed on Fedora and it works on there.
1
3,640
0
4
2008-11-21T21:18:00.000
python,installation,wxpython,cygwin,compilation
How do you compile wxPython under cygwin?
0
3
4
11,237,925
1
0
0
I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?
false
310,224
0.148885
0
0
3
You would need a full working X environment to get it to work. It would be much easier to just use Python and wxPython under plain vanilla Windows. Do you have a special case?
1
3,640
0
4
2008-11-21T21:18:00.000
python,installation,wxpython,cygwin,compilation
How do you compile wxPython under cygwin?
0
3
4
310,365
1
0
0
I'm trying to install the Python Imaging Library 1.1.6 for Python 2.6. After downloading the installation executable (Win XP), I receive the following error message: "Application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem" Any thoughts on what I have done / not done? The application has not been installed, and I can't import the module through the IDLE session. Thoughts?
false
321,668
0.049958
0
0
1
Install Python "for all users", not "just for me".
1
784
0
4
2008-11-26T18:21:00.000
python,image-processing
Application configuration incorrect with Python Imaging Library
0
2
4
323,097
1
0
0
I'm trying to install the Python Imaging Library 1.1.6 for Python 2.6. After downloading the installation executable (Win XP), I receive the following error message: "Application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem" Any thoughts on what I have done / not done? The application has not been installed, and I can't import the module through the IDLE session. Thoughts?
false
321,668
0
0
0
0
I got that same message recently to do with the wxPython library. It was because wxPython had been built using a later version of Visual C++ than I had on my PC. As atzz suggests, one solution is to install the appropriate redistributable package. Try a Google search for 'Microsoft Visual C++ 2008 Redistributable Package' and do the download. If that doesn't work, repeat for the 2005 version.
1
784
0
4
2008-11-26T18:21:00.000
python,image-processing
Application configuration incorrect with Python Imaging Library
0
2
4
368,543
1
0
0
I use something like this: screen.addstr(text, color_pair(1) | A_BOLD), but it doesn't seem to work.. However, A_REVERSE and all others attribute does work! In fact, I'm trying to print something in white, but the COLOR_WHITE prints it gray.. and after a while of searching, it seems that printing it gray + BOLD makes it! Any helps would be greatly appreciated.
false
327,026
0.462117
0
0
5
I tried this: screen.addstr(text, curses.color_pair(1) | curses.A_BOLD) and it worked! So just add curses. and it should do the trick. Of course at the beginning use: import curses
0
6,287
0
6
2008-11-29T01:46:00.000
python,linux,curses,bold
Attribute BOLD doesn't seem to work in my curses
0
1
2
53,016,371
1
0
0
I'm giving my first steps on Python. I saw that we don't have switch case statement, so I would you guys implement a text Menu in python? Thanks
false
327,597
0
0
0
0
To your first question I agree with Ali A. To your second question : import sys sys.exit(1)
1
5,723
0
3
2008-11-29T15:01:00.000
python
Suggestion to implement a text Menu without switch case
0
1
6
327,735
1
0
0
I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical "Python for C++ Developers" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references? As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study? Thanks in advance.
false
328,577
0.099668
1
0
4
I learned a lot about Python by reading the source of the standard library that ships with Python. I seem to remember having a few "a-ha!" moments when reading urllib2.py in particular.
1
43,679
0
56
2008-11-30T07:14:00.000
c++,python
Python for C++ Developers
0
3
8
328,599
1
0
0
I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical "Python for C++ Developers" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references? As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study? Thanks in advance.
false
328,577
0
1
0
0
For the best examples of code of a language, the language's standard library is often a good place to look. Pick a recent piece, though - old parts are probably written for older versions and also sometimes were written before the library became big enough to warrant big standards - like PHP and Erlang's libraries, which have internal inconsistency. For Python in particular, Python 3000 is cleaning up the library a lot, and so is probably a great source of good Python code (though it is written for a future Python version).
1
43,679
0
56
2008-11-30T07:14:00.000
c++,python
Python for C++ Developers
0
3
8
328,598
1
0
0
I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical "Python for C++ Developers" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references? As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study? Thanks in advance.
false
328,577
0.024995
1
0
1
C# and Java are seen as cleaner replacements for C++ in many application areas so there is often a "migration" from one to the other - which is why there are books available. Python and C++ are very different beasts, and although they are both considered general purpose programming languages they are targetted towards different ends of the programming spectrum. Don't try to write C++ in Python; in fact, try to forget C++ when writing Python. I found it far better to learn the common Python paradigms and techniques and apply them to my C++ programs than the other way around.
1
43,679
0
56
2008-11-30T07:14:00.000
c++,python
Python for C++ Developers
0
3
8
328,689
1
0
0
I am currently looking at developing a mobile apps for the S60 platform and is specifically looking at PyS60. It seems to suggest that the it can be compiled into native .sis files without the need for an embedded python interpreter. Reading through the documentations I could not find any statements where this is explicitly mentioned. While I am right now downloading the SDKs, Emulators, and the whole bunch of tool chains needed to test the development out on Linux, I thought I would ask here a bit while I am doing that.
true
334,765
1.2
0
0
1
Linux is not officially supported for Series60 development yet. You will save yourself a lot of headache using Windows, weirdly enough. As far as Python is oncerned, I think the developed application is packaged into a .sis file but still requires the PyS60 interpreter to run once installed.
0
1,161
0
9
2008-12-02T17:30:00.000
python,symbian,s60,pys60
Does PyS60 produce sis files that are native?
0
1
2
337,308
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
0
1
0
0
Very interesting. What would happen if you write all your code with IronPython (not just the unit tests)? Would you end up with approximately 10 times less code? Maybe I should learn IronPython too.
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
342,457
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
0
1
0
0
I gotta go with Will and Jon.. I would prefer my tests be in the same language as the code I'm testing; it causes fewer cognitive context switches. But maybe I'm just not as mentally agile as I once was. Jon
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
443,959
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
0.07486
1
0
3
Actually testing is a great opportunity to try integrating a new language. Languages like Python shine especially well in testing, and it's a low risk project to try - the worst case is not too bad at all. As far as experience testing another language in Python, I've tested C and C++ systems like this and it was excellent. I think it's definitely worth a shot. What Jon says is true, though - the level of tooling for Python in general, and IronPython in particular, is nowhere near that of C#. How much that affects you is something you'll find out in your pilot.
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
342,490
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
0.07486
1
0
3
Python being a much less verbose language than C# might actually lower the barrier to writing unit tests since there is still a lot of developers that are resistant to doing automated unit testing in general. Introducing and having them use a language like IronPython that typically tends to take less time to write the equivalent code in C# might actually encourage more unit tests to be written which is always a good thing. Plus, by using IronPython for your test code, you might end up with less lines of code (LOC) for your project overall meaning that your unit tests might be more likely to be maintained in the long run versus being ignored and/or discarded.
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
341,683
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
1
1
0
6
Python is excellent for UnitTesting C# code. Our app is 75% in Python and 25% C#(Python.Net), and our unit tests are 100% python. I find that it's much easier to make use of stubs and mocks in Python which is probably one of the most critical components that enable one to write effective unittests.
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
346,907
1
0
0
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. Is it ideal choice to write unit test cases in IronPython instead of C#? Any body has done like that? I wrote few test cases, they seems to be good. But hairy pointy managers won't accept.
false
340,128
0.049958
1
0
2
There's an obvious disadvantage which is that everyone working on the code now needs to be proficient in two languages, not just one. I'm fairly hairy but not very pointy, but I do see why managers might be sceptical.
0
3,355
0
13
2008-12-04T10:21:00.000
c#,python,unit-testing,ironpython
IronPython For Unit Testing over C#
0
6
8
340,152
1
0
0
Okay, what is it, and why does it occur on Win2003 server, but not on WinXP. It doesn't seem to affect my application at all, but I get this error message when I close the application. And it's annoying (as errors messages should be). I am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I'm a C# programmer that has taken over this Python app, and I had to learn Python to do it. I can supply code and version numbers etc, but I'm still learning the technical stuff, so any help would be appreciated. Python 2.5, wxPython and pyOpenGL
false
345,991
0.132549
0
0
2
After adding the Logging above, I was able to see that the problem was caused by missing TConstants class, which I was excluding in the py2exe setup.py file. After removing the "Tconstants" from the excluded list, I no longer had problems.
0
91,403
0
80
2008-12-06T05:59:00.000
python,logging,opengl,wxpython,pyopengl
Python - No handlers could be found for logger "OpenGL.error"
0
1
3
369,184
1
0
0
I need to decide on a GUI/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform? If possible, cite strengths and weaknesses of the suggested toolkit. Thank you, Luis
false
360,602
1
0
0
8
Python binding of Wx is very strong since at least one of the core developer is a python guy itself. WxWdgets is robust, time proven stable, mature, but also bit more than just GUI. Even is a lot is left out in WxPython - because Python itself offers that already - you might find that extra convenient for your project. Wx is the fastest especially on Win, because it lets render the OS and yes WxLicense is de facto LGPL. With XRC you have also a way like Glade to click you to a UI that you can reuse by different projects and languages. What is one major reason for me to use Wx is the fast and helping mailing list, never seen a flamewar, you get even often answers from core developers there, like the notorious vadim zeitlin++. The only thing con to Wx is the API that once grew out of MS MFC and has still its darker(unelegant) corners, but with every version you have some improvements on that as well. QT done some nice stuff, especially warping the language but under python that don't count. They invented also a lot of extra widgets. In wx you have also combined, more complex widgets like e.g. for config dialog, but that goes not that far as in QT. And you could of course use GTK. almost no difference under linux to Wx but a bit alien and slower under win. but also free.
0
1,840
0
4
2008-12-11T19:38:00.000
python,windows,linux,native,gui-toolkit
What GUI toolkit looks best for a native LAF for Python in Windows and Linux?
0
2
3
361,672
1
0
0
I need to decide on a GUI/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform? If possible, cite strengths and weaknesses of the suggested toolkit. Thank you, Luis
false
360,602
0
0
0
0
Like others said, PyQt or wxPython... The technical difference between the two is more or less imaginary - it's a question of your comfort with the toolkit that matters, really.
0
1,840
0
4
2008-12-11T19:38:00.000
python,windows,linux,native,gui-toolkit
What GUI toolkit looks best for a native LAF for Python in Windows and Linux?
0
2
3
361,996
1
0
0
This is a two part question. A dumb technical query and a broader query about my possibly faulty approach to learning to do some things in a language I'm new to. I'm just playing around with a few Python GUI libraries (mostly wxPython and IronPython) for some work I'm thinking of doing on an open source app, just to improve my skills and so forth. By day I am a pretty standard c# bod working with a pretty normal set of MS based tools and I am looking at Python to give me a new perspective. Thus using Ironpython Studio is probably cheating a bit (alright, a lot). This seems not to matter because however much it attempts to look like a Visual Studio project etc. There's one simple behaviour I'm probably being too dumb to implement. I.E. How do I keep my forms in nice separate code files, like the c# monkey I have always been ,and yet invoke them from one another? I've tried importing the form to be invoked to the main form but I just can't seem to get the form to be recognized as anything other than an object. The new form appears to be a form object in its own code file, I am importing the clr. I am trying to invoke a form's 'Show' method. Is this not right? I've tried a few (to my mind more unlikely) ways around this but the problem seems intractable. Is this something I'm just not seeing or would it in fact be more appropriate for me to change the way I think about my GUI scripting to fit round Python (in which case I may switch back to wxPython which seemed more approachable from a Pythonic point of view) rather than try to look at Python from the security of the Visual Studio shell?
true
362,428
1.2
0
0
0
In the end it was even simpler. I was trying to invoke the subform thus: f = frmSubform() f.Show() But I actually needed to do it this way f = frmSubform() Form.Show(f) Form.ShowDialog(f) worked also; in a Dialog format of course. A simple enough error but until you know you, well, don't know. I'm not 100% sure I understand at this stage why what works, works, but I'm sure I shall learn with experience.
0
1,298
0
1
2008-12-12T10:36:00.000
ironpython,ironpython-studio
Ironpython Studio forms
0
1
2
363,455
1
0
0
I've had some experience with Pygame, but there seems to be a lot of buzz around Pyglet these days. How do these two libraries compare? What would be the advantage of using one over the other, both in features and ease of use? Finally, would you say that one is more Pythonic than the other?
false
370,680
0.119427
0
0
3
Having looked at both pygame and pyglet I found pyglet easier to pick up and was able to write a simple breakout style game within a few days.
0
24,875
0
46
2008-12-16T07:55:00.000
python,pygame,pyglet
Differences between Python game libraries Pygame and Pyglet?
0
2
5
2,477,829
1
0
0
I've had some experience with Pygame, but there seems to be a lot of buzz around Pyglet these days. How do these two libraries compare? What would be the advantage of using one over the other, both in features and ease of use? Finally, would you say that one is more Pythonic than the other?
false
370,680
1
0
0
15
Pyglet is good (for 2D games) if you never intend to draw any vector graphics or primitives within the game itself, and just stick to loading images from disk. It's also much cleaner because there's no need to write your own game loop and have to worry about speed and timing and responsiveness. However, if you ever have to generate graphics on-the-fly, and then save them, either as a variable or as a file, then pyglet becomes considerably more complicated because you start having to muck around with the low-level OpenGL functions. In those scenarios, pygame is much more user-friendly, with its software rendering and Surface class. Or you could use Python Imaging Library and interface it with pyglet. Obviously, for 3D games, you are going to have to muck around with OpenGL functions anyway, in which case I recommend pyglet over pygame + PyOpenGL.
0
24,875
0
46
2008-12-16T07:55:00.000
python,pygame,pyglet
Differences between Python game libraries Pygame and Pyglet?
0
2
5
4,520,448
1
0
0
I'm looking into writing a wxWidget that displays a graphical node network, and therefore does a lot of drawing operations. I know that using Python to do it is going to be slower, but I'd rather get it working and port it later when its functional. Ideally, if the performance hit isn't too great, I'd prefer to keep the codebase in Python for easy updates. What I'm wondering is how much slower should I expect things to go? I realize this is vague and open ended, but I just need a sense of what to expect. Will drawing 500 circles bog down? Will it be noticeable at all? What are your experiences?
false
379,442
0.066568
0
0
1
For drawing, people have suggested PyGame. I like PyGame, its easy to work with and works well. Other choices would be Pyglet, or using PyOpenGL (you can most likely draw to a wx widget too, though I've never done it). Personally, I'd do it in Python using whatever library I'm most familiar with (in my case, I'd use pygtk and cairo) and worry about performance only when it becomes a problem - then profile and optimize the bottleneck, if its Python code thats slow, I'll know which bits to run in C instead.
0
1,255
0
6
2008-12-18T21:52:00.000
c++,python,performance,drawing,wxpython
How much slower is a wxWidget written in Python versus C++?
0
1
3
380,558
1
0
0
I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts/sizers and event handling, none really tackle project organization of a wxPython project. For example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level. How should I organize and call "universal" methods like these so that I don't clutter up my frame classes. UPDATE: To clarify, the "list of folders" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame. I'm looking for actual project organization techniques, not programming fundamentals.
false
390,867
0.099668
0
0
2
As Mark stated you should make a new class that handles things like this. The ideal layout of code when using something like wxWidgets is the model view controller where the wxFrame class only has the code needed to display items and all the logic and business rules are handled by other class that interact with the wxFrame. This way you can change logic and business rules with out having to change your interface and change (or swap) your interface with out having to change your logic and business rules.
0
1,063
0
1
2008-12-24T06:07:00.000
python,wxpython,wxwidgets,model-view-controller,project-organization
Calling Application Methods from a wx Frame Class
0
3
4
390,912
1
0
0
I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts/sizers and event handling, none really tackle project organization of a wxPython project. For example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level. How should I organize and call "universal" methods like these so that I don't clutter up my frame classes. UPDATE: To clarify, the "list of folders" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame. I'm looking for actual project organization techniques, not programming fundamentals.
true
390,867
1.2
0
0
2
Your classes that inherit from wxWidgets/wxPython data types should not implement any business logic. wxWidgets is a GUI library, so any subclasses of wxApp or wxFrame should remain focused on GUI, that is on displaying the interface and being responsive to user actions. The code that does something useful should be separated from wx, as you can decide later to use it in some web or console application and you don't want to create wxApp object in such case. You can also decide later on to move some computations to separate 'worker threads', while your GUI will be the 'main thread' - responsive, and repainted properly during long lasting computations. Last but not least - the classes that encapsulate your logic might tend to grow during projects lifetime. If they're mixed with your GUI classes they will grow faster, and finally they become so complex that you're almost unable to debug them... While having them separated leads to clean code when you don't mix bugs in logic with bugs in GUI (refreshing/layout/progress bar etc.). Such approach has another nice feature - ability to split work among GUI-people and logic-people, which can do their work without constant conflicts.
0
1,063
0
1
2008-12-24T06:07:00.000
python,wxpython,wxwidgets,model-view-controller,project-organization
Calling Application Methods from a wx Frame Class
0
3
4
394,333
1
0
0
I'm starting out with wxPython and have been working my way through every tutorial and example I can get my hands on. I've run into a slight problem, however, and it has to do with the wx.App versus the wx.Frame and which should contain specific methods. Just about every example I've seen don't go much beyond layouts/sizers and event handling, none really tackle project organization of a wxPython project. For example, I have a method that gets a list of folders. The way most examples would deal with this would be to stick the method right in the frame class. This method has the potential to be used in several other parts of the application, so it would make more sense to store it at the application class level. How should I organize and call "universal" methods like these so that I don't clutter up my frame classes. UPDATE: To clarify, the "list of folders" was just an example, my actual method does a lot more work. What I'm saying is I have code that isn't Frame-specific. If I had this in the application class, what is the best way to call it from and event method in my frame. I'm looking for actual project organization techniques, not programming fundamentals.
false
390,867
0
0
0
0
In a proper OOP design, this would be independent or part of a filesystem class - it wouldn't be part of the app or the frame.
0
1,063
0
1
2008-12-24T06:07:00.000
python,wxpython,wxwidgets,model-view-controller,project-organization
Calling Application Methods from a wx Frame Class
0
3
4
390,887
1
0
0
I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you can build with the available tools, specifically in the types of available widgets. I'm interested in using some of the more advanced wxPython widgets such as the ListView (grid), Tree, etc. This would involve using a complete wxFrame (window) to display the whole UI, which would essentially mean that window would no longer be tied to Maya. Not a deal breaker, but it means when Maya is minimized, the window won't follow suit. I've tried something like this before with tkinter as a test, but found that it needed a MainLoop to run in its own thread. This is logical, but in my case, it conflicts with Maya's own thread, essentially making Maya hang until the window is closed. This is due to the fact that Maya runs all scripts, be they MEL or Python, in a single thread that the main Maya GUI shares. This is to prevent one script from, say, deleting an object while another script is trying to do work on the same object. wxPython has this same "mainloop" methodolgy. I'm wondering if there's any way around it so that it can work within Maya?
false
397,337
0
0
0
0
The best way to go is creating a QWidget with what you need, and using it from within a MPxCommand thru the C++ API. That way you also have the chance to inject complete custom editors into Maya via scriptedPanels. But if you're bound to Python, pyQt is the way to go.
0
3,503
0
8
2008-12-29T08:41:00.000
python,scripting,wxpython,wxwidgets,maya
Using external GUI libraries to make user interfaces in Autodesk Maya
0
2
3
30,247,511
1
0
0
I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you can build with the available tools, specifically in the types of available widgets. I'm interested in using some of the more advanced wxPython widgets such as the ListView (grid), Tree, etc. This would involve using a complete wxFrame (window) to display the whole UI, which would essentially mean that window would no longer be tied to Maya. Not a deal breaker, but it means when Maya is minimized, the window won't follow suit. I've tried something like this before with tkinter as a test, but found that it needed a MainLoop to run in its own thread. This is logical, but in my case, it conflicts with Maya's own thread, essentially making Maya hang until the window is closed. This is due to the fact that Maya runs all scripts, be they MEL or Python, in a single thread that the main Maya GUI shares. This is to prevent one script from, say, deleting an object while another script is trying to do work on the same object. wxPython has this same "mainloop" methodolgy. I'm wondering if there's any way around it so that it can work within Maya?
false
397,337
0
0
0
0
I don't know if there is a way around a mainloop for the gui, since it is needed to handle all event chains and redraw queues. But there are several means of inter-process communication, like pipes or semaphores. Maybe it is an option to split your Maya extension into the actual plugin, being tight into maya, and a separate application for the gui. These two could use such means to communicate and exchange model information between plugin and gui. I'm not sure, however, if I can really recommend this approach because it very much complicates the application. You could have a look at IPython, an interactive Python shell, whose dev team has put some effort into integrating it with wxPython. They have some way of interrupting the event loop and hooking into it to do their own stuff.
0
3,503
0
8
2008-12-29T08:41:00.000
python,scripting,wxpython,wxwidgets,maya
Using external GUI libraries to make user interfaces in Autodesk Maya
0
2
3
398,469
1
0
0
More particularly - I have a window handle of another running application. This application contains a TListControl.UnicodeClass control somewhere (I know this from Winspector). How can I, using the Windows API and that window handle, go through all the items in that list control and get the text from all of the items? You can assume the language is C/C++, though I'll actually be using win32all for python. References to the appropriate API calls would be great.
true
408,334
1.2
0
0
2
Above answers are completely wrong and don't even know what is a PAS. This has been answered hundreds of times for 20 years on Usenet. You must use IPC of course (RPM) ask on news://comp.os.ms-windows.programmer.win32 for code.
0
1,808
0
1
2009-01-02T23:49:00.000
python,windows,winapi,controls
In Windows, how can I enumerate and get text from another window's controls?
0
1
2
409,110
1
0
0
I would like to force my python app to the front if a condition occurs. I'm using Kubuntu & QT3.1 I've tried setActiveWindow(), but it only flashes the task bar in KDE. I think Windows has a function bringwindowtofront() for VB. Is there something similar for KDE?
false
412,214
0.26052
0
0
4
Check if KWin is configured to prevent focus stealing. There might be nothing wrong with your code -- but we linux people don't like applications bugging us when we work, so stealing focus is kinda frowned upon, and difficult under some window managers.
0
2,418
1
1
2009-01-05T03:36:00.000
python,qt
How to bring program to front using python
0
1
3
413,073
1
0
0
Does anyone know of an example where it is shown how to drag a button from one panel to another in wxPython? I have created a bitmap button in a panel, and I would like to be able to drag it to a different panel and drop I there. I haven't found any examples using buttons, just text and files. I am using the latest version of Python and wxPython.
true
425,722
1.2
0
0
4
If you want to graphically represent the drag, one good way to do this is to create a borderless Frame that follows the mouse during a drag. You remove the button from your source Frame, temporarily put it in this "drag Frame", and then, when the user drops, add it to your destination Frame.
0
1,052
0
1
2009-01-08T20:17:00.000
python,drag-and-drop,wxpython
Drag button between panels in wxPython
0
1
1
425,740
1
0
0
My site is full of rounded corners on every box and picture, except for the thumbnails of user uploaded photos. How can I use the Python Imaging Library to 'draw' white or transparent rounded corners onto each thumbnail?
false
430,379
0
0
0
0
Might it not be a better idea (assuming HTML is the output) to use HTML and CSS to put some rounded borders on those pictures? That way, if you want to change the look of your site, you don't have to do any image reprocessing, and you don't have to do any image processing in the first place.
0
3,944
0
0
2009-01-10T02:00:00.000
python,python-imaging-library,rounded-corners
Draw rounded corners on photo with PIL
0
1
2
430,410
1
0
0
I was wondering if there is something similar to Java's JFileChooser for Python? JFileChooser is a graphical front end to choose a file. Preferably something that is already with Python. Maybe with Tkinter.
false
433,945
0.132549
0
0
4
wxPython (www.wxpython.org) provides the wx.FileDialog class which will give you a native file selection dialog on any of the supported platforms (Mac, Linux or Windows).
1
2,182
0
4
2009-01-11T23:03:00.000
java,python,jfilechooser
JFileChooser for Python?
0
2
6
433,967
1
0
0
I was wondering if there is something similar to Java's JFileChooser for Python? JFileChooser is a graphical front end to choose a file. Preferably something that is already with Python. Maybe with Tkinter.
false
433,945
0
0
0
0
Maybe you would like to take a look at Jython.
1
2,182
0
4
2009-01-11T23:03:00.000
java,python,jfilechooser
JFileChooser for Python?
0
2
6
433,977
1
0
0
I've got a wx.Toolbar and I'd like to make the buttons larger. I've searched and can't seem to find any concrete documentation on how to do this. I'm also wondering how well this will translate across platforms; what will happen to the buttons and icons on OSX?
false
445,037
0.132549
0
0
2
Doesn't the size of the toolbar adapts itself automatically to the size of the bitmap icons? I think if you want a bigger toolbar, you need bigger bitmaps.
0
3,854
0
2
2009-01-14T22:57:00.000
python,user-interface,wxpython,wxwidgets,toolbar
How to make a wx Toolbar buttons larger?
0
1
3
446,014
1
0
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
false
456,884
1
1
0
8
An observation: Based on the benchmarking conducted by the pybindgen developers, there is no significant difference between boost.python and swig. I haven't done my own benchmarking to verify how much of this depends on the proper use of the boost.python functionality. Note also that there may be a reason that pybindgen seems to be in general quite a bit faster than swig and boost.python: it may not produce as versatile a binding as the other two. For instance, exception propagation, call argument type checking, etc. I haven't had a chance to use pybindgen yet but I intend to. Boost is in general quite big package to install, and last I saw you can't just install boost python you pretty much need the whole Boost library. As others have mentioned compilation will be slow due to heavy use of template programming, which also means typically rather cryptic error messages at compile time. Summary: given how easy SWIG is to install and use, that it generates decent binding that is robust and versatile, and that one interface file allows your C++ DLL to be available from several other languages like LUA, C#, and Java, I would favor it over boost.python. But unless you really need multi-language support I would take a close look at PyBindGen because of its purported speed, and pay close attention to robustness and versatility of binding it generates.
0
32,045
0
70
2009-01-19T08:32:00.000
python,c++,c,swig,cython
Extending python - to swig, not to swig or Cython
0
3
10
3,167,276
1
0
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
false
456,884
1
1
0
6
There be dragons here. Don't swig, don't boost. For any complicated project the code you have to fill in yourself to make them work becomes unmanageable quickly. If it's a plain C API to your library (no classes), you can just use ctypes. It will be easy and painless, and you won't have to spend hours trawling through the documentation for these labyrinthine wrapper projects trying to find the one tiny note about the feature you need.
0
32,045
0
70
2009-01-19T08:32:00.000
python,c++,c,swig,cython
Extending python - to swig, not to swig or Cython
0
3
10
461,364
1
0
0
I found the bottleneck in my python code, played around with psycho etc. Then decided to write a c/c++ extension for performance. With the help of swig you almost don't need to care about arguments etc. Everything works fine. Now my question: swig creates a quite large py-file which does a lot of 'checkings' and 'PySwigObject' before calling the actual .pyd or .so code. Does anyone of you have any experience whether there is some more performance to gain if you hand-write this file or let swig do it.
false
456,884
0.059928
1
0
3
If its not a big extension, boost::python might also be an option, it executes faster than swig, because you control what's happening, but it'll take longer to dev. Anyways swig's overhead is acceptable if the amount of work within a single call is large enough. For example if you issue is that you have some medium sized logic block you want to move to C/C++, but that block is called within a tight-loop, frequently, you might have to avoid swig, but I can't really think of any real-world examples except for scripted graphics shaders.
0
32,045
0
70
2009-01-19T08:32:00.000
python,c++,c,swig,cython
Extending python - to swig, not to swig or Cython
0
3
10
456,894
1
0
0
I'm looking for a way to implement this design in wxPython on Linux... I have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) and a text box... My main problem is that the toolbar is small in height, so the popup has to overflow the bounds of the window/client area.. I thought of two possible implementations: by using a wxMenu, since a menu can be drawn outside the client area. I fear that the layout possibilities aren't flexible enough for my goal by using a shaped frame. Pressing the button would re-shape the frame and draw the needed widgets as requested. My question is: am I missing something / wrong on something? :) Is this doable at all?
true
462,320
1.2
0
0
1
Using a menu is a no-go, because wxWidgets can't put widgets on a menu. Using the shaped frame would be possible in principle, but the problem is then to get the position of the button you clicked, to display the window at the right position. I tried to do that back then, but didn't have luck (in C++ wxWidgets). Maybe this situation changed in between though, good luck. You can also try a wxComboCtrl, which allows you to have a custom popup window. That one could then display the radio boxes and the input control.
0
551
0
1
2009-01-20T17:44:00.000
wxpython,wxwidgets,shaped-window
Window-overflowing widget in wxWidgets
0
1
1
462,387
1
0
0
I am adding some wx.StaticText objects on top of my main wx.Frame, which already has a background image applied. However, the StaticText always seems to draw with a solid (opaque) background color, hiding the image. I have tried creating a wx.Color object and changing the alpha value there, but that yields no results. Is there any way I can put text on the frame and have the background shine through? And furthermore, is it possible to make the text itself translucent? Thanks.
false
462,933
0.099668
0
0
1
You probably need some graphics rendering widget. As far as I know, in wxPython you can use either built-in wxGraphicsContext or pyCairo directly. Cairo is more powerful. However, I don't know the details.
0
472
0
1
2009-01-20T20:20:00.000
python,wxpython,transparency,opacity
Is it possible to make text translucent in wxPython?
0
2
2
464,706
1
0
0
I am adding some wx.StaticText objects on top of my main wx.Frame, which already has a background image applied. However, the StaticText always seems to draw with a solid (opaque) background color, hiding the image. I have tried creating a wx.Color object and changing the alpha value there, but that yields no results. Is there any way I can put text on the frame and have the background shine through? And furthermore, is it possible to make the text itself translucent? Thanks.
false
462,933
0
0
0
0
I would try aggdraw into a small canvas. Any Static Text uses the platform's native label machinery, so you don't get that sort of control over it.
0
472
0
1
2009-01-20T20:20:00.000
python,wxpython,transparency,opacity
Is it possible to make text translucent in wxPython?
0
2
2
598,202
1
0
0
This is going to be a generic question. I am struggling in designing a GUI application, esp. with dealing with interactions between different parts. I don't know how I should deal with shared state. On one hand, shared state is bad, and things should be as explicit as possible. On the other hand, not having shared state introduces unwanted coupling between components. An example: I want my application to be extendable in an Emacs/Vim sort of way, via scripts. Clearly, some sort of shared state needs to be modified, so that the GUI will use it. My initial plan was having a global "session" that is accessible from everywhere, but I'm not so sure about it. One tricky use case is key bindings. I want the user to be able to specify custom keybindings from a script. Each keybinding maps to an arbitrary command, that receives the session as the only argument. Now, the editor component captures keypresses. It has to have access to the keymappings, which are per-session, so it needs access to the session. Is coupling the editor to the session a good idea? Other components will also need to access the keybindings, so the session now becomes shared and can be a singleton... Is there any good reading about designing GUI applications that goes beyond MVC? This is Python and wxPython, FWIW. [EDIT]: Added concrete usecase.
false
471,279
0.132549
0
0
2
If you've looked at MVC you're probably moving in the right direction. MVC, MVP, Passive View, Supervising Controller. Those are all different ways, each with their own pros and cons, of accomplishing what you're after. I find that Passive View is the "ideal", but it causes you to introduce far too many widgets into your GUI interfaces (i.e. IInterface). In general I find that Supervising Controller is a good compromise.
0
805
0
9
2009-01-22T23:25:00.000
python,model-view-controller,user-interface,architecture,wxpython
Organising a GUI application
0
2
3
471,297
1
0
0
This is going to be a generic question. I am struggling in designing a GUI application, esp. with dealing with interactions between different parts. I don't know how I should deal with shared state. On one hand, shared state is bad, and things should be as explicit as possible. On the other hand, not having shared state introduces unwanted coupling between components. An example: I want my application to be extendable in an Emacs/Vim sort of way, via scripts. Clearly, some sort of shared state needs to be modified, so that the GUI will use it. My initial plan was having a global "session" that is accessible from everywhere, but I'm not so sure about it. One tricky use case is key bindings. I want the user to be able to specify custom keybindings from a script. Each keybinding maps to an arbitrary command, that receives the session as the only argument. Now, the editor component captures keypresses. It has to have access to the keymappings, which are per-session, so it needs access to the session. Is coupling the editor to the session a good idea? Other components will also need to access the keybindings, so the session now becomes shared and can be a singleton... Is there any good reading about designing GUI applications that goes beyond MVC? This is Python and wxPython, FWIW. [EDIT]: Added concrete usecase.
false
471,279
0.066568
0
0
1
In MVC, the Model stuff is the shared state of the information. The Control stuff is the shared state of the GUI control settings and responses to mouse-clicks and what-not. Your scripting angle can 1) Update the Model objects. This is good. The Control can be "Observers" of the model objects and the View be updated to reflect the observed changes. 2) Update the Control objects. This is not so good, but... The Control objects can then make appropriate changes to the Model and/or View. I'm not sure what the problem is with MVC. Could you provide a more detailed design example with specific issues or concerns?
0
805
0
9
2009-01-22T23:25:00.000
python,model-view-controller,user-interface,architecture,wxpython
Organising a GUI application
0
2
3
471,307
1
0
0
We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. I know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves
false
471,712
1
1
0
7
The way you describe things, it sounds like you're company is switching to Python simple for the sake of Python. Is there some specific reason you want to use Python? Is a more dynamic language necessary? Is the functional programming going to help you at all? If you've got a perfectly good working set of tools in C#, why bother switching? If you're set on switching, you may want to consider starting with standard Python unless you're specifically tied to the .NET libraries. You can write cross platform GUIs using a number of different frameworks like wxPython, pyQt, etc. That said, Visual Studio has a far superior GUI designer to just about any of the tools out there for creating Python windowed layouts.
0
5,128
0
16
2009-01-23T02:49:00.000
python,ironpython,ironpython-studio
Pros and cons of IronPython and IronPython Studio
0
2
3
471,725
1
0
0
We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software structures. So we believe IronPython is a good platform for us because it provides standard GUI functionality on windows and access to all of .Net libraries. I know Ironpython studio is not complete, and in fact I had a hard time adding my references but I was wondering if someone could list some of the pros and cons of this migration for us, considering Python code is easier to read by our clients and we usually deliver a proof-of-concept prototype instead of a full-functional code, our clients usually go ahead and implement the application themselves
true
471,712
1.2
1
0
18
My company, Resolver Systems, develops what is probably the biggest application written in IronPython yet. (It's called Resolver One, and it's a Pythonic spreadsheet). We are also hosting the Ironclad project (to run CPython extensions under IronPython) and that is going well (we plan to release a beta of Resolver One & numpy soon). The reason we chose IronPython was the .NET integration - our clients want 100% integration on Windows and the easiest way to do that right now is .NET. We design our GUI (without behaviour) in Visual Studio, compile it into a DLL and subclass it from IronPython to add behaviour. We have found that IronPython is faster at some cases and slower at some others. However, the IronPython team is very responsive, whenever we report a regression they fix it and usually backport it to the bugfix release. If you worry about performance, you can always implement a critical part in C# (we haven't had to do that yet). If you have experience with C#, then IronPython will be natural for you, and easier than C#, especially for prototypes. Regarding IronPython studio, we don't use it. Each of us has his editor of choice (TextPad, Emacs, Vim & Wing), and everything works fine.
0
5,128
0
16
2009-01-23T02:49:00.000
python,ironpython,ironpython-studio
Pros and cons of IronPython and IronPython Studio
0
2
3
472,355
1
0
0
I'm working with PyGTK, trying to come up with a combination of widgets that will do the following: Let me add an endless number of widgets in a column Provide a vertical scrollbar to get to the ones that run off the bottom Make the widgets' width adjust to fill available horizontal space when the window is resized Thanks - I'm new to GTK.
true
474,034
1.2
0
0
8
An endless number of widgets in a column: Sounds like a GtkVBox. Vertical scrollbar: Put your VBox in a GtkScrolledWindow. Horizontal stretching: This requires setting the appropriate properties for the VBox, ScrolledWindow, and your other widgets. At least in Glade the defaults seem to mostly handle this (You will probably want to change the scrollbar policy of the ScrolledWindow). Now for the trick. If you just do what I've listed above, the contents of the VBox will try to resize vertically as well as horizontally, and you won't get your scrollbar. The solution is to place your VBox in a GtkViewport. So the final hierarchy is ScrolledWindow( Viewport( VBox( widgets ) ) ).
0
4,354
0
4
2009-01-23T18:53:00.000
python,gtk,pygtk,widget
Which GTK widget combination to use for scrollable column of widgets?
0
1
2
474,134
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0
1
0
0
Between komodo and wingide i would go for wing. The license is not that expensive and the fact that it is commercial gives you a bigger probability of more updates and bug fixes. If you, like me, prefer a free solution, then stick with pydev. At least until aptana closes the free door :)
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
495,362
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0.036348
1
0
2
Check to see if the 'P' icon is appearing for your items and in the top of your editor after opening it. If it's not appearing, it may be that there's a problem with the file association, so, go to window > preferences > general > editors > file associations and make sure that the .py files are associated with the Python Editor (note that because of an eclipse bug, if it seems correct, you may have to remove the association and add it again)
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
1,399,741
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0.01818
1
0
1
It sounds like you have to specify the location of the Python interpreter. Do this under Preferences > Pydev > Interpreter - Python. Create a new interpreter and point it to the Python interpreter executable.
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
4,665,424
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0.090659
1
0
5
Make sure you use 'Open With' as 'Python Editor' by right clicking on the file - It worked for me
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
17,847,161
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0
1
0
0
Check your Theme configuration. Python highlighting uses Theme Colors
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
18,933,901
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0
1
0
0
In case anyone else makes the embarrassing mistake that I did: be sure your source code file actually ends with ".py". Even if its in a Python project, PyDev won't guess without the extension.
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
19,301,447
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0
1
0
0
When syntax highlighting was not working for me using PyDev, I discovered that there were somehow two 'Python Editor' associations defined for .py files in my installation of Eclipse/PyDev. From the Eclipse Main Menu, go to Window > Preferences > General > Editors > FileAssociations to see the file extension <-> editor mapping. I set a different one as default for .py files at the bottom of the dialog, and got syntax highlighting working again.
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
35,208,736
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
0
1
0
0
Well, I tried the Wing Professional and I think its really the best Py IDE out there.
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
495,297
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
false
491,053
1
1
0
13
The typical reason that code completion doesn't work under PyDev is that the libraries aren't in the PYTHONPATH. If you go into the Project Properties, and setup PyDev PYTHONPATH preferences to include the places where the code you are trying to complete lives, it will work just fine... Project > Properties > PyDev-PYTHONPAH > click 'Add source folder'
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
1,836,524
1
0
0
I just configured Eclipse with PyDev latest version, but when I import external modules, neither code completion nor syntax highlighting works. How do I enable it? Komodo Edit does a better synax highlighting, apparently. - But Ctrl+R doesnt run the program. I prefer a SciTE kind of editor with similar highlighting and fonts (aesthetics) and F5 working but with display of folder and files dynamically like Komodo Edit and a better code completion and vi emulation. Suggestions, please. If I want to buy a Py IDE, Komodo or Wingware, which is better?-- Wrt syntax highlighting and code completion
true
491,053
1.2
1
0
23
To enable code completion, go to Window > Preferences > Pydev > Editor > Code Completion, and check the 'Use Code Completion?' box, as well as the other boxes for what you want to complete on. It seems to take a second to load, the first time it has to complete something. Syntax coloring should just work by default. Right-click on the file in the package explorer, go to 'Open With', and make sure you're opening it with the Python Editor, and not the regular Text Editor. I don't know exactly what you mean by importing external modules. I have my source in a separate directory structure on disk; my PyDev projects contain folders linked to those. Code completion works for that, as well as other modules like 'os'. If you're having troubles, are the modules added to the PyDev's Python search path (not necessarily the same as the regular one)? I took a brief look at Komodo and Wingware a while back, so I can't answer the second part of your question. But ended up going with PyDev. I'm not a big fan of Eclipse, but PyDev works reasonably well for me.
0
31,316
0
18
2009-01-29T09:50:00.000
python,ide
No code completion and syntax highlighting in Pydev
0
10
11
492,073
1
0
0
I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again. Everything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :/ I tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this? Many thanks! (wxPython 2.8.8.0 on Xubuntu 8.10)
false
492,365
0
0
0
0
Since tooltips normally disappear when the user moves the mouse you could also bind to EVT_MOTION instead of EVT_LEAVE_WINDOW and hide the tooltip when the user moves the mouse.
0
628
0
1
2009-01-29T16:30:00.000
wxpython,wxwidgets
ScrolledWindow and wx.EVT_LEAVE_WINDOW
0
2
2
826,451
1
0
0
I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again. Everything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :/ I tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this? Many thanks! (wxPython 2.8.8.0 on Xubuntu 8.10)
true
492,365
1.2
0
0
0
Robin Dunn told me: "the same thing would happen with any other widgets that are on the scrolled window, just as the frame will get a EVT_LEAVE_WINDOW when the mouse moves into the scrolled window (assuming some portion of the frame was visible so it could have received an enter window event too)"
0
628
0
1
2009-01-29T16:30:00.000
wxpython,wxwidgets
ScrolledWindow and wx.EVT_LEAVE_WINDOW
0
2
2
11,717,036
1
0
0
in my python program to upload a file to the internet, im using a GTK progress bar to show the upload progress. But the problems that im facing is that the progress bar does not show any activity until the upload is complete, and then it abruptly indicates upload complete. im using pycurl to make the http requests...my question is - do i need to have a multi-threaded application to upload the file and simultaneously update the gui? or is there some other mistake that im making? Thanks in advance!
false
496,814
0.039979
0
0
1
More than likely the issue is that in your progress callback, which is where I presume you're updating the progress bar, you're not making a call to manually update the display i.e. run through the GUI's event loop. This is just speculation though, if you can provide more code, it might be easier to narrow it down further. The reason you need to manually update the display is because your main thread is also performing the upload, which is where it's blocking.
0
6,986
0
9
2009-01-30T19:17:00.000
python,user-interface,gtk,progress-bar,pygtk
Progress bar not updating during operation
0
1
5
496,995
1
0
0
I have a C extension module for Python and I want to make it available to Rubyists. The source has a number of C modules, with only one being Python-dependent. The rest depend only on each other and the standard library. I can build it with python setup.py build in the usual way. I've been experimenting with adding Ruby support using newgem and I can build a version of the extension with rake gem. However, the combined source has an ugly directory layout (mixing Gem-style and Setuptools-style structures) and the build process is a kludge. I can't just keep all the sources in the same directory because mkmf automatically picks up the Python-dependent module and tries to build that, and users shouldn't have to install Python to compile a module that won't be used. My current hack is for extconf.rb to copy the Python-independent source-files into the same directory as the Ruby-dependent extension module. Is there a saner way to make the code available to both languages? Should I just duplicate the Python-independent code in a separate Gem? Should I release the independent code as a separate lib built with autotools? Is there a version of mkmf that can skip the unwanted module?
true
511,412
1.2
1
0
5
One way to solve it is to create three different projects: The library itself, independent on python & ruby Python bindings Ruby bindings That's probably the cleanest solution, albeit it requires a bit more work when doing releases, but it has the advantage that you can release a new version of the Ruby bindings without having to ship a new library/python bindings version.
0
734
0
8
2009-02-04T13:42:00.000
python,ruby,setuptools,newgem
Combined Python & Ruby extension module
0
1
2
511,871
1
0
0
I've been writing tools in Maya for years using MEL and Python. I'd consider myself an expert in custom window/gui design in Maya except for one area; modifying existing panels and editors. Typically, I'm building tools that need totally custom UIs, so its customary for me to build them from scratch. However, recently I've found myself wanting to add some additional functionality to the layer editor in Maya. I've seen tutorials that explain how to do this, but now that I want to do it, I can't find any. Links to tutorials or a brief code snippet to get me started would be great. I just need to know how to find the layer editor/panel and, say, add a button or text field to it.
true
527,314
1.2
0
0
1
Have you tried searching ui item names in MEL files under maya installation directory? It should be one of the MEL scripts included, and from there you can just modify it.
0
5,048
0
1
2009-02-09T07:05:00.000
python,user-interface,maya,panels,mel
How to modify existing panels in Maya using MEL or Python?
0
1
4
551,109
1
0
0
I've got an wx App that has the UI defined in XRC files. Each form is in its own xrc file. There is one panel that is common to many of the forms. Is there a way to have objects defined in one file that are included and referenced in another? I know there is a object_ref mechanism, but I can't see how that can reference external xrc files. I'd like something that worked similar to the way you can define xsd elements in one file and include and reference them in another xsd file.
true
537,774
1.2
0
0
1
XRC doesn't have an include mechanism that I know of, but you can have custom widgets. So implement your common panel as its own XRC, and set that up as something that you can reference by class name in other xrc files. You would create an XmlResourceHandler that handles the custom Panel in the XRC, and instantiates your Panel class. The place to look is demo/wxXmlResourceHandler.py You can even extend XRCed to recognize your own resource, and insert it into future dialogs with ease.
0
260
0
0
2009-02-11T16:58:00.000
wxpython,wxwidgets,xrc
Is there to include elements from one xrc file in another xrc file
0
1
1
598,169
1
0
0
How to remove tkinter icon from title bar in it's window
false
550,050
0.057081
0
0
2
Alternative to @ubomb's solution for adding custom images by utilizing Tkinter.PhotoImage's built-in support for processing .gif images. From file: icon = Tkinter.PhotoImage(file="logo.gif") from base64: gif_base64_string = """ R0lGODdhEAAQAIcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4O Dg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEh ... 4B8AAP9Ci/4HoLTpfwD+qV4NoHVAADs= """ icon = Tkinter.PhotoImage(data=gif_base64_string) Visit the undermentioned link for more details: //effbot.org/tkinterbook/photoimage.htm
0
45,549
0
26
2009-02-15T00:27:00.000
python,python-3.x,tkinter,tk
Removing the TK icon on a Tkinter window
0
1
7
52,803,981
1
0
0
For C++, Java, or Python, what are some good game + free game engines that are easy to pick up? Any type of game engine is okay. I just want to get started somewhere by looking into different game engines and their capabilities.
false
564,469
0
1
0
0
There is a RPG engine called VERGE if you're interested. Never tried it but I heard good things from it. I think it's in C++.
0
10,754
0
9
2009-02-19T09:05:00.000
java,c++,python
What is a good & free game engine?
0
1
14
1,949,983
1
0
0
In a "multitouch" environement, any application showed on a surface can be rotated/scaled to the direction of an user. Actual solution is to drawing the application on a FBO, and draw a rotated/scaled rectangle with the texture on it. I don't think it's good for performance, and all graphics cards don't provide FBO. The idea is to clip the rendering viewport in the direction of user. Since glViewport cannot be used for that, is another way exist to achieve that ? (glViewport use (x, y, width, height), and i would like (x, y, width, height, rotation from center?)) PS: rotating the modelview or projection matrix will not help, i would like to "rotate the clipping plan" generated by glViewport. (only part of the all scene).
false
577,639
0.197375
0
0
2
If you already have the code set up to render your scene, try adding a glRotate() call to the viewmodel matrix setup, to "rotate the camera" before rendering the scene.
0
3,051
0
2
2009-02-23T13:33:00.000
python,math,opengl
Rotating a glViewport?
0
2
2
577,672
1
0
0
In a "multitouch" environement, any application showed on a surface can be rotated/scaled to the direction of an user. Actual solution is to drawing the application on a FBO, and draw a rotated/scaled rectangle with the texture on it. I don't think it's good for performance, and all graphics cards don't provide FBO. The idea is to clip the rendering viewport in the direction of user. Since glViewport cannot be used for that, is another way exist to achieve that ? (glViewport use (x, y, width, height), and i would like (x, y, width, height, rotation from center?)) PS: rotating the modelview or projection matrix will not help, i would like to "rotate the clipping plan" generated by glViewport. (only part of the all scene).
true
577,639
1.2
0
0
2
There's no way to have a rotated viewport in OpenGL, you have to handle it manually. I see the following possible solutions : Keep on using textures, perhaps using glCopyTexSubImage instead of FBOs, as this is basic OpenGL feature. If your target platforms are hardware accelerated, performance should be ok, depending on the number of viewports you need on your desk, as this is a very common use case nowadays. Without textures, you could setup your glViewport to the screen-aligned bounding rectangle (rA) of your rotated viewport (rB) (setting also proper scissor testing area). Then draw a masking area, possibly only in depth or stencil buffer, filling the (rA - rB) area, that will prevent further drawing on those pixels. Then draw normally your application, using a glRotate to adjust you projection matrix, so that the rendering is properly oriented according to rB.
0
3,051
0
2
2009-02-23T13:33:00.000
python,math,opengl
Rotating a glViewport?
0
2
2
593,825
1
1
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
false
595,296
0.148885
0
0
3
Yes, PyS60 is based on CPython, thus uses the C stack.
0
417
0
3
2009-02-27T15:48:00.000
python,symbian,nokia,pys60
Does the stack limit of Symbian also apply to PyS60?
0
4
4
595,330
1
1
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
false
595,296
0.049958
0
0
1
Increasing the Symbian stack size is done through a parameter in the mmp file. This is valid when you create a native application that the toolchain will turn into an exe file. If you were to upgrade the Python runtime on your phone, with a version you built yourself, you could increase the stack size of the runtime process itself.
0
417
0
3
2009-02-27T15:48:00.000
python,symbian,nokia,pys60
Does the stack limit of Symbian also apply to PyS60?
0
4
4
606,180
1
1
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
false
595,296
0
0
0
0
I would assume that PyS60 should be doing the memory management for you, as your program will probably be constrained by the resources of PyS60.
0
417
0
3
2009-02-27T15:48:00.000
python,symbian,nokia,pys60
Does the stack limit of Symbian also apply to PyS60?
0
4
4
685,145
1
1
0
Symbian has a stack limit of 8kB. Does this also apply to the function calling in PyS60 apps?
true
595,296
1.2
0
0
1
There is a difference between python runtime and python apps. Also from PyS60 app developer point of view, it's the heapsize that's more interesting... Version 1.9.5 comes by default with heapsize 100k min and 4M max. Of course you can define those by yourself when creating the SIS package to release and distribute your application. Sorry if I answered right question with wrong answer (stack vs heap). Stack is usually "enough", but with deep enough recursion you can run out of it. Have done it - and fixed some endless loops :) Never had any real stack problems. Usually it's the heap that runs out, esp with graphics manipulation.
0
417
0
3
2009-02-27T15:48:00.000
python,symbian,nokia,pys60
Does the stack limit of Symbian also apply to PyS60?
0
4
4
915,134
1
1
0
I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop. IronPython-1.1 implemented IDisposable on its objects so that you can dispose of them when they are done. The new IronPython-2 engine based on the DLR has no such concept. From what I understood, everytime you execute a script in the ScriptEngine a new assembly is injected in the appdomain and can't be unloaded. Is there any way around this?
true
610,128
1.2
1
0
0
Turns out, after aspnet_wp goes to about 500mb, the garbage collector kicks in and cleans out the mess. The memory usage then drops to about 20mb and steadily starts increasing again during load testing. So there's no memory 'leak' as such.
0
1,344
0
2
2009-03-04T11:11:00.000
performance,ironpython
IronPython memory usage
0
2
3
613,533
1
1
0
I'm hosting IronPython in a c#-based WebService to be able to provide custom extension scripts. However, I'm finding that memory usage sharply increases when I do simple load testing by executing the webservice repeatedly in a loop. IronPython-1.1 implemented IDisposable on its objects so that you can dispose of them when they are done. The new IronPython-2 engine based on the DLR has no such concept. From what I understood, everytime you execute a script in the ScriptEngine a new assembly is injected in the appdomain and can't be unloaded. Is there any way around this?
false
610,128
0.066568
1
0
1
You could try creating a new AppDomain every time you run one of your IronPython scripts. Although assebmlies cannot be unloaded from memory you can unload an AppDomain and this will allow you to get the injected assembly out of memory.
0
1,344
0
2
2009-03-04T11:11:00.000
performance,ironpython
IronPython memory usage
0
2
3
611,623
1
0
0
From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of a technical exercise on what can be done?
false
619,437
0
1
0
0
cross-platform compatibility Yes
1
3,214
0
28
2009-03-06T16:25:00.000
python,interpreter,pypy
What does PyPy have to offer over CPython, Jython, and IronPython?
0
2
4
619,480
1
0
0
From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of a technical exercise on what can be done?
true
619,437
1.2
1
0
38
PyPy is really two projects: An interpreter compiler toolchain allowing you to write interpreters in RPython (a static subset of Python) and have cross-platform interpreters compiled standalone, for the JVM, for .NET (etc) An implementation of Python in RPython These two projects allow for many things. Maintaining Python in Python is much easier than maintaining it in C From a single codebase you can generate Python interpreters that run on the JVM, .NET and standalone - rather than having multiple slightly incompatible implementations Part of the compiler toolchain includes an experimental JIT generator (now in its fifth incarnation and starting to work really well) - the goal is for a JITed PyPy to run much faster than CPython It is much easier to experiment with fundamental language features - like removing the GIL, better garbage collection, integrating stackless and so on So there are really a lot of reasons for PyPy to be exciting, and it is finally starting to live up to all its promises.
1
3,214
0
28
2009-03-06T16:25:00.000
python,interpreter,pypy
What does PyPy have to offer over CPython, Jython, and IronPython?
0
2
4
619,544
1
0
0
wx (and wxPython) has two events I miss in PyQt: EVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state EVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler Now, PyQt doesn't seem to have these, and the PyQt book suggests writing an updateUi method and calling it manually. I even ended up calling it from a timer once per 0.1 seconds, in order to avoid many manual calls from methods that may update the GUI. Am I missing something? Is there a better way to achieve this? An example: I have a simple app with a Start button that initiates some processing. The start button should be enabled only when a file has been opened using the menu. In addition, there's a permanent widget on the status bar that displays information. My application has states: Before the file is opened (in this state the status bar show something special and the start button is disabled) File was opened and processing wasn't started: the start button is enabled, status bar shows something else The processing is running: the start button now says "Stop", and the status bar reports progress In Wx, I'd have the update UI event of the button handle its state: the text on it, and whether it's enabled, depending on the application state. The same for the status bar (or I'd use EVT_IDLE for that). In Qt, I have to update the button in several methods that may affect the state, or just create a update_ui method and call it periodically in a timer. What is the more "QT"-ish way?
false
624,050
0.049958
0
0
1
As far as I understand EVT_IDLE is sent when application message queue is empty. There is no such event in Qt, but if you need to execute something in Qt when there are no pending events, you should use QTimer with 0 timeout.
0
2,691
0
2
2009-03-08T18:26:00.000
python,qt,wxpython,pyqt
wx's idle and UI update events in PyQt
0
2
4
624,282
1
0
0
wx (and wxPython) has two events I miss in PyQt: EVT_IDLE that's being sent to a frame. It can be used to update the various widgets according to the application's state EVT_UPDATE_UI that's being sent to a widget when it has to be repainted and updated, so I can compute its state in the handler Now, PyQt doesn't seem to have these, and the PyQt book suggests writing an updateUi method and calling it manually. I even ended up calling it from a timer once per 0.1 seconds, in order to avoid many manual calls from methods that may update the GUI. Am I missing something? Is there a better way to achieve this? An example: I have a simple app with a Start button that initiates some processing. The start button should be enabled only when a file has been opened using the menu. In addition, there's a permanent widget on the status bar that displays information. My application has states: Before the file is opened (in this state the status bar show something special and the start button is disabled) File was opened and processing wasn't started: the start button is enabled, status bar shows something else The processing is running: the start button now says "Stop", and the status bar reports progress In Wx, I'd have the update UI event of the button handle its state: the text on it, and whether it's enabled, depending on the application state. The same for the status bar (or I'd use EVT_IDLE for that). In Qt, I have to update the button in several methods that may affect the state, or just create a update_ui method and call it periodically in a timer. What is the more "QT"-ish way?
true
624,050
1.2
0
0
5
The use of EVT_UPDATE_UI in wxWidgets seems to highlight one of the fundamental differences in the way wxWidgets and Qt expect developers to handle events in their code. With Qt, you connect signals and slots between widgets in the user interface, either handling "business logic" in each slot or delegating it to a dedicated method. You typically don't worry about making separate changes to each widget in your GUI because any repaint requests will be placed in the event queue and delivered when control returns to the event loop. Some paint events may even be merged together for the sake of efficiency. So, in a normal Qt application where signals and slots are used to handle state changes, there's basically no need to have an idle mechanism that monitors the state of the application and update widgets because those updates should occur automatically. You would have to say a bit more about what you are doing to explain why you need an equivalent to this event in Qt.
0
2,691
0
2
2009-03-08T18:26:00.000
python,qt,wxpython,pyqt
wx's idle and UI update events in PyQt
0
2
4
624,734
1
0
0
I am writing an IM client for Mac (in Python, but an Objective C / Cocoa solution here is fine). I want to detect whether or not the user is currently watching a movie or playing a game in the foreground, or doing anything else that takes up the entire screen. If so, I won't play a sound when a new IM comes in, but if not, I will play the sound. How can I detect this? Is there some way to get the foreground window with Applescript and look at its dimensions? Or is there some other API call?
false
633,086
0
0
0
0
The two solutions posted so far apply to “real” full-screen, but it’s worth noting that many full-screen apps just put a window over the whole screen (or, as vasi points out, a whole screen). To be accurate, you’ll have to check both.
0
1,606
0
2
2009-03-11T02:11:00.000
python,objective-c,cocoa,macos,fullscreen
Detecting fullscreen on Mac
0
1
4
633,718
1
0
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
true
636,990
1.2
0
0
6
If all you want is a GUI, wxPython should do the trick. If you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame.
0
5,022
0
6
2009-03-12T00:53:00.000
python,wxpython,pygame,playing-cards
wxPython or pygame for a simple card game?
0
3
6
637,017
1
0
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
false
636,990
0.099668
0
0
3
Generally, PyGame is the better option for coding games. But that's for the more common type of games - where things move on the screen and you must have a good "frame-rate" performance. For something like a card game, however, I'd go with wxPython (or rather, PyQt). This is because a card game hasn't much in terms of graphics (drawing 2D card shapes on the screen is no harder in wx / PyQt than in PyGame). And on the other hand, you get lots of benefits from wx - like a ready-made GUI for interaction. In Pygame you have to create a GUI yourself or wade through several half-baked libraries that do it for you. This actually makes sense for Pygame because when you create a game you usually want a GUI of your own, that fits the game's style. But for card games, most chances are that wx's standard GUI widgets will do the trick and will save you hours of coding.
0
5,022
0
6
2009-03-12T00:53:00.000
python,wxpython,pygame,playing-cards
wxPython or pygame for a simple card game?
0
3
6
640,064
1
0
0
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
false
636,990
0.033321
0
0
1
I'd say pygame -- I've heard it's lots of fun, easy and happy. Also, all of my experiences with wxPython have been sad an painful. But I'm not bias or anything.
0
5,022
0
6
2009-03-12T00:53:00.000
python,wxpython,pygame,playing-cards
wxPython or pygame for a simple card game?
0
3
6
637,004
1
0
0
I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). When I was planning what to do, I started wondering about switching to Python. I know that Python didn't come into existence to be a tool to write 3d games, but is it possible to write good looking games with this language? I have in mind 3d graphics, nice effects and free CPU time to power to rest of game engine? I had seen good looking java games - and too be honest, I was rather shocked when I saw level of detail achieved in Runescape HD. On the other hand, pygame.org has only 2d games, with some starting 3d projects. Are there any efficient 3d game engines for python? Is pyopengl the only alternative? Good looking games in python aren't popular or possible to achieve? I would be grateful for any information / feedback.
true
641,770
1.2
0
0
18
If you are worried about 3D performance: Most of the performance-critical parts will be handled by OpenGL (in a C library or even in hardware), so the language you use to drive it should not matter too much. To really find out if performance is a problem, you'd have to try it. But there is no reason why it cannot work in principle. At any rate, you could still optimize the critical parts, either in Python or by dropping to C. You still gain Python's benefit for most of the game engine which is less performance-critical.
0
17,104
0
16
2009-03-13T07:48:00.000
python,opengl
Can 3D OpenGL game written in Python look good and run fast?
0
2
8
641,832
1
0
0
I am planning to write an simple 3d(isometric view) game in Java using jMonkeyEngine - nothing to fancy, I just want to learn something about OpenGL and writing efficient algorithms (random map generating ones). When I was planning what to do, I started wondering about switching to Python. I know that Python didn't come into existence to be a tool to write 3d games, but is it possible to write good looking games with this language? I have in mind 3d graphics, nice effects and free CPU time to power to rest of game engine? I had seen good looking java games - and too be honest, I was rather shocked when I saw level of detail achieved in Runescape HD. On the other hand, pygame.org has only 2d games, with some starting 3d projects. Are there any efficient 3d game engines for python? Is pyopengl the only alternative? Good looking games in python aren't popular or possible to achieve? I would be grateful for any information / feedback.
false
641,770
0.024995
0
0
1
There was a Vampires game out a few years ago where most if not all of the code was in Python. Not sure if the 3D routines were in them, but it worked fine.
0
17,104
0
16
2009-03-13T07:48:00.000
python,opengl
Can 3D OpenGL game written in Python look good and run fast?
0
2
8
645,987
1
0
0
I noticed that my programs written with wxPython have Win98 button style. But Boa Constructor (that is written using wxPython too) got pretty buttons. How to make buttons look like current Windows buttons style?
false
642,853
-0.099668
0
0
-2
Have you tried running your scripts with pythonw.exe instead of python.exe?
0
1,511
0
3
2009-03-13T14:01:00.000
python,coding-style,wxpython
WinXP button-style with wxPython
0
2
4
642,948
1
0
0
I noticed that my programs written with wxPython have Win98 button style. But Boa Constructor (that is written using wxPython too) got pretty buttons. How to make buttons look like current Windows buttons style?
false
642,853
0
0
0
0
The answers so far handle distributing the package as an executable (eg. py2exe), where the answer has already been given. But since (i think) python 2.6 you have the same problem when just starting the .py file from the commandline (Vista and Windows7). Robin Dunn suggested using update_manifest.py which he distributes with wxPython and puts it in the same directory as python.exe. After applying update_manifest.py using a copied version of python.exe wxPython apps have the correct themed look and yes it also works using windows7 RC1.
0
1,511
0
3
2009-03-13T14:01:00.000
python,coding-style,wxpython
WinXP button-style with wxPython
0
2
4
841,710
1
0
0
I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with "__imp": error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main python26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin /all shows them). Thanks.
false
658,879
0.197375
0
0
2
Try to include C:\WINDOWS\system32\python26.dll in your references. python26.lib contains the symbol names for the main DLL.
1
6,181
0
8
2009-03-18T15:52:00.000
python,visual-studio,import,linker
Linking to Python import library in Visual Studio 2005
0
2
2
659,107
1
0
0
I have a C++ application that has embedded Python. I'm building with Visual Studio 2005. When I try to link to python26.lib, I get a number of unresolved symbols, all of which begin with "__imp": error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main python26.lib is an import library (installed by the Python 2.6 installer). What do I have to do to resolve these symbols? They do exist in the import library (dumpbin /all shows them). Thanks.
true
658,879
1.2
0
0
13
Looks like I was trying to link a 64-bit Python library to a 32-bit application. I wish the linker would tell me something other than "unresolved symbol." Linking to the 32-bit library fixes the problem.
1
6,181
0
8
2009-03-18T15:52:00.000
python,visual-studio,import,linker
Linking to Python import library in Visual Studio 2005
0
2
2
660,181
1
0
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
false
671,741
0.024995
0
0
1
There is a good book on wxPython, "wxPython in Action", which can't be said for some of the other solutions. No knock on the others. I've had success developing with wxPython in the past and it comes with a great set of demo applications with source code from which you can borrow liberally. The best UI designer I found for wxPython applications is a commercial one, Anthemion DialogBlocks. It's by one of the wxPython programmers and is worth the money. Other solutions for UI design include wxGlade (I found it usable but not featureful) and Boa Constructor (haven't used it). Wing IDE might also have one. Stani's Python Editor bundles wxGlade, I believe. There are a lot of other projects that don't really work or are fairly old. As far as SQL automation goes, as another answerer says, I'd look at SQL alchemy, but the learning curve for a small application might be too much and you'd be better off just going straight to odbc. The best odbc api is the one used by Django, pyodbc. It's been a while since I developed with these tools, so there may be something newer for each, but at the time these were definitely the best of breed in my opinion.
0
1,574
0
7
2009-03-22T22:49:00.000
python,user-interface,sqlite,gtk,glade
Is there a Python library that allows to build user interfaces without writing much code?
0
3
8
691,567
1
0
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
false
671,741
0
0
0
0
I had lots of success with wxPython, but that was some years ago now and there may be better new solutions...
0
1,574
0
7
2009-03-22T22:49:00.000
python,user-interface,sqlite,gtk,glade
Is there a Python library that allows to build user interfaces without writing much code?
0
3
8
678,000
1
0
0
I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time. Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates. The technologies in question are just examples, but I want to stick with Python as far as possible.
false
671,741
0.099668
0
0
4
PyQt and its models can automate some of these tasks for you (to some amount off course, e.g. filling widgets with data from a database and handling most of the widgets behaviour, buffering etc.). If you want a more object-oriented approach to handling SQL you could look into an ORM-oriented solution (for example SQLAlchemy).
0
1,574
0
7
2009-03-22T22:49:00.000
python,user-interface,sqlite,gtk,glade
Is there a Python library that allows to build user interfaces without writing much code?
0
3
8
671,752
1
0
0
My next work is going to be heavily focused on working with data that is best understood when organized on a two-dimensional zoomable plane or canvas, instead of using lists and property forms. The library can be based on OpenGL, GTK+ or Cairo. It should allow me to: build widgets out of vector shapes and text (perhaps even SVG based?) arrange these widgets on a 2D plane catch widget-related events zoom deeply into a widget to reveal additional data arrange widgets in a tree animate widgets fluidly It wouldn't hurt if it would also allow for some databinding or model/view concept.
false
673,434
0.291313
0
0
3
Qt has this covered... check PyQt
0
802
0
3
2009-03-23T13:51:00.000
python,user-interface,opengl,gtk,cairo
Is there a Python library for easily writing zoomable UI's?
0
1
2
673,447
1
0
0
This is a continuation of my question Python2.5.2 The code i developed is working fine with clr.Addreference(). Now thee problem is I have to load ny script which uses dll developed in .NET to another application.They had used QT for its implementation.There is a Script console in that application.When ii entered 'import clr' ,it was saying 'No module named clr' or 'Cannot import clr'.What shall i do?
true
680,336
1.2
0
0
3
You won't be able to run your script in that application. The script console in that QT application doubtlessly uses plain ol' CPython instead of IronPython. There's no real good way to change that without significant surgery to the application that's hosting the python console.
1
614
0
0
2009-03-25T05:34:00.000
python,ironpython
Python 2.5.2 continued
0
1
1
680,367
1
0
0
I hit this issue about two years ago when I first implemented our SWIG bindings. As soon as we exposed a large amount of code we got to the point where SWIG would output C++ files so large the compiler could not handle them. The only way I could get around the issue was to split up the interfaces into multiple modules and to compile them separately. This has several downsides: • Each module must know about dependencies in other modules. I have a script to generate the interface files which handles this side of things, but it adds extra complexity. • Each additional module increases the time that the dynamic linker requires to load in the code. I have added an init.py file that imports all the submodules, so that the fact that the code is split up is transparent to the user, but what is always visible is the long load times. I'm currently reviewing our build scripts / build process and I wanted to see if I could find a solution to this issue that was better than what I have now. Ideally, I'd have one shared library containing all the wrapper code. Does anyone know how I can acheive this with SWIG? I've seen some custom code written in Ruby for a specific project, where the output is post-processed to make this possible, but when I looked at the feasibility for Python wrappers it does not look so easy.
false
697,749
0
1
0
0
If split properly, the modules don't necessarily need to have the same dependencies as the others - just what's necessary to do compilation. If you break things up appropriately, you can have libraries without cyclic dependencies. The issue with using multiple libraries is that by default, SWIG declares its runtime code statically, and as a result, as problems passing objects from one module to another. You need to enable a shared version of the SWIG runtime code. From the documentation (SWIG web page documentation link is broken): The runtime functions are private to each SWIG-generated module. That is, the runtime functions are declared with "static" linkage and are visible only to the wrapper functions defined in that module. The only problem with this approach is that when more than one SWIG module is used in the same application, those modules often need to share type information. This is especially true for C++ programs where SWIG must collect and share information about inheritance relationships that cross module boundaries. Check out that section in your downloaded documentation (section 16.2 The SWIG runtime code), and it'll give you details on how to enable this so that objects can be properly handled when passed from one module to the other. FWIW, I've not worked with Python SWIG, but have done Tcl SWIG.
0
2,117
0
9
2009-03-30T15:40:00.000
c++,python,swig
Is it possible to split a SWIG module for compilation, but rejoin it when linking?
0
1
2
698,089
1
0
0
I have a wx.Frame, in which I have a vertical BoxSizer with two items, a TextCtrl and a custom widget. I want the custom widget to have a fixed pixel height, while the TextCtrl will expand normally to fill the window. What should I do?
true
730,394
1.2
0
0
6
Got it. When creating the widget, use a size of (-1,100), where "100" is the height you want. Apparently the "-1" is a sort of "None" in this context. When adding the widget to the sizer, use a proportion of 0, like this: self.sizer.Add(self.timeline,0,wx.EXPAND)
0
2,175
0
2
2009-04-08T14:53:00.000
python,layout,wxpython,widget
wxPython: Making a fixed-height panel
0
1
1
730,452
1
0
0
I'm kind of lost on how to approach this problem, I'd like to write a GUI ideally using Tkinter with python, but I initially started with Qt and found that the problem extends either with all GUI frameworks or my limited understanding. The data in this case is coming from a named pipe, and I'd like to display whatever comes through the pipe into a textbox. I've tried having one thread listen on the pipe and another create the GUI, but in both cases one thread always seems to hang or the GUI never gets created. Any suggestions?
false
731,759
0
0
0
0
When I did something like this I used a separate thread listening on the pipe. The thread had a pointer/handle back to the GUI so it could send the data to be displayed. I suppose you could do it in the GUI's update/event loop, but you'd have to make sure it's doing non-blocking reads on the pipe. I did it in a separate thread because I had to do lots of processing on the data that came through. Oh and when you're doing the displaying, make sure you do it in non-trivial "chunks" at a time. It's very easy to max out the message queue (on Windows at least) that's sending the update commands to the textbox.
0
641
0
0
2009-04-08T20:46:00.000
python,user-interface,named-pipes
Showing data in a GUI where the data comes from an outside source
0
2
3
731,919
1