Web Development
int64
0
1
Data Science and Machine Learning
int64
0
1
Question
stringlengths
35
6.31k
is_accepted
bool
2 classes
Q_Id
int64
5.14k
40.5M
Score
float64
-1
1.2
Other
int64
0
1
Database and SQL
int64
0
1
Users Score
int64
-6
163
Answer
stringlengths
19
4.91k
Python Basics and Environment
int64
0
1
ViewCount
int64
12
475k
System Administration and DevOps
int64
0
1
Q_Score
int64
0
346
CreationDate
stringlengths
23
23
Tags
stringlengths
6
68
Title
stringlengths
12
138
Networking and APIs
int64
0
1
Available Count
int64
1
31
AnswerCount
int64
1
35
A_Id
int64
5.3k
72.3M
GUI and Desktop Applications
int64
1
1
0
0
I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects. My question is: what building mechanism can I use to manage dependencies and build these projects? I have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python. I develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.
false
4,141,511
0.158649
1
0
4
I tried to do a Java / C++ / C++ To Java swig / (+ Protocol buffers) project in CMAKE and it was horrible! In such a case the problem with Cmake is, that the scripting language is extremely limited. I switched to Scons and everything got much easier.
0
2,318
1
6
2010-11-10T05:32:00.000
java,c++,python,scons,gyp
What are the SCons alternatives?
0
4
5
7,201,456
1
0
0
I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects. My question is: what building mechanism can I use to manage dependencies and build these projects? I have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python. I develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.
false
4,141,511
0.039979
1
0
1
For Java and C++ projects you can take a look into Maven + Maven-nar-plugin but for Python i really don't know the best. May be other tools like CMake would fit better.
0
2,318
1
6
2010-11-10T05:32:00.000
java,c++,python,scons,gyp
What are the SCons alternatives?
0
4
5
4,142,509
1
0
0
I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects. My question is: what building mechanism can I use to manage dependencies and build these projects? I have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python. I develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.
false
4,141,511
1
1
0
9
CMake I use and prefer it for my projects. There's also Rake (comes with Ruby, but can be used for anything), which I regard rather highly.
0
2,318
1
6
2010-11-10T05:32:00.000
java,c++,python,scons,gyp
What are the SCons alternatives?
0
4
5
4,141,589
1
0
0
I have projects in C++, Java and Python. Projects in C++ export SWIG interfaces so they can be used by Java and Python projects. My question is: what building mechanism can I use to manage dependencies and build these projects? I have used SCons and GYP. They are fairly easy to use and allow plugins (code-generators, compilers, packers). I'd like to know whether there are alternatives, in particular with native support for C++, Java and Python. I develop in Linux platform, but I'd like to be able to build in mac and win platforms as well.
false
4,141,511
0.039979
1
0
1
In Java world ant is "lingua franca" for build systems. Ant supports a C++ task via ant-contrib - so you can compile your C++ code. With Ant's exec task you can still run swig on C++ code in order to get the wrappers. Then standard tasks as javac/jar can be used for java application build.
0
2,318
1
6
2010-11-10T05:32:00.000
java,c++,python,scons,gyp
What are the SCons alternatives?
0
4
5
4,143,403
1
0
0
I'd like to develop a small/medium-size cross-platform application (including GUI). My background: mostly web applications with MVC architectures, both Python (Pylons + SqlAlchemy) and Java (know the language well, but don't like it that much). I also know some C#. So far, I have no GUI programming experience (neither Windows Forms, Swing nor QT). I plan to use SQLite for data storage: It seems to be a nice cross-platform solution and has some powerful features (e.g. full text search, which SQL Server Compact lacks). I have done some research and these are my favorite options: 1) QT, Python (PyQT or PySide), and SQLAlchemy pros: Python the language open source is strong in the Python world (lots of libraries and users) SQLAlchemy: A fantastic way to interact with a DB and incredibly well documented! cons: compilation, distribution and deployment more difficult? no QT experience QT Designer not as nice as the Visual Studio Winforms designer 2) .NET/Mono, Windows Forms, C#, (Fluent) NHibernate, System.Data.SQLite pros: C# (I like it, especially compared to Java and would like to get more experience in it) The Winforms GUI designer in Visual Studio seems really slick IntelliSense ClickOnce Deployment(?) Windows Forms look and feel good on Windows cons: (Fluent) NHibernate far less documented than SQLAlchemy; also annoying: Fluent docs refer to NHibernate docs which refer to Hibernate (aargh!). But plain NHibernate + XML does not look very comfortable. Windows Forms will not look + behave native on Linux/Mac OS (correct?) fewer open source libraries in the .NET world, fewer OSS users, less documentation in general no WinForms and NHibernate experience 3) JVM, Java + Jython, Swing, SQLAlchemy (I'm emotionally biased against this one, but listed for completeness sake) pros: JVM/Swing work well as cross-platform basis Jython SQLAlchemy lots of open source libraries cons: Swing seems ugly and difficult to layout lacks a good GUI designer Guessing that I won't be able to avoid Java for UI stuff Not sure how stable the Jython/Java integration is (Options that I have ruled out... just to avoid discussion on these): - wxWidgets/wxPython (now that QT is LGPLed) - GTK/PyGTK The look and feel of the final application is very important to me. The above technology stacks are very different (PyQT, .NET WinForms, JVM Swing) and require some time to get proficient, so: Which alternative would you recommend and why?
false
4,145,350
0.761594
0
1
5
I'm a Python guy and use PyQt myself, and I can wholly recommend it. Concerning your cons: compilation, distribution and deployment more difficult? No, not really. For many projects, a full setup.py for e.g. cx_Freeze can be less than 30 lines that rarely need to change (most import dependencies are detected automatically, only need to specify the few modules that are not recognized), and then python setup.py will build a standalone executable. Then you can distribute it just like e.g. a C++ .exe. no QT experience I didn't have notable GUI experience either when I started out with Qt (only a bit of fiddling with Tkinter), but I grew to love Qt. Most of the time, all widgets work seamlessly and do what they're supposed to do - and there's a lot of them for many purposes. You name it, there's probably a widget that does it, and doesn't annoy the user by being half-assed. All the nice things we've been spoiled with are there. Qt is huge, but the PyQt documentation answer most question with reasonable search effort. And if all else fails and you know a bit of C++, you can also look at Qt resources. QT Designer not as nice as the Visual Studio Winforms designer I don't know the VS Winforms designer, but I must admit that the Qt Designer is lacking. I ended up making a sketch of the UI in the designer, generating the code, cleaning that up and taking care all remaining details by hand. It works out okay so far, but my projects are rather small. PS: (now that QT is LGPLed) PyQt is still GPL only. PySide is LGPL, yes, but it's not that mature, if that's a concern. The project website states that "starting development on PySide should be pretty safe now" though.
0
3,111
0
11
2010-11-10T14:11:00.000
c#,java,python,user-interface,cross-platform
Python + QT, Windows Forms or Swing for a cross-platform application?
0
1
1
4,145,581
1
0
0
Is there a way to add undo and redo capabilities in Tkinter Entry widgets or must I use single line Text widgets for this type of functionality? If the latter, are there any tips I should follow when configuring a Text widget to act as an Entry widget? Some features that might need tweaking include trapping the Return KeyPress, converting tab keypresses into a request to change focus, and removing newlines from text being pasted from the clipboard.
false
4,146,971
0.066568
0
0
1
Update on using this method for Undo/Redo: I am creating a GUI with lot of frames and each contains at least ten or more 'entry' widgets. I used the History class and created one history object for each entry field that I had. I was able to store all entry widgets values in a list as done here. I am using 'trace' method attached to each entry widget which will call 'add' function of History class and store each changes. In this way, I was able to do it without running any thread separately. But the biggest drawback of doing this is, we cannot do multiple undos/redos with this method. Issue: When I trace each and every change of the entry widget and add that to the list, it also 'traces' the change that happens when we 'undo/redo' which means we cannot go more one step back. once u do a undo, it is a change that will be traced and hence the 'undo' value will be added to the list at the end. Hence this is not the right method. Solution: Perfect way to do this is by creating two stacks for each entry widget. One for 'Undo' and one for 'redo'. When ever there is a change in entry, push that value into the undo stack. When user presses undo, pop the last stored value from the undo stack and importantly push this one to the 'redo stack'. hence, when the user presses redo, pop the last value from redo stack.
0
4,108
0
4
2010-11-10T17:03:00.000
python,user-interface,text,tkinter,tkinter-entry
Undo and Redo in an Tkinter Entry widget?
0
1
3
32,384,249
1
0
0
I'm working on a project involving puzzles made out of user-supplied images. I have been very hard-pressed to find a library that will serve my purposes. I would like to write the program in either Python or C++. I have been considering using Qt (or PyQt) to do it, so if you know of a library that will work with Qt it would be nice, though at this point anything would be nice.
true
4,151,746
1.2
0
0
2
You can't expect to find a library for any specific task. In this case, you need image-processing library, which is able to: draw image region with transparent background. You have piece configuration, use it as a mask to cut out edges. save drawn image to some format. Qt graphics is totally able to do all that.
0
174
0
1
2010-11-11T05:57:00.000
c++,python,qt,image-processing,pyqt
Anyone know of a C++ or Python library that will divide an image into pieces of arbitrary shape?
0
1
1
4,154,281
1
0
0
I am wondering, is it possible to display images in python?
false
4,160,082
0
0
0
0
The easiest way is to use a web server I reckon. You can script a nice, simple server with bottle and turn out a UI with images. It depends what you want to do. Python can do it all, but needs something to work with. There's pygame and stuff like that if you're just starting out.
0
12,412
0
3
2010-11-11T22:54:00.000
python,image
How do you show a picture in python?
0
4
6
14,884,366
1
0
0
I am wondering, is it possible to display images in python?
false
4,160,082
0.033321
0
0
1
The question needs more clearing up. Do you want to put the picture on a system display? Or on a window in a desktop app? Or render it to a http response? Python can do all these things in different manners, but for people to explain it - you need to specify your question a bit more.
0
12,412
0
3
2010-11-11T22:54:00.000
python,image
How do you show a picture in python?
0
4
6
4,160,323
1
0
0
I am wondering, is it possible to display images in python?
false
4,160,082
0
0
0
0
The various OpenCV bindings for Python also provide ways to display images (and videos). Might be a bit heavy if you just want to display an image.
0
12,412
0
3
2010-11-11T22:54:00.000
python,image
How do you show a picture in python?
0
4
6
4,160,130
1
0
0
I am wondering, is it possible to display images in python?
false
4,160,082
0.16514
0
0
5
Almost all GUI toolkits (wxWindows, pyQt, pyGTK, Tkinter) have Canvas or other-type widgets that allow you to draw an image. The standard library way to draw an image is to use Tkinter's Canvas widget.
0
12,412
0
3
2010-11-11T22:54:00.000
python,image
How do you show a picture in python?
0
4
6
4,160,121
1
0
0
Does Tkinter or underlying Tk framework support the ability to apply the equivalent of the attributes() method to Frames vs. Windows? Specifically: I have forms with a message area that I would like to fade away in jquery-like manner, eg. display a non-modal status message that fades away. I know I can fade a Tkinter window via window.attributes("-alpha", alpha), but I don't see an equivalent way to achieve this effect with a Frame. (I know I could place a top-level message window over my dialog, but coordinating the position and size of this window to match the layout of my dialog sounds complicated).
false
4,164,962
0
0
0
0
No, there is no way to do what you want. Tkinter only supports transparency on top-level windows.
0
502
0
0
2010-11-12T13:13:00.000
python,user-interface,tkinter
Python/Tkinter: Apply .attributes() method to Frame vs. Window?
0
1
1
7,360,992
1
0
0
How would I get a handle to the active gtk.Window in python? (not a window I created, but the currently focused window).
false
4,166,169
0.462117
0
0
5
The answer is actually not OS-specific -- you can do it within GTK. You can get a list of all the toplevel windows from the application using gtk.window_list_toplevels(), then iterate through it until you find one where window.is_active() returns True. If you want to consider other windows than the ones from your application, then you could try gtk.gdk.screen_get_default().get_toplevel_windows() but this will only get you GDK windows and not GTK windows, because you have no way of knowing whether those GDK windows are actually associated with GTK windows.
0
5,129
0
3
2010-11-12T15:31:00.000
python,gtk
Get active gtk window in python
0
1
2
4,169,956
1
0
0
i want to create application in windows. i need to use databases which would be preferable best for pyqt application like sqlalchemy mysql etc.
false
4,168,020
0
0
1
0
i guess its totally upto you ..but as far as i am concerned i personlly use sqlite, becoz it is easy to use and amazingly simple syntax whereas for MYSQL u can use it for complex apps and has options for performance tuning. but in end its totally upto u and wt your app requires
0
535
0
0
2010-11-12T18:49:00.000
python,database,pyqt
which databases can be used better for pyqt application
0
3
4
4,208,750
1
0
0
i want to create application in windows. i need to use databases which would be preferable best for pyqt application like sqlalchemy mysql etc.
false
4,168,020
0.049958
0
1
1
SQlite is fine for a single user. If you are going over a network to talk to a central database, then you need a database woith a decent Python lirary. Take a serious look at MySQL if you need/want SQL. Otherwise, there is CouchDB in the Not SQL camp, which is great if you are storing documents, and can express searches as Map/reduce functions. Poor for adhoc queries.
0
535
0
0
2010-11-12T18:49:00.000
python,database,pyqt
which databases can be used better for pyqt application
0
3
4
4,294,636
1
0
0
i want to create application in windows. i need to use databases which would be preferable best for pyqt application like sqlalchemy mysql etc.
false
4,168,020
0.049958
0
1
1
If you want a relational database I'd recommend you to use SQLAlchemy, as you then get a choice as well as an ORM. Bu default go with SQLite, as per other recommendations here. If you don't need a relational database, take a look at ZODB. It's an awesome Python-only object-oriented database.
0
535
0
0
2010-11-12T18:49:00.000
python,database,pyqt
which databases can be used better for pyqt application
0
3
4
4,512,428
1
0
0
I've done a few searches but I couldn't find anything about this topic. Perhaps because it is common programmer knowledge (I'm not a programmer, I've learned from necessity), or because I'm going about it the wrong way. I would like ideas/suggestions on how to manage button states for a GUI. For example, if I have a program which allows the user to import and process data, then certain functions should be inaccessible until the data has been imported successfully, or if they want to graph certain data, they need to select which data to graph before hitting the 'graph' or 'export' button. Even in the simple programs I've built these relationships seems to get complicated quickly. It seems simple to say "User shouldn't be able to hit button 'A' until 'B' and 'C' have been completed, then 'A' should be disabled if button 'D' or the 'Cancel' button. But that's a lot to track for one button. Thus far, I've tried two things: Changing/Checking button states in the callback functions for the button. So in the above example, I would have code in buttons B's and C's callback to check if A should be enabled. And in buttons D's and Cancel's callbacks I would have code to disable button A. This gets complicated quickly and is difficult to maintain as code changes. Setting boolean variables in every buttons callback (or just checking the states later using cget()) and checking the variables in a polling function to determine which buttons should be enabled or disabled. I'm just not sure about this. I would like to make code as short and easy to understand as possible (and easy to edit later), but I don't like the idea of polling all the button states every few hundred milliseconds just for button 'management'. You can extend the same idea to check boxes, menu items, etc... but I'd like to here what others have done and why they do it the way they do.
false
4,172,426
0.197375
0
0
1
You are only changing button states based on events, right? There is no reason to 'poll' to see if a button state has changed. What you can do is build a function which does all of the calling for you, then call it with something like disable_buttons([okButton, graphButton, printButton]). When an event takes place that modifies the appropriate user interface options (such as importing data), have another function that turns them on: enable_buttons([graphButton]). You could do this with each object's methods, of course, but making a wrapper allows you to be consistent throughout your application.
0
851
0
0
2010-11-13T12:11:00.000
python,button,tkinter,state
How to handle button states efficiently in Tkinter
0
1
1
4,187,733
1
0
0
How practical would it be to use Cython as the primary programming language for a game? I am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C. I understand that I'll probably need to learn a bit of C/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison. So, is it practical? And would I still be able to use C/C++ libraries like OpenGL, OpenAL, and Bullet Physics?
false
4,180,836
0.16514
0
0
5
I've found that a lot of the time, especially for larger libraries, you wind up spending a tremendous amount of time just configuring the Cython project to build, knowing which structures to import, bridging the C code into Python in either direction etc. While Cython is a nice stopgap (and significantly more pleasant than pure C/C++ development), the amount of C++ you'd have to learn to effectively use it basically means you're going to have to bite the bullet and learn C++ anyway. How about PyGame?
1
9,169
0
19
2010-11-15T01:46:00.000
python,c,cython
Using Cython for game development?
0
4
6
4,180,878
1
0
0
How practical would it be to use Cython as the primary programming language for a game? I am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C. I understand that I'll probably need to learn a bit of C/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison. So, is it practical? And would I still be able to use C/C++ libraries like OpenGL, OpenAL, and Bullet Physics?
false
4,180,836
-0.033321
0
0
-1
Threads!!! A good modern game must use threads. Cython practically forbids their use, holding to GIL (global interpreter lock) the entire time, making your code run in sequence. If you are not writing a huge game, than Python/Cython is okay. But Cython is no good as a modern language without good thread support.
1
9,169
0
19
2010-11-15T01:46:00.000
python,c,cython
Using Cython for game development?
0
4
6
4,445,486
1
0
0
How practical would it be to use Cython as the primary programming language for a game? I am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C. I understand that I'll probably need to learn a bit of C/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison. So, is it practical? And would I still be able to use C/C++ libraries like OpenGL, OpenAL, and Bullet Physics?
false
4,180,836
1
0
0
7
at this date (12th of April 2011) unixmab83 is wrong. Cython doesn't forbid the use of threads, you just needs to use the no_gil special statements. Beside the bindins of c++ is now functional in cython. We do use it for something which is close to gamedev. So while I cannot be final on this, cython is a valid candidate.
1
9,169
0
19
2010-11-15T01:46:00.000
python,c,cython
Using Cython for game development?
0
4
6
5,638,409
1
0
0
How practical would it be to use Cython as the primary programming language for a game? I am a experienced Python programmer and I absolutely love it, but I'm admittedly a novice when it comes to game programming specifically. I know that typically Python is considered too slow to do any serious game programming, which is why Cython is interesting to me. With Cython I can use a Python-like language with the speed of C. I understand that I'll probably need to learn a bit of C/C++ anyway, but it seems like Cython would speed up development time quite a bit in comparison. So, is it practical? And would I still be able to use C/C++ libraries like OpenGL, OpenAL, and Bullet Physics?
false
4,180,836
0
0
0
0
I know Cython and you do not have to know C/C++. You will use static typing but very easy. The hardest part is to get the compiling working, I think on Windows this is done over visual studio thing. There is something like a standard library including math for example. The speed gain is not too big but this depends on your scope. ctypes was much faster (pure C) but the connection to Python was very slow so that i decided to look for Cython which can still be dynamic. For speed gain in a game Cython will be the right choice but i would name this performance also limited.
1
9,169
0
19
2010-11-15T01:46:00.000
python,c,cython
Using Cython for game development?
0
4
6
17,047,294
1
0
0
Can I program for Android using Python? I seem to have stumbled upon many links while searching... however neither of them is concrete. Any suggestions? I want to write apps for Android but really don't want to get into Java for all this. PS: My question is whether I can write proper, full fledged apps for Android.
false
4,185,061
0.039979
0
0
1
No, not currently. ASE (Android Scripting Environment) allows you to do simple script apps, but you can only write proper Android apps in Java.
0
84,928
0
112
2010-11-15T14:03:00.000
python,android
Android Python Programming
0
1
5
4,185,138
1
0
0
I've got an option menu that's about 60 items long and, needless to say, I can't see it all on the screen at once. Is there a way that I can make the OptionMenu widget in tkinter scrollable?
true
4,186,981
1.2
0
0
2
Short answer is no, but you could try a ComboBox mega-widget (quick search will throw some suitable examples up there) which could be a 'good enough' alternative (in fact with it being a combined entry field and scrolled list you could make it 'smart' by including auto-search / auto-complete - 60 items in a drop down is a lot :)
0
1,975
0
1
2010-11-15T17:13:00.000
python,tkinter
Make OptionMenu Widget Scrollable?
0
1
1
4,194,418
1
0
0
How do I get an integer type from the Tkinter Entry widget? If I try to get the value using variable_name.get(), it says it is a str. If I try to change the type using int(variable_name.get()), it says int can only accept a string or number. Any help would be welcome!
false
4,199,278
0.132549
0
0
4
In the end I just initialized the variable as tk.IntVar() instead of tk.StringVar() That way you don't have to cast it as an int, it will always be one, and the default value from the Entry element will now be 0 instead of '' That's how I approached it anyway, seems the simplest way and avoid the need for a lot of the validation you'd need to do otherwise...
1
34,695
0
5
2010-11-16T21:41:00.000
python,tkinter
Get an Integer from Entry
0
1
6
22,458,776
1
0
0
Like the subject says: Does the latest stable pygame release work with python2.7? I've got both versions installed on my OSX Snow Leopard, but import pygame only works on python2.6 - That's the official distro which is 2.6.6, not the pre-installed one which is 2.6.1). And if it does work, how can I make it work on my machine? What am I doing wrong? Thanks in advance.
true
4,200,644
1.2
0
0
0
My guess is that you installed it for 2.6 and so it is residing in 2.6's library directory. Install it in 2.7's library directory and you should be good to go. I don't know OSX so I can't help with the details but a little bit of googling shouldn't be too hard. The problem is that the two python installations have distinct import paths.
1
324
0
0
2010-11-17T01:10:00.000
python,macos,pygame
Does the latest stable pygame release work with python2.7?
0
1
1
4,200,863
1
0
0
I am looking for a Python GUI library that I can rewrite the rendering / drawing. It has to support basic widgets (buttons, combo boxes, list boxes, text editors, scrolls,), layout management, event handling The thing that I am looking for is to use my custom Direct3D and OpenGL renderer for all of the GUI's drawing / rendering. edit suggested by S.Lott: I need to use this GUI for a 3D editor, since I have to drag and drop a lot of things from the GUI elements to the 3d render area, I wanted to use a GUI system that renders with Direct3D (preffered) or OpenGL. It also has to have a nice look. It is difficult to achieve this with GUI's like WPF, since WPF does not have a handle. Also it needs to be absolutly free for commercial use. edit: I would also like to use the rendering context I initialized for the 3d part in my application
false
4,203,614
0.039979
0
0
1
You can use Qt Scene Framework with OpenGL rendering. There are many examples on Nokia site.
0
2,152
0
8
2010-11-17T10:51:00.000
python,user-interface,opengl,directx
Python GUI with custom render/drawing
0
1
5
4,250,496
1
0
0
I am trying to embed some python code in a c++ application i am developing with ms visual studio c++ 2010. But when i run the program, it exits with code 0x01 when i call Py_initialize(). I dont know how to find out what went wrong. the help file says, Py_Initialize can't return an error value, it only fails fataly. But, why did it fail? I am using a self-compiled python27_d.dll, which i created with the msvs project files in the source downloads from python.org.
true
4,216,988
1.2
0
0
0
Well, i finally found out what went wrong. I did compile my python27_d.dll with the same VC10 as my program itself. But my program is normally compiled as 64 bit executable. I just forgot to compile the dll for x64, too. I didnt think this would lead to such annoying behavoiur, as i believed i would get a linkr error then.
1
1,264
0
1
2010-11-18T16:16:00.000
c++,python,visual-studio-2010,python-c-api,python-embedding
Tried to embed python in a visual studio 2010 c++ file, exits with code 1
0
2
2
4,277,222
1
0
0
I am trying to embed some python code in a c++ application i am developing with ms visual studio c++ 2010. But when i run the program, it exits with code 0x01 when i call Py_initialize(). I dont know how to find out what went wrong. the help file says, Py_Initialize can't return an error value, it only fails fataly. But, why did it fail? I am using a self-compiled python27_d.dll, which i created with the msvs project files in the source downloads from python.org.
false
4,216,988
0
0
0
0
Is there simple 'hello world' type example of the Py_Initilize code in the python sdk you can start with? That will at least tell you if you have the compiler environment setup correctly, or if the error is in your usage.
1
1,264
0
1
2010-11-18T16:16:00.000
c++,python,visual-studio-2010,python-c-api,python-embedding
Tried to embed python in a visual studio 2010 c++ file, exits with code 1
0
2
2
4,217,625
1
0
0
How do I get the width and height of a Tkinter window?
true
4,220,295
1.2
0
0
32
You use the winfo_width method of the widget to get the actual width. You can use winfo_reqwidth to get the size that the widget is requesting, which may be different. Note that if you call this before the window appears on the screen, you won't get the answer you expect. Tkinter needs to have actually drawn the window before it can know the size. A simple fix if you're trying to get the window size before your program starts is to call the update method on the window before trying to get the size.
0
22,438
0
22
2010-11-18T22:31:00.000
python,tkinter
Get Tkinter Window Size
0
2
2
4,221,002
1
0
0
How do I get the width and height of a Tkinter window?
false
4,220,295
0.099668
0
0
1
to create an exact window size you can simple do: window.geometry("400x400") as an example but you have to make sure it is like a string otherwise it wont work like I have experience
0
22,438
0
22
2010-11-18T22:31:00.000
python,tkinter
Get Tkinter Window Size
0
2
2
71,922,330
1
0
0
Wondering if there's a menu event I can bind to that's related to the currently selected menu item? By menu item I mean the items that show up in a popup menu like New, Open, Save, etc. Use case: I would like to update a statusbar area of our application with a description of the currently selected menu item. Any ideas appreciated. Thank you, Malcolm
true
4,220,441
1.2
0
0
2
You need to bind to the <<MenuSelect>> event.
0
1,525
0
0
2010-11-18T22:49:00.000
python,menu,tkinter
Python/Tkinter: bind to event related to currently selected menu item
0
1
2
4,220,839
1
0
0
The widgets in my application are the old style mac widgets. How do I make them become the new style ones. I am using pyqt 4.6.3-1 with python 2.7 on os x 10.6. Everything was installed using fink and I installed both qt4-mac and qt4-x11. Not sure which is being used or how to select one or the other.
true
4,232,228
1.2
0
0
1
I switched from Fink to Macports, and I got the nice widgets.
0
475
0
0
2010-11-20T10:16:00.000
python,cocoa,qt4,pyqt
getting pyqt to use cocoa widgets
0
1
1
4,365,030
1
0
0
I am writing a little gui application with Tkinter, which requires me to have a path to icon files. I am planning on embedding the file into the exe that I make with py2exe, and then retrieving it from there. The only problem is that I need to know where that file is. Does anyone know a way of getting the currently running exe file/path? Thanks for the help in advance!
false
4,234,697
0
0
0
0
Oops! I found out the answer! sys.executable should do the trick. It returns the path and filename of the currently running exe, although I must test to see that it works with py2exe.
1
1,490
0
0
2010-11-20T19:56:00.000
python,py2exe
Get path to exe file on py2exe
0
1
3
4,234,727
1
0
0
I am creating a series of buttons(Or windows) etc on RUN time. Now how do i identify when user clicks on these buttons?
false
4,239,896
0.197375
0
0
1
HI, I did an R&D on wx.Event(GetEventObject) and found out that i can get object details. SO i solved my problem using this.
0
77
0
0
2010-11-21T19:36:00.000
python,wxpython
How to Identify Dynamically created window/buttons in wxpython?
0
1
1
4,240,158
1
0
0
(Or, "Can PyPy/RPython be used to compile/translate Python to C/C++ without requiring the Python runtime?") I have tried to comprehend PyPy with its RPython and its Python, its running and its compiling and its translating, and have somewhat failed. I have a hypothetical Python project (for Windows); I would like to keep its size down, in the order of a hundred kilobytes (O.N.O.) rather than the several megabytes that using py2exe entails (after UPX). Can I use PyPy1 in any way to produce a standalone executable which does not depend on Python26.dll? If I can, does it need to follow the RPython restrictions like for only working on builtin types, or is it full Python syntax? I do realise that if this can be done I almost certainly couldn't use C modules from Python directly. 1 (Since the time of asking, the situation has become clearer, and this part of the toolchain is more clearly branded as RPython rather than PyPy; it wasn't so in 2010.)
true
4,251,964
1.2
0
0
18
Yes, PyPy can produce standalone executables from RPython code. That means, you need to follow all the awkward RPython rules when it comes to writing code. Your Python code is completely unlikely to function out of the box and porting existing Python code is usually not fun. It won't make executables as small as C, but for example rpystone target (from pypy/translator/goal) using boehm GC is 80k on 64bit after stripping.
1
6,144
0
27
2010-11-23T01:41:00.000
python,compiler-construction,translate,pypy,rpython
Can PyPy/RPython be used to produce a small standalone executable?
0
1
1
4,253,643
1
0
0
I have created a gtkMenu using gtk.Menu(), appended a couple of items and now I want to remove some menu items. How can I do that?
false
4,258,771
0
0
0
0
Maybe using destroy() could save some RAM: menu.foreach(lambda child: child.destroy())
0
3,084
0
8
2010-11-23T17:10:00.000
python,pygtk
How to remove an item from a gtkMenu?
0
1
2
65,870,271
1
0
0
I'm using pygame to create a small scene. Right now, I'm working with lines. I have an array of lines which are drawn to the screen and when a line is deleted from the array, I would like the line to disappear from the screen. The problem I've found is that the line is drawn on the screen and remains static. I can't find a way to reset the screen (I'm using a JPEG as the background). Is there a way to remove a drawn line from the screen? Thanks
true
4,276,342
1.2
0
0
1
If you use screen.fill([0,0,0]) it will fill in the background (or whatever you have set to be your background). This will erase any lines drawn on the image, essentially removing anything drawn on the background.
0
4,502
0
0
2010-11-25T11:10:00.000
python,line,pygame
Python (pygame): How can I delete a line?
0
1
3
4,276,397
1
0
0
Is it possible to display PyGame surfaces with controllable alpha? I would like to take a surface with its own per pixel alpha and display it with variable level of translucency without affecting the surface data and keep the transparency intact i.e. the objects on the surface would keep their shapes but their "contents" becoming more or less translucent. In other words I want to combine per-pixel alpha from the source image with per-surface alpha calculated at the runtime.
true
4,276,850
1.2
0
0
4
After checking both PyGame and SDL documentations I came to conclusion that what I asked wasn't doable in PyGame using standard functions. SDL docs state that per-pixel alpha and per-surface alpha cannot be combined with the former always taking the precedence. The only way to achieve the effect I want is by writing a code which updates per-pixel alpha values of the source surface before the blit.
0
7,315
0
13
2010-11-25T12:05:00.000
python,pygame,transparent
PyGame: translucent sprites with per pixel alpha
0
1
4
4,535,566
1
0
0
I need to expose a file-like object from a C library that i'm wrapping with a Cython module. I want to reuse python's generic io code for stuff like buffering, readline(), etc. The new IO module seems to be just what i need, but actually using it from Cython seems to be non-trivial, I've tried several aproaches: My code in a cdef class that inherits from IO.RawIOBase - This fails because cdef classes can inherit only from other cython cdef classes, while IO is "raw" C. My code in a cdef class, another (non-cdef) class that inherits both my cdef class and RawIOBase - Fails with "TypeError: multiple bases have instance lay-out conflict" My code in a (non-cdef) class that inherits from RawIOBase - This works, but i loose the ability to store my c-level (that i need to talk to the underlying library) stuff inside the class, so i need a make a cdef wrapper around it and store that as a member... this looks like a mess. My code in cdef class that doesn't inherit (Raw)IOBase rather reimplements it's functionality, Python code gets my object wrapped in BufferedReader/BufferedWriter - This one seems to work and less messy than the previous option. My questions(s): 1) Am I missing something and reinventing the wheel here? 2) What is the exact stuff from IOBase that I need to implement to keep BufferedReader/Writer happy with my object in current and future versions of python? Is this documented anywhere? 3) How will that work in python 2.6 where IO is pure python? I guess that performance will suffer but it will work, right?
false
4,278,444
0.197375
1
0
1
Would it be too inefficient to call os.fdopen() on the file descriptor number returned by the underlying library, and then to dispatch normal Python method calls to the resulting file object in order to do your input and output? With most I/O, I would be surprised if you could see a difference with whether you called a C routine directly or let the Python method dispatch logic call it for you — but, of course, you might be in an unusual situation and I could be wrong!
0
1,145
0
20
2010-11-25T15:08:00.000
python,file-io,cython
Exposing a file-like object from Cython
0
1
1
8,262,264
1
0
0
I was thinking that for a learning project for myself, I would try to make a GUI for ffdshow on linux, using tkinter. Wanted to make sure this project would be feasible first, before I get halfway through and run into something that cant be done in python. Basic idea is to have a single GUI window with a bunch of drop down boxes that have the various presets (like format or bitrate), as well as a text box where a custom number can be entered if applicable. Then when all the options are selected, the user hits the Start button on the GUI and it shows a progress little bar with a percentage. All the options selected would just send the relevant selections as cli arguments for ffdshow, and begin the conversion progress (essentially turning all the user's input into a single perfect cli command). Is all this doable with python and tkinter? and is it something that a relative newb with only very basic tkinter experience could pull off with books and other python resources? Thanks
false
4,278,461
0.197375
0
0
1
That is precisely the type of thing that python and Tkinter excel at. And yes, a relative newbie can easily do a task like that.
0
446
0
1
2010-11-25T15:10:00.000
python,user-interface,tkinter,ffdshow
making a python gui for ffdshow
0
1
1
4,278,800
1
0
0
This is a bit of a vague question but bear with me. I am in the process of writing a game using Python/Pyglet and openGL. I currently have it structured so that there is an object called 'world', in this are other objects with other objects inside them etc. I did it this way because for instance one part of the game is a platform with other objects on it, and when I tilt the platform I want the objects on it to tilt with it. So I do platform.draw() which calls glRotate, glTranslate, then draw each of the objects saving the modelview matrix inbetween, this way all the objects on the platform move together. The first question is, is this a sensible way to organise things or should I be using some other method? I don't have a camera class, currently I am just translating the whole world or parts of it to give the illusion of movement. However, in the future I want to be able to switch viewpoints between objects, so for instance switch from looking down onto the world from above to a 1st person view from one of the objects in the world. So the second question is what is the best way to structure my program so that this will be achievable in the future?
false
4,291,566
0
0
0
0
You could put the logic into a seperate module / into seperate classes/functions. In my 2D-Game I have a GameLogic class which simplifies registering it's methods for certain events or scheduling them (and unregistering+unscheduling them), and I created a @state_wrapper decorator which injects a simple new-style object as state-storage for that method. If you do it like that you don't have to pass the pointer to all your world objects, only the event-methods have to get access to your objects. But I wouldn't claim that this is the best solution ;)
0
382
0
2
2010-11-27T12:10:00.000
python,architecture,3d,pyglet
How to organise the structure of a 3D game?
0
1
2
4,368,817
1
0
0
I have a Tkinter app written in python, and I want to make "native" (easy to run) mac and windows executables of it. I've successfully built a windows .exe using py2exe, but the equivalent process with py2app isn't working. Here's my setup.py: from setuptools import setup import sys MAIN_SCRIPT = "myapp.py" WINDOWS_ICON = "myicon.ico" MAC_ICON = "myicon.icns" if sys.platform in ("win32", "win64"): # does win64 exist? import py2exe setup( windows=[{ "script":MAIN_SCRIPT, "icon_resources":[(0x0004, WINDOWS_ICON)] }], ) elif sys.platform == "darwin": import py2app setup( app=[MAIN_SCRIPT], # doesn't include the icon yet setup_requires=["py2app"], ) I just cd to my app directory and run python setup.py py2app. The .app appears without errors, but it crashes on launch with "myapp has encountered a fatal error, and will now terminate." I'm running Snow Leopard, and I've tried this with both the standard Apple Python 2.6 and python25 from MacPorts. I read somewhere that it's better to use a different Python because py2app won't bundle the system version in your app. EDIT: Here's what the mac console has to say about it: 11/27/10 1:54:44 PM [0x0-0x80080].org.pythonmac.unspecified.myapp[77495] dlsym(0x10b120, Py_SetProgramName): symbol not found 11/27/10 1:54:46 PM [0x0-0x80080].org.pythonmac.unspecified.myapp[77495] 0x99274242 11/27/10 1:54:46 PM com.apple.launchd.peruser.501[185] ([0x0-0x80080].org.pythonmac.unspecified.myapp[77495]) Exited with exit code: 255
true
4,294,060
1.2
0
0
0
Turns out it was a problem with using Snow Leopard. I tried it on a Leopard machine at school and it builds fine.
0
1,470
0
2
2010-11-27T21:41:00.000
python,tkinter,py2app
Help building a mac application from python using py2app?
0
1
1
4,300,560
1
0
0
I'd like to remove focus from a widget manually.
false
4,299,432
0.066568
0
0
2
My solution is root.focus() it will remove widget focus.
0
16,266
0
11
2010-11-28T22:15:00.000
python,tkinter
In Tkinter how do i remove focus from a widget?
0
2
6
64,151,502
1
0
0
I'd like to remove focus from a widget manually.
false
4,299,432
0.16514
0
0
5
Set focus to another widget to remove focus from the target widget is a good idea. There are two methods for this: w.focus_set() and w.focus_force(). However, method w.focus_force() is impolite. It's better to wait for the window manager to give you the focus. Setting focus to parent widget or to the root window removes focus from the target widget. Some widgets have takefocus option. Set takefocus to 0 to take your widget out of focus traversal (when user hits <Tab> key).
0
16,266
0
11
2010-11-28T22:15:00.000
python,tkinter
In Tkinter how do i remove focus from a widget?
0
2
6
47,823,400
1
0
0
So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application. Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff. We are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.
false
4,303,851
0
0
0
0
I would implement the time-critical stuff as 3D and its object handling + rendering in raw C/C++ and let an embedded Python with external modules handle the game logic (object movement, object properties, scripting and so on).
1
56,291
0
15
2010-11-29T12:49:00.000
c++,python,3d
3d game with Python, starting from nothing
0
3
8
4,303,972
1
0
0
So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application. Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff. We are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.
false
4,303,851
0.049958
0
0
2
If you want to write a 3D game you might want to start by understanding the basics of programming and computer science. Starting with the top and learning a language, then find yourself a good graphics library for example Panda, Pygame are all good choices, then there are other parts to consider like networking with twisted for example or a physics engine. It might also be a good choice to consider using a working engine like the unreal engine as often game designers get too wrapped up in game mechanics and not the game itself
1
56,291
0
15
2010-11-29T12:49:00.000
c++,python,3d
3d game with Python, starting from nothing
0
3
8
4,303,913
1
0
0
So we want to program a 3d game for school, we can probably use blender for the 3d models, however we are totally clueless as to how to use them in a game/application. Are there any recommended guides/documents we should read on general 3d game programming and perhaps python specific stuff. We are also possibly considering programming it in C++ but for now I think it's easier to use Python as we can fully focus on the 3d mechanics that way.
false
4,303,851
0.049958
0
0
2
You should be aware that 3D game consists of animated 3D models 3D environment (including NPCs and objects) simulation of interaction between the environment and the models (game logic and game mechanics) user interface (starting, saving and game settings) The game logic and mechanics is going to usually the biggest and most complicated part and you should try to wrap your head against that first. Modeling 3D objects and environment should be much easier after that.
1
56,291
0
15
2010-11-29T12:49:00.000
c++,python,3d
3d game with Python, starting from nothing
0
3
8
4,304,000
1
0
0
Using Python 2.6, Twisted 10.1, and GTK+ 2.22, with latest pygtk installed, I'm having problems on shutdown. When I close my application and shut down the reactor (using the gtk2reactor of course), the application simply freezes. I've poked around the twisted source and added debug messages. What ends up happening is, the 'shutdown' event fires, PortableGtkReactor.crash is called, which calls gtk.main_quit. The event gets processed at the end of ReactorBase.runUntilCurrent. When the function returns, control goes to ReactorBase.iterate, which returns control to PortableGtkReactor.simulate, which goes back to... the gtk.main() call. It looks like gtk just doesn't quit. Unfortunately, when I put together a very simple example with twisted and the gtk "Hello World" sample, everything shut down correctly. It must be something my application is doing. Until I can figure it out further, though... What might be causing this? Like what could an app do that causes gtk to not quit? The app worked fine on Gtk 2.12, with Python 2.5 and Twisted 8.1, if that helps at all.
false
4,308,346
0
0
0
0
Threads, perhaps? The Twisted reactor joins all threads on shutdown, and if you're doing something in a callInThread that hangs, your loop may be unable to stop. (I'm not sure what the behavior would be if you're starting your own threads, either.)
0
426
0
1
2010-11-29T21:36:00.000
python,pygtk,twisted,gtk
Twisted + Gtk - shutdown not working properly
0
1
2
4,310,711
1
0
0
I have implemented an informational popup in a python app using a Tkinter Menu widget. I have a Text widget on a canvas in the root window. I created a Menu widget that has root as its parent. When I detect a mouse hover over the text widget I post the popup menu with menuWidget.post(). When I get a leave event from the text widget my intention was to have the popup disappear by calling menuWidget.unpost(), only the popup menu does not disappear until I click elsewhere outside the text widget. First, is this a sane method for implementing an informational popup? And can anyone tell me why the popup menu won't disappear?
false
4,328,603
0.53705
0
0
3
This is not the right way to do an informational popup. On the Mac and on windows machines menus are native controls. Because of this the unpost command doesn't work because tk cedes control to the system event loop in order to get platform-specific behavior. What you want is to use instead is a toplevel window with the overrideredirect flag set. This lets you display a borderless window anywhere you want. The upside to this is that you aren't limited to simple text -- you can put anything you want in that toplevel -- another text widget, a canvas, buttons, etc.
0
2,151
0
1
2010-12-01T20:09:00.000
python,tkinter
'hover over' popup with Tkinter
0
1
1
4,328,747
1
0
0
hey all, im looking for a way of catching a button held down event in wxpython i cant seem to find anything. theres just wx.EVT_BUTTON which isnt quite what i want. i want my event to continue processing as long as the button is down. any help would be appreciated thanks james
true
4,329,377
1.2
0
0
2
I think I would catch the EVT_LEFT_DOWN and the EVT_LEFT_UP. Then start a wx.Timer to run your process on EVT_LEFT_DOWN until the EVT_LEFT_UP is fired. Alternatively, you could use a ToggleButton.
0
1,279
0
1
2010-12-01T21:32:00.000
button,wxpython
wxpython button held down event
0
1
1
4,329,486
1
0
0
Is there a way to customize the horizontal padding between an image and text in a Label widget when compound=left or right? The 2 ways I can think of are: Use PIL to dynamically add columns of pixels to an image Insert or append spaces to the text= option of the label to force the separation of image and text What I'm looking for is a way to specify the horizontal padding (between image and text) in pixels.
true
4,333,359
1.2
0
0
0
There is no built-in way to do what you want. Your own suggestions are good. Another option is to create a frame, and place separate image and label widgets in the frame. You then have complete control of the placement of the widgets
0
912
0
0
2010-12-02T09:16:00.000
python,image,label,tkinter
Python/Tkinter: Customize horizontal padding between image and text in Label widget?
0
1
1
4,334,872
1
1
0
I am trying to integrate IronPython in my Silverlight application but am unable to do so. After downloading the binaries, every time I try to add the dlls as references in my VS2010 solution all I get is an error about them not being compiled for Silverlight. I have even tried downloading the source distribution, but cannot set the various projects making up the solution to build against Silverlight (the only choices I have are different versions of the .net framework). As the IronPython website explicitly states Silverlight compatibility, why is it not working? Is there any easier way of getting scripting capabilities in my Silverlight app?
true
4,336,935
1.2
0
0
2
You have to use binaries from IronPython-2.6.1\Silverlight\bin folder in Silverlight.
0
127
0
3
2010-12-02T15:56:00.000
silverlight,silverlight-4.0,ironpython
Ironpython 2.6.1 on Silverlight 4
0
1
1
4,358,122
1
0
0
I'm trying to disable warning C0321 ("more than one statement on a single line" -- I often put if statements with short single-line results on the same line), in Pylint 0.21.1 (if it matters: astng 0.20.1, common 0.50.3, and Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)). I've tried adding disable=C0321 in the Pylint configuration file, but Pylint insists on reporting it anyway. Variations on that line (like disable=0321 or disable=C321) are flagged as errors, so Pylint does recognize the option properly. It's just ignoring it. Is this a Pylint bug, or am I doing something wrong? Is there a way around this? I'd really like to get rid of some of this noise.
false
4,341,746
0.015383
0
0
1
Python syntax does permit more than one statement on a line, separated by semicolon (;). However, limiting each line to one statement makes it easier for a human to follow a program's logic when reading through it. So, another way of solving this issue, is to understand why the lint message is there and not put more than one statement on a line. Yes, you may find it easier to write multiple statements per line, however, Pylint is for every other reader of your code not just you.
1
404,539
0
346
2010-12-03T01:41:00.000
python,pylint
How do I disable a Pylint warning?
0
1
13
48,765,416
1
0
0
hey.. i have a panel (lets call it mainpanel) with a couple of panels in it and other widgets. i need to know what to bind the wx.EVT_LEFT_DOWN to in order for it to fire an event for clicks anywhere in mainpanel and its children. e.g. if i click on a textctrl in mainpanel i want it to pick that up aswell. binding to mainpanel doesnt work. please help i really need to find a solution to this its making me mad! p.s. binding everychild to the wx.EVT_LEFT_DOWN is not an option i have hundreds of children i really dont want to go that route
false
4,368,885
0
0
0
0
Text controls eat mouse clicks so you may just want to catch the focus event for them. I think the rest should work though.
0
242
0
1
2010-12-06T16:55:00.000
wxpython
wxpython, what to bind an application wide mouse event to
0
1
1
4,370,204
1
0
0
Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. with python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False) Then the interpreter crashed with Windows error reporting. I tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck. Is there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App
false
4,369,102
0.066568
0
0
1
If you are running that in IDLE, then that is your problem. IDLE and wx don't get along very well because you basically end up with two mainloops fighting each other. Try putting it in a file and then run the file from the command line: c:\python27\python.exe myPyFile.py That should work just fine. Otherwise, download the correct wxPython for your Python and OS (32/64 bit), uninstall the current one and install the new one. I've been using wxPython on Windows XP, Vista and 7 with no problems like this.
0
1,983
1
1
2010-12-06T17:19:00.000
python,wxpython
wx.App (wxPython) crash when calling
0
3
3
4,369,662
1
0
0
Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. with python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False) Then the interpreter crashed with Windows error reporting. I tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck. Is there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App
true
4,369,102
1.2
0
0
0
I searched for a while and found that this is the problem with wxPython and Python >2.5. Tried many fix with manyfest file but no luck, so I think switch to PyQt is the only solution now.
0
1,983
1
1
2010-12-06T17:19:00.000
python,wxpython
wx.App (wxPython) crash when calling
0
3
3
4,496,450
1
0
0
Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here. with python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False) Then the interpreter crashed with Windows error reporting. I tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck. Is there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App
false
4,369,102
0.066568
0
0
1
In case like me somebody will stumble into this question like I did. Recently installed wxpython on two machines, windows 7 and XP. Testing the sample code in simple.py (provided with the wxpython docs-demos installer), running from a python console, I had the following problem on both machines: First import ok, but when I did a reload of the module, python crash. I added this line in the end of the simple.py file: del app and that fixed the problem on windows 7 and tomorrow I try it on the XP machine. Same solution fitted for the XP machine. So, reloading an un-edited module with a reference to a wx.App with a closed gui seem not to be feasable. Killing the reference with a del statement was enough to solve the problem.
0
1,983
1
1
2010-12-06T17:19:00.000
python,wxpython
wx.App (wxPython) crash when calling
0
3
3
16,407,973
1
0
0
I'm using the Android 2.2 SDK emulator to test out the Scripting Layer for Android and have one annoyance. When you launch a Python interpreter and start to type code it appears that the parentheses key isn't mapped properly. When I hit the key on the PC keyboard I get ^[[20~ instead. What am I missing?
false
4,369,261
0
0
0
0
Looks like the Control-K button actually toggles the left-ALT key on the PC to mimic the virtual keyboard left-ALT.
0
669
0
0
2010-12-06T17:41:00.000
python,android,sl4a
Android Emulator Keyboard
0
1
1
4,531,739
1
0
0
How do I get my filechooser to be able to select both files and folders when the open button on the filechooser dialog is hit ? I want to squeeze the ability to open files and filders in just one filechooser. I am using GTK+ and Python.
true
4,376,500
1.2
0
0
2
I was thinking about this, and although in your comments you've decided to go another route, I do have a suggestion: Write your own file chooser subclass of the GTK+ one and provide two "Open" buttons, one to "Open File" and another to "Open Directory". That would eliminate the ambiguity discussed above.
0
1,339
0
7
2010-12-07T12:21:00.000
python,pygtk,gtk,filechooser
GTK+ Filechooser to open both files and folders
0
1
1
4,831,626
1
0
0
I am developing a Python 2.7.1 / Tkinter 8.4 app on Windows XP that checks several lines of input from a RS-232 port. However, if no input arrives it will sit in a loop for ever. I am trying to implement an ‘Abandon Test’ button on the GUI but because the main thread is busy waiting for input it doesn’t appear to every check if a button has been pressed. I have tried update_idletasks() and time.sleep(1) with no success. Any suggestions?
true
4,376,870
1.2
0
0
5
Tk is single-threaded, so if the main thread is busy the GUI will freeze. One solution is to use a separate thread to do the reading, so when the read blocks your main thread can continue. When you get a line of input you can push it on a queue which is monitored by the main thread. The other way is to figure out how to do a non-blocking read on your serial port. If there is data, read it. If not, return to the main event loop. You then need to configure the event loop to poll your port every few hundred milliseconds or so, depending on your performance needs.
0
987
0
2
2010-12-07T13:04:00.000
python,tkinter
How can I monitor Tkinter buttons when Python is busy?
0
1
1
4,377,125
1
0
0
Currently I'm drawing some things in a subclass of DrawingArea, where I get a cairo context inside an expose-event and call a draw method from there. (according to some PyGTK tutorial I found) I'm used to doing a repaint() with java, but how can I get the same effect here?
false
4,383,614
0
0
0
0
I found a solution that uses the queue_draw() method (callable from the Gtk.DrawingArea but seems like a method every gtk widget must have), but there are probably alternatives since this one implies it might get delayed, even though in my tests it didn't happen.
0
3,673
0
2
2010-12-08T02:15:00.000
python,gtk,drawing,pygtk
(Py)GTK: How can I force my window to be repainted / call expose-event?
0
1
2
4,383,675
1
0
0
I am running a .NET 3.5 C# project in Visual Studio 2008. In the project I am hosting an IronPython script that imports modules that I have compiled to .NET dlls with pyc. The version of IronPython is 2.6.1. I have used ObjectOperations.GetInstance and GetMember to wire up the python methods to the C# code. When I am debugging the C# code and try to step into the pyc generated IronPython dll, VS won't allow me to do that. Is there any way for me to be able to step into that code?
true
4,396,727
1.2
0
0
1
There is no way to do this out of the box. You'd need to modify IronPython/DLR so that the calls from ClrModule.CompileToMethod down would pass an option to emit symbols and then ultimately call LambdaExpression.CompileToMethod to emit symbols.
1
242
0
1
2010-12-09T09:38:00.000
.net,visual-studio,dll,ironpython
Is it possible to step into an IronPython dll compiled with pyc?
0
1
1
4,414,812
1
0
0
Is there a pack equivalent of the grid_remove() method where a widget's original pack() settings are restored on a re-pack()? Use case: When I show a packed widget that has been hidden via pack_forget(), I would like to have the widget re-packed with its original pack settings when I issue the widget.pack() show request.
true
4,399,237
1.2
0
0
4
No, there is no equivalent. There is only pack_forget which doesn't remember where the widget was when you restore it. If I need this sort of feature I just use the grid geometry manager.
0
2,749
0
3
2010-12-09T14:23:00.000
python,tkinter,ttk
Python/Tkinter: pack equivalent of grid_remove(), eg. pack_remove()?
0
1
2
4,399,322
1
0
0
Are there any best practice tips regarding when one should use pack vs. grid for their layouts? From what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa. To start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show/hide widgets.
true
4,401,202
1.2
0
0
18
Neither is intrinsically better than the other. Each have strengths and weaknesses. Learn what those are and the choice of which to use becomes obvious. grid is considerably easier to use if you need to lay things out in a grid. pack is generally easier to use if all you need to do is put some widgets in a single row or single column. There's a whole lot of gray area in-between where neither is necessarily better than the other. The other thing to consider is what you said in your question: if you want to show and hide widgets at run-time, grid is probably the best choice because of the grid_remove method which remembers the values of all of the configured attributes in case you want to re-add the widget. Personally, my first choice is always to use pack because I first learned Tk back when there was no grid command. If I can't do it easily in pack, or if I'm very clearly laying things out in a grid, I'll use grid.
0
33,054
0
31
2010-12-09T17:23:00.000
python,user-interface,layout,tkinter,ttk
When to use pack or grid layouts in tkinter?
0
3
3
4,402,589
1
0
0
Are there any best practice tips regarding when one should use pack vs. grid for their layouts? From what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa. To start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show/hide widgets.
false
4,401,202
1
0
0
10
I always recommend grid over pack for polished applications. There are only a few edge cases where pack is easier and fits the bill (everything in one row or col). grid has better "composability" (e.g. megawidgets or gridding elements of gridded elements). The reasons to prefer grid are the extra fine-tuning options that it provides. The use of weight (which effects growing and shrinking btw), minsize and maxsize, as well as convenience features like enforcing uniform rows/columns. A fully gridded app of any size will use (significantly) fewer frames than an equivalent packed app, and have better shrink/expand control over inner elements. BTW, both pack and grid can show/hide sub-elements, though the syntax differs slightly between the two. Grid is just slightly better because 'remove' (rather than 'forget') will remember the grid options on the slave widget.
0
33,054
0
31
2010-12-09T17:23:00.000
python,user-interface,layout,tkinter,ttk
When to use pack or grid layouts in tkinter?
0
3
3
4,411,675
1
0
0
Are there any best practice tips regarding when one should use pack vs. grid for their layouts? From what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa. To start the conversation, it appears that one use case that favors grid vs. pack is when one wants to show/hide widgets.
false
4,401,202
0.132549
0
0
2
I personally just think grid is a lot easier to work with, so I would use that. Of course, you've probably read the one thing you should never do is try to use both at the same time in the same container. Thank you Bryan Oakley for making that distinction.
0
33,054
0
31
2010-12-09T17:23:00.000
python,user-interface,layout,tkinter,ttk
When to use pack or grid layouts in tkinter?
0
3
3
4,401,215
1
0
0
one topic that has always been of highest interest to me is 3D Programming. I've made several attempts at programming small games and never really successed. After experiences with DirectX and C++, XNA and C#, as well as Unity3d and C#, I would like to try OpenGL. Just being curious. When using C++ the way to go is rather clear. However Java (and Scala that I'm currently learning), Python ... are way more comfortable. After about 2 years of struggling with C++ without any remarkable success, I turned away from it. Now for Java/Scala/... there are many OpenGL bindings and I would like to choose the right one. On the contrary there are few books on them. Java 3d and/or JOGL books are available but when looking at Scala or Python things aren't that good. What layer/wrapper/binding would you recommend (Java or Scala). Is there a kind of standard ? Is it possible to learn this binding by reading for eyample "OpenGL Superbible" ? If not, can you recommend a book ? Any advice is welcome. If there's a good IDE (plugin), tool, website, tutorial, ... please let me know it.
true
4,403,150
1.2
0
0
3
I have used JOGL in many of my 3D projects. Learning how to use a binding is not as important as learning the actual api. Using opengl in c and java are pretty much the same. The only thing that differs is the way you set up your rendering windows and buffers. I use netbeans ide with the opengl for netbeans plugin because it sets everything up for you and all you have to worry about is the opengl part. To learn opengl any book is fine. If you have a good background in programming then you should catch on quite easily.
0
1,677
0
3
2010-12-09T21:10:00.000
java,python,scala,opengl,jogl
Key to OpenGL. Java / Scala / Python
0
1
2
4,435,696
1
0
0
I want to make a gtk SpinButton, but for inputting dates. Is there an easier way to input dates into GTK? If not, how can I create a SpinButton look-alike, but whose output is text representing dates instead of integers? Ideally I'd re-use the arrows, the clicks, the integration with the adjustment, etc. I really just need the output to look different, as I can even represent dates as integers.
false
4,404,825
0.197375
0
0
3
The calendar is a bit large, but you can find code putting it in a popup. Personally I use a regular text entry and parse the date. As for SpinButton, it is based on a text entry, so you might be able to modify its display only by fiddling with inherited signals and returning False. See also the update-policy and numeric properties.
0
847
0
1
2010-12-10T01:22:00.000
python,user-interface,gtk,pygtk
gtk custom spin button
0
1
3
4,450,091
1
0
0
I have done coding for mathematical simulation of Theory of Computation concepts in Python such as grammar checking and other stuff. My Problem is that I have to build a decent looking GUI for it . I have looked at PyQt4 and the lack of documentation is really a big deterrent. I have looked at other graphical libraries in Python and they are not helping me so is there a way that I can write the GUI stuff in some other language and integrate python in it. The problem is that I want mathematical stuff like circles, epsilon on runtime which have drag and drop events available on them. So simply creating an image is not an option. I am sorry for being a little non specific here but the problem is that I am looking for things that can help here. I have asked a question before too for GUI and unfortunately I could'nt find the right answers for it. Is there a way I can get around this problem. Thanks a lot....
false
4,413,692
0
0
0
0
Most python guis I recommend tkinter but drag 'n drop isn't built into tkinter yet and I'm not a huge fan of the other libraries. Have you thought about IronPython in .Net and WPF? You'll need to learn the xaml syntax but it's not much harder than html (technically, it's stricter and simpler but you need to learn some library controls it will instantiate). There are free versions of visual studio for all of this. Another simple way would be to expose a command line or webservice interface to your python routines.
0
77
0
1
2010-12-10T22:02:00.000
python
Interlinking GUI in some other language and Python
0
2
2
4,413,768
1
0
0
I have done coding for mathematical simulation of Theory of Computation concepts in Python such as grammar checking and other stuff. My Problem is that I have to build a decent looking GUI for it . I have looked at PyQt4 and the lack of documentation is really a big deterrent. I have looked at other graphical libraries in Python and they are not helping me so is there a way that I can write the GUI stuff in some other language and integrate python in it. The problem is that I want mathematical stuff like circles, epsilon on runtime which have drag and drop events available on them. So simply creating an image is not an option. I am sorry for being a little non specific here but the problem is that I am looking for things that can help here. I have asked a question before too for GUI and unfortunately I could'nt find the right answers for it. Is there a way I can get around this problem. Thanks a lot....
true
4,413,692
1.2
0
0
1
I'd look again at PyQT4 if you want something decent looking. PyQt has an an example directory in the source code. KDE uses QT and they have a lot examples too. You have to understand that it is a binding against QT4. When I use it with python I usually just have the QT docs open. Its pretty easy to translate. You could look at PyGTK also, but again, it is a binding against GTK.
0
77
0
1
2010-12-10T22:02:00.000
python
Interlinking GUI in some other language and Python
0
2
2
4,413,875
1
0
0
Is there anyway I could register button pushes on a joystick without using any function from pygame?
false
4,415,649
0.099668
0
0
1
If you're looking for a way to do it with just the standard Python library, the answer is probably "no" - or at the very least, "not in any straightforward manner". There are many things in the standard library, but gaming hardware support is not one of them.
0
916
0
1
2010-12-11T07:05:00.000
python
Detecting an arbittrary button press on a USB joystick WITHOUT pygame
0
1
2
4,415,722
1
1
0
Every time I need to load a local file using webkit in python I need to start with "file://" which I need to include in all files I am working with. How can I eliminate the need to do that? I want to load files like webview.load_uri('file.html') instead of webview.load_uri('file://file.html')?
true
4,416,570
1.2
0
0
3
You can't. webview.load_uri() takes a string containing a URI. 'file.html' isn't a URI, 'file://file.html' is.
0
2,182
0
2
2010-12-11T11:50:00.000
python,webkit,gtk
Problem loading local files with webkit in python
0
2
2
4,421,093
1
1
0
Every time I need to load a local file using webkit in python I need to start with "file://" which I need to include in all files I am working with. How can I eliminate the need to do that? I want to load files like webview.load_uri('file.html') instead of webview.load_uri('file://file.html')?
false
4,416,570
0.099668
0
0
1
webview.load_string() takes the text of an html file. you can load the file into a file object without the file:// and read it into the load_string function.
0
2,182
0
2
2010-12-11T11:50:00.000
python,webkit,gtk
Problem loading local files with webkit in python
0
2
2
7,470,386
1
0
0
Has anyone figured out a way to change the brace matching colours in WingIDE? I have managed to manually port my favourite colour scheme across from my text editor and the default green just doesn't do it for me. I've been unable to find instructions on how to do this in the UI, user manual and mailing lists.
true
4,418,839
1.2
0
0
1
I've contacted Wingware support and they have confirmed that there is no way to set the brace matching colour.
0
135
0
3
2010-12-11T20:40:00.000
python,wing-ide
WingIDE brace matching colours
0
1
1
4,431,943
1
0
0
I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems like an obvious thing to want to do.
false
4,451,166
0.066568
0
0
1
The simple answer is that the wx.ListBox doesn't support that. Try using a one column wx.ListCtrl (in Report mode) instead.
0
721
0
2
2010-12-15T14:50:00.000
python,windows,wxpython
Keyboard interface to wxPython listbox
0
2
3
4,465,221
1
0
0
I'm using a wxPython listbox on Windows to get a choice from the user, and I would like them to be able to select an item using the ENTER key, as if they had double-clicked. I know how to do this in C or C++ using the Windows API directly, but can't seem to find how to do it using wxPython. Anyone know how? It seems like an obvious thing to want to do.
false
4,451,166
0.066568
0
0
1
Maybe I'm missing some nuance, there wasn't much info to go on, but it sounds like you could accomplish this by catching the keydown event, matching for enter and then calling your on_doubleclick function. Unless there's an implicit double-click handling you should be good to go.
0
721
0
2
2010-12-15T14:50:00.000
python,windows,wxpython
Keyboard interface to wxPython listbox
0
2
3
4,451,586
1
0
0
I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. Besides for memory, is there a speed reasons to not use a pre-rendered map?
false
4,451,464
0
0
0
0
Depends on the size of the map you want to make, however, with the actual technologies it's very hard to see a tile-map "rendered" to take longer than expected, tiled based games are almost extinguished, however is always a good practice and a starting point to the world of game programming
0
2,637
0
5
2010-12-15T15:12:00.000
python,pygame
Pygame: Tiled Map or Large Image
0
3
4
4,474,154
1
0
0
I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. Besides for memory, is there a speed reasons to not use a pre-rendered map?
false
4,451,464
0.049958
0
0
1
Memory and speed are closely related. If your tile set fits in video memory, but the pre-rendered map doesn't, speed will suffer.
0
2,637
0
5
2010-12-15T15:12:00.000
python,pygame
Pygame: Tiled Map or Large Image
0
3
4
4,451,504
1
0
0
I am trying to decide if it is better to use a pre-rendered large image for a scrolling map game or to render the tiles individual on screen each frame. I have tried to program the game both ways and don't see any obvious difference in speed, but that might be due to my lack of experiences. Besides for memory, is there a speed reasons to not use a pre-rendered map?
true
4,451,464
1.2
0
0
5
The only reason I can think of for picking one over the other on modern hardware (anything as fast and with as much ram as, say, an iPhone), would be technical ones that make the game code itself easier to follow. There's not much performance wise to distinguish them. One exception I can think of, is if you are using a truly massive background, and doing tile rendering in a GPU, tiles can be textures and you'll get a modest speed bump since you don't need to push much data between cpu and gpu per frame, and it'll use very little video ram.
0
2,637
0
5
2010-12-15T15:12:00.000
python,pygame
Pygame: Tiled Map or Large Image
0
3
4
4,451,490
1
0
0
I have a small Python app ready that I'd like to distribute around to my friends in the company. I have used wxWidgets for the GUI, with SQLite for the database. I'm planning on using py2exe for packaging the entire thing. I'd like to know if bundling the Python interpreter is required ? Does py2exe does it by default ? My friends wont have Python installed on their systems. Are there any extra libraries that I should bundle for the GUI ? I want this to run only on Windows, nothing else.
false
4,463,097
0
0
0
0
py2exe must bundle the Python interpreter--how else would your friends without Python use your program without it? But it does, of course. py2exe mostly includes what needs to be included based on what is imported into your app, so if you have import sqlite3 in there, it will be included. I'd try using GUI2Exe, it makes using py2exe so much more intuitive and easier.
1
725
0
0
2010-12-16T16:37:00.000
python,installation,wxwidgets,executable,py2exe
Do I need to bundle the Python interpreter (in py2exe) when I am distributing my app?
0
1
2
4,467,946
1
0
0
i want to change my progrssbar color to Black which is green. i think by default it is green I am trying with self.progress_bar.color but doesnot reflect any change i think there will be any inbuilt method but i am unable to find it.
false
4,468,326
0.099668
0
0
1
I'm guessing here, but because wxPython wraps native widgets whenever possible, those widgets may or may not support the changing of certain colors. I know that's true with StaticText on some OSes. So you may want to try with the generic progress bar, PyProgress, since it's written in pure Python and can be hacked easily.
0
1,414
0
1
2010-12-17T06:42:00.000
wxpython
Want to change progress bar color to Black in wx python
0
1
2
4,471,136
1
0
0
I am currently in the process of discovering OpenCL via the Python binding Clyther. So far I am messing with a very simple script to get the sin or cos of a buffer of 65536. Apparently 65536 is the limit for buffers on my card but say I'd have 16 million numbers in my buffer how would I go about it without constantly bringing the CPU into it to retrieve/send data? What I have do so far is, fill buffer, run kernel, retrieve buffer, in a loop but that also hits the CPU badly. I looked a bit at OpenCL docs but I just failed to understand how that is achieved. Thank you
true
4,470,246
1.2
0
0
2
This awfully looks like you are using __constant memory. The solution is to use __global memory instead, but you have to be careful about how you access it for best performance. __constant memory is a special address space for often used constant values, but is restricted in size on current GPUs.
0
156
0
0
2010-12-17T12:02:00.000
python,opencl
Processing buffers bigger than 65536 in Clyther/OpenCL
0
1
1
4,478,655
1
0
0
I checked some other question and websites, and I've come to the conclusion that Python does allow (correct me if I'm wrong) you to make GUI programs using different cross-platform toolkits like Qt, wxWidgets and some others. But what if I don't want cross-platform portability. Primary, I want to develop native application using native libraries like Cocoa for Mac, native libraries of Windows for window, GTK for GNOME and Qt for KDE apps different with different code. Different code is not an issue here. Can I do this? I just don't need cross-platform portability but I need to make native apps? Any insights from pro programmers ?
false
4,471,056
1
0
0
8
Don't waste your time. Use wxPython, which will use the native toolkit for you.
0
1,951
0
1
2010-12-17T13:52:00.000
python,windows,qt,macos,wxwidgets
Python and native GUI
0
1
3
4,471,107
1
0
0
If I were to write several classes in c++ then use swig to do the conversion so I could later use them in python, would they run faster or slower than if I completely rewrote them in python? Or is there no noticable speed difference?
true
4,476,663
1.2
1
0
6
The quality and speed of wrappers generated by SWIG is very good, and they will probably perform just as good as handcrafted wrappers. From my experience, the wrappers themselves are very thin and add very little overhead to the native functions they wrap, making it a perfectly valid choice to use wrapped libraries in python or any other supported language, and is a good way to reuse code. however, to be if you are interested in performance in addition to code reuse, wrapping native code will probably only pay off if you have some computationally intensive native functions, like multiplying matrices, computing MD5 or CRC, folding proteins etc. on the other hand, sometimes you can just rewrite everything in an easy language like python or C# and enjoy better code and better tools, with comparable performance.
1
3,456
0
9
2010-12-18T04:38:00.000
c++,python,performance,swig
Speed of swig wrappers
0
1
1
4,484,174
1
0
0
I'm trying to create a configuration file for a C# app in IronPython. Is there any way I can have that python file just return a value, or do I have to go through variables/functions to access the results of the script? i.e., right now I've got Config.py that looks like x = "test" and C# code that goes dynamic pyfile = Python.CreateRuntime().ExecuteFile("Config.py"); Console.WriteLine(pyfile.x); Is there any way to remove the x?
true
4,479,679
1.2
1
0
3
You can create a ScriptSource with SourceCodeKind.AutoDetect and it will return the last expression in the file.
1
618
0
2
2010-12-18T19:21:00.000
c#,dynamic,interop,ironpython
How to create an IronPython file that simply returns a single value to C#?
0
1
1
4,480,156
1
0
0
Is there a messagebox class where I can just display a simple message box without a huge GUI library or any library upon program success or failure. (My script only does 1 thing). Also, I only need it to run on Windows.
false
4,485,610
0.066568
0
0
2
You can also use the messagebox class from tkinter: from tkinter import messagebox unless tkinter is that huge GUI you want to avoid. Usage is simple, ie: messagebox.FunctionName(title, message [, options]) with FuntionName in (showinfo, showwarning, showerror, askquestion, askokcancel, askyesno, askretrycancel).
1
53,872
0
43
2010-12-19T22:58:00.000
python,windows,user-interface,windows-7
Python Message Box Without huge library dependency
0
1
6
40,915,752
1
0
0
I am C/C /Java programmer, but lately I have started learn Python. Moreover I have 3D Graphics on my studies. I have to create 3D model of my apartment, with dynamic camera. I am wondering if this is a good idea to merge this two issues, by writing this 3D model in python. However as I said, I am a python beginner, so I don't know possibilities, which python can give me in this area. Which libraries/engine will be the best for a start?
false
4,490,991
0.099668
0
0
2
If you're solely trying to learn how to do a 3d model go for the language you're the most familiar with. I'd recommend C++ or C# in that case (whichever of the 2 you meant with the second C). If you also want to learn more about the language Python is the better choice. But pure language wise I wouldn't say that C++/c#/python beats the other.
1
425
0
5
2010-12-20T15:19:00.000
python,3d
Is python is a good choice as language used to implementing my first 3D model?
0
1
4
4,491,082
1
0
0
I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the packages and I have also tried with the PyQt packages from yum but I have the same problem. Has anyone else encountered this problem before? Thanks.
false
4,499,204
0
0
0
0
If it's really an ImportError, that suggests that it's failing to import the library altogether. Check that it's definitely somewhere that's in your sys.path, and that from PyQt4 import QtCore works. If the library exists, and QT_VERSION_STR doesn't exist, it will give you a NameError rather than an ImportError.
1
856
0
0
2010-12-21T12:25:00.000
python,linux,qt4,pyqt
PyQt4.QtCore doesn't contain many of its classes and attributes
0
2
2
4,499,868
1
0
0
I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the packages and I have also tried with the PyQt packages from yum but I have the same problem. Has anyone else encountered this problem before? Thanks.
true
4,499,204
1.2
0
0
0
The reason for this problem was a conflict in my python path. I had two modules named sip.py in different locations on my python path, the python path was using the first one but I wanted it to use the second one. I removed the first entry from the python path as it wasn't necessary.
1
856
0
0
2010-12-21T12:25:00.000
python,linux,qt4,pyqt
PyQt4.QtCore doesn't contain many of its classes and attributes
0
2
2
4,592,960
1
0
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.
false
4,505,097
0.099668
0
0
2
In addition to what these fellows are saying, you might also want to try EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I think these are fired when you move the mouse into and out of the frame widget, although I don't think the frame has to be in focus for those events to fire. @ Hugh - thanks for the readership!
0
2,304
0
1
2010-12-22T00:01:00.000
python,wxpython,wxwidgets
wxPython Whole Window Focus Event
0
3
4
4,510,733
1
0
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.
false
4,505,097
0.099668
0
0
2
as WxPerl programmer i know there is EVT_SET_FOCUS( EVT_KILL_FOCUS( if you initialize this event by listening to the frame as first parameter it should work as in Perl since the API is almost the same
0
2,304
0
1
2010-12-22T00:01:00.000
python,wxpython,wxwidgets
wxPython Whole Window Focus Event
0
3
4
4,505,382
1
0
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground. My application is just a single window derived from wx.Frame.
true
4,505,097
1.2
0
0
5
The correct answer for this case is to use an EVT_ACTIVATE handler bound to the frame. There will be an event whenever the frame is activated (brought into the foreground relative to other windows currently open) or deactivated. You can use the event object's GetActive method to tell which just happened.
0
2,304
0
1
2010-12-22T00:01:00.000
python,wxpython,wxwidgets
wxPython Whole Window Focus Event
0
3
4
4,521,758
1
1
0
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. Thank you
false
4,514,389
0
0
0
0
Python is a good beginning language, but you need to ensure that you do more than just course work. Why not just run through tutorials on Android development right off the bat? If you are worried about wasting time by not using Java immediately, then why not just start there?
0
352
0
1
2010-12-22T22:41:00.000
iphone,python,android
Beginner's Language app
0
2
5
4,514,409
1
1
0
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. Thank you
false
4,514,389
0.039979
0
0
1
Learn to program first before learning how to develop for the iPhone. That will give you a much better chance at success. Python a perfectly good language for learning to program, especially in the context of an Intro to CS course environment. But any intro programming language environment will do (even one designed for kids). Once you're comfortable writing non-trivial programs in Python (or whatever first computer language you choose), learning Objective C and the iOS APIs (or Java and the Android APIs) will become much much easier, compared with starting from scratch and zero programming background.
0
352
0
1
2010-12-22T22:41:00.000
iphone,python,android
Beginner's Language app
0
2
5
4,514,481
1
0
0
I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from "Open" to "Create" or "Delete", etc. What I am doing is I have a button with the text "Delete Portfolio", when pressed it opens a FileDialog & allows the user to select a portfolio file(.db) to delete. So instead of the File Dialog's bottom right confirm button displaying "Open" I would like to be able to change the text to "Confirm" or "Delete" or whatever. Is this possible, its a rather superficial thing to do, but if the button says open when the user wants to select a file to delete, it can be a little confusing even if the title of the dialog says "please select a file to delete"
false
4,529,991
0
0
0
0
If you are using the native controls, which wx tends to use, then you probably can't.
0
691
0
2
2010-12-25T10:17:00.000
python,wxpython
wxPython: Change a buttons text in a wx.FileDialog
0
2
2
4,530,426
1
0
0
I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from "Open" to "Create" or "Delete", etc. What I am doing is I have a button with the text "Delete Portfolio", when pressed it opens a FileDialog & allows the user to select a portfolio file(.db) to delete. So instead of the File Dialog's bottom right confirm button displaying "Open" I would like to be able to change the text to "Confirm" or "Delete" or whatever. Is this possible, its a rather superficial thing to do, but if the button says open when the user wants to select a file to delete, it can be a little confusing even if the title of the dialog says "please select a file to delete"
false
4,529,991
0.099668
0
0
1
Yeah, I agree with Arafangion. wxPython uses the native widgets and can only manipulate them in whatever way that native widgets allow. You would need to create a custom dialog to do this.
0
691
0
2
2010-12-25T10:17:00.000
python,wxpython
wxPython: Change a buttons text in a wx.FileDialog
0
2
2
4,539,977
1
0
0
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt. I thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?
true
4,530,901
1.2
0
0
3
if you want just a simple animation and want to finish your game fast. use the pyqt's scene view. refer to (Rapid GUI programming using python and pyqt) book if you want to learn more about scene view.
0
2,261
0
1
2010-12-25T17:02:00.000
python,pyqt,pygame
what framework to use for python card game?
0
2
3
4,562,183
1
0
0
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt. I thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?
false
4,530,901
0
0
0
0
Both pygame and pyqt will work for what you want to do, but I'd recommend pyqt: you'll be able to use standard widgets (like listboxes, textboxes, menus, buttons, ...). I've never worked with pyqt myself, but I image that drag 'n drop is something built-in, which will be really useful for a card game. With pygame on the other hand you'll have to make everything yourself. This will give it more of a game feel as you can draw everything exactly like you want it to look like, but it'll take more work as you have to implement basic stuff yourself.
0
2,261
0
1
2010-12-25T17:02:00.000
python,pyqt,pygame
what framework to use for python card game?
0
2
3
4,562,270
1
0
0
I'm new to pyglet. I'd like to change a pixel from black to white at each on_draw iteration. So after 1000 iterations, there should be exactly 1000 white pixels in the window. However, I'd like to avoid calling 1000 draw operations in on_draw for that. So I'd like to create an image, do an RGB putpixel on the image, and blit the image to the screen. How can I do that? The pyglet documentation, the examples and the source code aren't too helpful on this.
false
4,532,008
0
0
0
0
It seems there is no easy way to do this in pyglet. So I've given up on using pyglet.
0
1,298
0
1
2010-12-25T22:51:00.000
python,image,pyglet
putpixel with pyglet
0
1
3
5,832,879
1
0
0
I have a PyQt application that reads and writes data files. I am including a 'version number' in each file written. This is a simple number similar to: 1.2 or something (major and minor versions). I am doing this so that I can change the format of these data files in future versions and then still correctly parse them simply by checking to see what the version is inside the file. My question is what is the best practice for keeping this number stored inside the app itself. I.e. do I just hard-code the app version number into the class that is responsible for reading and writing files? Or should I have some sort of object/variable stored at the top-level of the app and somehow access it from the class responsible for reading and writing these files. If the latter, how do I store it and how do I access it? Thanks.
false
4,535,895
0
0
0
0
Personally, I wouldn't do it manually this way. I'd save my code in Subversion and let it maintain the revision numbers for me.
1
3,932
0
5
2010-12-26T23:43:00.000
python,version,global-variables
Python: Best practice for including a version number in an app?
0
1
3
4,535,921
1