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 a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0
1
0
0
As someone familiar with C# and .NET you should consider IronPython. Python for .NET. This would be a good way to leverage what you know and learn a new dynamic language at the same time.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,470
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
1
1
0
7
I Am a little scared of C++ because developing anything in it takes ages. I'm not sure how you can say that when you say yourself that you have no experience in the language. C++ is a good tool for some things, Python is good for other things. What you want to do should be driving this decision, not the technology in and of itself. C# programmer or not, I would assume that you can pick up any language, but a language is just a tool, so your question is difficult to answer.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,460
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0.099668
1
0
5
Python may be easier to get started with, but a dynamically typed scripting language is a very different language from C# or C++. You will learn more about programming learning it than you will by hopping to a close cousin of a language you already know. Really, solid familiarity with at least one scripting language (Python, Perl and Ruby are the favorites) should be a requirement for all programmers.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,467
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
true
1,534,450
1.2
1
0
2
C# is a little closer to Java and C++ than it is to Python, so learn Python first out of the two. However, my advice would be: Stick with your current language and learn more techniques, such as a wider range of algorithms, functional programming, design by contract, unit testing, OOAD, etc. learn C (focus on figuring out pointers, multi-dimensional arrays, data structures like linked lists, and resource management like memory allocation/deallocation, file handles, etc) learn Assembly (on a modern platform with a flat memory architecture, but doing low-level stuff like talking to hardware or drawing on a canvas) learn Python or Ruby. Chances are, you'll stick with one of these for a while, knowing all of the above, unless some hot new language has come along by then.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,729
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0.059928
1
0
3
If you want to apply to Google then Python might be the one to go for, surely MS would like the C# already. If nothing else the competition would not be as fierce as there are much more folk out there with multi years of C++ experience. Also Python gives you a broader language skill and would be a good path to more languages and scripting. But as said and will be said again, choose your tool wisely and see whether it's a nail or a screw you're trying to secure.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,483
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0
1
0
0
You might be interested in looking at Windows Powershell. It's the latest scripting technology from Microsoft, built on .NET, and can be extended via C#. Granted, it's not as portable as C++ or Python, but it would leverage your C#/.NET experience more readily. Otherwise, I would suggest C++ (and possibly C). Microsoft builds a lot more of its products with C/C++ than with Python.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,589
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0.019997
1
0
1
C++ is usually used when speed, and low-level OS access is involved. It's a good skill to have if you want to expand. Python allows you to do thing quickly, and it's quite easy to learn, and provides more power than you'd expect from a scripting language, and probably one of the fastest ones out there. C++ isn't exactly slow to develop, if you've got an IDE, it's not hard to write per-se, but the syntax is going to get you.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,645
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0.019997
1
0
1
If you want to apply to Google and/ or Microsoft then I'd say that of the two you need both! Given more choice, probably C++ and one other language - either dynamic, functional, or both (Scala might be a good choice too). It's not necessarily about whether you'd use the languages themselves but more about the different approaches they require and encourage. If you continue to be "scared" by C++ you're probably going to struggle applying as a dev at either of those organisations - unless you are highly specialised elsewhere.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,651
1
0
0
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future. So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language. Any C# developers having same dilemma?
false
1,534,450
0.019997
1
0
1
Why not learn some of each. Studying a language for a week or so won't make you an expert, but it will answer a lot of questions in your head and plant a seed for the future. It's important to not just read through exercises. Find some simple problems that can be programmed in a page or two at most and solve them with each language. That will help you to learn the strengths and weaknesses in the context of the way you think and how you solve problems.
1
1,673
0
2
2009-10-07T21:52:00.000
c#,c++,python
C++ or Python for C# programmer?
0
9
10
1,534,556
1
0
0
I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its "Main Function" or from where the program start executing. So is there any tutorial/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python. OK i think i did not put the question heading or question right, basically i was confused about the "Main" Function, otherwise other things are quite obvious from python official documentation except this concept. Thanks to all
false
1,548,620
0
0
0
0
I started Python over a year ago too, also C++ background. I've learned that everything is simpler in Python, you don't need to worry so much if you're doing it right, you probably are. Most of the things came natural. I can't say I've read a book or anything, I usually pested the guys in #python on freenode a lot and looked at lots of other great code out there. Good luck :)
0
463
0
4
2009-10-10T17:56:00.000
python
Python for C++ or Java Programmer
0
2
7
1,548,641
1
0
0
I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its "Main Function" or from where the program start executing. So is there any tutorial/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python. OK i think i did not put the question heading or question right, basically i was confused about the "Main" Function, otherwise other things are quite obvious from python official documentation except this concept. Thanks to all
false
1,548,620
0
0
0
0
The pithiest comment I guess is that the entry point is the 1st line of your script that is not a function or a class. You don't necessarily need to use the if hack unless you want to and your script is meant to be imported.
0
463
0
4
2009-10-10T17:56:00.000
python
Python for C++ or Java Programmer
0
2
7
1,548,801
1
0
0
Is there a way to do this? Also, I need this to work with pygame, since I want audio in my game. I'm asking this because I didn't see any tone change function in pygame.. Anyone knows? Update: I need to do something like the noise of a car accelerating. I don't really know if it is timbre or tone.
true
1,561,104
1.2
0
0
1
Well, it depends on how you're doing your sounds: I'm not sure if this is possible with pygame, but SDL (which pygame is based off of) lets you have a callback to retrieve data for the sound buffer, and it's possible to change the frequency of the sine wave (or whatever) to get different tones in the callback, given that you generate the sound there. If you're using a pre-rendered tone, or sound file, then you'll probably have to resample it to get it to play at different frequencies, although it'd be difficult to keep the same length. If you're talking about changing the timbre of the sound, then that's a whole different ballpark... Also, it depends on how fast the sound needs to change: if you can accept a little lag in response, you could probably generate a few short sounds, and play/loop them as necessary. I'm not sure how constant replaying of sounds would impact performance/the overall audio quality, though: you'd have to make sure the ends of all the waveform ends smoothly transition to the beginning of the next one (maybe).
0
1,240
0
1
2009-10-13T15:44:00.000
python,pygame,pitch
Playing sounds with python and changing their tone during playback?
0
1
1
1,561,314
1
0
0
After upgrading to Snow Leopard, I'm having trouble building my application. It looks like py2app is building and copying over wxPython, but when I run from the buld app, it can't find wx.
false
1,562,483
1
0
0
7
I solved this by doing a clean Snow Leopard install, and installing python from Python.org, then the corresponding wxPython. py2app I built from source.
0
997
0
4
2009-10-13T19:39:00.000
macos,wxpython,osx-snow-leopard,py2app
py2app dropping wxpython (Snow Leopard)
0
1
1
1,583,793
1
0
0
I am probably looking for the wrong thing in the handbook, but I am looking to take an image object and expand it without resizing (stretching/squishing) the original image. Toy example: imagine a blue rectangle, 200 x 100, then I perform some operation and I have a new image object, 400 x 300, consisting of a white background upon which a 200 x 100 blue rectangle rests. Bonus if I can control in which direction this expands, or the new background color, etc. Essentially, I have an image to which I will be adding iteratively, and I do not know what size it will be at the outset. I suppose it would be possible for me to grab the original object, make a new, slightly larger object, paste the original on there, draw a little more, then repeat. It seems like it might be computationally expensive. However, I thought there would be a function for this, as I assume it is a common operation. Perhaps I assumed wrong.
false
1,572,691
1
0
0
6
You might consider a rather different approach to your image... build it out of tiles of a fixed size. That way, as you need to expand, you just add new image tiles. When you have completed all of your computation, you can determine the final size of the image, create a blank image of that size, and paste the tiles into it. That should reduce the amount of copying you're looking at for completing the task. (You'd likely want to encapsulate such a tiled image into an object that hid the tiling aspects from the other layers of code, of course.)
0
13,934
0
26
2009-10-15T14:23:00.000
python,python-imaging-library
In Python, Python Image Library 1.1.6, how can I expand the canvas without resizing?
0
1
4
1,573,679
1
0
0
I've got a library written in C++ which I wrap using SWIG and use in python. Generally there is one class with few methods. The problem is that calling these methods may be time consuming - they may hang my application (GIL is not released when calling these methods). So my question is: What is the simplest way to release GIL for these method calls? (I understand that if I used a C library I could wrap this with some additional C code, but here I use C++ and classes)
false
1,576,737
0
1
0
0
You can use the same API call as for C. No difference. Include "python.h" and call the appoproate function. Also, see if SWIG doesn't have a typemap or something to indicate that the GIL shuold not be held for a specific function.
1
3,393
0
7
2009-10-16T08:07:00.000
c++,python,swig,gil
Releasing Python GIL while in C++ code
0
1
3
1,576,959
1
0
0
I need to create a desktop app that will work with Windows and Gnome(Ubuntu). I would like to use Python to do this. The GUI part of the app will be a single form with a message area and a couple of buttons. The list of GUI's for Python seems overwhelming. I am looking for something simple if possible, the main requirements is it must work with Gnome(2.26 and up) and Windows XP/Vista/7.
false
1,577,175
0.197375
0
0
4
You might want to check out wxPython. It's a mature project and should work on Windows and Linux (Gnome).
0
895
0
4
2009-10-16T09:53:00.000
python,user-interface,cross-platform
Python GUI Library for Windows/Gnome
0
1
4
1,577,197
1
0
0
I'm sure others have run into this problem too... I often watch videos in a small VLC window while working on other tasks, but no matter where the window is placed, I eventually need to access something in the GUI behind it, and have to manually reposition the video window first. This could be solved by having the VLC window snap to another corner whenever the mouse pointer is moved over it. I haven't found an app that does this, so would like to write one. What technologies could I use to do this? Cross platform might be harder... so what if just on Windows? I'd prefer something in C# (or Python), but am willing to learn something new if need be.
false
1,581,782
0
0
0
0
This is a bit OOT, but in Windows 7, shaking the active window will hide others to reveal the desktop (and so will clicking/hovering the rightmost taskbar button). Instead of hiding/moving vlc, you could just temporarily reveal the whole desktop. Shaking the active window again brings everything back.
0
565
0
2
2009-10-17T09:04:00.000
c#,python,windows,cross-platform,vlc
Reposition a VLC window programmatically
0
1
2
1,582,934
1
0
0
I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. here's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython. bear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython. 1) PLEASE don't recommend psyco edit: ANY information that will help understand the oficial cython docs is useful information
false
1,582,105
0
1
0
0
Cython does not support threads well at all. It holds the GIL (Global Intrepreter Lock) the entire time! This makes your code thread-safe by (virtually) disabling concurrent execution. So I wouldn't use it for general purpose development.
0
8,650
0
20
2009-10-17T12:33:00.000
python,c,cython
Noob-Ready Cython Tutorials
0
4
7
4,445,452
1
0
0
I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. here's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython. bear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython. 1) PLEASE don't recommend psyco edit: ANY information that will help understand the oficial cython docs is useful information
false
1,582,105
0
1
0
0
About all the C that you really need to know is: C types are much faster than Python types (adding to C ints or doubles can be done in a single clock cycle) but less safe (they are not arbitrarily sized and may silently overflow). C function (cdef) calls are much faster than Python (def) function calls (but are less flexible). This will get you most of the way there. If you want to eke out that last 10-20% speedup for most applications, there's no getting around knowing C, and how modern processes work (pointers, cache, ...).
0
8,650
0
20
2009-10-17T12:33:00.000
python,c,cython
Noob-Ready Cython Tutorials
0
4
7
2,582,450
1
0
0
I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. here's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython. bear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython. 1) PLEASE don't recommend psyco edit: ANY information that will help understand the oficial cython docs is useful information
false
1,582,105
0.028564
1
0
1
You can do a lot of very useful things with Cython if you can answer the following C quiz... (1) What is a double? What is an int? (2) What does the word "compile" mean? (3) What is a header (.h) file? To answer these questions you don't need to read a whole C book! ...maybe chapter 1. Once you can pass that quiz, try again with the tutorial. What I usually do is start with pure python code, and add Cython elements bit by bit. In that situation, you can learn the Cython features bit by bit. For example I don't understand C strings, because so far I have not tried to cythonize code that involves strings. When I do, I will first look up how strings work in C, and then second look up how strings work in Cython. Again, once you've gotten started with Cython, you will now and then run into some complication that requires learning slightly more C. And of course the more C you know, the more dextrous you will be with taking full advantage of Cython, not to mention troubleshooting if something goes wrong. But that shouldn't make you reluctant to start!
0
8,650
0
20
2009-10-17T12:33:00.000
python,c,cython
Noob-Ready Cython Tutorials
0
4
7
11,103,468
1
0
0
I know a bunch of scripting languages, (python, ruby, lua, php) but I don't know any compiled languages like C/C++ , I wanted to try and speed up some python code using cython, which is essentially a python -> C compiler, aimed at creating C extensions for python. Basically you code in a stricter version of python which compiles into C -> native code. here's the problem, I don't know C, yet the cython documentation is aimed at people who obviously already know C (nothing is explained, only presented), and is of no help to me, I need to know if there are any good cython tutorials aimed at python programmers, or if I'm gonna have to learn C before I learn Cython. bear in mind I'm a competent python programmer, i would much rather learn cython from the perspective of the language I'm already good at, rather than learn a whole new language in order to learn cython. 1) PLEASE don't recommend psyco edit: ANY information that will help understand the oficial cython docs is useful information
false
1,582,105
0.028564
1
0
1
Cython does support concurrency (you can use native POSIX threads with c, that can be compiled in extent ion module) , you just need to be careful enough to not to modify any python objects when GIL is released and keep in mind the interpreter itself is not thread safe. You can also use multiprocessing with python to use more cores for parallelism which can in turn use your compiled cython extensions to speed up even more. But all in all you definitely have to know c programming model , static types etc
0
8,650
0
20
2009-10-17T12:33:00.000
python,c,cython
Noob-Ready Cython Tutorials
0
4
7
10,643,399
1
1
0
Is there a way to do panning or 3d sound in Pygame? The only way I've found to control sound playback is to set the volume for both the left and right channels.
false
1,583,284
0
0
0
0
I think setting the separate channel volume is the only way. Pygame doesn't seem to have any notion of world space or positioning for sounds.
0
2,176
0
2
2009-10-17T21:32:00.000
python,audio,pygame
positioning sound with pygame?
0
1
3
1,583,298
1
0
0
What would be the best library for multithreaded harvesting/downloading with multiple proxy support? I've looked at Tkinter, it looks good but there are so many, does anyone have a specific recommendation? Many thanks!
false
1,597,093
0
0
0
0
Is this something you can't just do by passing a URL to newly spawned threads and calling urllib2.urlopen in each one, or is there a more specific requirement?
1
940
0
0
2009-10-20T20:27:00.000
python,proxy,download,multithreading,harvest
Multithreaded Downloading Through Proxies In Python
0
1
3
1,597,142
1
0
0
what I want to do is a image recognition for a simple app: given image (500 x 500) pxs ( 1 color background ) the image will have only 1 geometric figure (triangle or square or smaleyface :) ) of (50x50) pxs. python will do the recognition of the figure and display what geometric figure is. any links? any hints? any API? thxs :)
false
1,603,688
0.099668
0
0
2
If you know the statespace of your data, you can use Principal Component Analysis. With PCA all of the objects must be posed (in the center of the screen). PCA will not do detection, but it will seperate objects into unique layers in which you can identify as being a triangle, etc. Also note: this is not scale or rotation invariant. [I can't remember what this technique is called, but its similar to how the postoffice does handwritting rec] If you can handle only non-curved curvfaces, you could do edge detection, and then do sampling at intersections to get an approximation of similarity.
0
38,079
0
36
2009-10-21T21:13:00.000
python,algorithm,image,image-processing,python-imaging-library
python image recognition
0
1
4
1,603,723
1
0
0
I am using the Python/C API with my app and am wondering how you can get console output with a gui app. When there is a script error, it is displayed via printf but this obviously has no effect with a gui app. I want to be able to obtain the output without creating a console. Can this be done? Edit - Im using Windows, btw. Edit - The Python/C library internally calls printf and does so before any script can be loaded and run. If there is an error I want to be able to get it.
false
1,604,811
0.099668
0
0
1
If by printf you mean exactly thqt call from C code, you need to redirect (and un-buffer) your standard output (file descriptor 0) to somewhere you can pick up the data from -- far from trivial, esp. in Windows, although maybe doable. But why not just change that call in your C code to something more sensible? (Worst case, a geprintf function of your own devising that mimics printf to build a string then directs that string appropriately). If you actually mean print statements in Python code, it's much easier -- just set sys.stdout to an object with a write method accepting a string, and you can have that method do whatever you want, including logging, writing on a GUI windows, whatever you wish. Ah were it that simple at the C level!-)
0
173
0
0
2009-10-22T03:06:00.000
python,user-interface
How to get output?
0
1
2
1,604,842
1
0
0
I'm trying to compile my python script into a single .exe using gui2exe (which uses py2exe to create a .exe). My program is using wxWidgets and everytime I try to compile it I get the following error message: error MSVCP90.dll: No such file or directory. I have already downloaded and installed the VC++ redistributable package, so I should have this .dll shouldn't I?
false
1,605,006
0.099668
0
0
1
what you need is to go to microsoft's download site and get visual C++ 2008 redistributed package. Tell it to do a repair and search for the driver. Copy the driver to the DLL folder in the python directory
1
3,149
0
9
2009-10-22T04:20:00.000
python,dll,wxwidgets,py2exe,gui2exe
Making a Windows .exe with gui2exe does not work because of missing MSVCP90.dll
0
1
2
5,768,777
1
0
0
I have an app that uses the python/c api and I was wondering what files I need to distribute with it? The app runs on Windows and links with libpython31.a Are there any other files? I tried the app on a seperate Win2k system and it said that python31.dll was needed so theres at least one. Edit - My app is written in C++ and uses the Python/C api as noted below.
true
1,605,022
1.2
0
0
2
The best way to tell is to try it on 'clean' installations of windows and see what it complains about. Virtual machines are a good way to do that.
1
260
0
2
2009-10-22T04:29:00.000
python,file,runtime
What files do I need to include with my Python app?
0
1
2
1,605,039
1
0
0
I am writing a python app using Tkinter for buttons and graphics and having trouble getting a timer working, what I need is a sample app that has three buttons and a label. [start timer] [stop timer] [quit] When I press the start button a function allows the label to count up from zero every 5 seconds, the stop button stops the timer and the quit button quits the app. I need to be able to press stop timer and quit at any time, and the time.sleep(5) function locks everything up so I can't use that. currently i'm using threading.timer(5,do_count_function) and getting nowhere ! I'm a vb.net programmer, so python is a bit new to me, but hey, i'm trying.
false
1,606,700
0.379949
0
0
2
Check the .after method of your Tk() object. This allows you to use Tk's timer to fire events within the gui's own loop by giving it a length of time and a callback method.
1
1,711
0
1
2009-10-22T11:53:00.000
python,tkinter
Timer in Python
0
1
1
1,606,815
1
0
0
Does anyone know of a automated GUI testing package for that works with PyQT besides Squish? Nothing against Squish I am just looking for other packages. It would be cool if there were an open source package. I am doing my testing under Linux.
false
1,616,228
0.197375
1
0
4
It looks like PyQT4 includes a QtTest object that can be used for unit testing.
0
3,768
0
18
2009-10-23T22:19:00.000
python,testing,pyqt
PyQT GUI Testing
0
1
4
1,829,332
1
0
0
I have a C++ app that uses Python to load some scripts. It calls some functions in the scripts, and everything works fine until the app exits and calls Py_Finalize. Then it displays the following: (GetName is a function in one of the scripts) Exception AttributeError: "'module' object has no attribute 'GetName'" in 'garbage collection' ignored Fatal Python error: unexpected exception during garbage collection Then the app crashes. I'm using Python 3.1 on Windows. Any advice would be appreciated.
true
1,619,908
1.2
1
0
4
From the docs to Py_Finalize(): Bugs and caveats: The destruction of modules and objects in modules is done in random order; this may cause destructors (__del__() methods) to fail when they depend on other objects (even functions) or modules. Dynamically loaded extension modules loaded by Python are not unloaded. Small amounts of memory allocated by the Python interpreter may not be freed (if you find a leak, please report it). Memory tied up in circular references between objects is not freed. Some memory allocated by extension modules may not be freed. Some extensions may not work properly if their initialization routine is called more than once; this can happen if an application calls Py_Initialize() and Py_Finalize() more than once. Most likely a __del__ contains a call to <somemodule>.GetName(), but that module has already been destroyed by the time __del__ is called.
1
1,194
0
2
2009-10-25T03:24:00.000
python,exception,attributes
What is causing this Python exception?
0
1
1
1,619,944
1
0
0
I know python and I'm a newibe with wx python but I would like to make a card game. However I have no idea how to make a image follow the mouse and put it in the middle of the screen when the program running. It will be nice if you guys can help me out.
false
1,622,884
0.197375
0
0
2
Going through the wxPython demo and looking at all the examples would be a good start. You'll likely find page Using Images | DragImage to be useful, since you'll probably want cards that you can drag. Generally, the demo can help you do most things in wxPython, and also show you what wxPython can do, and it's worth the time to see every demo. This approach works for everything except the very first step of getting an app running and putting a frame in it (since the demo itself is an app, but not a simple one). Any of the basic tutorials can help you get started with an app and frame in just a very lines of code.
0
877
0
0
2009-10-26T02:52:00.000
wxpython,drag,playing-cards
wx python card game
0
1
2
1,623,027
1
0
0
I'm working on an adventure game in Python using Pygame. My main problem is how I am going to define the boundaries of the room and make the main character walk aroud without hitting a boundary every time. Sadly, I have never studied algorithms so I have no clue on how to calculate a path. I know this question is quite general and hard to answer but a point in the right direction would be very appreciated. Thanks!
false
1,623,331
0.148885
0
0
3
Sadly, I have never studied algorithms so I have no clue on how to calculate a path. Before you start writing games, you should educate yourself on those. This takes a little more effort at the beginning, but will save you much time later.
1
1,431
0
0
2009-10-26T06:16:00.000
python,pygame
Adventure game - walking around inside a room
0
1
4
1,623,346
1
0
0
I'm now thinking, is it possible to integrate Python, Perl and C/C++ and also doing a GUI application with this very nice mix of languages?
false
1,628,001
0.197375
1
0
5
Anything is "possible", but whether it is necessary or beneficial is debatable and highly depends on your requirements. Don't mix if you don't need to. Use the language that best fits the domain or target requirements. I can't think of a scenario where one needs to mix Python and Perl as their domain is largely the same. Using C/C++ can be beneficial in cases where you need hardcore system integration or specialized machine dependent services. Or when you need to extend Python or Perl itself (both are written in C/C++). EDIT: if you want to do a GUI application, it is probably easier to choose a language that fits the OS you want your GUI to run in. I.e. something like (but not limited to) C# for Windows, Objective-C for iPhone or Mac, Qt + C++ for Linux etc.
0
735
0
1
2009-10-27T00:04:00.000
c++,python,c,perl,integration
Python, Perl And C/C++ With GUI
0
3
5
1,628,011
1
0
0
I'm now thinking, is it possible to integrate Python, Perl and C/C++ and also doing a GUI application with this very nice mix of languages?
false
1,628,001
0.039979
1
0
1
Everything is possible - but why add two and a half more levels of complexity?
0
735
0
1
2009-10-27T00:04:00.000
c++,python,c,perl,integration
Python, Perl And C/C++ With GUI
0
3
5
1,628,012
1
0
0
I'm now thinking, is it possible to integrate Python, Perl and C/C++ and also doing a GUI application with this very nice mix of languages?
false
1,628,001
0.039979
1
0
1
Python & Perl? together? I can only think of an editor.
0
735
0
1
2009-10-27T00:04:00.000
c++,python,c,perl,integration
Python, Perl And C/C++ With GUI
0
3
5
1,628,013
1
0
0
If you have a QImage wrapped inside a QLabel, is it possible to scale it up or down when you resize the window and maintain the aspect ratio (so the image doesn't become distorted)? I figured out that it can scale using setScaledContents(), and you can set a minimum and maximum size, but the image still loses its aspect. It would be great if this could be explained using Python (since I don't know c++), but I'll take what I can get. :-) Thanks in advance!
true
1,631,574
1.2
0
0
2
I'm showing this as C++, which is what the documentation I'm looking at is in. It shouldn't be too difficult to convert to python. You need to create a custom derivative of QLayoutItem, which overrides bool hasHeightForWidth() and int heightForWidth( int width) to preserve the aspect ratio somehow. You could either pass the image in and query it, or you could just set the ratio directly. You'll also need to make sure the widget() function returns a pointer to the proper label. Once that is done, you can add a layout item to a layout in the same manner you would a widget. So when your label gets added, change it to use your custom layout item class. I haven't actually tested any of this, so it is a theoretical solution at this point. I don't know of any way to do this solution through designer, if that was desired.
0
2,384
0
1
2009-10-27T15:23:00.000
python,user-interface,qt,pyqt
How to allow scaling with uniform aspect ratio in (Py)Qt?
0
1
2
1,632,726
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
false
1,653,419
0
0
0
0
Java seems better for what you want. Well what about the web application in Javascript?
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,653,442
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
false
1,653,419
0
0
0
0
I would suggest going the wxPython route, I know that wxWidgets (which is what wxPython is using) can be made to have great looking Mac apps (look at PgAdmin3 from postgresql). While PgAdmin3 is not done in python, it was done with wxWidgets and looks fine on a mac.
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,681,376
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
false
1,653,419
0.01818
0
0
1
I think wxPython is pretty good, though I am not sure what you mean by "support on Mac OS X is fairly limited" but I have been porting a wxPython app (www.mockupscreens.com) to Mac and it wasn't that difficult with few tweaks e.g. some UI elements may not come up as you expected, as wxPython uses native UI elements, which can be an advanatage or disadvantage based on your requirements. Other good option is PyQT which will give you consistent look on all platforms.
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,656,477
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
false
1,653,419
0.01818
0
0
1
I work on a program that has to run on Windows, Linux and OS X (and OS X is my development platform), and wxPython is what we use. If I had a chance to start again, I'd probably go with PyQT (based on advice from friends), but wxPython will get the job done.
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,653,436
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
false
1,653,419
0
0
0
0
I use three cross-platform tools regularly: Realbasic from Realsoftware which is what Visual Basic v6 would have been if allowed to grow; Revolution from Runrev which is what Hypercard would have been if allowed to survive (and its neat using a scripting language whose syntax is basically English); and finally, Delphi Prism with Mono. All are quite mature and yet expanding at a great rate. For instance, Revolution is just introducing a web-application feature to its language that is really easy to use.
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,681,426
1
0
0
For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python) I know of wxPython but I have read that it's support on Mac OS X is fairly limited Java sounds good & it looks good but it seems almost too difficult to program in Any help?
true
1,653,419
1.2
0
0
6
I used Python with wxPython for quite a while and found it very easy to use. I now use Java with both Swing and SWT. I prefer Java but that's just a personal preference so you shouldn't let that sway you. I didn't find the transition from Python to Java that difficult. In terms of GUI, they both have the layout manager paradigm - the managers are different but not so different you'll have trouble switching. Java has an absolute huge class library to the point where you probably don't need to write your own version of anything, just string together the components. I never really got that deep into Python but it may well be similar. One thing I did notice is that all the really good stuff I used in Python (e.g., s[-4:-1]) could still be done quite easily in Java. Both languages were a step up from C where I had to manage strings with my own libraries. If you think wxPython is limited on MacOS, you should try Java. I run my Java code on Windows, Linux and other UNIXes without compatibility problems. Sadly, not Mac, so I can't really advise you there. My advice, pick a smallish project - do it in both Python and Java - see how it runs on all the platforms you're interested in.
1
3,320
0
3
2009-10-31T04:34:00.000
java,python,cross-platform,wxpython,multiplatform
Cross-Platform Programming Language with a decent gui toolkit?
0
6
11
1,653,433
1
1
0
I am trying to design an MVC-pattern with PyQt. I want to split all programs into 3 parts: classes abstracted from all Qt classes (model) classes providing data from the model to a Qt app (controller) the Qt app itself with defined method SignalsToSlots that connects signals with controller. Is this optimally? What scheme is recommended for use in PyQt development?
false
1,660,474
1
0
0
9
Yes, PyQt uses Model/View concept (officially without the "Controller" part), but may be you have a somewhat distorted picture what does it mean in PyQt. There are two parts: Models, subclassed from appropriate PyQt base abstract model classes (QAbstractItemModel, QAbstractTableModel, QAbstractListModel, etc.). These models can talk to your data sources directly (files, databases), or proxy your own PyQt-agnostic models which were written before. Views, which are implemented in Qt library, and often do not require any modifications (examples: QTreeView, QTableView and others). Even some simpler controls, like QComboBox can act as a view for a PyQt model. All other parts of you application, which react to signals, etc. may be considered as "Controller". PyQt also provides a set of predefined "universal" models which can be subclassed or used directly if you need only simple functionality from the model, like QStringListModel, QStandardItemModel, etc. And there are also models which can talk to databases directly, like QSqlTableModel.
0
29,014
0
35
2009-11-02T10:27:00.000
python,qt,pyqt
PyQt and MVC-pattern
0
1
3
1,692,893
1
0
0
I am looking for an example application written in Python and PyGTK. There should be an editor out there somewhere that already does this. Some app with a text editor row of buttons: - Font - Bold/italic/underline - etc I am hoping to avoid reinventing the wheel on this one! thanks
true
1,665,288
1.2
0
0
2
I found some related examples: KeepNote, which has a custom rich edit, and Rednotebook which implements KeepNote's richedit.
0
1,341
0
1
2009-11-03T04:40:00.000
python,pygtk,pango
Are there any examples of a Python PyGTK Pango editor toolbar?
0
1
2
1,772,990
1
0
0
In Gnome, whenever an application is started, the mouse cursor changes from normal to an activity indicator (a spinning wheel type thing on Ubuntu). Is there any way to inform Gnome (through some system call) when the application has finished launching so that the mouse cursor returns to normal without waiting for the usual timeout of 30 seconds to occur. I have a program in Pythong using GTK+ that is showing the icon even after launching, so what system call do I make?
false
1,680,311
0
0
0
0
This normally happens automatically when calling the gtk.main() function
0
840
1
7
2009-11-05T12:39:00.000
python,linux,ubuntu,gnome
GTK+ Startup Notification Icon
0
1
4
1,680,360
1
0
0
I have a lot of APIs/Classes that I have developed in Ruby and Python that I would like to use in my .NET apps. Is it possible to instantiate a Ruby or Python Object in C# and call its methods? It seems that libraries like IronPython do the opposite of this. Meaning, they allow Python to utilize .NET objects, but not the reciprocal of this which is what I am looking for... Am I missing something here? Any ideas?
false
1,684,145
-0.049958
1
0
-1
I have seen ways to call into Ruby / Python from c#. But it's easier the other way around.
0
5,027
0
8
2009-11-05T22:37:00.000
c#,.net,python,ruby
Call Ruby or Python API in C# .NET
0
1
4
1,684,168
1
1
0
I have a widget that displays a filesystem hierarchy for convenient browsing (basically a tree control and some associated toolbar buttons, such as "refresh"). Each of these widgets has a set of base directories for it to display (recursively). Assume that the user may instantiate as many of these widgets as they find convenient. Note that these widgets don't correspond to any business data -- they're independent of the model. Where should the (per-widget) set of base directories live in good MVC design? When the refresh button is pushed, an event is trapped by the controller, and the event contains the corresponding filesystem-browser widget. The controller determines the base directories for that particular widget (somehow), walks that directory path, and passes the widget some data to render. Two places I can think to store the base directories: The easy solution: make the base directories an instance variable on the widget and have the controller manipulate it to retain state for that widget. There's a conceptual issue with this, though: since the widget never looks at that instance variable, you're just projecting one of the responsibilities of the controller onto the widget. The more (technically, maybe conceptually) complex solution: Keep a {widget: base_directory_set} mapping in the controller with weak key references. The second way allows for easy expansion of controller responsibilities later on, as putting things in the controller tends to do -- for example, if I decided I later wanted to determine the set of all the base directories for all those widgets. There may be some piece of MVC knowledge I'm missing that solves this kind of problem well.
true
1,686,235
1.2
0
0
2
The anomaly (from the MVC viewpoint) that makes this design difficult to make MVC-conformant is that you want to display information that, by your conceptualization, "does not live in a model". There is no such thing as "information that does not live in a model" in MVC: its conceptual root is "the models hold all the information, the views just do presentation tasks, the controllers mediate user interaction". It's quite possible that the information you're displaying doesn't "correspond to any business data", but (in an MVC worldview) this does not mean that info is "independent of the model", because there is no such thing -- it just means you need another model class (beyond whatever you're using to hold "business data"), to hold this "non-business" data!-) So when the user "instantiates a widget" (creates a directory-display view, presumably by some user action on some master/coordinating view, possibly on another existing widget if "cloning" is one of the ways to instantiate a widget), the controller's responsible for creating both a widget object and an instance of the "directory-display model class", and establish connection between them (normally by setting on the widget a reference to the relevant model instance), as well as telling the model to do its initial loading of information. When the user action on the widget implies an action on the model, the controller retrieves from the widget involved in the event the reference to the model instance, and sends that instance the appropriate request(s) (it's the model's business to let the view[s] interested in it know about changes to information -- typically by some observer pattern; it's definitely not the controller's business to feed the view with information -- that's really a very different approach from MVC!). Is the architectural investment required by MVC worth it, in your case, compared to a rougher approach where the information flows are less pristine and the model that should be there just doesn't exist? I'm a pragmatist and I definitely don't worship at the altar of MVC, but I think in this case the (relatively small) investment in sound, clear architecture may indeed repay itself in abundance. It's a question of envisioning the likely directions of change -- for example, what functionality that you don't need right now (but may well enter the picture soon afterwards) will be trivial to add if you go the proper MVC route, and would be a nightmare of ad-hoc kludges otherwise (or require a somewhat painful refactoring of the whole architecture)? All sort of likely things, from wanting to display the same directory information in different widgets to having a smarter "directory-information watching" model that can automatically refresh itself when needed (and supply the new info directly to interested views via the usual observer pattern, with no involvement by the controller), are natural and trivially easy with MVC (hey, that's the whole point of MVC, after all, so this is hardly surprising!-), kludgy and fragile with an ad-hoc corner-cutting architecture -- small investment, large potential returns, go for it! You may notice from the tone of the previous paragraph that I don't worship at the "extreme programming" altar either -- as a pragmatist, I will do a little "design up front" (especially in terms of putting in place a clean, flexible, extensible architecture, from the start, even if it's not indispensable right now) -- exactly because, in my experience, a little forethought and very modest investment, especially on the architectural front, pays back for itself many times over during a project's life (in such varied currencies as scalability, flexibility, extensibility, maintainability, security, and so forth, though not all of them will apply to every project -- e.g., in your case, security and scalability are not really a concern... but the other aspects will likely be!-). Just for generality, let me point out that this pragmatic attitude of mine does not justify excessive energy and time spent on picking an architecture (by definition of the word "excessive";-) -- being familiar with a few fundamental architectural patterns (and MVC is surely one of those) often reduces the initial investment in terms of time and effort -- once you recognize that such a classic architecture will serve you well, as in this case, it's really easy to see how to embody it (e.g., reject the idea of an "MVC without a M"!-), and it doesn't really take much more code compared to the kludgiest, ad-hoccest shortcuts!-)
0
519
0
4
2009-11-06T08:37:00.000
python,model-view-controller,user-interface
wxPython: How should I organize per-widget data in the controller?
0
1
3
1,738,316
1
0
0
I need an IronPython\Python example that would show C#/VB.NET developers how awesome this language really is. I'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities. Any thoughts?
false
1,708,103
1
1
0
10
Rewrite any small C# app in IronPython, and show them how many lines of code it took you. If that's not impressing, I don't know what is. I'm referring to one of your internal apps.
1
1,848
0
10
2009-11-10T13:49:00.000
python,ironpython
How to impress developers with IronPython/Python
0
2
13
1,708,382
1
0
0
I need an IronPython\Python example that would show C#/VB.NET developers how awesome this language really is. I'm looking for an easy to understand code snippet or application I can use to demo Python's capabilities. Any thoughts?
false
1,708,103
0.046121
1
0
3
I have to agree Geo. Show a C# or VB app next to the same app written in IronPython. When I've done my IronPython talks, I've had a lot of success morphing C# code into Python. It makes for a very dramatic presentation. I'm also a big fan of showing off how duck typing makes your code more testable.
1
1,848
0
10
2009-11-10T13:49:00.000
python,ironpython
How to impress developers with IronPython/Python
0
2
13
1,711,358
1
0
0
How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?
false
1,709,528
0
0
0
0
If you want to have Yes/No translated into the current language, usually setting the system language should be enough. Otherwise try with Natim's suggestion. If you want custom texts: The static methods like question() etc. don't allow custom button texts. That's unfortunate, as "Yes"/"No" dialogs are considered bad style (they are not descriptive, one has to read the whole message, and its easy to misunderstand what means Yes and what means No and accidentally negating them). For custom texts, you have to use QMessageBox directly. I'd suggest to write your own static methods accepting optional button texts.
0
5,231
0
4
2009-11-10T17:03:00.000
python,qt,pyqt,translation,button
PyQt: translating standard buttons
0
2
4
4,627,449
1
0
0
How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?
false
1,709,528
0.148885
0
0
3
Are you sure you have to translate them yourself? In other toolkits, standard buttons are automatically translated to the language that the user is using.
0
5,231
0
4
2009-11-10T17:03:00.000
python,qt,pyqt,translation,button
PyQt: translating standard buttons
0
2
4
1,709,930
1
0
0
I have a couple of questions. I have an algorithm that will generate a couple of pictures in python that must be displayed on a form. I am using PyGt for this. My question is: where should I run my code? Right from the initializer? In that case from what I tested, the form won't show up. Should I set up a timer in the constructor that starts my algorithm half a second later? Will running the algorithm freeze my form making it impossible to see the picture itself? I don't mind that the buttons, checkboxes, etc freeze while it is computing, as long as the current picture is still visible. Should I use something like c#'s OnFormLoad()? If yes, how can I set it? Through connect()? How does threading work on python? I've heard, but I'm not too sure about it, that it was a pain to deal with. Is it? In c# it is as easy as writing 4 lines. I'd like to use it if possible, but if it is going to be hard to implement it I can live without it. Thanks
false
1,715,098
0.099668
0
0
1
You can run the algorithm in a separate thread, placing the data into a Queue when finished. The main thread (GUI) will periodically sample the queue and display the data when it arrives.
0
155
0
1
2009-11-11T13:12:00.000
python,pyqt,pyqt4
Couple of questions regarding PyQt
0
1
2
1,715,113
1
0
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might use uSTL though. as little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible. no backward/forward compatibility necessary. no copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later. should not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea. should allow to move the loaded data around, as with individual files 1/3 the RAM size, fragmentation might be an issue. No MMU to abuse. robustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice. exchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus. I kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs/classes in the main app with getters which would convert offsets to properly typed pointers/references, but i'd like to hear your suggestions. Clarification: the request is primarily about data loading framework and memory management issues.
false
1,727,594
0
1
0
0
Consider storing your data as BLOBs in a SQLite DB. SQLite is extremely portable and lighweight, ANSI C, has both C++ and Python interfaces. This will take care of large files, no fragmentation, variable-length records with fast access, and so on. The rest is just serialization of structs to these BLOBs.
0
270
0
3
2009-11-13T06:56:00.000
c++,python,embedded,playstation
Optimal datafile format loading on a game console
0
3
4
1,727,732
1
0
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might use uSTL though. as little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible. no backward/forward compatibility necessary. no copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later. should not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea. should allow to move the loaded data around, as with individual files 1/3 the RAM size, fragmentation might be an issue. No MMU to abuse. robustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice. exchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus. I kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs/classes in the main app with getters which would convert offsets to properly typed pointers/references, but i'd like to hear your suggestions. Clarification: the request is primarily about data loading framework and memory management issues.
false
1,727,594
0.148885
1
0
3
I note that nowhere in your description do you ask for "ease of programming". :-) Thus, here's what comes to mind for me as a way of creating this: The data should be in the same on-disk format as it would be in the target's memory, such that it can simply pull blobs from disk into memory with no reformatting it. Depending on how much freedom you want in putting things into memory, the "blobs" could be the whole file, or could be smaller bits within it; I don't understand your data well enough to suggest how to subdivide it but presumably you can. Because we can't rely on the same endianness and alignment on the host, you'll need to be somewhat clever about translating things when writing the files on the host-side, but at least this way you only need the cleverness on one side of the transfer rather than on both. In order to provide a bit of assurance that the target-side and host-side code matches, you should write this in a form where you provide a single data description and have some generation code that will generate both the target-side C code and the host-side Python code from it. You could even have your generator generate a small random "version" number in the process, and have the host-side code write this into the file header and the target-side check it, and give you an error if they don't match. (The point of using a random value is that the only information bit you care about is whether they match, and you don't want to have to increment it manually.)
0
270
0
3
2009-11-13T06:56:00.000
c++,python,embedded,playstation
Optimal datafile format loading on a game console
0
3
4
1,728,074
1
0
0
I need to load large models and other structured binary data on an older CD-based game console as efficiently as possible. What's the best way to do it? The data will be exported from a Python application. This is a pretty elaborate hobby project. Requierements: no reliance on fully standard compliant STL - i might use uSTL though. as little overhead as possible. Aim for a solution so good. that it could be used on the original Playstation, and yet as modern and elegant as possible. no backward/forward compatibility necessary. no copying of large chunks around - preferably files get loaded into RAM in background, and all large chunks accessed directly from there later. should not rely on the target having the same endianness and alignment, i.e. a C plugin in Python which dumps its structs to disc would not be a very good idea. should allow to move the loaded data around, as with individual files 1/3 the RAM size, fragmentation might be an issue. No MMU to abuse. robustness is a great bonus, as my attention span is very short, i.e. i'd change saving part of the code and forget the loading one or vice versa, so at least a dumb safeguard would be nice. exchangeability between loaded data and runtime-generated data without runtime overhead and without severe memory management issues would be a nice bonus. I kind of have a semi-plan of parsing in Python trivial, limited-syntax C headers which would use structs with offsets instead of pointers, and convenience wrapper structs/classes in the main app with getters which would convert offsets to properly typed pointers/references, but i'd like to hear your suggestions. Clarification: the request is primarily about data loading framework and memory management issues.
false
1,727,594
0.197375
1
0
4
On platforms like the Nintendo GameCube and DS, 3D models are usually stored in a very simple custom format: A brief header, containing a magic number identifying the file, the number of vertices, normals, etc., and optionally a checksum of the data following the header (Adler-32, CRC-16, etc). A possibly compressed list of 32-bit floating-point 3-tuples for each vector and normal. A possibly compressed list of edges or faces. All of the data is in the native endian format of the target platform. The compression format is often trivial (Huffman), simple (Arithmetic), or standard (gzip). All of these require very little memory or computational power. You could take formats like that as a cue: it's quite a compact representation. My suggestion is to use a format most similar to your in-memory data structures, to minimize post-processing and copying. If that means you create the format yourself, so be it. You have extreme needs, so extreme measures are needed.
0
270
0
3
2009-11-13T06:56:00.000
c++,python,embedded,playstation
Optimal datafile format loading on a game console
0
3
4
1,728,071
1
0
0
I am having an issue with an embedded 64bit Python instance not liking PIL. Before i start exhausting more methods to get a compiled image editor to read the pixels for me (such as ImageMagick) i am hoping perhaps anyone here can think of a purely Python solution that will be comparable in speeds to the compiled counterparts. Now i am aware that the compiled friends will always be much faster, but i am hoping that because i "just" want to read the alpha of a group of pixels, that perhaps a fast enough pure Python solution can be conjured up. Anyone have any bright ideas? Though, i have tried PyPNG and that is far too slow, so i'm not expecting any magic solutions. None the less, i had to ask. Thanks to any replies! And just for reference, the images i'll be reading will be on average around 512*512 to 2048*2048, and i'll be reading anywhere from one to all of the pixels alpha (multiplied by a few million times, but the values can be stored so reading twice isn't done).
true
1,732,761
1.2
1
0
2
Getting data out of a PNG requires unpacking data and decompressing it. These are likely going to be too slow in Python for your application. One possibility is to start with PyPNG and get rid of anything in it that you don't need. For example, it is probably storing all of the data it reads from the PNG, and some of the slow speed you see may be due to the memory allocations.
1
955
0
1
2009-11-14T00:30:00.000
python,png
Reading Alpha of a PNG Pixel. Fast way via pure Python?
0
1
2
1,732,962
1
0
0
I'm using PyQt to capture my screen with QPixmap.grabWindow(QApplication.desktop().winId()) and I was wondering if there was a way I could display my screengrab fullscreen (no window borders, etc.) I'm trying to find a way to desaturate my display with PyQt
true
1,732,935
1.2
0
0
9
Passing QtCore.Qt.FramelessWindowHint to the QWidget constructor in symphony with self.showFullScreen() in the image widget's code achieves this.
0
3,562
0
4
2009-11-14T01:36:00.000
python,pyqt,screenshot,fullscreen
PyQt display fullscreen image
0
1
2
1,733,241
1
0
0
I know this is a long shot, but I was wondering if Python had a way to manipulate the screen buffer. Specifically, I want to be able to gray-out my desktop and highlight my windows when I press a key combination. Is this in the realm of possibility?
false
1,734,575
0.197375
0
0
2
Instead of "graying out" the desktop, try to overlay a gray, semi-transparent image over the entire screen and then make sure your window is on top of that. You may face a couple of minor limitations; for example, I don't know off the top of my head if it's possible to overlay the mac menubar (and I'm not sure you'd want to).
0
1,923
0
1
2009-11-14T15:34:00.000
python,screen,buffer
Manipulate screen buffer in python
0
1
2
1,737,577
1
0
0
How to put QGraphicsScene's (0,0) to top-left corner of QGraphicsView?
false
1,737,624
0.099668
0
0
1
Try doing setCenterOn(0,0) on the QGraphicsView?
0
1,081
0
2
2009-11-15T14:17:00.000
python,qt,pyqt
QGraphicsScene and positioning
0
1
2
4,600,372
1
0
0
I have some project about game programming, which have to use blender with phanthom ,Don't know possible to do it
true
1,740,299
1.2
0
0
0
If you mean Phantom Omni, the haptic feedback device, and you mean Blender, the rendering program, then I don't see any reason why you can't use the API for both of them in a program, together to make a game. In short, if your questions means what I think it does, of course.
0
305
0
0
2009-11-16T05:48:00.000
python,blender
Can i integrate Blender with Phanthom Omni
0
1
1
1,740,306
1
0
0
I'm not familiar with PowerBuilder but I have a task to create Automatic UI Test Application for PB. We've decided to do it in Python with pywinauto and iaccesible libraries. The problem is that some UI elements like newly added lists record can not be accesed from it (even inspect32 can't get it). Any ideas how to reach this elements and make them testable?
false
1,741,023
0.099668
0
0
2
I'm experimenting with code for a tool for automating PowerBuilder-based GUIs as well. From what I can see, your best bet would be to use the PowerBuilder Native Interface (PBNI), and call PowerScript code from within your NVO. If you like, feel free to send me an email (see my profile for my email address), I'd be interested in exchanging ideas about how to do this.
0
3,825
0
6
2009-11-16T09:23:00.000
python,testing,powerbuilder
How to make PowerBuilder UI testing application?
1
2
4
1,741,142
1
0
0
I'm not familiar with PowerBuilder but I have a task to create Automatic UI Test Application for PB. We've decided to do it in Python with pywinauto and iaccesible libraries. The problem is that some UI elements like newly added lists record can not be accesed from it (even inspect32 can't get it). Any ideas how to reach this elements and make them testable?
false
1,741,023
0.049958
0
0
1
I've seen in AutomatedQa support that they a recipe recommending using msaa and setting some properties on the controls. I do not know if it works.
0
3,825
0
6
2009-11-16T09:23:00.000
python,testing,powerbuilder
How to make PowerBuilder UI testing application?
1
2
4
2,328,021
1
1
0
From the web I've gleaned that WSGI is a CGI for python web development/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C/++.
false
1,747,266
1
1
0
27
They are two different things. WSGI is a Python specific interface for writing web applications. There are wrappers for about any web server protocol to provide the WSGI interface. FastCGI (FCGI) is one of such web server protocols. So, WSGI is an abstraction layer, while CGI / FastCGI / mod_python are how the actual web servers talk to the application. Some code has to translate the native interface to WSGI (there is a CGI module in wsgiref, there is flup for FastCGI, etc.). There is also mod_wsgi for Apache, which does the translation directly in an Apache module, so you don't need any Python wrapper.
0
25,057
0
39
2009-11-17T07:59:00.000
python,wsgi,fastcgi
Is there a speed difference between WSGI and FCGI?
0
2
2
1,747,336
1
1
0
From the web I've gleaned that WSGI is a CGI for python web development/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C/++.
true
1,747,266
1.2
1
0
80
Correct, WSGI is a Python programmatic API definition and FASTCGI is a language agnostic socket wire protocol definition. Effectively they are at different layers with WSGI being a higher layer. In other words, one can implement WSGI on top of something that so happened to use FASTCGI to communicate with a web server, but not the other way around. In general, FASTCGI being a socket wire protocol means that you always need some type of programmatic interface on top to use it. For Python one such option is WSGI. As FASTCGI is just a means to an end, one can't really compare its performance to WSGI in that case because WSGI isn't a comparable socket wire protocol, but a user of FASTCGI itself. One could try and compare performance of different language interfaces on top of FASTCGI, but in general that is quite meaningless in itself as the lower network layer and server request handling aren't the bottleneck. Instead your application code and database will be.
0
25,057
0
39
2009-11-17T07:59:00.000
python,wsgi,fastcgi
Is there a speed difference between WSGI and FCGI?
0
2
2
1,748,161
1
0
0
What experiences do you have with Stackless Python and PyQt? Issues i would be happy if people address: Compilation of PyQt for Stackless: does PyQt need to be compiled especially for Stackless? is the compilation smooth? problems with bindings etc. Stability: any unexpected crashes, freezes, pauses and other weirdities? Memory Management: any hints of memory leaks. comparison of RAM needed for a Stackless/Plain Vanilla PyQt applications Software Engineering Empowerment: very short outline of flow-of-control models for Stackless-powered PyQt applications Lessons learned: any painful lesson learned, traps to be avoided, problems to tackle you might have experienced Be Happy
true
1,749,818
1.2
0
0
0
I tried to go down this path several months ago and decided it was not worth the effort. I was able to run a binary install of PyQt (on Windows) against a stackless version of Python, but I found that I had to manually go in and change some of the files. I was getting an error message (sorry, I forget what it was), and google search led to a solution from several years ago. Newer code did not include the old fix, so the change was not too difficult and (if I remember correctly) it was in python, so no recompile was necessary. But that was a deal breaker for me. Qt updates come out regularly, as do updates to PyQt, and I didn't want to be continually fixing the code. Stackless and PyQt are simply not used enough together to be checked out thoroughly. I found the risk of difficult to debug issues pretty high. This is especially true given the author of stackless has moved on to PyPy. Let me apologize in advance - I wish I had the references I found for the author stopping development on stackless python and more detail on the errors I had to fix - I wasn't expecting to regurgitate the details on Stack Overflow. So I chose to run PyQt on a vanilla Python instead of stackless. BTW, I also thought that mixing signals/slots with stackless code would be confusing, as they are completely different methods of solving multi-threading problems. Good luck!
0
1,679
0
4
2009-11-17T15:52:00.000
python,pyqt,pyqt4,stackless,python-stackless
Stackless Python and PyQt
0
1
2
2,047,183
1
0
0
The documentation for pyWebKitGTK is pretty scarce. I've looked through their python .def files but they don't seem to contain the words cookie, session, (lib)soup or (lib)curl.. so maybe it isn't possible, huh. I've also looked through the WebKitGTK docs (for the C-based library) and aside from a brief mention of libsoup there doesn't appear to be anything there either. But on the other hand cookie support seems like pretty fundamental stuff. Could anyone confirm / deny PyWebKitGTK's support of cookies? Note: am currently using the GTK version, but I don't mind switching to the Qt one if the feature is there.
true
1,761,473
1.2
0
0
-1
webkit is a html renderer, not a complete browser. I guess you must deal with persisting the cookies yourself.
0
2,065
0
2
2009-11-19T07:20:00.000
python,cookies,webkit
How to enable cookie support with pyWebKit?
0
1
2
1,762,266
1
0
0
The problem I have is that I have this Python script to launch a application. After the application is launched (the GUI is shown on screen), I want to make it de-activated. It can be done manually by activating another window, or minimizing this app, or pressing the Show Desktop key for WindowsXP. So is there any way that I can do this by Python? Core or 3rd party library would be all ok. Thanks!
false
1,767,575
0
0
0
0
I've used AutoIt (via it's COM interface) a lot of times
0
1,789
0
2
2009-11-20T00:24:00.000
python,windows,keyboard
Are there any libraries for Python to simulate keyboard action?
0
1
3
1,773,644
1
0
0
I have an existing Python 2.4 and it is working properly with tkinter as I tested it using python import _tkinter import Tkinter Tkinter._test() Now, I have installed python 2.5.2 but when I try the same tests (with the newer version), it returns (but the same tests are working for the previous version) ImportError: No module named _tkinter I know that tcl8.5 and tk8.5 are installed on my machine as the following commands return there locations whereis tcl tcl: /usr/lib/tcl8.4 /usr/local/lib/tcl8.5 /usr/local/lib/tcl8.4 /usr/share/tcl8.4 whereis tk tk: /usr/lib/tk8.4 /usr/local/lib/tk8.5 /usr/share/tk8.4 Any ideas how do I make my newer python version work with tkinter?
false
1,773,222
0.53705
1
0
3
The files you found are for linking directly to tcl/tk. Python depends on another library as well: _tkinter.so. It should be in /usr/lib/python2.5/lib-dynload/_tkinter.so. How did you install python2.5? If you are using Debian or Ubuntu you need to install the python-tk package to get Tkinter support. If the _tkinter.so file is there, your environment could be causing problems. If python -E -c "import Tkinter;Tkinter._test()" suceeds, but python -c "import Tkinter;Tkinter._test()" fails, then the problem is with how your environment is set up. Check the value of PYTHONPATH is set correctly.
1
1,073
0
0
2009-11-20T21:02:00.000
python,tcl,tkinter,tk
Linking Tcl/Tk to Python 2.5
0
1
1
1,773,435
1
0
0
I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice. Sorry for the subjective question.
true
1,779,004
1.2
0
0
13
I've written reasonably large apps in both PyGTK and PyQt. On balance, my personal opinion is that PyQt is superior, but not by so much that it's worth worrying about. If you're only worried about supporting Ubuntu, then use PyGTK; it'll give a better look and feel. If you think you may want to port this app to other platforms, then use PyQt; PyQt is far and away the superior crossplatform solution.
0
3,384
0
9
2009-11-22T15:21:00.000
python,ubuntu,pyqt,pygtk
Is PyGTK or PyQT preferred for making GTK-native Python apps?
0
4
4
1,818,306
1
0
0
I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice. Sorry for the subjective question.
false
1,779,004
0.049958
0
0
1
In my experience, having made both PyGTK and PyQT apps, there is little difference on the underlying programming side of things. PyQT seems more consistent across different flavors of Linux, where GTK is constantly changing and breaking on older distributions. PyQT has QTCreator, which is a great GUI designer. PyGTK has Glade3, which is getting better, but not as good. Until recently Glade was a bad joke. If you need to draw GUIs in an editor, PyQT is probably the better choice. Otherwise, I'd go with PyGTK for coding because the online PyGTK documentation is excellent. One bizarre thing I've found is PyQT has poor support for dynamic menu item callbacks. Maybe I just didnt use it right, but PyGTK is a bit more flexible in comparison. It's a tough choice, really. But if you design your application right, the interface should be irrelevant; you could design your app with multiple interfaces...
0
3,384
0
9
2009-11-22T15:21:00.000
python,ubuntu,pyqt,pygtk
Is PyGTK or PyQT preferred for making GTK-native Python apps?
0
4
4
1,901,957
1
0
0
I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice. Sorry for the subjective question.
false
1,779,004
0.049958
0
0
1
In my opinion use PYQT as its definately superior for a few reasons. There is no worries with pixmaps ever, there is only one library coded in the same style and conventions. In pygtk you need to learn up to 4 libraries coded in a different style. You have to learn GLIB constants at least if not GLIB variable names as well even though they are a complete 1 to 1 swap with the stdlib C type itself, but why use standard types everyone else uses when as the master of your toolkit you can use pretty useless special purpose types which then can be forced onto everyone else. Gnome developers need a serious wake up. Go with PYQT its sane easy to use and wont make you constantly look up documentation to find out why you cant use standard code.
0
3,384
0
9
2009-11-22T15:21:00.000
python,ubuntu,pyqt,pygtk
Is PyGTK or PyQT preferred for making GTK-native Python apps?
0
4
4
13,670,093
1
0
0
I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they both produce native-looking widgets on a GNOME system? Is one easier to use than the other? Any opinions would be nice. Sorry for the subjective question.
false
1,779,004
0.244919
0
0
5
PyGTK application will look more native on a Gnome system. PyQt application will look more native on a KDE system. As I found PyGTK have better documentation then PyQt. It will take the same time to write a program on PyQt and PyGTK.
0
3,384
0
9
2009-11-22T15:21:00.000
python,ubuntu,pyqt,pygtk
Is PyGTK or PyQT preferred for making GTK-native Python apps?
0
4
4
1,779,036
1
0
0
I need to make a StaticText red, what should I use?
false
1,785,227
0.197375
0
0
3
Depending on which color you would need to set, look into SetForegroundColour() or SetBackgroundColour() method.
0
28,120
0
23
2009-11-23T18:57:00.000
wxpython,static-text
Change the colour of a StaticText, wxPython
0
1
3
1,786,334
1
0
0
Greetings, everybody. I'm trying to import the following libraries in python: cx_Oracle and kinterbasdb. But, when I try, I get a very similar message error. *for cx_Oracle: Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: Não foi possível encontrar o procedimento especificado. (translation: It was not possible to find the specified procedure) *for kinterbasdb: Traceback (most recent call last): File "C:\", line 1, in File "c:\Python26\Lib\site-packages\kinterbasdb__init__.py", line 119, in import _kinterbasdb as _k ImportError: DLL load failed: Não foi possível encontrar o módulo especificado. (translation: It was not possible to find the specified procedure) I'm using python 2.6.4 in windows XP. cx_Oracle's version is 5.0.2. kinterbasdb's version is 3.3.0. Edit: I've solved it for cx_Oracle, it was a wrong version problem. But I believe I'm using the correct version, and I downloaded it from the Firebird site ( kinterbasdb-3.3.0.win32-setup-py2.6.exe ). Still need assistance with this, please. Can anyone lend me a hand here? Many Thanks Dante
false
1,799,475
-0.197375
0
1
-1
oracle is a complete pain. i don't know the details for windows, but for unix you need ORACLE_HOME and LD_LIBRARY_PATH to both be defined before cx_oracle will work. in windows this would be your environment variables, i guess. so check those. also, check that they are defined in the environment in which the program runs (again, i don't know windows specific details, but in unix it's possible for everything to work when you run it from your account by hand, but still not work when run as a batch job because the environment is different).
0
767
0
2
2009-11-25T19:43:00.000
python,cx-oracle,kinterbasdb
importing cx_Oracle and kinterbasdb returns error
0
1
1
1,803,407
1
0
0
I want to develop a desktop application framework in Python, much like QT, but how to go about it? Any tutorials or links related to it would be helpful!
true
1,811,940
1.2
0
0
2
Well the best way to start is to look at the source code of the framework the other answers are talking about. First, try to use them all to build the same application with the functionalities you expect from a framework. Them, look at how it works under the hood. Secondly, build your framework, starting by writing your first widgets, then notice the problems with your current architecture, and re factor. Start again, until you have something stable and usable. Eventually, find out this was nice as training experience, but useless as a contribution to the software communities since you will never reach out the qualities of existing tools. Then give up and try to code your own MMORPG.
0
813
0
2
2009-11-28T08:04:00.000
python,frameworks,desktop
I want to develop a framework in Python for desktop based applications. How should I go about it?
0
1
4
1,813,171
1
0
0
The usual way to use Qt widgets from Python seems to be to subclass them. Qt widget classes have a great many methods, so inevitably I'm going to end up adding a method to the subclass, with the same name as one inherited from the Qt widget. In Python, all methods are virtual, so what I'm concerned about is that some Qt code might end up calling my method instead of the expected Qt one - in the worst-case scenario, breaking some edge case that doesn't easily show up in testing. On the other hand, maybe all the PyQt methods are just wrappers for C++ code, which would of course be unaffected by anything I do in terms of Python subclassing. Anyone know offhand which is the case?
true
1,828,567
1.2
0
0
3
If the underlaying C++ methods are virtual, your Python methods that override them will be called any time C++ code calls them. If they are just regular methods, any C++ code will call the original C++ methods by default (Python code will call the Python methods though, because it sees the Python object and all methods are "virtual" there).
1
1,972
0
4
2009-12-01T20:10:00.000
python,qt,qt4,pyqt,pyqt4
PyQt subclassing
0
1
1
1,828,607
1
0
0
I need to render wikitext (pulled from the database of a mediawiki of it's relevant) and display in some other format (ultimately to be rendered as a PDF, but basically any other format will do). I can definately hack together something that does the job but ultimately I'll be writing it as I go along, and I can see that the overhead of implementing new tags as people in my team use them will eat up a lot of my time. Is there a project to do this? I saw TiddlyWiki which is written in python, which I will look into borrowing their library, but in the meantime I figured there may be a project that's a bit more niche that someone knows? Cheers
false
1,836,884
-0.066568
1
0
-1
pywikipedia i have found to be best
0
2,209
0
1
2009-12-03T00:29:00.000
python,mediawiki,wikitext
Render wikitext with Python
0
1
3
2,321,542
1
0
0
In PyQt 4.5, I have a layout inside another layout. I'd like to remove the sublayout from its parent, and hide it. I can say parent_layout.removeItem(child_layout) to remove the layout from its parent, but it still shows on the widget. I can't find any way to hide it in one step, as QLayout doesn't have a hide() method like QWidget does.
true
1,844,630
1.2
0
0
4
The easy solution would be to have an interior widget, not an interior layout. You could assign the layout you desire to the widget, then just remove/hide the widget when you want to do so. A good rule of thumb is if you just want to arrange how widgets appear, then use a layout; if you want to hide/show them as a group, use a widget.
0
2,317
0
3
2009-12-04T03:19:00.000
python,qt4,pyqt
Remove a sublayout in qt?
0
1
2
1,844,678
1
0
0
I have a GTK layout with a widget on the left of an HBox deciding the maximum height I want, and a VBox on the right containing three buttons, each containing only an image and no text. The images are a GTK stock icon, and so have the stock storage type. Using expand=True, fill=True packing the buttons without images are exactly the height I want - some arbitrary small width, and 1/3 each the height of the left half of the HBox. However with an image, they are either too tall - 3 * ICON_SIZE_MENU is too tall in many themes - or if I force the button's height request, they get clipped. I would rather scale them to the size of the parent button. Do I have to make my own pixbufs for each of the stock icons I'm using (and regenerate them if the size changes)? Or can GTK automatically size the image to fit the button, rather than the other way around? Since the images are only a few pixels off from fitting in every theme I've tried, is there a way to just disable the button's clipping? This application is written in Python using PyGTK, but solutions in any language are appreciated. (I tried just making it an icon name storage type, but one of the icons is REVERT_TO_SAVED, which turned into the broken stock image when I tried to force it to a particular pixel height. Plus, I'd rather not force it to any fixed pixel height.)
true
1,851,862
1.2
0
0
2
There's no way to automatically do you want you want. You might want to subclass gtk.Image and in your subclass, scale a pixbuf to your widget's allocation size. The advantage of this is that you'll have a reusable widget and you'll be able to have it resize your image on the fly. The downside is that you'll have an ugly, scaled up pixmap. You may want to look into scalable vector graphics.
0
2,476
0
2
2009-12-05T10:48:00.000
python,user-interface,pygtk,gtk
Scaling an image to its parent button size in GTK?
0
1
2
1,872,356
1
0
0
I know that IronPython is a dynamically typed language so what I am asking sounds pretty stupid, but is it possible to do something with an IronPython script to make sure the changing of the CLR libraries it references will not result in a runtime error when the script is executed? The reason I ask is that I have written a library referenced by IronPython scripts in C#, and I want a way to know if I've broken any of the interfaces used by the IronPhon scripts when I change the C# library. This is easy to do with another C# project by just compiling the code and seeing compile errors, but this doesn't seem to work when compiling the IronPython scripts. Any ideas?
true
1,852,897
1.2
1
0
2
No, there is no way to statically verify at compile time that the interface changes have not broken your IronPython code. This is the nature of dynamic languages. Such errors are instead presented at runtime
1
244
0
4
2009-12-05T17:51:00.000
ironpython,dynamic-language-runtime
IronPython compile-time checks against CLR libraries?
0
2
2
1,852,956
1
0
0
I know that IronPython is a dynamically typed language so what I am asking sounds pretty stupid, but is it possible to do something with an IronPython script to make sure the changing of the CLR libraries it references will not result in a runtime error when the script is executed? The reason I ask is that I have written a library referenced by IronPython scripts in C#, and I want a way to know if I've broken any of the interfaces used by the IronPhon scripts when I change the C# library. This is easy to do with another C# project by just compiling the code and seeing compile errors, but this doesn't seem to work when compiling the IronPython scripts. Any ideas?
false
1,852,897
0.099668
1
0
1
A good set of fast running unit tests would be a good alternative to compile time checking.
1
244
0
4
2009-12-05T17:51:00.000
ironpython,dynamic-language-runtime
IronPython compile-time checks against CLR libraries?
0
2
2
1,866,436
1
0
0
I'm new to pyglet and i have a problem with video.. I'm trying to play a video using pyglet .. but instead of playing the video in the window it just exits immediately and terminates .. do you guys have any solution for this problem how can i hold the window to play vedio?? i use windows vista 64x with python 2.5 please help and here is the code : vidPath="vid.avi" widnow = pyglet.window.Window() source = pyglet.media.StreamingSource() MediaLoad = pyglet.media.load(vidPath) player = pyglet.media.Player() player.queue(MediaLoad) player.play() @window.event ...def on_draw(): ... player.get_texture.blit(0,0) thank u very much for your time
true
1,859,195
1.2
0
0
0
I think calling "pyglet.app.run()" is missing.
0
4,199
0
1
2009-12-07T10:38:00.000
python,video,pyglet
problem with pyglet playing video
0
1
2
1,860,559
1
0
0
Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!
false
1,871,672
1
0
0
6
If this is your first Pygame application, don't spend time worrying about "object oriented design patterns for managing levels". What you need to do now is to figure out how to make Pygame do what you want it to do. Can you display everything you want to? Is your display flicker-free? Can you read the user input controls properly? etc. Object oriented patterns for managing levels comes later, much later.
1
5,646
0
3
2009-12-09T05:01:00.000
python,design-patterns,oop,pygame
Level Design in Pygame
0
3
3
1,871,698
1
0
0
Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!
false
1,871,672
0.066568
0
0
1
Generally speaking, a simple way to do it is using matrices (or multidimensional arrays - they work the same way here). Basically, each Map is an Array, with each item in the array being a square on the grid. For example a 3 by 3 grid would be as follows: (Psuedocode) var Map = [[1,2,3][1,2,3][1,2,3]]; In place of numbers, you could put strings for a function to parse and draw or take action based on what the value of the cell is.
1
5,646
0
3
2009-12-09T05:01:00.000
python,design-patterns,oop,pygame
Level Design in Pygame
0
3
3
1,871,700
1
0
0
Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks!
true
1,871,672
1.2
0
0
7
With this type of game your maps are in terms of tiles (I'm assuming that by level you mean an individual level, not managing all of your levels). Each tile has an associated picture (what it looks like on the display) a type (ie, a wall, the ground, a trap, etc.) When I create tile-based games in Pygame, I usually have a Map class which contains the current map: the pygame.Surface of the map (what you'll be blitting to the display) a list of lists (ie, a matrix) where each item is a Tile object (I've also done games where you just have a string that tells you what type of tile it is, and then you don't need a separate Tile class) The map should be relatively static - you could have that traps become normal tiles after you step on them (this is pretty easy - when you do collision detection and it's a hit, just change that tile to a different Tile object (presumably the one for an empty tile)), but you don't want characters or movable blocks in the map if you can help it. Since the movable blocks have their own rules for how they can be moved, it's not as simple as just changing a tile - you'd have a whole set of logic, and at least two tiles would have to be changed (and what if you could move the blocks onto traps - you'd then have to remember, separately, what was below it - bleh). In my opinion it's easier to just have a class for each moving object and item. In short, you have: Tile Map Block other movable objects/sprites And that's basically your whole level. For multiple levels, if individual levels are always the same, you can just have a list of Map objects, one for each level.
1
5,646
0
3
2009-12-09T05:01:00.000
python,design-patterns,oop,pygame
Level Design in Pygame
0
3
3
1,873,480
1
0
0
I have a wxPython program where I want to be able to drag groups of controls around to reorder them. Each group of controls is on a panel, and I want the panel object to handle the drag-and-drop. Currently it works if you click and drag on the panel itself, but it doesn't work if you click on any control inside the panel. This is because the wx.EVT_LEFT_DOWN event that I am using to trigger the drag is not a command event, so is not propagated up to the parent panel. The only way I can think of to get round this is to bind that event to the panel's handler for every control on the panel. This does not seem very elegant to me - either I have to explicitly do it when I create each child event, which breaks encapsulation, or the panel recurses through the child controls and does the binding - this seems dangerous, since the individual controls may already be using that event for other purposes. Ideally I would like the controls on the panel to not need to know anything about the DnD. Does anyone know of any alternative solutions? Are there any command events that I could use to initiate dragging? Or anything else I haven't thought of?
false
1,877,402
0.099668
0
0
1
IMO the best way is, Panel should bind to control's wx.EVT_LEFT_DOWN and drag only when special key combination e.g. cntrl-alt-d are pressed Panel can do it recursively or have a function in Panel, addControl and only such control will be hooked. Your point that "individual controls may already be using that event for other purposes" is not valid because either you can use that event for dragging or not, you can't have both way. If you want drag on control to be used as drag of whole group, then you MUST override such event, but with doing dragging only inspecial key combination or modes you can let child control have their behaviour too.
0
1,099
0
0
2009-12-09T22:32:00.000
python,drag-and-drop,wxpython
wxPython: Handling drag-and-drop in a parent object - problem with event propagation
0
1
2
1,935,002
1
0
0
I have an application in which I would like to connect whatever signal is emitted when a pyqt4 dialog is displayed in order to do execute an initial method. I don't want the method to be called in the __init__ method for a number of reasons. I've spent quite some time searching but I have yet to find an answer. I'm sure there is a simple solution that because of my inexperience I am overlooking as I can do this in wxPython. Suggestions?
false
1,878,353
0.53705
0
0
3
There is no signal emitted on first display, instead, you will have to intercept the first resizeEvent or paintEvent by overloading these methods (as you don't want to initialize from the __init__ method). Another option would be to add your own showAndInit method, that initializes and then calls show.
0
114
0
1
2009-12-10T02:49:00.000
python,qt,pyqt4
What signal can be connected to an initial dialog display in pyqt4 (qt)
0
1
1
1,879,368
1
0
0
I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?
false
1,883,455
1
1
0
8
Java and C# will be less of a step away from Python than would C or C++ because Java, C#, and Python all have automatic memory management. A good Java book is Thinking in Java by Bruce Eckel. It starts at an introductory level, but also has a lot of depth. The big difference with the language coming from Python is the fact that all variables are typed. The other hard thing with Java has to do with the bewildering array of Java APIs out there. The fact that you are interested in Android is an advantage here. After becoming comfortable with the core language, I suggest you start learning the Android API and focus on becoming an Android expert. I think Android will be a growing market for a while. Good luck!
0
18,209
0
20
2009-12-10T19:41:00.000
java,python
Learn Java from Python background
0
5
9
1,883,690
1
0
0
I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?
false
1,883,455
0
1
0
0
I don't think you should use a special way to learn Java because you know Python. Just start with HelloWorld.java and move on step by step. Your basic skills in programming will help you.
0
18,209
0
20
2009-12-10T19:41:00.000
java,python
Learn Java from Python background
0
5
9
1,883,538
1
0
0
I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?
false
1,883,455
0
1
0
0
I suppose one could ease his/her way into .NET and Java by starting with IronPython and Jython respectively. This will not teach you the new language syntax but open up respective libraries so you can explore what is "out there", learn development tools, build process etc. Syntax is by far the easiest to switch but the know-how and best practices in each language are not.
0
18,209
0
20
2009-12-10T19:41:00.000
java,python
Learn Java from Python background
0
5
9
1,884,743
1
0
0
I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?
false
1,883,455
0
1
0
0
1) It depends what you would do with an "hireable" language. For instance, if you were interested in programming web applications and distributed/client/server app, Java would be a good choice. C# is maybe a bit less client / server oriented, and maybe more valuable for small non IT companies and for most retail software companies. C and C++ are still great languages, but are more "system", embeded and "critical apps" oriented. And they are not suitable to be runned on differents mobile phones. 2) The best way to learn java, according to me, is firstable to learn the basics, then look for more specialized stuff like J2ME and Android software framework.
0
18,209
0
20
2009-12-10T19:41:00.000
java,python
Learn Java from Python background
0
5
9
1,883,705
1
0
0
I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?
false
1,883,455
1
1
0
9
I would take a project you've implemented in Python and try converting it to Java. Since you already know basic programming fundamentals, it'll probably be easier if you take things you know how to do and figure out how you'd do the same sort of operations in Java (or whatever new language you want to learn). In the end, the only way to learn to write code, is to write more code.
0
18,209
0
20
2009-12-10T19:41:00.000
java,python
Learn Java from Python background
0
5
9
1,883,585
1
0
0
I'm making a python script that should run in the background and notify a user of changes, and I'd quite like it to work cross-platform. Main problem is, I don't have access to a mac at all, so coding specifically for it could be very difficult. wxPython seems like massive overkill for simple popups, so is there anything with a lighter footprint?
true
1,893,213
1.2
0
0
4
Does Python on Windows and Mac also ship with Tk wrappers? If so, you might be able to roll your own notification box. I do not think they have a dead-simple notification API (i.e. you pass it a string and a cute box pops up for 5 seconds) however at least you will only have one codebase to maintain. I am thinking about other cross-platform apps such as Skype, Dropbox, and Thunderbird. Skype and Thunderbird seem to have rolled their own, and Dropbox went the platform-specific route.
0
2,853
0
9
2009-12-12T12:06:00.000
python,cross-platform,notifications
Cross-Platform Python Notification Library
0
1
3
1,893,404
1
0
0
I've started building an app with Flex/Air but am getting sick of it's clunkyness. The app that I'm building has similar behaviour to Prezi (www.prezi.com) but in a completely different field. I'm looking for something on the desktop which has flex like capabilities, such as drawing vectors then zooming in/out, rotating etc, gui widgets would be a bonus but not essential. If it was written in Python/Ruby or had an abstraction in either language that would be great. I've had a quick look at PyGame and Pyglet but am not sure of their suitability. Any ideas? Cheers, Chris
true
1,907,736
1.2
0
0
0
If you have any .NET experience I would recommend Silverlight. I have worked with it in the academic setting and it has impressed me very much. Some of the examples are pretty mind blowing, for the web applications at least. I also know they did focus on making silverlight into exactly what your question asks, a framework for building "visually rich" desktop applications also. There is a set of tools called expression blend that interact directly with visual studio to build the GUI and it's pretty impressive the control their GUI gives you in making your GUI. At least worth a look.
0
384
0
0
2009-12-15T14:13:00.000
python,vector,svg
Framework for building visually rich desktop applications?
0
1
2
1,907,972
1
0
0
I have a scrollbar widget that ALWAYS hides the last 15 px under the resize button, is there an option to stop this happening on mac or a padding "under" the widget option?\ thanks!
true
1,927,475
1.2
0
0
0
No, there isn't an option. You need to adjust your padding so that the scrollbar doesn't extend all the way to the bottom of the window. Perhaps the easiest way is to add a statusbar that extends across the bottom of the window.
0
204
0
1
2009-12-18T10:44:00.000
python,user-interface,tkinter
Python - Tkinter - Padding woes
0
2
2
1,927,946
1
0
0
I have a scrollbar widget that ALWAYS hides the last 15 px under the resize button, is there an option to stop this happening on mac or a padding "under" the widget option?\ thanks!
false
1,927,475
0
0
0
0
Or, you could also try switching to the place() layout manager.
0
204
0
1
2009-12-18T10:44:00.000
python,user-interface,tkinter
Python - Tkinter - Padding woes
0
2
2
1,927,968
1
0
0
I'm writing a python application that has a glade gui. Using subprocess to execute some shell commands in the background. Using a glade GUI which has a scrolledwindow widget and a textview widget inside the scrolledwindow widget. The textview gets populated as the subprocess.Popen object run and display their stdout and stderr to this textview. My problem is that the textview is constantly populated, but stays still @ scroll position 0, 0 (top-most, left-most) I want this scrolledwindow widget to stays at bottom-most, left-most at all times... Does anyone have any idea which method I need to call scroll this thing downwards?
false
1,940,957
0
0
0
0
look at gtk.ScrolledWindow.set_placement. (never tried)
0
2,933
1
3
2009-12-21T16:03:00.000
python,pygtk,subprocess,glade
howto scroll a gtk.scrolledwindow object from python code
0
1
3
1,941,109
1
0
0
I want to make the background of a textview widget black and the foreground white. Been trying the .modify_bg and .modify_fg methods, but none affect the way this thing looks. Can anyone suggest anything or is this just not possible?
true
1,948,396
1.2
0
0
2
Use gtk.Widget.modify_text and gtk.Widget.modify_base instead of fg and bg.
0
1,612
0
0
2009-12-22T18:52:00.000
python,gtk,pygtk
pygtk: howto change background of a gtk.TextView widget
0
1
2
1,948,993
1
0
0
I have installed PyQt GPL v4.6.2 for Python v3.1 and Qt by Nokia v4.6.0 (OpenSource), but the documentation in PyQt is not coming up. Example docs are all blank, too. Would anyone mind writing a step-by-step guide on what links to visit and what procedures must be executed in order to get text to come up for the PyQt documentation? Edit: The programs are running on Windows, and the documentation is not coming up in PyQt GPL v4.6.2 for Python v3.1 > Examples > PyQt Examples and Demos and PyQt GPL v4.6.2 for Python v3.1 > Assistant. What needs to done to let both programs access the docs?
true
1,962,273
1.2
0
0
1
The PyQt documentation is exactly as provided on the website, and as included in the installer. It is not integrated with Assistant (it will be in a future version). If you want to use Assistant then you can use the Qt documentation instead (a lot of people do) and translate between C++ and Python as you read it.
0
16,124
0
7
2009-12-25T23:56:00.000
python,qt,pyqt
PyQt documentation
0
2
5
1,966,523
1
0
0
I have installed PyQt GPL v4.6.2 for Python v3.1 and Qt by Nokia v4.6.0 (OpenSource), but the documentation in PyQt is not coming up. Example docs are all blank, too. Would anyone mind writing a step-by-step guide on what links to visit and what procedures must be executed in order to get text to come up for the PyQt documentation? Edit: The programs are running on Windows, and the documentation is not coming up in PyQt GPL v4.6.2 for Python v3.1 > Examples > PyQt Examples and Demos and PyQt GPL v4.6.2 for Python v3.1 > Assistant. What needs to done to let both programs access the docs?
false
1,962,273
0.039979
0
0
1
If you installed the Qt documentation, you should have an app named Assistant. This is a simple-minded browser for a local copy of the Qt doc as found at doc.qt.nokia.com. It is written for C++ but the mental translation to Python is not difficult, and it is nicely formatted and richly cross-linked. I keep Assistant running all the time I'm coding in PyQt4 and find it very helpful. The PyQt doc, as given at www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html, is merely this same Nokia text with its formatting and many of the internal links stripped out and edited to python class and function syntax.
0
16,124
0
7
2009-12-25T23:56:00.000
python,qt,pyqt
PyQt documentation
0
2
5
8,174,151
1