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 a GUI application written with python+tkinter. In my workflow, I generally start the gui from the commandline, do some things in the gui and then I find myself navigating to other terminal windows to do some work. Inevitably, I want to shut down the GUI at some point, and out of habit I often just navigate to ... | true | 9,998,274 | 1.2 | 0 | 0 | 5 | from the newsgroups:
I'm using Python 1.5 under Redhat Linux 5.0. I'm trying to figure out
the best way to trap a SIGINT (or Ctrl-C) when using tkinter. To
illustrate the problem I have, do the following ...
-- Build Python-1.5 with tkinter enabled.
-- Go into the Demo/tkinter/guido directory under the Python-1.5 ... | 0 | 2,414 | 0 | 6 | 2012-04-03T17:23:00.000 | python,tkinter,keyboardinterrupt | tkinter keyboard interrupt isn't handled until tkinter frame is raised | 0 | 1 | 1 | 10,067,034 | 1 |
0 | 0 | I'm having a problem with my (game) application, which is using Boost.Python, when it comes to the scripting part. I have a client thread and a server thread that runs in the same process if you do not connect to an external server.
This is where my problems arise: It seems like the Python interpreter can't execute scr... | false | 10,000,524 | 0.197375 | 1 | 0 | 1 | As of today, you cannot avoid GIL interactions when using python threads in the same process.
You may want to have a look at multiprocessing module which is meant to easily spawn Python processes, thus not interacting with GIL.
Another option is to explicitly release the GIL when its not needed in your wrapped C/C++ fu... | 1 | 624 | 0 | 2 | 2012-04-03T20:04:00.000 | c++,parallel-processing,boost-python,cpython | Running two python scripts parallel with boost::python | 0 | 1 | 1 | 10,002,004 | 1 |
0 | 0 | I have a GUI project which I am about to start. GUI requirement is simple ( though not as simple as tkinter will suffice). So I need to use a GUI toolkit for python (which will be wxpython if I have to go for GUI). Now I am thinking, why cannot I use simple web-framework such as cherrypy or bottlepy (sorry, if I am not... | false | 10,013,904 | 0.099668 | 0 | 0 | 2 | You think absolutely right. There are loads of python-based frameworks, just choose the right one: pyramid, pylons, django are the most popular and widely-used.
I suggest you to outsource HTML/CSS slicing to some professional instead of doing it by yourself. You can face up quite a lot of browser-specific things, which... | 0 | 6,264 | 0 | 5 | 2012-04-04T15:06:00.000 | python,user-interface | Using web-server to substitute for GUI in python | 0 | 2 | 4 | 10,014,865 | 1 |
0 | 0 | I have a GUI project which I am about to start. GUI requirement is simple ( though not as simple as tkinter will suffice). So I need to use a GUI toolkit for python (which will be wxpython if I have to go for GUI). Now I am thinking, why cannot I use simple web-framework such as cherrypy or bottlepy (sorry, if I am not... | false | 10,013,904 | 0.049958 | 0 | 0 | 1 | No, you are thinking of this correctly. HTML/CSS is very simple it can lend to rapid development. Additionally python micro frameworks will make creating your business logic a breeze. This is a very straight forward sipmle route to take. | 0 | 6,264 | 0 | 5 | 2012-04-04T15:06:00.000 | python,user-interface | Using web-server to substitute for GUI in python | 0 | 2 | 4 | 10,013,987 | 1 |
0 | 0 | What I'm wanting to do is create a selection tool (like what you see in most paint programs) using PyGtk. I've seen a previous question that asked something similar, but they already seemed to know what they were doing to make the selection itself. That user said he was using an eventbox, but I don't know how I would... | false | 10,018,767 | 0 | 0 | 0 | 0 | If you want to display an image and allow the user to select and move parts of it, you best look for a ready-made image editing widget. GTK doesn't come with one.
To roll your own you can use an image widget for display, but it doesn't care about the mouse, so you can place it inside an event box and connect to button ... | 0 | 212 | 0 | 0 | 2012-04-04T20:29:00.000 | python,pygtk | How do I create a canvas selection tool? | 0 | 1 | 1 | 10,057,082 | 1 |
0 | 0 | I have a large data set (log data) that is stored in a SQLite3 database. I created a Python GUI using Wx.listctrl that displays that data from a query. It works fine for small amounts of data but obviously hangs on larger sets.. therefore I would like to implement one of two things:
-paging were the first 5000 records ... | false | 10,020,528 | 0 | 0 | 0 | 0 | In different scenarios, the strategies will be different. The assumption is that you just use wxPython for presentation purpose, and you have a separate module/package dealing with the data. wxPython controls get data only from the data abstraction layer.
Scenario I: load all the log data into the memory and use wx.lis... | 0 | 1,254 | 0 | 1 | 2012-04-04T23:08:00.000 | python,sqlite,wxpython,wxwidgets | Display large dataset from Sqlite database in Python wx | 0 | 1 | 2 | 10,021,932 | 1 |
0 | 0 | I'm learning Python and want to make a small text editor that would allow the code collapsing like when def a Function, how you can collapse that to a single line.
I'm thinking of using Tkinter but would be open to other environments.
I mainly want to know what widget I should use, I'd like to think that I'd be able to... | false | 10,045,312 | 0.197375 | 0 | 0 | 1 | You could consider the Scintilla text editing component, with bindings for Python (and other languages.) The Scintilla text editing widget is the basis for the SciTE text editor.
SciTE supports code folding, so it is certainly doable - it may even be a built in part of Scintilla.
From the SciTE website:
Scintilla is a... | 1 | 200 | 0 | 0 | 2012-04-06T15:03:00.000 | python | Python: How to program an IDE Code collapsing? | 0 | 1 | 1 | 10,045,462 | 1 |
0 | 0 | I'm want to show in the GUI a small box (400x85) that shows in an HTML file over the web.
The QtWebKit class got his QWebView widget, but the whole QtWebKit class is VERY heavy, weights 16MB, and slows the init of the application in three seconds.
It's not really necessary to load the whole QtWebKit class just to show ... | true | 10,053,409 | 1.2 | 0 | 0 | 1 | You can use Internet Explorer via ActiveQT. There is a c++ example in "yourqtdir\4.8.0\examples\activeqt\webbrowser". | 0 | 326 | 0 | 0 | 2012-04-07T09:45:00.000 | python,windows,qt4,pyqt4 | An Internet browser Qt4 widget? | 0 | 1 | 1 | 10,059,458 | 1 |
0 | 0 | I am trying to learn OpenGL, and I'm using PyOpenGL and GLUT.
What really bugs me, is that I can't figure out how to change the
title bar icon. Has anyone had any success in changing this? | true | 10,054,167 | 1.2 | 0 | 0 | 2 | You don't.
Remember: GLUT is primarily for test applications and demos. If your application is complex and platform-specific enough to need to change its icon, then you probably need to move beyond GLUT. | 0 | 248 | 0 | 1 | 2012-04-07T11:45:00.000 | python,opengl,freeglut | How do I replace the GLUT title bar icon when using pyopengl? | 0 | 1 | 1 | 10,055,756 | 1 |
0 | 0 | I have a two years of experience in programming of enterprise application's with Java and Visual Studio, and I'm new in Python and wxPython. So my question is: Can wxPython provide me enough rich GUI to create those same app's? My reason if using Python is in it's diversity, simplicity and fast development of app's. T... | false | 10,093,879 | 0 | 0 | 0 | 0 | I would certainly suggest using Python and its GUI libraries, but only you can really make the decision as to wether you think its better than visual studio or Java. The syntax of Python is very basic and I think many people can agree its a plesure to use when you get your head around it (no curly brackets etc). Python... | 0 | 3,812 | 0 | 4 | 2012-04-10T17:54:00.000 | python,wxpython | wxPython GUI - can it be compared to Java GUI or Visual Studio GUI? | 0 | 2 | 4 | 10,094,083 | 1 |
0 | 0 | I have a two years of experience in programming of enterprise application's with Java and Visual Studio, and I'm new in Python and wxPython. So my question is: Can wxPython provide me enough rich GUI to create those same app's? My reason if using Python is in it's diversity, simplicity and fast development of app's. T... | false | 10,093,879 | 0.049958 | 0 | 0 | 1 | wxGlade will give you the GUI skeleton. You will still need a separate text editor (I recommend Geany) to fill in the handlers. | 0 | 3,812 | 0 | 4 | 2012-04-10T17:54:00.000 | python,wxpython | wxPython GUI - can it be compared to Java GUI or Visual Studio GUI? | 0 | 2 | 4 | 10,093,925 | 1 |
0 | 0 | I've decided to start working on a personal project, attempting to develop a cross platform, MSPaint like app. Oddly enough, I find mspaint is one of the applications I miss the most on Linux or OS X, so I want to try to make something similar. Tuxpaint, mtpaint, gpaint, etc. are all old and inactive and ugly. I don... | false | 10,104,261 | 0 | 0 | 0 | 0 | Short: You can use both, no third party library is guaranteed to be distributed with all major distributions.
Long:
Gtk+ vs. Qt
What do you want incorporate into your application. If it is just selecting a brush, selecting color you could pretty much use any gui toolkit.
If you are going to run it as a web-based tool,... | 0 | 810 | 0 | 1 | 2012-04-11T10:33:00.000 | python,linux,qt,gtk | Framework for paint program | 0 | 2 | 4 | 10,106,439 | 1 |
0 | 0 | I've decided to start working on a personal project, attempting to develop a cross platform, MSPaint like app. Oddly enough, I find mspaint is one of the applications I miss the most on Linux or OS X, so I want to try to make something similar. Tuxpaint, mtpaint, gpaint, etc. are all old and inactive and ugly. I don... | false | 10,104,261 | 0.148885 | 0 | 0 | 3 | Qt's canvas object (or its newer replacement QGraphicsView) can do pretty cool things. Whether you choose C++ or python is a matter of personal choice, as Qt is supported in both languages. For a simple project like this I'd choose python because killer performance is not much of an issue, and it will be much easier to... | 0 | 810 | 0 | 1 | 2012-04-11T10:33:00.000 | python,linux,qt,gtk | Framework for paint program | 0 | 2 | 4 | 10,104,320 | 1 |
0 | 0 | So I'm using pyqt and I'm trying to populate my List with items that contain an icon and some text beside it. My icons gets shrunk down when inserted to the List and my font size is super small. How do I increase size of everything (i.e size of icon and text)? | false | 10,115,481 | 0 | 0 | 0 | 0 | The icon size and the font can be set on the view widget with setIconSize and setFont. | 1 | 748 | 0 | 1 | 2012-04-11T23:38:00.000 | python,qt | Resizing row height of list widget | 0 | 1 | 1 | 10,115,583 | 1 |
0 | 0 | I want to develop in Qt, and I already know Python. I am learning C++, so what are the advantages of programming Qt in C++ over Python? C++ seems more complicated, and seems like there is not much gain. | false | 10,132,427 | 1 | 0 | 0 | 22 | What is the advantage of using the native C++ Qt over PyQt
Speed/power/control.
PyQt application will still require python. C++/Qt Application compiles to native exe. By using C++ you'll get access to 3rd party libraries that won't be available in python, plus you'll exterminate "middle man" - layer that sits between ... | 0 | 17,063 | 0 | 14 | 2012-04-12T21:53:00.000 | c++,python,qt,qt4,pyqt | What is the advantage of using the native C++ Qt over PyQt | 0 | 3 | 4 | 10,132,617 | 1 |
0 | 0 | I want to develop in Qt, and I already know Python. I am learning C++, so what are the advantages of programming Qt in C++ over Python? C++ seems more complicated, and seems like there is not much gain. | false | 10,132,427 | 0.049958 | 0 | 0 | 1 | In short, I believe that unless you have strong performance requirements, you should stick with Python. Also, as Greg mention, your program will be more portable with Python than with C++.
I love C++ but these days, for most project, I mostly turn to Python if not Java. However, if I'm writing a game or a graphics appl... | 0 | 17,063 | 0 | 14 | 2012-04-12T21:53:00.000 | c++,python,qt,qt4,pyqt | What is the advantage of using the native C++ Qt over PyQt | 0 | 3 | 4 | 10,132,490 | 1 |
0 | 0 | I want to develop in Qt, and I already know Python. I am learning C++, so what are the advantages of programming Qt in C++ over Python? C++ seems more complicated, and seems like there is not much gain. | false | 10,132,427 | 1 | 0 | 0 | 6 | If you're planning on distributing your app, it's much easier to deliver a self-contained compiled executable than relying on your end users to install Python and PyQt first. But that may or may not be a consideration for you. | 0 | 17,063 | 0 | 14 | 2012-04-12T21:53:00.000 | c++,python,qt,qt4,pyqt | What is the advantage of using the native C++ Qt over PyQt | 0 | 3 | 4 | 10,132,451 | 1 |
0 | 0 | Is it possible to define a class with a __getitem__ that takes a tuple argument using the Python C-API?
The sq_item member of the tp_as_sequence member of a PyTypeObject
must be a ssizeargfunc, so I don't see how to do it.
(But I assume that the NumPy ndarray does it.) | true | 10,151,806 | 1.2 | 0 | 0 | 5 | Yes, use tp_as_mapping instead.
Its mp_subscript takes a PyObject * so you can use anything as index/key.
To understand how they relate, you could have a look at the source of PyObject_GetItem() which (as the doc says) is the equivalent of Python o[key] expression. You will see that it first tries tp_as_mapping and if ... | 0 | 853 | 0 | 3 | 2012-04-14T07:16:00.000 | python,python-c-api | __getitem__ method with tuple argument using Python C-API | 0 | 1 | 1 | 10,152,614 | 1 |
0 | 0 | Does anybody know if it's possible to put two lines of text in a single row using grid in TKinter?
If I make the font small enough, can I distribute the text in two lines? | false | 10,171,249 | 0.099668 | 0 | 0 | 1 | You can put multiple items in one cell but it is highly unusual, may have surprising behavior, and there are better ways to accomplish the same effect.
For example, the grid is invisible so you can have as many rows as you want to achieve any look you can imagine. Also, the definition of "item" is pretty loose -- you c... | 0 | 1,178 | 0 | 0 | 2012-04-16T09:00:00.000 | python,text,grid,tkinter,row | Two lines of text in a single grid row | 0 | 1 | 2 | 10,172,879 | 1 |
0 | 0 | I'd like to make a small desktop editor to take notes, that uses markdowns to format text quickly. The application should transcribe markdowns instantaneously or after clicking on a button.
For this I'd like to use Qt4 and Python.
What, in your opinion, is the most efficient way to proceed?
In the case the rich text is... | false | 10,178,875 | 0 | 0 | 0 | 0 | I came here because I'm looking for a solution for the same task.
Here is what I would (or hopefully will) try:
Subclass QTextEdit, which can display both plain and rich text.
supply two string properties, one containing Markdown source, the other generated HTML.
For entering "edit mode" (however your UI will handle t... | 0 | 1,474 | 0 | 0 | 2012-04-16T17:36:00.000 | python,qt4,pyqt4,markdown,rtf | How to make an editor using markdowns with Qt4 and Python? | 0 | 1 | 2 | 24,965,112 | 1 |
0 | 0 | On OS X, ttk.Style().configure('TLabelframe.label', font='helvetica 14 bold') works to change the font used by the ttk.LabelFrame widget. On Windows, ttk.Style().configure('TLabelframe.label', font='arial 14 bold') has no effect other than returning the same font info to ttk.Style().lookup('TLabelframe.label','font').... | false | 10,196,305 | 0 | 0 | 0 | 0 | I believe the code in this area is buggy and will open a ticket. Using 'TLableframe.Label' (note uppercase 'L' in 'Label' works. 'TButton.label' and 'TButton.Label' don't work, but just 'TButton' does; 'TCheckbutton' is the same. I was unable to change the fonts for 'TEntry' with any combination, including adding 't... | 0 | 1,687 | 0 | 1 | 2012-04-17T17:47:00.000 | python,fonts,styles,widget,ttk | How to changes fonts using ttk themed widgets in windows | 0 | 1 | 2 | 10,249,969 | 1 |
0 | 0 | I am inserting some data in qtablewidget after some time interval. For this i am clearing all content of qtable and then inserting data. But the table showing data from first row, I want that the table always show last row. This will feel like real updation of table. how to do this? | false | 10,196,716 | 0 | 0 | 0 | 0 | After inserting the row, call QTableWidget.scrollToBottom() to show that last row. | 0 | 303 | 0 | 0 | 2012-04-17T18:16:00.000 | python,pyqt4 | Pyqt table widget updation | 0 | 1 | 1 | 10,201,627 | 1 |
0 | 0 | I am working on a design of an application. The Core should be written in C# but i also want to use some already finished CPython modules (un-managed).
So I am interested in the interoperability (Call CPython method from C# and Call C# from CPython). And if there are problems, because C# runs within the .NET runtime (m... | true | 10,208,960 | 1.2 | 1 | 0 | 2 | I think you misunderstand Python. It's an interpreted1 language. You just provide the text source files and the interpreter will execute them.
There is a difference between the language Python and the implementations CPython, IronPython, Jython, PyPy, what have you. Each of them attempts to implement the language Pytho... | 1 | 1,191 | 0 | 3 | 2012-04-18T12:02:00.000 | c#,.net,python,interop,ironpython | C# .NET interoperabillity with managed Python (CPython) -> any problems? | 0 | 2 | 2 | 10,210,229 | 1 |
0 | 0 | I am working on a design of an application. The Core should be written in C# but i also want to use some already finished CPython modules (un-managed).
So I am interested in the interoperability (Call CPython method from C# and Call C# from CPython). And if there are problems, because C# runs within the .NET runtime (m... | false | 10,208,960 | 0.099668 | 1 | 0 | 1 | Expose your Python code via COM and call that from C#. Used this avenue (both ways) many times. | 1 | 1,191 | 0 | 3 | 2012-04-18T12:02:00.000 | c#,.net,python,interop,ironpython | C# .NET interoperabillity with managed Python (CPython) -> any problems? | 0 | 2 | 2 | 14,318,714 | 1 |
0 | 0 | I am writing an application which should be able to run on Linux, Mac OS X, Windows and BSD (not necessarily as a single executable, so it doesn't have to be Java) and be extensible using simple plugins.
The way I want my plugins to be implemented is as a simple Python program which must implement a certain function an... | false | 10,244,713 | 0 | 0 | 0 | 0 | The simplest way to share the cross-platform Python component of your application would probably be to implement it as a command-line program, and then invoke it using the relevant system calls in each of the front-ends. It's not the most robust way, but it could be sufficient.
If you want plugins to just be a file con... | 0 | 1,296 | 1 | 0 | 2012-04-20T10:44:00.000 | c++,python,objective-c,plugins,cross-platform | Simplest way to write cross-platform application with Python plugin extensibility? | 0 | 1 | 2 | 10,245,373 | 1 |
1 | 0 | In order to develop an Android app using Python, I need to install Python for Android and SL4A on my computer to be used with the Android emulator. My question is, when I distribute this app to actual users/phones, do the phones need to get Python for Android and SL4A explicitly? Or is the supporting infrastructure bui... | true | 10,258,703 | 1.2 | 0 | 0 | 2 | Your users have to install SL4A and the language plugin (python?) on their phones, this is not a built-in functionality.
Since the source code is available, it's possible to create combined application, which includes your scripts and SL4A/python code, but in my opinion this defies the purpose of scripting in the first... | 1 | 1,128 | 0 | 6 | 2012-04-21T12:01:00.000 | android,python | Running a Python app on real Android phone | 0 | 1 | 2 | 10,258,955 | 1 |
0 | 0 | I am trying to create a roguelike using the Text widget.
I have figured out a few things, namely that I can set the size of the widget using width and height options and that I can find the pixel height or width of said widget. However, what I want to do is have the widget resizable (pack(expand="yes", fill="both")) bu... | false | 10,288,554 | 0.132549 | 0 | 0 | 2 | I've run into that exact same problem a couple times jaccarmac, and to my knowledge there is no way to find the width of a string of characters. Really the only way is to use the winfo_ commands: width, height, geometry. However, it kind of sounds like you just want to make sure that all of the text is displayed if you... | 0 | 1,580 | 0 | 1 | 2012-04-23T21:24:00.000 | python,python-3.x,tkinter | Finding The Current Size Of A tkinter.Text Widget | 0 | 2 | 3 | 10,289,415 | 1 |
0 | 0 | I am trying to create a roguelike using the Text widget.
I have figured out a few things, namely that I can set the size of the widget using width and height options and that I can find the pixel height or width of said widget. However, what I want to do is have the widget resizable (pack(expand="yes", fill="both")) bu... | true | 10,288,554 | 1.2 | 0 | 0 | 0 | There is no way to automatically get the width in characters, but it's easy to calculate, assuming you're using a fixed width font. One way to do this is to use the font_measure method of a font object. Use font_measure to get the width of a '0' (or any other character for that matter; I think tk users zero internally,... | 0 | 1,580 | 0 | 1 | 2012-04-23T21:24:00.000 | python,python-3.x,tkinter | Finding The Current Size Of A tkinter.Text Widget | 0 | 2 | 3 | 10,290,058 | 1 |
0 | 0 | I'm creating message boxes in Tkinter using tkMessageBox.showwarning.
Does Tkinter let you insert a sort of checkbox with the message that says, for example, "do not show again" so when selected the message won't appear the next time? | true | 10,295,384 | 1.2 | 0 | 0 | 1 | No, the standard dialogs don't support that.
If you want such a feature you'll have to build your own dialog out of a Toplevel window and other widgets. | 0 | 410 | 0 | 2 | 2012-04-24T09:41:00.000 | python,checkbox,tkinter,message | "do not show message again" checkbox in Tkinter warning message | 0 | 1 | 1 | 10,296,668 | 1 |
0 | 0 | From what I can tell, the difference between PyList_SetItem and PyList_SETITEM is that PyList_SetItem will lower the reference count of the list item it overwrites and PyList_SETITEM does not.
Is there any reason why I shouldn't just use PyList_SetItem all the time? Or would I get into trouble if I used PyList_SetItem... | true | 10,305,327 | 1.2 | 0 | 0 | 8 | PyList_SET_ITEM is an unsafe macro that basically sticks an object into the list's internal pointer array without any bound checks. If anything non-NULL is in the ith position of the list, a reference leak will occur. PyList_SET_ITEM steals the reference to the object you put in the list. PyList_SetItem also steals the... | 1 | 2,163 | 0 | 8 | 2012-04-24T20:12:00.000 | python,python-c-extension | PyList_SetItem vs. PyList_SETITEM | 0 | 1 | 1 | 10,305,714 | 1 |
0 | 0 | I'm starting to work on a 2D scrolling shoot-em-up game, and I was wondering if pygame is suitable. I would like to hit close to 60 fps while animating a scrolling background with hundreds of sprites (mostly bullets, of course); is this feasible with pygame? From what I've read, I'm leaning toward no, but I'd like an... | true | 10,310,068 | 1.2 | 0 | 0 | 0 | Pygame is as good as they get for 2D CPU graphics. All the graphics is implemented in C, (PyGame wraps SDL) so the code is nearly as fast as an equivalent C software renderer.
That said, it's still (basically) a software renderer, and there's this interesting device in every modern computer called a GPU which is desig... | 0 | 1,238 | 0 | 0 | 2012-04-25T05:53:00.000 | python,pygame | Using Pygame to make scrolling shoot-em-up | 0 | 2 | 2 | 10,647,216 | 1 |
0 | 0 | I'm starting to work on a 2D scrolling shoot-em-up game, and I was wondering if pygame is suitable. I would like to hit close to 60 fps while animating a scrolling background with hundreds of sprites (mostly bullets, of course); is this feasible with pygame? From what I've read, I'm leaning toward no, but I'd like an... | false | 10,310,068 | 0 | 0 | 0 | 0 | Pygame is the best solution for 2D games in python according to me. You can save Surfaces uses its optimized Sprites animation, so I think it's the fastest solution : as for development process than for code execution. | 0 | 1,238 | 0 | 0 | 2012-04-25T05:53:00.000 | python,pygame | Using Pygame to make scrolling shoot-em-up | 0 | 2 | 2 | 10,315,791 | 1 |
0 | 0 | I am trying to implement a Mario type plat-former in pyGame. I have Collision detection working with Polygons no problem. I am curious how I can get the player to be able to jump through the floor above him, which is a polygon floating in air.
What is the theory on how to handle that? | false | 10,325,418 | 0.197375 | 0 | 0 | 1 | you could make it so that when your character hits a block, they move up at the current speed until they are no longer colliding with the polygon. That way, when you hit the ground from above,you don't go downward through it, but when you hit the bottom, you do. I would recommend a while loop set to the collide functio... | 1 | 228 | 0 | 0 | 2012-04-25T23:52:00.000 | python,collision-detection,pygame | Jump Through Polygon/Floor Collision Detection | 0 | 1 | 1 | 11,217,539 | 1 |
0 | 0 | So when I try to run a file in PyWin, it opens an edit window instead. The first could times that it did this, I assumed it was due to some syntax errors in the file, but after I fixed them, it continued to open an edit window each time. This particular file has a lot of defined functions in it if that helps at all. | false | 10,325,600 | 0 | 0 | 0 | 0 | Does this problem occurred with every Python you run? Based on your problem description it is not certain if this problem is specific to the script you are trying to run or it is a general issue.
What I will do is that try running builtin demo script first to test & verify that you do have full set of libraries install... | 1 | 118 | 0 | 0 | 2012-04-26T00:15:00.000 | python,pywin32,robot | Trouble Running a File in PyWin | 0 | 1 | 1 | 10,326,072 | 1 |
0 | 0 | I am using Python3 on Windows 7. I want to grab all the attributes like color intensity, color etc. Of all the pixels of the screen area that I select with mouse. The selection can be of any shape but right now rectangular and square will do.
I want to do it in any area of the screen.
Can you guys please guide me how ... | false | 10,328,943 | 0 | 0 | 0 | 0 | You need to use some sort of cross-platform GUI toolkit, such as GTK or KDE, maybe Tk or wx will work as well, I don't know.
How you then do it depends on what toolkit you choose. | 0 | 185 | 0 | 1 | 2012-04-26T07:24:00.000 | python-3.x,pixels | Grabbing pixel attributes in Python | 0 | 1 | 1 | 10,331,335 | 1 |
0 | 0 | My game is a platform game. I want the player to move when it is X pixels away from the center, moving left or right.
I understand pygame doesn't have anything that would make a camera move.
When the player has reached the point where it is X pixels away from the center, stop the player movement and have the terrain mo... | false | 10,343,052 | 0 | 0 | 0 | 0 | You could just make something called xscroll that is added to everything that is supposed to scroll across the screen. Then, when you reach a certain distance from the center, instead of adding your players movespeed to his position, you add or subtract the movespeed from xscroll. This makes everything move very smooth... | 0 | 2,011 | 0 | 1 | 2012-04-27T00:01:00.000 | python,animation,pygame | How would I go about making a camera like movement in pygame? | 0 | 1 | 3 | 11,236,094 | 1 |
0 | 0 | What event is called when the caret inside a TextCtrl / Styled TextCtrl has its position changed? I need to bind the event to show in the status bar, the current position of the caret. | false | 10,364,900 | 0 | 0 | 0 | 0 | I don't think there is such an event, but you can try wx.EVT_SET_CURSOR. Alternatively, you can catch wx.EVT_CHAR or one of the EVT_KEY_* events and use the TextCtrl's GetInsertionPoint() method to know where the cursor is. You may need to call the method when you click around in the text control using mouse events as ... | 0 | 1,551 | 0 | 1 | 2012-04-28T15:25:00.000 | python,events,wxpython,wxwidgets | wxPython caret move event | 0 | 1 | 4 | 10,385,658 | 1 |
0 | 0 | I'd like to create a Gtk.StatusIcon with custom text. Ideally I'd like to append this to an existing image, but text-only is ok, too. How can I achieve this?
I've seen some posts about getting a Gtk.Label's pixbuf but those methods seem to be removed from Gtk3 (pixbuf_get_from_drawable) | false | 10,369,496 | 0.197375 | 0 | 0 | 1 | I don't think that is possible. The status icon is not a widget and the icon is going to be scaled by the window manager. Even if you used Cairo or PIL to generate an image on the fly to use as the icon pixbuf, it wouldn't have the effect of an embedded label in the system tray. It would instead be tiny, unreadable tex... | 0 | 377 | 0 | 6 | 2012-04-29T03:36:00.000 | python,gtk,gtk3,pygobject | How do I set a Gtk.StatusIcon as Text | 0 | 1 | 1 | 11,075,153 | 1 |
0 | 0 | I am testing kivy and I want to create a BoxLayout so to stack some buttons. My problem is that the children that are added to the layout follow a bottom-top logic while I want the opposite. Do you know how can I reverse the order? Thanks! | false | 10,421,194 | 0.099668 | 0 | 0 | 1 | There is a tricky way to do that.
Use a gridlayout and set cols to 1 | 0 | 2,021 | 0 | 3 | 2012-05-02T20:29:00.000 | python,layout,python-2.7,boxlayout,kivy | How can I change the order of the BoxLayout in kivy? | 0 | 1 | 2 | 22,755,884 | 1 |
0 | 0 | I have a problem where it is beneficial for me to be able to mix python code and C++ code, and I think that the task is simple enough that it could be done by simply initializing the C++ program from python, and then having the C++ program "wait" for python to give it some input via std in, and then have python "wait" ... | false | 10,453,841 | 0 | 1 | 0 | 0 | Sounds like SWIG might be what you're looking for. Use it to generate an extension module for Python, then call your C++ methods from a Python script. | 1 | 314 | 0 | 0 | 2012-05-04T17:58:00.000 | c++,python,stdout,stdin | Mixing python and C++ via std in and std out | 0 | 2 | 2 | 10,453,984 | 1 |
0 | 0 | I have a problem where it is beneficial for me to be able to mix python code and C++ code, and I think that the task is simple enough that it could be done by simply initializing the C++ program from python, and then having the C++ program "wait" for python to give it some input via std in, and then have python "wait" ... | true | 10,453,841 | 1.2 | 1 | 0 | 0 | Look at the the Submodule library. You can use Submodule.popen() to create a process from python, using stdin=PIPE and stdout=PIPE. You can then read from the C++ program's stdout and write to its stdin. | 1 | 314 | 0 | 0 | 2012-05-04T17:58:00.000 | c++,python,stdout,stdin | Mixing python and C++ via std in and std out | 0 | 2 | 2 | 10,454,012 | 1 |
0 | 0 | I am creating a Project Manager using wxPython it has a splitter window. On one side is a tree that shows the names of and opens the files and on the other size is a textctrl that is used to edit the file.
One problem I am having is that I would like it to go back 4 spaces when SHIFT and TAB are pressed, I have code wo... | false | 10,463,702 | 0.099668 | 0 | 0 | 1 | I don't know use WxPython and so don't have much idea about it. But in general what you can do is whenever a key is pressed, call a callback function and you could get the time when the key was pressed. save it somewhere. And when the next key is pressed, get the time. compare both times, if there's not much significan... | 0 | 1,518 | 0 | 0 | 2012-05-05T16:19:00.000 | python,tree,wxpython | Multiple key press detection wxPython | 0 | 1 | 2 | 10,464,339 | 1 |
0 | 0 | Having a pygame.display window open, I call pygame.display.quit() upon it in order to destroy the window.
Because I need to open the window again, I call pygame.display.init() and pygame.display.set_mode(), but after these two functions are called, nothing happens.
Can anyone point me to the root of this problem? | false | 10,466,411 | -0.066568 | 0 | 0 | -1 | Have you tried calling just pygame.quit() or pygame.init()? I don't believe there is a pygame.display.quit(). | 0 | 2,849 | 0 | 3 | 2012-05-05T22:12:00.000 | python,pygame | Pygame display module init and quit | 0 | 1 | 3 | 10,779,855 | 1 |
0 | 0 | Is there any way to hide the screen of 'pygame.display' and to make it visible afterwards without calling 'pygame.display.quit()'? | true | 10,466,590 | 1.2 | 0 | 0 | 5 | No there isn't. All you can do is minimize the window using pygame.display.iconify(). | 0 | 7,611 | 0 | 6 | 2012-05-05T22:44:00.000 | python,pygame | Hiding pygame display | 0 | 1 | 4 | 10,466,840 | 1 |
0 | 0 | I have a quick question about WxPython. I would like to have frames inside of my main frame in a program. The user should not be able to move the frame. Any ideas you guys?
Thanks | false | 10,467,224 | 0 | 0 | 0 | 0 | I'm guessing the OP is talking about an MDI frame, which Microsoft created and has since decided to abandon. I think the OP should check out the wx.agw.aui widget set versus the wx.aui stuff since the former has been updated a lot and wx.aui has not. Plus the agw package is pure Python and thus much more hackable. | 0 | 1,726 | 0 | 1 | 2012-05-06T00:54:00.000 | python,wxpython | Frame Inside a Frame WxPython | 0 | 1 | 3 | 10,483,810 | 1 |
0 | 0 | Is there some simple way in PyQt to store data from QTableWidget to some file, and use that content again? It's not a critical task for me, so i don't want to invent some custom xml rules or somethin else. | true | 10,496,168 | 1.2 | 0 | 0 | 0 | Qt provides a (modified) Model->View framework and so the data in a table, or any other GUI widget, is stored in a data model. It's the data in the model that you want to persist. The GUI widgets themselves don't provide any facilities to do this.
There's no standard data persistence method implemented in the Qt data m... | 0 | 1,493 | 0 | 1 | 2012-05-08T09:40:00.000 | python,pyqt4,qtablewidget | How to import/export QTableWidget to some file? | 0 | 1 | 1 | 10,537,246 | 1 |
0 | 0 | I was recently told that I should keep my code in separate files; like main.py, engine.py, settings.py and so on. Although this surely does have benefits, like easier management, scalability and others, to me it seems like it has too many drawbacks...
For example, if I have a script called settings.py, where some thing... | false | 10,499,419 | 0 | 0 | 0 | 0 | You can import symbols from settings.py in any module they are needed. That's the concept. An actual problem is when you have circular imports. e.g. What if you had some symbols inside engine.py that were needed in main.py and vice versa. In that situation a common pattern is to break these dependencies in a third modu... | 1 | 9,182 | 0 | 6 | 2012-05-08T13:17:00.000 | python,class,design-patterns | How to organize my Python code into multiple classes? | 0 | 1 | 6 | 10,499,592 | 1 |
0 | 0 | After creating a simple window/widget layout with Page (page.sourceforge.net)
I found that the listbox curselection() call returns the proper index when releasing Button-1.
When hit, it returns the previous index (the item which we just leave).
Becasue of some timer activities I'd like to get the clicked index at click... | false | 10,560,041 | 0.197375 | 0 | 0 | 1 | Bind to the event <<ListboxSelect>> instead of <1>, this event will fire after the current selection has been updated.
If you genuinely need for the binding to work literally on a press of the mouse button you will have to rearrange the order of the bind tags for the widget. | 0 | 875 | 0 | 1 | 2012-05-12T00:18:00.000 | python,listbox,tkinter | Getting Tkinter listbox item when hit Button-1 | 0 | 1 | 1 | 10,560,466 | 1 |
0 | 0 | I want to import a sprite sheet and select one sprite. How would I do this in Python/pygame? | false | 10,560,446 | 0 | 0 | 0 | 0 | The above code posted by aquasheep is brilliant! Although in lines:
for i in range(0,sheet_rect.height-len_sprt_y,size[1]):#rows
for i in range(0,sheet_rect.width-len_sprt_x,size[0]):#columns
I had to remove -len_sprt_y and -len_sprt_x it just would not load the last sprites on the x and y axis. It may vary depending ... | 0 | 13,966 | 0 | 9 | 2012-05-12T01:58:00.000 | python,pygame | How do you select a sprite image from a sprite sheet in Python? | 0 | 1 | 4 | 33,223,021 | 1 |
0 | 0 | I am quite new in Python programming. While googling I found some of the Python related words. I just wanted to know what is the difference among Python, Jython, IronPython, and wxPython.
I know wxPython is for GUI programming. But what are Jython and IronPython?
Please help me. | true | 10,579,824 | 1.2 | 0 | 0 | 72 | Jython and IronPython are different python implementations, both of which run on different virtual machines. Jython runs on the JVM (Java virtual machine) and IronPython runs on the CLR (common language runtime). This means that programs using these implementations can take advantage of the libraries and ecosystem of t... | 1 | 37,688 | 0 | 41 | 2012-05-14T08:29:00.000 | python,wxpython,jython,ironpython | What is the difference between Python vs Jython vs IronPython vs wxPython? | 0 | 1 | 1 | 10,579,887 | 1 |
0 | 0 | Is there a way to track elements properties in Tkinter canvas?
Specifically, I want to know if at a certain coordinates set I have already created an element or not.
I believe I can do this with tracking sets of elements in a dictinoary but I was hoping for something more elegant. | false | 10,585,184 | 0.197375 | 0 | 0 | 1 | The canvas has many methods for finding objects. You could, for example, call find_closest to find the element closest to the coordinate you are wanting to check. Then, for the element it finds, you can use the coords method to find out if all of the coordinates of the element are identical. | 0 | 153 | 0 | 0 | 2012-05-14T14:20:00.000 | python,canvas,tkinter | Tracking list on elements on canvas (tkinter) | 0 | 1 | 1 | 10,585,691 | 1 |
0 | 0 | Basically, I want the body of a Text widget to change when a StringVar does. | true | 10,593,027 | 1.2 | 0 | 0 | 10 | Short version is, you can't. At least, not without doing extra work. The text widget doesn't directly support a variable option.
If you want to do all the work yourself it's possible to set up a trace on a variable so that it keeps the text widget up to date, and you can add bindings to the text widget to keep the vari... | 0 | 5,546 | 0 | 5 | 2012-05-15T01:19:00.000 | python,tkinter | How can I connect a StringVar to a Text widget in Python/Tkinter? | 0 | 1 | 2 | 10,593,117 | 1 |
0 | 0 | I'm making a little game for fun, and there is an event where you can take control of the enemies (muhahaha I can take over their little programmed minds)
I want to convert part of the image from red to blue.
Should I either use the surface.set to change to colour value,
Or should I just load a new image into the surf... | true | 10,642,331 | 1.2 | 0 | 0 | 0 | So Ian Mallett was correct:
Efficient how? .set_at will be more space efficient, but obviously
you're setting individual pixels every time you want to change.
Loading an entirely new image at startup will be faster, but you'll
use more space. I'd guess you're wanting the second, but . . .
I wanted the second on... | 0 | 106 | 0 | 0 | 2012-05-17T19:32:00.000 | python-3.x,pygame,pixels | Python Pygame Changing Surfaces efficiently | 0 | 1 | 1 | 10,856,777 | 1 |
0 | 0 | Is there a way to get Glade, or any similar software, to work with Tkinter? I'm unable to install WxPython or any other libraries, so I need something compatible with what's installed on OSX.6 by default. | false | 10,661,041 | 0.197375 | 0 | 0 | 1 | No, there is no way to get glade or other not-designed-for-tkinter GUI tools to work with tkinter. At least, not without a tremendous amount of effort. | 0 | 1,825 | 0 | 2 | 2012-05-18T23:41:00.000 | python,macos,tkinter,glade | Glade with Tkinter? | 0 | 1 | 1 | 21,465,072 | 1 |
0 | 0 | I've been searching the web and reading about GUI development in Python and have read that Tkinter is one of the best GUI toolkits for Python. But I also know that Pygame is a library that can be used for GUI. As i'm fairly new to programming, could somebody please explain the differences between Pygame and Tkinter, an... | false | 10,668,116 | 0 | 0 | 0 | 0 | I actually recommend Tkinter for simple python game development tho. | 0 | 26,041 | 0 | 12 | 2012-05-19T19:14:00.000 | python,tkinter,pygame | pygame vs tkinter. | 0 | 2 | 3 | 72,318,955 | 1 |
0 | 0 | I've been searching the web and reading about GUI development in Python and have read that Tkinter is one of the best GUI toolkits for Python. But I also know that Pygame is a library that can be used for GUI. As i'm fairly new to programming, could somebody please explain the differences between Pygame and Tkinter, an... | false | 10,668,116 | 0.066568 | 0 | 0 | 1 | Pygame is normally used to create games though I would recommend using the arcade library instead. Pygame does not help you to create GUIs. instead you should use tkinter which is specifically designed for GUIs. For your project I would recommend using tkinter. Tkinter helps you create labels, buttons and stuff pygame ... | 0 | 26,041 | 0 | 12 | 2012-05-19T19:14:00.000 | python,tkinter,pygame | pygame vs tkinter. | 0 | 2 | 3 | 64,797,294 | 1 |
0 | 0 | I'm using PyGObject but I think this is a question that could be adapted to all GTK, so if someone know how to do it using C or anything should work in python also.
I have two treeview, Active and Inactive, I load data from a Sqlite database and I can swap and drag & drop items from one to other.
This is just an aeste... | true | 10,681,740 | 1.2 | 0 | 0 | 2 | At the risk of being too basic (perhaps I misunderstand the problem), to manipulate treeview selections, you use the GtkTreeSelection object returned from GtkTreeView.get_selection. You can attach to signals on this object, change the current selection,etc. | 0 | 1,990 | 0 | 3 | 2012-05-21T08:23:00.000 | python,c,gtk,pygobject,gtktreeview | Gtk.Treeview deselect row via signals and code | 0 | 1 | 2 | 10,690,046 | 1 |
0 | 0 | I wrote a diff and merge program in Python using the Tkinter UI framework.
Running it on OS-X there are two problems:
when starting it the window does not get displayed unless switching back and forth with other running apps. There has been a thread here recommending
top.call('wm', 'attributes', '.', '-topmost', '1')
... | false | 10,690,416 | 0 | 0 | 0 | 0 | Try some variant of this command:
self.createcommand('tkAboutDialog', self.aboutProgram)
and put your app "about" dialog code in the aboutProgram() function. | 0 | 382 | 0 | 1 | 2012-05-21T18:14:00.000 | python,macos,cocoa,tkinter,tk | use a Tkinter frame in a Mac Cocoa app | 0 | 1 | 1 | 11,246,589 | 1 |
0 | 0 | I have TextView with pages of text, but I want to be able to highlight (change the background color) of specific strings in different colors. Is this possible? If so, can anybody point me in the right direction? Thanks | false | 10,707,815 | 0 | 0 | 0 | 0 | If the specific strings are always the same, as in a programming language, then use GtkSourceView instead. | 0 | 411 | 0 | 1 | 2012-05-22T18:22:00.000 | python,pygtk | Highlight certain text in a PyGTK TextView | 0 | 1 | 2 | 10,715,877 | 1 |
0 | 0 | I am using customtreectrl in wxpython with checkboxes. Once I submit I would like to save the state of the checkboxes in the customtreectrl. How can I save the checked state of a customtreectrl with checkboxes.Please help me.
Sushma | true | 10,732,171 | 1.2 | 0 | 0 | 1 | try and use the "persist" library in the AGW package. This will allow you to save the state of (almost) any wxPython widget across sessions. See the PersistentControls demo in the AGW library. | 0 | 101 | 0 | 0 | 2012-05-24T06:20:00.000 | wxpython | preserving the state of check boxex in customtreectrl | 0 | 1 | 1 | 10,733,286 | 1 |
0 | 0 | I have a simple pygtk/glade window with a menu and a 3x3 grid. Each row of the grid consists on: two labels and a button.
When the Window is resized, the labels holds the same font size, but the buttons get resized, and they could become HUGE if the windows gets very big.
How could I manage to keep my buttons with the ... | true | 10,742,317 | 1.2 | 0 | 0 | 2 | You just have to set the fill and expand parameters of the Buttons to False (uncheck them in the Glade interface).
You would also want to put each button at the center of a 3x3 GtkTable, so it will appear centered and not aligned at the top of the cell | 0 | 787 | 0 | 0 | 2012-05-24T17:20:00.000 | python,pygtk,glade | PyGTK/Glade keep button size standard | 0 | 1 | 1 | 10,743,355 | 1 |
0 | 0 | I have a problem with python to C code translation and further compilation.
First, I installed MinGW, wrote `setup.py? script and translated python code (simplest helloworld) to C with Cython:
python setup.py build_ext --inplace
Then I tried to compile generated .c file:
gcc.exe helloworld.c -mdll -IC:\Python27\incl... | false | 10,759,765 | 0.197375 | 0 | 0 | 2 | The compiled file isn't an executable, it's a library (dll).
python modules on windows usually have a .pyd extension, so either rename your file to helloworld.pyd or use -o helloworld.pyd as argument for the compiler.
then you should be able to import helloworld from python. | 1 | 1,230 | 0 | 1 | 2012-05-25T18:40:00.000 | python,c,gcc,mingw,cython | Cython and gcc: can't run compiled program | 0 | 1 | 2 | 10,760,117 | 1 |
0 | 0 | I googled and search stackoverflow before asking this question
Answers that I don't expect:
wxWidgets is the best Python GUIUse TkInter (BIM) for GUI development.
Q. How to make a GUI without using any module/library? i.e make a GUI from scratch. Modules like tkinter not allowed. | false | 10,763,814 | 0.099668 | 0 | 0 | 1 | The easiest GUI to make without "module/library" is a web-based one. I.e. generate HTML with Javascript from your Python code, and let the Javascript interact via AJAX with your Python app. This can be implemented without too much effort with just the standard Python library (and some JS code, of course), or with modul... | 0 | 2,003 | 0 | 1 | 2012-05-26T05:24:00.000 | python,user-interface | Python custom GUI | 0 | 1 | 2 | 10,763,834 | 1 |
0 | 0 | I've added support for mods for my game. Any Python module put in a specific folder is automatically imported on startup. All is fine, except now I've written an official mod which allows mod makers to easily add GUI settings of their mods to a single toggable GUI frame. They are not forced to use it, but it greatly si... | true | 10,781,201 | 1.2 | 0 | 0 | 2 | Why not have a list of all "system" modules that you need to have loaded which will be imported first, before then looking in sub-folders for all your mods and importing those ?
That way you still maintain your base system and only afterwards do you load up subsequent user mods. | 0 | 68 | 0 | 0 | 2012-05-28T07:57:00.000 | python,import,module | Telling a module to be imported first by the module itself? | 0 | 1 | 1 | 10,781,228 | 1 |
0 | 0 | I want to fit some text in a label. I almost managed to do it: when I enlarge the window, I add some <big> tags to the label and the text enlarges with the window. But if I try to shrink the window, the size-request of the label doesn't let me do it.
The label is updated many times a second, so if I try to set a custom... | false | 10,788,211 | 0.099668 | 0 | 0 | 1 | Put the label in a container like GtkScrolledWindow. | 0 | 291 | 0 | 0 | 2012-05-28T17:09:00.000 | python,gtk3 | Remove the size request of a widget (Python, Gtk3) | 0 | 2 | 2 | 11,008,840 | 1 |
0 | 0 | I want to fit some text in a label. I almost managed to do it: when I enlarge the window, I add some <big> tags to the label and the text enlarges with the window. But if I try to shrink the window, the size-request of the label doesn't let me do it.
The label is updated many times a second, so if I try to set a custom... | true | 10,788,211 | 1.2 | 0 | 0 | 1 | Set the "ellipsize" property of label to True. | 0 | 291 | 0 | 0 | 2012-05-28T17:09:00.000 | python,gtk3 | Remove the size request of a widget (Python, Gtk3) | 0 | 2 | 2 | 33,259,216 | 1 |
0 | 0 | I have been working on a Gui-based program using Tkinter. It needs data to display and there are a lot of different data. I tried to do it, but it did not show the right result. I mean, it cannot display other datasets and it just displays the first dataset.
Simply, its procedure is as following:
Load 1st data
Display... | false | 10,805,751 | 0 | 0 | 0 | 0 | Assuming your code to display the data is correct, the only conclusion I can draw is that either you "load another data" function isn't actually loading anything, or your "display on canvas" code is not being given tne newly loaded data.
The other possibility is that there is an error in your drawing code that is gett... | 0 | 583 | 0 | 0 | 2012-05-29T19:52:00.000 | python,canvas,tkinter | How to apply to new data on tkinter's canvas | 0 | 1 | 2 | 10,807,933 | 1 |
0 | 0 | I am new to using pygame and I was wondering if someone could explain the use of alpha values? I don't quite understand the difference between that and colorkey.
For my current situation I think I want to use alpha values but am not quite clear how.
In my game I have two sprites with .png files loaded to each surfac... | false | 10,823,285 | 0.291313 | 0 | 0 | 3 | Colorkey lets you pick one color in a sprite (surface); any pixel of that color will be completely transparent. (If you remember .gif transparency, it's the same idea.)
'alpha' is a measure of opacity - 0 for completely transparent, 255 for completely opaque - and can be applied to an entire sprite (as an alpha plane) ... | 0 | 399 | 0 | 1 | 2012-05-30T19:52:00.000 | python,pygame | Pygame alpha values | 0 | 2 | 2 | 10,823,436 | 1 |
0 | 0 | I am new to using pygame and I was wondering if someone could explain the use of alpha values? I don't quite understand the difference between that and colorkey.
For my current situation I think I want to use alpha values but am not quite clear how.
In my game I have two sprites with .png files loaded to each surfac... | false | 10,823,285 | 0 | 0 | 0 | 0 | Although if you want the sprites to fade until they've vanished, gradually reduce the alpha value after they've collided. When alpha reaches 0, use del sprite if you don't need the sprites anymore. | 0 | 399 | 0 | 1 | 2012-05-30T19:52:00.000 | python,pygame | Pygame alpha values | 0 | 2 | 2 | 51,940,966 | 1 |
0 | 0 | What is the best drag and drop GUI builder for wxPython?
I've tried wxGLade, but I strongly dislike it. | true | 10,824,112 | 1.2 | 0 | 0 | 0 | If you are just starting out on GUI programming in Python I'll strongly recommend ditching wxPython for PySide/PyQt4. It has a simpler API and Qt-Designer is one of the best drag 'n' drop GUI designer I've used. Plus PySide/PyQt4 is well documented. | 0 | 1,452 | 0 | 2 | 2012-05-30T20:54:00.000 | user-interface,wxpython | Best drag and drop GUI builder for wxPython | 0 | 1 | 1 | 10,824,301 | 1 |
0 | 0 | So I currently have a ScrolledPanel that contains a number of TextCtrls that are placed in a vertical BoxSizer programmatically. The reason I'm doing this instead of just appending lines to one big scrolled TextCtrl is so that I can also add other controls in between the TextCtrl, such as images or stylized expand/cont... | false | 10,825,597 | 0.197375 | 0 | 0 | 1 | I would stay away from trying to reimplement text selection controls if at all possible, since that is bound to turn very messy very fast. Another way you could tackle this issue would be to use a single multi-line textctrl widget with the other widgets tacked on over it. This is also messy, but less so.
You can place... | 0 | 431 | 0 | 2 | 2012-05-30T23:16:00.000 | python,wxpython,wx.textctrl | Select text over multiple TextCtrls in wxpython | 0 | 1 | 1 | 16,593,067 | 1 |
0 | 0 | With wxPython a password field could be created as:
wx.TextCtrl(frm, -1, '', style=wx.TE_PASSWORD )
I'm wondering if there is a way to dynamically change this password field into a normal textctrl, such that user could see what the password is. | false | 10,836,062 | 0.197375 | 0 | 0 | 3 | I'm not aware of a way to dynamically change the style flags on the text control widget after creation. Some widgets allow this sort of thing on some OSes and some do not. You could just create two text controls with the second one in normal mode and hide it. Then when you want to toggle, you grab the password-protecte... | 0 | 5,172 | 0 | 4 | 2012-05-31T14:56:00.000 | python,user-interface,wxpython | how to make wxpython password textctrl show chars? | 0 | 2 | 3 | 10,837,325 | 1 |
0 | 0 | With wxPython a password field could be created as:
wx.TextCtrl(frm, -1, '', style=wx.TE_PASSWORD )
I'm wondering if there is a way to dynamically change this password field into a normal textctrl, such that user could see what the password is. | false | 10,836,062 | -0.066568 | 0 | 0 | -1 | then it would not be a password entry, but you can use style=wx.TE_MULTILINE or TE_RICH. if that is what you are asking.
Hope this helps | 0 | 5,172 | 0 | 4 | 2012-05-31T14:56:00.000 | python,user-interface,wxpython | how to make wxpython password textctrl show chars? | 0 | 2 | 3 | 10,836,512 | 1 |
0 | 0 | My simple question is how can I use pygame.MOUSEBUTTONDOWN on a sprite or item to trigger an event?
e.g. I have item_A and want music to start when I press the object with my mouse. | false | 10,838,959 | 0 | 0 | 0 | 0 | You will need to poll for events in your main loop, and when you detect a MOUSEBUTTONDOWN event you will need to check if it's on the sprite you want, and if it is then start the music. | 0 | 18,074 | 0 | 2 | 2012-05-31T18:12:00.000 | python,pygame,mouseevent,mouse | How to use pygame.MOUSEBUTTONDOWN? | 0 | 1 | 3 | 10,839,038 | 1 |
0 | 0 | I know there is a PyGTK class for a single-line entry, but what about
multi-line entries (like entering a description of an item)?
I've searched through the web, but didn't find anything. | true | 10,840,917 | 1.2 | 0 | 0 | 12 | TextView is the widget used to edit multi-line text. | 1 | 3,074 | 0 | 7 | 2012-05-31T20:37:00.000 | python,gtk,pygtk | multiline gtk entry in pygtk | 0 | 1 | 1 | 10,843,649 | 1 |
0 | 0 | I am trying really REALLY hard to install py2app, but whenever I run the install command on the source code, I get half way through and then I get a permission denied error. Does anyone have an idea about how I could fix this? I do have admin rights on the machine I am using. I am using the admin's profile to do the in... | false | 10,842,167 | 0 | 0 | 0 | 0 | I had this problem for a long time. Try running it as admin. | 0 | 586 | 1 | 0 | 2012-05-31T22:31:00.000 | python,py2app | py2app installation error--Permission Denied | 0 | 1 | 1 | 23,563,762 | 1 |
0 | 0 | I want to impliment some kind of UI for my Python programs (some simple operations, nothing advanced).
So I looked around and considered ncurses and tkinter for python. Yet I am not sure which of these two would suit best my needs for a simple interface (in the sense of easy to learn to program) with the best output po... | false | 10,859,023 | 0.379949 | 0 | 0 | 4 | I would like to suggest tkinter as it comes with python and compare to other GUI packages it has good tutorials. And also it will help you to improve your OOP concept for python | 0 | 1,422 | 0 | 4 | 2012-06-02T01:02:00.000 | python-3.x,tkinter,ncurses | python3 tkinter or ncurses | 0 | 1 | 2 | 10,861,849 | 1 |
0 | 0 | I'm new to PyQt and I have to work on an application which use it. For the moment, I don't have any problem, but I'm stuck on something. I have to create a "ComboBox with its items checkable, like a CheckBox". This ComboBox should contain many image format, like "jpg", "exr" or "tga", and I will have to pick up the tex... | true | 10,929,285 | 1.2 | 0 | 0 | 0 | You can do this using the model->view framework, but it means implementing a custom model to support checkable data.
You create a custom model by subclassing QAbstractItemModel. This presents an API to the QComboBox for accessing the underlying data. Off the top of my head I think you'll need to implement the flags met... | 0 | 1,527 | 0 | 0 | 2012-06-07T09:39:00.000 | python,qt,checkbox,combobox,pyqt | How to simply create a list of CheckBox which has a dropdown list like a ComboBox with PyQt? | 0 | 1 | 1 | 10,930,835 | 1 |
0 | 0 | Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True). My question is what is the best way to retrieve the new order? That is, how should I access a property of each of the elements in the new order? An iterator of sorts?
I am using gtk.ListStore to store the dat... | true | 10,972,821 | 1.2 | 0 | 0 | 0 | So, I understand now: it turns out that when items are reordered in IconView, gtk.ListStore.reorder or something similar is called. What that means is that all I needed to do was to use gtk.ListStore.get_iter() or gtk.ListStore.get_iter_first() and all the problems are solved.
How trivial! All I needed to do was eat ... | 0 | 135 | 0 | 0 | 2012-06-10T22:25:00.000 | python,pygtk | Reordering in IconView (PyGtk) | 0 | 1 | 1 | 10,973,513 | 1 |
0 | 0 | When I use wx python to create a button with a file name as the button label, I lose the & character that is inside of the file names.
If a file were named: hello&goodbye.txt, the button would read: hellogoodbye.txt
I have no idea where the & character goes and would love a little help here. | true | 10,984,263 | 1.2 | 0 | 0 | 5 | The & character is a special symbol for those kinds of buttons. It defines what key you press to use a keyboard shortcut.
&x - [Alt]+[x] hotkey shortcut. You can escape it by using a second: && -> '&' char | 0 | 203 | 0 | 3 | 2012-06-11T16:46:00.000 | python,wxpython | Python '&' Character is missing | 0 | 1 | 2 | 10,984,306 | 1 |
0 | 0 | I have only started learning python recently. I would still be considered a beginner. Does anyone know any simple games I could make using only python or python turtle. I have no experience with pygame or tkinter yet. The game does not need to use graphics. For example one of my recent games was trying to guess the let... | true | 10,997,651 | 1.2 | 0 | 0 | 3 | Two that come to mind for me are Tic-Tac-Toe and Higher or Lower | 0 | 665 | 0 | 1 | 2012-06-12T13:24:00.000 | python,graphics | simple game to make only using python | 0 | 1 | 1 | 10,997,736 | 1 |
0 | 0 | So, here I'm happy that I wrote the whole code for a awesome looking GUI using wxPython in a day but it evaporated when I found that the panels are getting out of the way leaving a lot of empty space on the sides or getting congested (you know how!) on a different screen resolution.
What I want to ask is that what all... | false | 11,027,366 | 0.379949 | 0 | 0 | 2 | Sizers automatically adjust your application widgets for screen resolution, resize, etc. If they aren't doing this automatically, then there's probably something buggy in your code. Since I don't have your code to look at, try going over the wxPython tutorials on sizers very carefully. I found the book wxPython In Acti... | 0 | 284 | 0 | 0 | 2012-06-14T05:49:00.000 | python,user-interface,wxpython,alignment,screen-resolution | wxPython : Adjusting the panels and sizers for different screen resolutions | 0 | 1 | 1 | 11,036,132 | 1 |
0 | 0 | I've been trying to find a way to implement MVVM with PySide but haven't been able to. I think that there should be a way to create Views from ViewModels with QItemEditorFactory, and to do data binding I think I can use QDataWidgetMapper.
Do you have any ideas on how MVVM may be implemented with Qt and PySide? Even if ... | false | 11,042,172 | 0 | 0 | 0 | 0 | I don't know how far do you want to take MVVM, but at a basic level it comes with Qt, and I've been using it for a long time. You have a business-specific model, say tied to a database. Then you create view-specific viewmodel as a proxy model. You can stack a few layers of those, depending on what you need. Then you sh... | 0 | 4,531 | 0 | 16 | 2012-06-14T22:22:00.000 | python,qt,mvvm,pyside,architectural-patterns | MVVM pattern with PySide | 0 | 2 | 3 | 18,681,903 | 1 |
0 | 0 | I've been trying to find a way to implement MVVM with PySide but haven't been able to. I think that there should be a way to create Views from ViewModels with QItemEditorFactory, and to do data binding I think I can use QDataWidgetMapper.
Do you have any ideas on how MVVM may be implemented with Qt and PySide? Even if ... | false | 11,042,172 | -0.132549 | 0 | 0 | -2 | An obvious answer for me is that MVVM is suitable for WPF and some other techs that welcome this pattern, and so you have to find out whether it's possible to apply this pattern on other technologies. Please, read on MVVM in wiki. | 0 | 4,531 | 0 | 16 | 2012-06-14T22:22:00.000 | python,qt,mvvm,pyside,architectural-patterns | MVVM pattern with PySide | 0 | 2 | 3 | 17,227,321 | 1 |
0 | 0 | My application consists of looking into a live feed from a spectroscope (optical instrument) and extracting frames from it. Clicking a point in the feed launches a new Frame where the image is analysed. Each frame handles a single panel.
The action of creating a new frame is very easy for a programmer to do (immediate... | false | 11,046,283 | 0 | 0 | 0 | 0 | I would put your feed inside a sizer with space for two elements. Have the feed expand to fill your window unless the second space in the sizer is available. Then, when you click the feed, add a panel with the detailed information to the empty part of the sizer.
You can add a close button which would simply close and r... | 0 | 69 | 0 | 0 | 2012-06-15T07:22:00.000 | python,wxpython | Design substitute to popping up new frames on each click in WxPython | 0 | 2 | 2 | 11,046,421 | 1 |
0 | 0 | My application consists of looking into a live feed from a spectroscope (optical instrument) and extracting frames from it. Clicking a point in the feed launches a new Frame where the image is analysed. Each frame handles a single panel.
The action of creating a new frame is very easy for a programmer to do (immediate... | false | 11,046,283 | 0 | 0 | 0 | 0 | Create a frame with two main elements:
Your current feed
A navigation control such as a wx.ListBox, wx.ListCtrl, or wx.TreeCtrl to allow you to scroll through and click on the feed you want displayed in element (1). | 0 | 69 | 0 | 0 | 2012-06-15T07:22:00.000 | python,wxpython | Design substitute to popping up new frames on each click in WxPython | 0 | 2 | 2 | 11,052,052 | 1 |
0 | 0 | I'm writing a physics simulating program, and found after() useful.
I once would like to create a thread for physics calculation and simulation. But when I finally noticed that function, I used it instead.
So, I'm curious about how Tkinter implements that function. Is it multi-threading? | true | 11,046,836 | 1.2 | 0 | 0 | 5 | It is not multithreaded.
Tkinter works by pulling objects off of a queue and processing them. Usually what is on this queue are events generated by the user (mouse movements, button clicks, etc).
This queue can contain other things, such as job created with after. So, to Tkinter, something submitted with after is just... | 1 | 718 | 0 | 1 | 2012-06-15T08:03:00.000 | python,tkinter,python-multithreading | Python: Does after() in Tkinter have a multi-threading approach? | 0 | 1 | 2 | 11,049,545 | 1 |
0 | 0 | I have an application whose GUI is to be remade for ergonomic reasons.
It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not.
This application has a mostly classical UI with buttons, toolbars, dialogs etc. but also has some specific requirements : I will certainly need... | false | 11,047,821 | 0.039979 | 0 | 0 | 1 | I also have no experience with GTK, but can offer some answers nevertheless:
Qt is designed from the ground up to be object-oriented; almost everything in it has excellent support for subclassing. PyQt likewise.
Qt explicitly does NOT support modification of the GUI by any threads other than the main GUI thread. You'r... | 0 | 8,254 | 0 | 12 | 2012-06-15T09:16:00.000 | python,user-interface,pygtk,pyqt4 | What are the advantages of PyQt over PyGTK and vice-versa? | 0 | 4 | 5 | 11,803,878 | 1 |
0 | 0 | I have an application whose GUI is to be remade for ergonomic reasons.
It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not.
This application has a mostly classical UI with buttons, toolbars, dialogs etc. but also has some specific requirements : I will certainly need... | false | 11,047,821 | 0.119427 | 0 | 0 | 3 | I like GTK+ best, since (at least to me) it looks nicer. PyQt and variants (e.g. PySide), however, do have an immensely large set of extras, including a WebKit engine, an XML parser, SQL support, and more.
If you just want looks, I'd say GTK+/PyGObject. If you are plannning on using anything PyQt has, use PyQt.
As a si... | 0 | 8,254 | 0 | 12 | 2012-06-15T09:16:00.000 | python,user-interface,pygtk,pyqt4 | What are the advantages of PyQt over PyGTK and vice-versa? | 0 | 4 | 5 | 15,823,008 | 1 |
0 | 0 | I have an application whose GUI is to be remade for ergonomic reasons.
It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not.
This application has a mostly classical UI with buttons, toolbars, dialogs etc. but also has some specific requirements : I will certainly need... | false | 11,047,821 | 0.039979 | 0 | 0 | 1 | I can't compare, because I don't use GTK, but I'd suggest Qt.
Qt definitely has "treeview/tableview" you're talking about and you can make the "cells" your custom widgets (I'm just studying this topic right now). Qt was made with a lot of thought about threads, so worker threads can use the signal/slot mechanism with e... | 0 | 8,254 | 0 | 12 | 2012-06-15T09:16:00.000 | python,user-interface,pygtk,pyqt4 | What are the advantages of PyQt over PyGTK and vice-versa? | 0 | 4 | 5 | 11,050,753 | 1 |
0 | 0 | I have an application whose GUI is to be remade for ergonomic reasons.
It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not.
This application has a mostly classical UI with buttons, toolbars, dialogs etc. but also has some specific requirements : I will certainly need... | false | 11,047,821 | 0.039979 | 0 | 0 | 1 | Definitely PyQt... There are a lot of advanced applications using it... Personally, I'm using KDE, so, even my system's GUI uses Qt! I'm also creating a spreadsheet application and I find that it's far easier that what I thought at first... But, BiaXpirit is also right: except if you're developing an open-source app, m... | 0 | 8,254 | 0 | 12 | 2012-06-15T09:16:00.000 | python,user-interface,pygtk,pyqt4 | What are the advantages of PyQt over PyGTK and vice-versa? | 0 | 4 | 5 | 11,899,802 | 1 |
0 | 0 | I have a small GTK python application that imports a package (Twisted) that may not be loaded twice.
If I run my application in emacs with python-mode.el and press C-c C-c, the application gets executed in a python shell window.
If I now close the application, the python shell stays up and running. If I now press C-c C... | false | 11,066,684 | 0.197375 | 0 | 0 | 2 | python-mode.el comes with a command py-execute-buffer-dedicated,
opening a new and reserved process for it | 0 | 1,178 | 1 | 1 | 2012-06-16T20:11:00.000 | emacs,python-mode | Open new python shell on C-c C-c in python-mode.el | 0 | 1 | 2 | 11,602,461 | 1 |
1 | 0 | Is it possible to write an application using the pyjamas widgets, together with the tornado server model? What I have in mind is to provide a desktop-like frontend for my web application with pyjamas, and do server side logic with tornado.
Specifically, I want to trigger events in the web application generated in the s... | true | 11,071,287 | 1.2 | 0 | 0 | 0 | The route I have chosen is to combine pyjs (old pyjamas) with web2py, via JSONRPC. So far it is working fine. | 0 | 178 | 0 | 0 | 2012-06-17T12:28:00.000 | python,tornado,pyjamas | Integration of pyjamas and tornado | 0 | 1 | 2 | 11,453,702 | 1 |
0 | 0 | So basically I want to create a GUI app using PySide and the Qt Framework. I am using the QT designer to make the initial UI design. The first version of the app will run on Mac and I want it to be like other Mac applications where the name of the app is in bold and all the way to the left with an "About", "Preferences... | false | 11,076,018 | 0.099668 | 0 | 0 | 1 | I don't know about Python; but on the Mac you create About, Preferences or Quit menu items and Qt will automatically shift them into the application menu on the left (the one with the bold text).
I'm guessing that you are trying to create your own application menu and Qt is getting confused. You don't need to create it... | 0 | 419 | 0 | 5 | 2012-06-18T01:09:00.000 | python,qt,pyside,qt-designer | Qt not letting me create a menu item named after my app with the strings "About", "Preferences", or "Quit? Any tips? | 0 | 1 | 2 | 11,092,105 | 1 |
0 | 0 | I am fairly new to Python programming and Threads isn't my area of expertise. I have a problem for which i would hope that people here can help me out with.
Task: as a part of my master thesis, i need to make a mixed reality game which involves multiplayer capability. in my game design, each player can set a bunch of t... | false | 11,079,785 | 0 | 0 | 0 | 0 | The main thread creates a queue and a bunch of worker threads that are
pulling tasks from the queue. As long as the queue is empty all worker
threads block and do nothing. When a task is put into the queue a random
worker thread acquires the task, does it job and sleeps as soon as its
ready. That way you can reuse a th... | 1 | 2,489 | 0 | 1 | 2012-06-18T09:08:00.000 | python,multithreading | Notify the main thread when a thread is done | 0 | 1 | 3 | 11,080,491 | 1 |
0 | 0 | I've got a Matplotlib canvas (FigureCanvasWxAgg) that I'm displaying inside of a wx.ScrolledWindow. The problem is that I'd like to have the default zooming and panning functionality of Matplotlib work in conjunction with the ScrolledWindow, so that when the user zooms the image within the canvas, the ScrolledWindow sh... | false | 11,108,160 | 0 | 0 | 0 | 0 | The problem is that the default Zoom and Pan don't resize the figure, they just change the limits and redraw the plot.
What you want is the Zoom to resize (keeping the same limits) and the Pan to work as in a normal Scrolled window. I have never tried this, fig.set_size_inches(w,h) should do the trick. | 0 | 448 | 0 | 4 | 2012-06-19T19:38:00.000 | python,image,matplotlib,scrolledwindow | Matplotlib zooming work in conjunction with wxPython ScrolledWindow | 0 | 1 | 1 | 24,759,361 | 1 |
1 | 0 | I've spent some time looking over the various threads here on stackoverflow and while I saw a lot of posts and threads regarding various engines that could be used in game development, I haven't seen very much discussion regarding the various platforms that they can be used on.
In particular, I'm talking about browser ... | false | 11,110,902 | 0.197375 | 0 | 0 | 1 | Download and install is a harder sell. People are more reluctant to do it, and once they have done it, you own the problem of platform compatibility, and you have installed code to update or avoid as your game evolves.
Java applets eliminate all that mess. Presumably also flash or html5. | 0 | 277 | 0 | 0 | 2012-06-19T23:27:00.000 | java,python,flash | Game development: "Play Now" via website vs. download & install | 0 | 1 | 1 | 11,113,116 | 1 |
0 | 0 | I would like to draw border for each row in a wxPython grid different (e.g. bold or broken line) based on data in the respective row. How can I achieve this result?
I am using python 2.6 and what I need is some pointers and/or suggestions. | true | 11,118,465 | 1.2 | 0 | 0 | 2 | Take a look at the wxPython demo. I think the demos that you'll find the most helpful are the following:
wx.Grid showing Editors and Renderers
GridLabelRenderer which is from wx.lib.mixins.gridlabelrenderer
Those will probably get you started. When you get stuck, ask on the wxPython mailing list. They'll be able to h... | 0 | 585 | 0 | 2 | 2012-06-20T11:24:00.000 | wxpython | How to draw border differently for each row in a Grid of wxPython? | 0 | 1 | 1 | 11,120,703 | 1 |
1 | 0 | The other day I came across a Python implementation called Jython.
With Jython you can write Java applications with Python and compile them to pure Java.
I was wondering: Android programming is done with Java.
So, is it possible to make Android apps with Jython? | true | 11,120,130 | 1.2 | 0 | 0 | 44 | Jython doesn't compile to "pure java", it compiles to java bytecode - ie, to *.class files. To develop for Android, one further compiles java bytecode to Dalvik bytecode. This means that, yes, Jython can let you use Python for developing Android, subject to you getting it to play nice with the Android SDK (I haven't pe... | 0 | 34,891 | 0 | 64 | 2012-06-20T12:58:00.000 | android,python,jython | Programming Android apps in jython | 0 | 6 | 7 | 11,122,066 | 1 |
1 | 0 | The other day I came across a Python implementation called Jython.
With Jython you can write Java applications with Python and compile them to pure Java.
I was wondering: Android programming is done with Java.
So, is it possible to make Android apps with Jython? | false | 11,120,130 | -1 | 0 | 0 | -6 | sadly No.
Mobile phones only have Java ME (Micro Edition) but Jython requires Java SE (Standard Edition). There is no Jython port to ME, and there is not enough interest to make it worth the effort. | 0 | 34,891 | 0 | 64 | 2012-06-20T12:58:00.000 | android,python,jython | Programming Android apps in jython | 0 | 6 | 7 | 26,718,708 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.