Web Development int64 0 1 | Data Science and Machine Learning int64 0 1 | Question stringlengths 35 6.31k | is_accepted bool 2
classes | Q_Id int64 5.14k 40.5M | Score float64 -1 1.2 | Other int64 0 1 | Database and SQL int64 0 1 | Users Score int64 -6 163 | Answer stringlengths 19 4.91k | Python Basics and Environment int64 0 1 | ViewCount int64 12 475k | System Administration and DevOps int64 0 1 | Q_Score int64 0 346 | CreationDate stringlengths 23 23 | Tags stringlengths 6 68 | Title stringlengths 12 138 | Networking and APIs int64 0 1 | Available Count int64 1 31 | AnswerCount int64 1 35 | A_Id int64 5.3k 72.3M | GUI and Desktop Applications int64 1 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | I'm a beginning programmer in Python and I have a strange problem with my computer. When I have a .py file on my computer (containing a script that works), and I double click on it to open, the following happens: the program opens (it's the black screen view), but it shuts itself down within a second, and the program i... | false | 13,959,257 | 0.132549 | 0 | 0 | 2 | but it shuts itself down within a second, and the program isn't executed.
Yes, the program is being executed. It is being executed so quickly that you don't have a chance to see what is happening.
Put raw_input() at the end of your code so that the console window doesn't close instantly. | 1 | 218 | 0 | 1 | 2012-12-19T19:00:00.000 | python,windows | computer (windows XP) doesn't want to open .py | 0 | 2 | 3 | 13,959,312 | 1 |
0 | 0 | I'm a beginning programmer in Python and I have a strange problem with my computer. When I have a .py file on my computer (containing a script that works), and I double click on it to open, the following happens: the program opens (it's the black screen view), but it shuts itself down within a second, and the program i... | false | 13,959,257 | 0.132549 | 0 | 0 | 2 | Austin is right, you made a console app, and once its finished(in microseconds), it closes itself.
Create a mainloop or use Austin's trick, to force app not to close itself. | 1 | 218 | 0 | 1 | 2012-12-19T19:00:00.000 | python,windows | computer (windows XP) doesn't want to open .py | 0 | 2 | 3 | 13,959,538 | 1 |
0 | 0 | I want to create a cross-platform application (Ubuntu and Android) with a notification icon. Is there a standard way to create such an app using Kivy? | true | 13,962,888 | 1.2 | 0 | 0 | 5 | Short answer, no… if you want to define such an API and implement it using platform-specific libs (libnotify on Ubuntu, and pyjnius on Android), that would be welcomed though. Others will help make it work on other platforms. | 0 | 641 | 0 | 5 | 2012-12-19T23:20:00.000 | android,python,linux,notifications,kivy | Kivy: crossplatform notification icon | 0 | 1 | 1 | 14,005,492 | 1 |
0 | 0 | I have my game running in a while True loop and I would like to be able to ask the user to "Play again?" I already have the code for a rect to pop up with the text but I need a way for the user to click on the rect or hit y for yes and the code run its self again. | false | 13,984,066 | 0.039979 | 0 | 0 | 1 | To tell if the user clicked on the rect, just set a 1 by 1 rect at the mouse position then when they click, check if the rects are colliding. Then, just call the loop again by having it be its own function, like DeadChex said. | 0 | 25,890 | 0 | 4 | 2012-12-21T03:58:00.000 | python,user-controls,while-loop,pygame | Pygame restart? | 0 | 2 | 5 | 14,188,676 | 1 |
0 | 0 | I have my game running in a while True loop and I would like to be able to ask the user to "Play again?" I already have the code for a rect to pop up with the text but I need a way for the user to click on the rect or hit y for yes and the code run its self again. | false | 13,984,066 | 0.07983 | 0 | 0 | 2 | Have the loop it's own method, call it from a main() run, when the game is over and ends, have main() ask the user if they want to play again, and if so recall the main loop after setting everything as its default
or
Just have the part that asks again clear and reinitialize all variables as there defaults and let the l... | 0 | 25,890 | 0 | 4 | 2012-12-21T03:58:00.000 | python,user-controls,while-loop,pygame | Pygame restart? | 0 | 2 | 5 | 13,984,092 | 1 |
1 | 0 | By default, the built-in views in PyQt can auto-refresh itself when its model has been updated. I wrote my own chart view, but I don't know how to do it, I have to manually update it for many times.
Which signal should I use? | true | 13,999,970 | 1.2 | 0 | 0 | 0 | You need to connect your view to the dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) signal of the model:
This signal is emitted whenever the data in an existing item changes.
If the items are of the same parent, the affected ones are those
between topLeft and bottomRight inclusive. If t... | 0 | 5,032 | 0 | 3 | 2012-12-22T04:07:00.000 | python,qt,user-interface,qt4,pyqt | PyQt - Automatically refresh a custom view when the model is updated? | 0 | 1 | 2 | 14,000,161 | 1 |
0 | 0 | I've written a curses program in python. It runs fine. However, when I use nodelay(), the program exits straight away after starting in the terminal, with nothing shown at all (just a new prompt).
EDIT
This code will reproduce the bug:
sc = curses.initscr()
sc.nodelay(1) # But removing this line allows the program t... | false | 14,004,835 | 0.066568 | 0 | 0 | 1 | While I didn't use curses in python, I am currently working with it in C99, compiled using clang on Mac OS Catalina. It seems that nodelay()` does not work unless you slow down the program step at least to 1/10 of a second, eg. usleep(100000). I suppose that buffering/buffer reading is not fast enough, and getch() or w... | 0 | 5,827 | 1 | 7 | 2012-12-22T17:13:00.000 | python,ncurses,curses | nodelay() causes python curses program to exit | 0 | 2 | 3 | 72,080,593 | 1 |
0 | 0 | I've written a curses program in python. It runs fine. However, when I use nodelay(), the program exits straight away after starting in the terminal, with nothing shown at all (just a new prompt).
EDIT
This code will reproduce the bug:
sc = curses.initscr()
sc.nodelay(1) # But removing this line allows the program t... | false | 14,004,835 | 0 | 0 | 0 | 0 | I see no difference when running your small test program with or without the sc.nodelay() line.
Neither case prints anything on the screen... | 0 | 5,827 | 1 | 7 | 2012-12-22T17:13:00.000 | python,ncurses,curses | nodelay() causes python curses program to exit | 0 | 2 | 3 | 14,006,585 | 1 |
0 | 0 | I need to store cookies persistently in an application that uses QWebKit. I understand that I have to create a subclass of QNetworkCookieJar and attach it to a QNetworkAccessManager. But how do I attach this QNetworkAccessManager to my QWebView or get the QNetworkAccessManager used by it?
I use Python 3 and PyQt if tha... | true | 14,034,401 | 1.2 | 0 | 0 | 4 | You can get/set the cookie jar through QWebView.page().networkAccessManager().cookieJar()/setCookieJar().
The Browser demo included with Qt (in C++) shows how to read and write cookies to disk. | 0 | 1,268 | 0 | 3 | 2012-12-25T22:21:00.000 | python,qt,cookies,qwebkit | Permanent cookies with QWebKit -- where to get the QNetworkAccessManager? | 0 | 1 | 1 | 14,039,648 | 1 |
0 | 0 | I'm using DataViewListCtrl and i add itemswith
AppendItem(["test123"])
How can i add data associated with each item? | false | 14,043,470 | 0.197375 | 0 | 0 | 2 | Old question, I know, but there should be an answer.
AppendItem(["test123", "data for second column", "third column", "etc..."]) | 0 | 1,889 | 0 | 1 | 2012-12-26T16:44:00.000 | wxpython | WxPython DataViewListCtrl item data | 0 | 1 | 2 | 36,878,217 | 1 |
0 | 0 | I'm designing a "settings" frame for a Python/Tkinter app that lets the user specify an IP address, port number, and a couple other configurable options. I want to validate the user entries before letting the user close the frame to apply them.
Based on what I've read up on (and tried) so far with the Entry widget's v... | false | 14,055,551 | 0.132549 | 0 | 0 | 2 | You can use the validation feature without the "heavy-handedness". Have your validation always return True after setting the state of the ok/apply button. | 0 | 471 | 0 | 0 | 2012-12-27T13:32:00.000 | python,tkinter | Does Tkinter validation have to be heavy-handed? | 0 | 2 | 3 | 14,056,624 | 1 |
0 | 0 | I'm designing a "settings" frame for a Python/Tkinter app that lets the user specify an IP address, port number, and a couple other configurable options. I want to validate the user entries before letting the user close the frame to apply them.
Based on what I've read up on (and tried) so far with the Entry widget's v... | false | 14,055,551 | 0.066568 | 0 | 0 | 1 | If you use trace, then you have what you want without needing to use Tkinter's validation at all. Make all traces go to the same function, where you test and validate all your values as you wish, and according to that enable or disable the ok button. | 0 | 471 | 0 | 0 | 2012-12-27T13:32:00.000 | python,tkinter | Does Tkinter validation have to be heavy-handed? | 0 | 2 | 3 | 14,055,762 | 1 |
0 | 0 | So my App needs to be able to open a single webpage(and it must be from the internet and not saved) in it, and specifically I'd like to use the Tkinter GUI toolkit since it's the one i'm most comfortable with. On top of that though, I'd like to be able to generate events in the window(say a mouse click) but without act... | false | 14,076,674 | 0.099668 | 0 | 0 | 2 | Tkinter does not have a widget that can render a web page. | 0 | 8,422 | 0 | 4 | 2012-12-28T22:38:00.000 | python,tkinter | Using Tkinter to open a webpage | 0 | 1 | 4 | 14,077,404 | 1 |
1 | 0 | I am using python webkit.WebView and gtk to crawl a web page. However, the web page is kind of dynamically loaded by javascript.
The WebView "load-finished" event is not sufficient to handle this. Is there any indicator/event to let me know that the page is really fully loaded even the content produced by javascript?
... | true | 14,093,870 | 1.2 | 0 | 0 | 4 | There is no real way to determine if that page is fully loaded.
One method is to determine the amount of time since the last request. However, some pages will make repeated requests continually. This is common with tracking scripts and some ad scripts.
What I would do is use a set amount of time after the web view ha... | 0 | 218 | 0 | 6 | 2012-12-30T19:26:00.000 | javascript,python,webview,webkit,web-crawler | How do I know a page is really fully loaded? | 0 | 1 | 1 | 14,094,212 | 1 |
0 | 0 | I was working with GUI automation for visual studio C# desktop application.
There I have DataGridView and inside the grid I have combo box and check boxes.
I tried to automate these using pywinauto, I can get only grid layout control only
and internal things I cant able to get the controls
(I tried with print _control_... | false | 14,101,063 | 0.291313 | 0 | 0 | 3 | The short answer is that there's no good way to automate sub-controls of a DataGridView using PyWinAuto.
If you want to read data out of a DataGridView (e.g. read the text contents of a cell, or determine whether a checkbox is checked), you are completely out of luck. If you want to control a DataGridView, there are t... | 0 | 1,878 | 0 | 0 | 2012-12-31T11:36:00.000 | c#,python,ui-automation,pywinauto | C# GUI automation using PyWinAuto | 0 | 1 | 2 | 14,104,632 | 1 |
0 | 0 | I found some many Python GUI toolkits.
The ones I like are:
wxPython
pyGTK
Tkinter
pyQt
pySide
Which one is the best and easiest to use?
And by the way what is the difference in pyQt and pySide? They both seem to be alike :/. | true | 14,106,229 | 1.2 | 0 | 0 | 4 | There is no "best" nor "easiest". All of the toolkits you mention have strengths and weaknesses. I've had significant experience with wxPython and Tkinter, and both are nice. I would say Tkinter is a little easier, wxPython is a little more full-featured.
When someone asks me this question I tell them just to pick one... | 0 | 8,808 | 0 | 6 | 2012-12-31T21:35:00.000 | python,python-2.7,user-interface | Which is the best and easiest Python GUI toolkit? | 0 | 1 | 1 | 14,106,272 | 1 |
0 | 0 | I have question and want to see if it can be realized in wxpython.
I would like to plot data on wxpython, and then use the mouse to select some points which are plotted, using the mouse.
At the moment i am using wx.lib.plot and using the PlotMarker
Is there a way of doing this with wx.lib.plot or do i have to use an... | false | 14,138,946 | 0 | 0 | 0 | 0 | You can use matplotlib or pygal. Something similar with your describing technique is used in PyQtGraph. | 0 | 944 | 0 | 0 | 2013-01-03T12:27:00.000 | python | interactive graph python wx.lib.plot. selecting some points | 0 | 1 | 3 | 14,139,047 | 1 |
0 | 0 | I made an app with PySide. When ever I run the app the GUI shows up but the CMD window is still there too. How do I hide it? | true | 14,139,190 | 1.2 | 0 | 0 | 1 | Run the app using pythonw it will hide the window | 0 | 228 | 0 | 1 | 2013-01-03T12:43:00.000 | python,qt,python-2.7,pyside | How to hide the CMD window in PySide app | 0 | 1 | 1 | 14,139,249 | 1 |
0 | 0 | i'm looking for a solution, either in linux or in windows, that allows me to
record video (+audio) from my webcam & microphone, simultaneously.
save it as a file.AVI (or mpg or whatever)
display the video on the screen while recording it
Compression is NOT an issue in my case, and i actually prefer to capture RAW and... | false | 14,140,495 | 0 | 0 | 0 | 0 | You can do offline html,js code to do video with audio recording. Using python lib python webview open that page. It should work fine. | 0 | 75,201 | 0 | 29 | 2013-01-03T14:08:00.000 | python,video-capture | How to capture a video (AND audio) in python, from a camera (or webcam) | 0 | 1 | 7 | 68,495,610 | 1 |
0 | 0 | Does anyone know of a GUI design app that lets you choose/drag/drop the widgets, and then turn that layout into Python code with the appropriate Tkinter calls & arrangement using the grid geometry manager? So far I've turned up a couple of pretty nice options that I may end up using, but they generate code using eithe... | false | 14,142,194 | 1 | 0 | 0 | 30 | The best tool for doing layouts using grid, IMHO, is graph paper and a pencil. I know you're asking for some type of program, but it really does work. I've been doing Tk programming for a couple of decades so layout comes quite easily for me, yet I still break out graph paper when I have a complex GUI.
Another thing t... | 0 | 150,823 | 0 | 59 | 2013-01-03T15:44:00.000 | python,grid,tkinter | Is there a GUI design app for the Tkinter / grid geometry? | 0 | 1 | 3 | 14,144,121 | 1 |
0 | 0 | My PyGTK application creates a secondary popup window for displaying a preview of results. This window is fairly elaborate, with Table widgets nested three deep and populated by HBoxes containing one Label each at the lowest level. The number of Labels total can be in the thousands. I am noticing that when I close this... | true | 14,147,434 | 1.2 | 0 | 0 | 0 | Apparently it was being caused by my attempt to change the background color of the tables--I was setting the background color of every HBox (and Label), which was responsible for nearly all of the excessive teardown time. All I had to do was set the background color of the Viewports the Tables are contained in. | 0 | 88 | 0 | 0 | 2013-01-03T21:20:00.000 | python,gtk | Excessive hang time when destroying a PyGTK window | 0 | 2 | 2 | 14,160,390 | 1 |
0 | 0 | My PyGTK application creates a secondary popup window for displaying a preview of results. This window is fairly elaborate, with Table widgets nested three deep and populated by HBoxes containing one Label each at the lowest level. The number of Labels total can be in the thousands. I am noticing that when I close this... | false | 14,147,434 | 0.099668 | 0 | 0 | 1 | How long takes that window to show up? Are all the widgets created at once when it is displayed?
Your problem might be caused by the destruction of your thousands of widgets, all at the same time. Or by a lengthy action perform on on of those widgets destruction. But without some code to look at, there could be thousa... | 0 | 88 | 0 | 0 | 2013-01-03T21:20:00.000 | python,gtk | Excessive hang time when destroying a PyGTK window | 0 | 2 | 2 | 14,156,870 | 1 |
0 | 0 | So I have an assignment in Computer Science that requires that I put an interactive menu into my python turtle graphics projects. I run on python 2.7.3 and would like some help on what modules to import and a basic outline of how to put an interactive menu into python turtle graphics. Thank you for your answers! | false | 14,177,297 | 0 | 0 | 0 | 0 | In 3.x, look at Lib/turtledemo/main.py for how to put a turtle canvas into a tkinter window with other stuff. In 2.x, the turtledemo main code is in Demo/turtle/turtleDemo.py in the source repository, but the Demo directory is not installed on Windows. | 0 | 1,224 | 0 | 1 | 2013-01-05T22:53:00.000 | menu,python-2.7,python-idle,turtle-graphics,cheeseshop | How to Insert an Interactive Menu into Python Turtle Graphics | 0 | 1 | 1 | 26,772,106 | 1 |
0 | 0 | I call foreign c library in my program using ctypes, I don't know how to assign a POINTER(c_char) variant to a string. | false | 14,191,462 | 0 | 0 | 0 | 0 | The question is vague, but I guess you should use c_char_p instead of POINTER(c_char). | 0 | 149 | 0 | 0 | 2013-01-07T07:12:00.000 | python,python-2.7 | How can I assign a variant of POINTER(c_char) type to a string? | 0 | 1 | 1 | 14,193,534 | 1 |
0 | 0 | I'm looking at a way to take screenshot of DirectX games in Python. I already tried to use PIL and other stuff but I only end up with black screenshots. I saw that the project directpython11 provided a Python binding to some DirectX stuff but I didn't find anything related to screenshot of external DirectX applications... | false | 14,205,113 | 0.761594 | 0 | 0 | 5 | This is a rather complicated topic.
Actually taking a screenshot, in the most simplistic way, involves grabbing the backbuffer and writing that to a file. Your Python DirectX bindings should provide support for making a texture and filling it with data, from the back or front buffer; after that the image writing is up ... | 0 | 2,931 | 0 | 2 | 2013-01-07T22:21:00.000 | python,directx,screenshot | Take a screenshot of a DirectX game in Python | 0 | 1 | 1 | 14,205,237 | 1 |
0 | 0 | I manage a number of Windows PCs which are used to control equipment. Each computer has a specific program installed which is what people launch to use that equipment. We want to require people to log in before they can access this program.
Currently, I have a wxpython app which just launches that executable when peopl... | true | 14,206,982 | 1.2 | 0 | 0 | 1 | There is no full proof way to do this on Windows. You can show a wx.Frame modally using its MakeModal() method. And you can catch EVT_CLOSE and basically veto it it they try to close the frame. However, if they have access to the Task Manager or even Run, they can probably get around the screen. Most users won't be tha... | 0 | 95 | 0 | 0 | 2013-01-08T01:35:00.000 | windows,authentication,wxpython,modal-dialog | Logon-type wxpython app | 0 | 1 | 1 | 14,217,396 | 1 |
0 | 0 | This is one of those just-making-sure-I-didn't-miss-anything posts.
I have a TKinter GUI in Python 2.7.3 that includes a listbox, and there are circumstances where I'd like to directly modify the text of a specific item at a known index. I've scoured the documents and there's no lb.itemset() method or anything like it... | true | 14,222,670 | 1.2 | 0 | 0 | 2 | Assuming from silence that there's nothing I missed. I went with option 2 -- the acrobatics weren't quite as complex as I'd thought. I just created a behind-the-scenes list wrapped up in a class; every time I update the list, the class syncs up the content of the listbox by doing a ' '.join on the list then setting t... | 0 | 1,274 | 0 | 3 | 2013-01-08T19:34:00.000 | listbox,python-2.7,tkinter | Directly modify a specific item in a TKinter listbox? | 0 | 1 | 1 | 14,251,259 | 1 |
0 | 1 | I am looking for a library, example or similar that allows me to loads a set of 2D projections of an object and then converts it into a 3D volume.
For example, I could have 6 pictures of a small toy and the program should allow me to view it as a 3D volume and eventually save it.
The object I need to convert is very si... | false | 14,232,451 | 0.379949 | 0 | 0 | 2 | There are several things you can mean, I think none of which currently exists in free software (but I may be wrong about that), and they differ in how hard they are to implement:
First of all, "a 3D volume" is not a clear definition of what you want. There is not one way to store this information. A usual way (for comp... | 0 | 1,288 | 0 | 0 | 2013-01-09T09:53:00.000 | python,image-processing,3d,2d | 2D image projections to 3D Volume | 0 | 1 | 1 | 14,233,016 | 1 |
0 | 0 | I have a notebook window. I want to change dynamically size. I did expand dynamically, but I couldn't shrink it. I used win.set_size_request(w,h) for expand. How can I shrink dynamically? | false | 14,236,918 | 0 | 0 | 0 | 0 | You likely have widgets on your pages that are stopping them from shrinking. You may need to put the content of your pages in a ViewPort or ScrolledWindow to get the effect you are looking. | 0 | 329 | 0 | 0 | 2013-01-09T14:00:00.000 | python,gtk | Gtk Notebook size dynamically change | 0 | 1 | 2 | 14,327,100 | 1 |
0 | 0 | I haven't seen an example of this but I wanted to know if any knows how to implement a colorbar with an adjustable slider using wxpython. Basically the slider should change the levels of the colorbar and as such adjust the colormap.
If anyone has an idea of how to do and possible some example code it would be much app... | true | 14,244,195 | 1.2 | 0 | 0 | 1 | I think you're looking for one of the following widgets:
ColourDialog, ColourSelect, PyColourChooser or CubeColourDialog
They all let you choose colors in different ways and they have a slider to help adjust the colours too.
You can see each of them in action in the wxPython demo (downloadable from the wxPython web pag... | 0 | 386 | 0 | 0 | 2013-01-09T18:41:00.000 | python,slider,wxpython,color-mapping | colorbar with a slider using wxpython | 0 | 1 | 1 | 14,260,324 | 1 |
0 | 0 | I have a text widget with dark background and I can't see the cursor's position. Is there any way to change the (blinking) text cursor's color? | true | 14,284,492 | 1.2 | 0 | 0 | 30 | You can change the insertbackground option of the text widget to whatever you want. | 0 | 12,336 | 0 | 21 | 2013-01-11T18:32:00.000 | python,tkinter,colors,text-cursor | How to change text cursor color in Tkinter? | 0 | 1 | 3 | 14,284,594 | 1 |
0 | 0 | I'm a Python guy building a Linux-based web service for a client who wants me to interface with a small C++ library that they're currently using with a bunch of Windows based VB applications.
They have assured me that the library is fairly simple (as far as they go I guess), and that they just need to know how best to ... | false | 14,289,656 | 0 | 0 | 0 | 0 | Due to complexities of the C++ ABI (such as name mangling), it's generally difficult and platform-specific to load a C++ library directly from Python using ctypes.
I'd recommend you either create a simple C API which can be easily wrapped with ctypes, or use SWIG to generate wrapper types and a proper extension module ... | 0 | 201 | 0 | 0 | 2013-01-12T02:41:00.000 | c++,python | How does one get a C++ library loaded into Python as a shared object file (.so)? | 0 | 1 | 2 | 14,289,688 | 1 |
0 | 0 | I was using PIL to do image processing, and I tried to convert a color image into a grayscale one, so I wrote a Python function to do that, meanwhile I know PIL already provides a convert function to this.
But the version I wrote in Python takes about 2 seconds to finish the grayscaling, while PIL's convert almost inst... | false | 14,289,657 | 0.291313 | 1 | 0 | 3 | Yes, coding the same algorithm in Python and in C, the C implementation will be faster. This is definitely true for the usual Python interpreter, known as CPython. Another implementation, PyPy, uses a JIT, and so can achieve impressive speeds, sometimes as fast as a C implementation. But running under CPython, the P... | 1 | 318 | 0 | 0 | 2013-01-12T02:41:00.000 | python,c,python-imaging-library | performance concern, Python vs C | 0 | 2 | 2 | 14,289,791 | 1 |
0 | 0 | I was using PIL to do image processing, and I tried to convert a color image into a grayscale one, so I wrote a Python function to do that, meanwhile I know PIL already provides a convert function to this.
But the version I wrote in Python takes about 2 seconds to finish the grayscaling, while PIL's convert almost inst... | false | 14,289,657 | 0.197375 | 1 | 0 | 2 | If you want to do image processing, you can use
OpenCV(cv2), SimpleCV, NumPy, SciPy, Cython, Numba ...
OpenCV, SimpleCV SciPy have many image processing routines already.
NumPy can do operations on arrays in c speed.
If you want loops in Python, you can use Cython to compile your python code with static declaration in... | 1 | 318 | 0 | 0 | 2013-01-12T02:41:00.000 | python,c,python-imaging-library | performance concern, Python vs C | 0 | 2 | 2 | 14,290,456 | 1 |
0 | 0 | Is there a method to add python pygame with images to PHP and display it in a local browser? What are the necessary requirements to do something like this? | false | 14,296,401 | 0 | 0 | 0 | 0 | If I got you right, then answer is: no, it's impossible. I think — Flash is most acceptable choice for you, or Unity3D with browser plugin. | 0 | 71 | 0 | 0 | 2013-01-12T18:12:00.000 | php,python,pygame | Is there a way to add Pygame into a local PHP file? | 0 | 1 | 1 | 14,296,430 | 1 |
0 | 0 | Can anybody tell me how I can return the dimensions of a video (pixel height/width) using Qt (or any other Python route to that information). I have googled the hell out of it and cannot find a straight answer.
I assumed it would either be mediaobject.metadata() or os.stat() but neither appear to return the required i... | true | 14,323,390 | 1.2 | 0 | 0 | 0 | OK - for others out there looking for the same info, I found Hachoir-metadata and Hachoir-parser (https://bitbucket.org/haypo/hachoir/wiki/Home).
They provide the correct info but there is a serious lack of docs for it and not that many examples that I can find. Therefore, while I have parsed a video file and returned... | 0 | 305 | 0 | 0 | 2013-01-14T17:21:00.000 | python,qt,video,pyside,phonon | qt phonon - returning video dimensions | 0 | 1 | 3 | 14,509,771 | 1 |
0 | 0 | I want disable dragging the wx.Dialog. I noticed when I remove the caption the user can not drag the dialog, but I want to keep the caption. Any suggestions would be helpful? Thank you. | false | 14,362,863 | 0 | 0 | 0 | 0 | The only way to do it is to remove the caption as you've already found. You might be able to use a wx.Timer or catch a dragging event of some sort and center the dialog that way, but otherwise, removing the caption is the way to go. | 0 | 139 | 0 | 2 | 2013-01-16T16:18:00.000 | wxpython,wxwidgets | How to disable dragging wx.DIalog from the user | 0 | 1 | 1 | 14,363,626 | 1 |
0 | 0 | EDIT: Can someone explain why this is "Off Topic"? I think it very clearly follows the guidelines laid out in the FAQ. Is there something I'm missing?
I've been creating a windows desktop application in PyQt (python 2.7, PyQt 4.9.5), and I'm getting close to releasing the software for sale. It's time for me to add s... | false | 14,388,482 | 0.379949 | 0 | 0 | 2 | One thing to note is that it is relatively easy to decompile and reverse engineer Python bytecode and remove any protection you put into it, so it's usually not worth it to spend too much effort and time on implementing a crack-proof protection. You just want to put enough to keep people honest.
If your concern is that... | 0 | 3,211 | 0 | 4 | 2013-01-17T21:30:00.000 | python,licensing | What serial number licensing solution should I use for a Python application with Fastspring? | 0 | 1 | 1 | 14,420,183 | 1 |
0 | 0 | Im a newbie to Wxpython programming and I have a general on how to make my application more program.
Assume, I have a tree with the list of employees being listed in the tree. When I click a employee the information is retrieved in the db and the information is diplayed on the right side of the panel.
Now, when I edit... | false | 14,430,915 | 0 | 0 | 0 | 0 | I don't believe the default TreeCtrl has database interaction builtin. You would have to add that. If you want it to check for updates periodically, you could use a wx.Timer. If you'll be updating the database with your wxPython GUI, then there shouldn't be a problem as you'll have to update the display anyway.
You mig... | 0 | 115 | 0 | 0 | 2013-01-21T00:23:00.000 | wxpython | Wxpython dynamic programming | 0 | 1 | 1 | 14,460,784 | 1 |
0 | 0 | I'm using the QComboBox to let the user select a very large quantity of choices. For the moment the user can type a character and the QComboBox selects the first row with this character, but I feel that it's just not enough.
Is there any thing already done for the user to search directly the item by entering a text?
Th... | true | 14,437,549 | 1.2 | 0 | 0 | 2 | You can use void QComboBox::setCompleter(QCompleter *completer) | 0 | 568 | 0 | 0 | 2013-01-21T11:21:00.000 | python,qt,pyqt,qcombobox | Quick find item with QComboBox in Qt | 0 | 1 | 1 | 14,437,632 | 1 |
0 | 0 | I need some help, I am coding a Zip password Cracker.I am trying to create a gui interface for my cracker.
I want to show a message box for right password if founded in password file..
But, showinfo message box is not executing after clicking on crack button, while if i am printing password using print it is working..... | false | 14,439,001 | 0 | 0 | 0 | 0 | You cannot call Tkinter commands from any thread other than the main thread. Tkinter is not thread safe. | 0 | 150 | 0 | 0 | 2013-01-21T12:48:00.000 | python,python-2.7,tkinter | Python-Help in Tkinter | 0 | 1 | 1 | 14,441,255 | 1 |
0 | 0 | I'd like a Python-accessible function show_image(...) that launches a fairly simple image viewer, where the image is specified as (for example) a NumPy array. Importantly, I'd like for this function not to block, but for the script to continue execution while maintaining interactivity of the window.
I realize that the ... | false | 14,446,488 | 0 | 0 | 0 | 0 | Personally I use os.system("xv foo.png &"), or any small image viewer. Depending on the details, you may also do g = os.popen("xv - &", "w") and write the image data to the file g. Again depending on the details, I sometimes make my program a web server (a few dozen lines of code, e.g. with Twisted), serve images fro... | 0 | 864 | 0 | 1 | 2013-01-21T20:16:00.000 | python,image,user-interface | Non-blocking image viewer function from Python? | 0 | 1 | 1 | 14,446,771 | 1 |
0 | 0 | I have populated a combobox with an QSqlQueryModel. It's all working fine as it is, but I would like to add an extra item to the combobox that could say "ALL_RECORDS". This way I could use the combobox as a filtering device.
I obviously don't want to add this extra item in the database, how can I add it to the combobo... | false | 14,455,871 | 0.099668 | 0 | 1 | 1 | You could use a proxy model that takes gets it's data from two models, one for your default values, the other for your database, and use it to populate your QComboBox. | 0 | 243 | 0 | 1 | 2013-01-22T10:02:00.000 | python,qt,pyqt,pyqt4,pyside | Adding an item to an already populated combobox | 0 | 1 | 2 | 14,540,595 | 1 |
0 | 0 | I'm writing a program and I need to inform the user about some changes with a popup message, but not a popup window. Something like the rectangle informing about new message in Kadu - no window, just a bitmap drawn directly on the screen for a few seconds.
I wonder if there is a simple way to do that with win32 packag... | false | 14,490,753 | 0 | 0 | 0 | 0 | I am using wxPython and looking for a way to have a popup message. Now I am using a popupmenu in which I append each item of the menu with one line of the message. | 0 | 1,969 | 0 | 0 | 2013-01-23T22:42:00.000 | python,popup,screen,draw | Python - popup message drawn on the screen | 0 | 1 | 2 | 15,838,631 | 1 |
0 | 0 | Someone know if it's possible to change the color of a pixel in a canvas without using un object, so without using something like canvas.create_oval or canvas.create_rectangle ? | false | 14,491,092 | 0.379949 | 0 | 0 | 4 | There is no way to color a pixel other than to create a 1x1 pixel object of some sort. And yes, at some point you will experience performance problems. The canvas simply wasn't designed to be used this way.
If you're really needing to create a large area in which you can manage individual pixels, you can create a canv... | 0 | 3,101 | 0 | 1 | 2013-01-23T23:07:00.000 | python,canvas,tkinter | Change the color of a pixel in a canvas, Tkinter, Python | 0 | 2 | 2 | 14,500,936 | 1 |
0 | 0 | Someone know if it's possible to change the color of a pixel in a canvas without using un object, so without using something like canvas.create_oval or canvas.create_rectangle ? | true | 14,491,092 | 1.2 | 0 | 0 | 0 | Within tkinter itself, it's impossible.
Even if you manage to change a pixel on canvas window (which is possible with X11 and Windows APIs in a platform-dependent way), you'd have to ensure it's repainted properly.
You can, of course, place a frame of size 1x1 over the canvas, with a background color you want. This way... | 0 | 3,101 | 0 | 1 | 2013-01-23T23:07:00.000 | python,canvas,tkinter | Change the color of a pixel in a canvas, Tkinter, Python | 0 | 2 | 2 | 14,491,248 | 1 |
0 | 0 | I am using pycairo (actually cairocffi) on Ubuntu 12.04.
The library on the system is cairo 1.10.
I've created an empty ImageSurface, having an ARGB32 format.
If, for example, I try to fill a semi-transparent white rectangle (RGBA(1,1,1,0.5)), I see a semi-transparent grey rectangle.
This is the same for every semi-tra... | true | 14,514,438 | 1.2 | 0 | 0 | 2 | I have finally found what was wrong with cairo and the bad alpha blending.
Cairo supports ARGB32 surface, but only with premultiplied alpha.
That is, every component of a pixel is stored premultiplied with the alpha component.
I have not found an answer for this over the internet, and I assume premultiplied alpha is no... | 0 | 835 | 0 | 3 | 2013-01-25T02:33:00.000 | python,cairo,pycairo | Cairo, ImageSurface : Cannot get correct alpha blending | 0 | 1 | 1 | 14,521,313 | 1 |
0 | 0 | I'm a newbie in this type of approach to programming since I really doesn't care for hardcore graphics generation. I design, write, run, and study parametrized climate models with python. But, at last, I have encountered myself with a visualization issue.
I was looking for something in Cairo library that allows me to m... | false | 14,518,005 | 0 | 0 | 0 | 0 | Mesh patterns were added in cairo 1.12 which is the latest release. Thus, most language bindings likely don't support them yet. I don't know anything about the combination of python and cairo and thus don't know any workaround.
I don't know any simple way to simulate what you need with other patterns, sorry. (Although ... | 0 | 926 | 0 | 1 | 2013-01-25T08:26:00.000 | python-2.7,cairo,pycairo | Using mesh gradients in Cairo for coloring a path | 0 | 1 | 1 | 14,520,708 | 1 |
0 | 0 | I am new to designing GUIs in python and have a query:
Is there a way to have a label or any other widget with copyable text. I want to provide help section within GUI which will contain a sample xml to be given as input, I want user to be able to copy that xml.
I don't want that information to go away if user cuts tha... | false | 14,549,545 | 0.197375 | 0 | 0 | 1 | Use a text widget in disabled state.
There is no insertion cursor in this state, but the text may still be selected and copied (but not modified). | 0 | 254 | 0 | 0 | 2013-01-27T16:39:00.000 | python,user-interface,text,python-3.x,tkinter | Python tkinter GUI: which widget to use for having copyable text | 0 | 1 | 1 | 14,549,709 | 1 |
0 | 0 | An app I made from my script with py2app doesn't work on newer versions of OS X. I was told that this was because the build was partially standalone, meaning it requires my version of wxPython, but doesn't include it. How can I make it fully standalone (where my version of wxPython is included), or not standalone, wher... | true | 14,563,591 | 1.2 | 0 | 0 | 2 | Make sure you are using the latest py2app, it looks like they've resolved some issues lately related to semi-standalone, perhaps that may affect your build too.
Use the Python from Python.org, not Apple's python installed with the OS.
Don't use the --semi-standalone flag or options like it in the setup script.
That sh... | 0 | 684 | 0 | 2 | 2013-01-28T13:55:00.000 | python,wxpython,wxwidgets,py2app | Toggling py2app standalone? | 0 | 1 | 1 | 14,571,464 | 1 |
0 | 0 | I have a Gtk IconView. Actually, selected items are draw with a different background color (this is the normal behavior). However, I'd like to be able to distinguish between "selected" and "active" items, by using a different background color for the "active" item. How can I achieve that? | false | 14,612,802 | 0 | 0 | 0 | 0 | Are you using a theme? Check the panel.rc file and look for bg[ACTIVE]. Change that value and the button should change colour | 0 | 127 | 0 | 0 | 2013-01-30T20:13:00.000 | python,gtk | How to distinguish active and selected item in Gtk IconView? | 0 | 1 | 1 | 14,612,976 | 1 |
0 | 0 | I'm writing a game with two processes. One for rendering with OpenGL. The other is for Collision detection. This is so I can use more than a single core.
However I can't use any pygame surfaces without the display open. So I can't use bitmasks to do pixel perfect collision or any other collision for that matter.
I've t... | false | 14,643,579 | 0 | 0 | 0 | 0 | I'm going to use pymunk. The python port of Chipmunk.
I did a silly experiment with it little over a year ago when I first started programming. It was pretty easy. I just totally forgot about it.
I couldn't get pybox2d to work in any python version. | 0 | 141 | 0 | 0 | 2013-02-01T09:52:00.000 | python,opengl,pygame | Using pygames Collision module without initializing display | 0 | 1 | 2 | 14,807,386 | 1 |
0 | 0 | Is there a way to program a function that takes user input without requesting it? For example, during a game of tic-tac-toe, the user could press "Q" at any time and the program would close? | true | 14,651,989 | 1.2 | 0 | 0 | 1 | There are a few ways to do this, and they are all different.
If your game is a terminal application using curses, you would catch the q when you call getch(), and then raise SystemExit or simply break out of your while loop that many curses applications use.
Using tkinter or another GUI library, you would bind a key pr... | 0 | 362 | 0 | 1 | 2013-02-01T17:41:00.000 | python,input | Python 3.2 Passive User Input | 0 | 1 | 2 | 14,652,103 | 1 |
0 | 0 | I am using QT4 (4.2.1) with python 2.4 on CentOS.
I assigned QAction with shortcuts to my menu and disable/enable them accordingly. I have event handlers assigned to the triggered event for the actions. Everything works as expected except that the shortcuts trigger the events for disabled actions. For example, I have... | true | 14,653,860 | 1.2 | 0 | 0 | 0 | This behaves fine with Qt 4.8.5, and as far as I can tell from the source it should work with versions as old as Qt 4.5.
Try upgrading Qt to a reasonably recent version, or at least try your code on a more modern version. | 0 | 199 | 0 | 0 | 2013-02-01T19:46:00.000 | python,qt,qt4 | Shortcuts trigger events for disabled QActions | 0 | 1 | 1 | 14,654,391 | 1 |
0 | 0 | In python I want to simulate a joystick that when used, to give values between -63 and +63 let's say. When the value it's positive, I want to press the "w" key and "s" key when negative.
I am not having problems receiving the values, but to transform these analog values into digital key presses. Does anyone has any ide... | true | 14,672,039 | 1.2 | 0 | 0 | 1 | Use PostMessage with the WM_CHAR command (if you're using Windows - you didn't say). | 0 | 118 | 0 | 0 | 2013-02-03T11:36:00.000 | python,keypress,joystick,analog-digital-converter | Transforming analog keypresses to digital | 0 | 1 | 1 | 14,709,657 | 1 |
0 | 0 | I have developed the python script for checking out a source code from repository and build it using visual studio.When i run the script,a GUI opens(developed using wxPython) which shows a button,clicking on which does the checkout and build.I would want to show a progress bar showing the process running when i click o... | true | 14,681,697 | 1.2 | 0 | 0 | 0 | You probably won't be able to get an accurate progress unless your build scripts are generating some progress information in the output that you can parse and represent in your GUI. Either way you will probably want to use wx.ProgressDialog or use a wx.Gauge in your main panel or something like that. Both wx.Progress... | 1 | 400 | 0 | 0 | 2013-02-04T06:52:00.000 | python-2.7,wxpython | Show progress bar when running a script | 0 | 1 | 1 | 14,692,494 | 1 |
0 | 0 | I have an application developed in Python using PyQt4, In which i used QTableView to display a reports.
when i open one report window with QTableView it shows the result properly.
If i open another report window with QTableView it shows the result properly.
Now both the windows are displaying the data in there QTableVi... | true | 14,682,935 | 1.2 | 0 | 0 | 0 | Check if you are using same instance of QtSql.QSqlDatabase for all the views you create. | 0 | 91 | 0 | 1 | 2013-02-04T08:29:00.000 | python,pyqt4,qtableview | QTableView data disapears by opening another QTableView | 0 | 1 | 1 | 16,030,744 | 1 |
0 | 0 | I am using Tkinter with Python 2.6 and 2.7 for programming graphic user interfaces.
These User Interfaces contain dialogs for opening files and saving data from the tkFileDialog module. I would like to adapt the dialogs and add some further entry widgets e.g. for letting the user leave comments.
Is there any way for do... | false | 14,686,543 | 0.099668 | 0 | 0 | 1 | I had to get rid of the canvasx/y statements. That line now simply reads set item [$data(canvas) find closest $x $y], which works well. $data(canvas) canvasx $x for its own works well but not in connection with find closest, neither if it is written in two lines. | 0 | 1,084 | 0 | 4 | 2013-02-04T12:12:00.000 | python,tkinter,filedialog | Python Tkinter: Adding widgets to file dialogs | 0 | 1 | 2 | 14,822,605 | 1 |
0 | 0 | I'm currently working on a small game using pygame.
Right now I render images the standard way, by loading them and then blitting them to my main surface. This is great, if I want to work with an individual image size. Yet, I'd like to take in any NxN image and use it at an MxM resolution. Is there a technique for thi... | true | 14,692,367 | 1.2 | 0 | 0 | 1 | There is no single command to do this. You will first have to change the size using pygame.transform.scale, then make a rect of the same size, and set its place, and finally blit. It would probably be wisest to do this in a definition. | 0 | 128 | 0 | 0 | 2013-02-04T17:45:00.000 | python,pygame | Rendering image independent of size? | 0 | 1 | 1 | 14,694,352 | 1 |
0 | 0 | I have seen a similar question on this site but not answered correctly for my requirements. I am reasonably familiar with py2exe.
I'd like to create a program (in python and py2exe) that I can distribute to my customers which would enable them to add their own data (not code, just numbers) and redistribute as a new/ame... | false | 14,692,822 | 0.197375 | 0 | 0 | 1 | I think it is possible. I'm not sure how py2exe works, but I know how pyinstaller does and since both does the same it should work similiar.
Namely, one-file flag doesn't really create one file. It looks like that for end user, but when user run app, it unpacks itself and files are stored somewhere physically. You cou... | 1 | 167 | 0 | 3 | 2013-02-04T18:11:00.000 | python,py2exe | compile py2exe from executable | 0 | 1 | 1 | 14,693,751 | 1 |
0 | 0 | I am creating a wx.Frame with a GLCanvas. On some platforms, setting the WX_GL_DEPTH_SIZE attribute of the canvas to 32 works fine. On another platform, I just get a blank frame (the GLCanvas doesn't render) unless I reduce the depth size to 16. Is there an easy way in the calling code to determine the allowable val... | false | 14,715,739 | 0.099668 | 0 | 0 | 1 | Are you running Linux? Perhaps you could get that information from the table of display modes that glxinfo -t outputs. | 0 | 239 | 0 | 1 | 2013-02-05T19:50:00.000 | python,wxpython,pyopengl | How can I determine the max allowable WX_GL_DEPTH_SIZE for a wx GLCanvas? | 0 | 1 | 2 | 14,971,097 | 1 |
0 | 0 | I'm creating a simple application through glade, and I want to be able to set the color displayed in the color selection dialog. I found the set_current_color function, however, it requires a gdk.Color object.
Trying to import gtk.gdk.Color fails (actually, just importing gtk fails). Is there another method I can use t... | false | 14,881,732 | 0 | 0 | 0 | 0 | It turned out to be an issue of mixing GTK2 and GTK3. gi.repository.Gtk has the Color constructor. | 0 | 125 | 0 | 0 | 2013-02-14T18:36:00.000 | python,gtk,pygtk,gdk | pygtk issue - unable to create gdk.Color object | 0 | 1 | 1 | 14,906,082 | 1 |
0 | 0 | I am trying to find a way to test my C code using python scripts. So far my findings are
1) with Ctypes, I can easily load the so and call the function directly from python. Plus, everything happens at run-time, so no extra compiling/wrapping stuff.
2) However, re-writing every types in python is tedious and error pron... | false | 14,887,374 | 0 | 0 | 0 | 0 | I ended up using Swig with dynamic linking to the so library generated by the C code. In this way, I only have to include the header files in the swig interface file to tell swig what functions/datatypes to expose. Another advantage of this approach is that I can write testing helper functions in C and easily expose th... | 0 | 321 | 0 | 0 | 2013-02-15T02:09:00.000 | python,c,swig,ctypes | Python & C: Is it possible to mix Ctypes and Swig together? | 0 | 1 | 1 | 14,943,730 | 1 |
0 | 0 | I've been working on a very simple python/tkinter script (a .pyw file) and I'd like to change it's application icon (the 'file' icon shown at the explorer window and the start/all programs window, for example - not the 'file type' icon nor the main window of the app icon) and the taskbar icon (the icon shown at the tas... | false | 14,900,510 | 0 | 0 | 0 | 0 | Create an single file exe using PyInstaller and use Inno Setup to build the windows installer package. Inno Setup will do the icon stuff for you. | 0 | 35,930 | 0 | 15 | 2013-02-15T17:53:00.000 | python,tkinter | Changing the application and taskbar icon - Python/Tkinter | 0 | 2 | 7 | 42,867,640 | 1 |
0 | 0 | I've been working on a very simple python/tkinter script (a .pyw file) and I'd like to change it's application icon (the 'file' icon shown at the explorer window and the start/all programs window, for example - not the 'file type' icon nor the main window of the app icon) and the taskbar icon (the icon shown at the tas... | false | 14,900,510 | 0 | 0 | 0 | 0 | add
--icon=iconname.ico
to the pyinstaller command in the prompt
eg>> pyinstaller --windowed --add-data "pics/myicon.ico;pics" --add-data "pics/*.png;pics" --icon=pics/myicon.ico -d bootloader myscript.py
this will show your icon on the windows taskbar instead of the default python pkg icon | 0 | 35,930 | 0 | 15 | 2013-02-15T17:53:00.000 | python,tkinter | Changing the application and taskbar icon - Python/Tkinter | 0 | 2 | 7 | 72,111,647 | 1 |
0 | 0 | How can I tell a Tkinter window where to open, based on screen dimensions? I would like it to open in the middle. | false | 14,910,858 | 0.066568 | 0 | 0 | 2 | root.geometry('520x400+350+200')
Explanation: ('width x height + X coordinate + Y coordinate') | 0 | 110,461 | 0 | 67 | 2013-02-16T13:30:00.000 | python,python-2.7,tkinter | How to specify where a Tkinter window opens? | 0 | 1 | 6 | 55,293,163 | 1 |
0 | 0 | If there are lets say 4 buttons, all with the same Click event, how can I find out which button was pressed?
if the event looks like this def Button_Click(self, sender, e): I'm sure I can compare sender to my buttons somehow. But how? | true | 14,959,093 | 1.2 | 0 | 0 | 1 | Well, I've never used IronPython so I don't know how much help this will be, but what I usually do when trying to figure out these things in regular python is to print type(sender) , print sender and print dir(sender) to console(or output to a file if you don't have a console available).
This should help you figure out... | 0 | 901 | 0 | 0 | 2013-02-19T13:47:00.000 | python,.net,ironpython | event handling iron python | 0 | 1 | 1 | 14,959,257 | 1 |
0 | 0 | mi problem is this. I´ve already created a program with tkinter, but I want to run it twice in the same window, one in each side of the window. How can I do that??
The idea is to be able to compare the data from both programs so I want them to work separated.
Many thanks.
PD: I cannot post an image for you because of m... | false | 14,994,651 | 0.379949 | 0 | 0 | 2 | Ultimately, what you need to do is put all of the logic behind creating and using a single workspace on a single Frame object. Then you just need to create 2 Frames side-by-side -- Each one holding a "workspace". | 0 | 100 | 0 | 0 | 2013-02-21T04:39:00.000 | python,programming-languages,tkinter | How can I create 2 workspaces in tkinter | 0 | 1 | 1 | 14,994,664 | 1 |
0 | 0 | I have a Qt application written in PySide (Qt Python binding). This application has a GUI thread and many different QThreads that are in charge of performing some heavy lifting - some rather long tasks. As such long task sometimes gets stuck (usually because it is waiting for a server response), the application sometim... | false | 15,014,932 | 0 | 0 | 0 | 0 | A couple of hints people might find useful:
A. You need to beware of the following:
Every so often the threads want to send stuff back to the main thread. So they post an event and call processEvents
If the code runs from the event also calls processEvents then instead of returning to the next statement, python can in... | 0 | 1,998 | 0 | 2 | 2013-02-22T00:37:00.000 | python,qt,events,pyqt,pyside | Is calling QCoreApplications.processEvents() on a set interval safe? | 0 | 1 | 2 | 42,914,476 | 1 |
0 | 0 | I have tried using pythonw and this only works if I drop and drag the file onto it. I remember reading somewhere there is a way to keep this from happening in the code but I can't find it. Thanks in advance. | false | 15,018,411 | 0.379949 | 0 | 0 | 2 | To run it with pythonw.exe just give your file a .pyw extension. | 0 | 57 | 0 | 0 | 2013-02-22T06:44:00.000 | python,python-2.7,wxpython | How do I keep shell or IDLE shell from opening when running wxPython | 0 | 1 | 1 | 15,018,504 | 1 |
0 | 1 | I have created a 10 by 10 game board. It is a 2D list, with another list of 2 inside. I used
board = [[['O', 'O']] * 10 for x in range(1, 11)]. So it will produce something like
['O', 'O'] ['O', 'O']...
['O', 'O'] ['O', 'O']...
Later on I want to set a single cell to have 'C' I use board.gameBoard[animal.y][animal.x]... | false | 15,036,694 | 0 | 0 | 0 | 0 | Your board is getting multiple references to the same array.
You need to replace the * 10 with another list comprehension. | 0 | 168 | 0 | 1 | 2013-02-23T03:25:00.000 | python,list | 2D Python list will have random results | 0 | 1 | 3 | 15,036,718 | 1 |
0 | 0 | How to run multiple processes in python without multithreading? For example consider the following problem:-
We have to make a Gui,which has a start button which starts a function(say, prints all integers) and there is a stop button, such that clicking it stops the function.
How to do this in Tkinter? | false | 15,057,789 | 0 | 0 | 0 | 0 | Did you try to used multiprocessing module? Seems to be the one you're looking for. | 1 | 7,177 | 0 | 4 | 2013-02-24T23:08:00.000 | python,tkinter,multiprocessing | Multiprocessing in Python tkinter | 0 | 1 | 2 | 15,057,824 | 1 |
0 | 0 | Im struggling opening a powerpoint presentation via python.
I have a program in educational program in pyqt and i need to open up a powerpoint presentation(in powerpoint viewer mode) when i click a push button.
I tried using pywin32 and such but ive had no luck :( | false | 15,058,771 | 0 | 0 | 0 | 0 | Import the os module, then use os.system("powerpoint.exe filename") | 0 | 3,049 | 0 | 2 | 2013-02-25T01:20:00.000 | python,pyqt,powerpoint | How to open a powerpoint presentation via python? | 0 | 1 | 1 | 15,058,874 | 1 |
0 | 0 | I'm making a simple game, whereby I want my characters quite customizable. I want my characters to be able to be fully edited in colours, for example, if a player wants their character to have cyan skin, they just put into the sliders, or what I choose to use, "0,255,255", or purple "255,0,255", or something random "25... | false | 15,076,133 | 0 | 0 | 0 | 0 | I assume by image you mean pygame.Surface. You have several options:
pygame.Surface.set_at(...)
Use a palettized surface. Then change the palette. Based on your use case, this is actually probably what I'd suggest.
Use the pygame.PixelArray PyGame module. I don't think it requires NumPy.
Just use NumPy. It's real... | 1 | 2,070 | 0 | 0 | 2013-02-25T20:44:00.000 | python,image,colors,pygame,numerical | PYGAME - Edit colours of an image (makes white red at 255,0,0) without numerical python? | 0 | 1 | 2 | 28,798,012 | 1 |
0 | 0 | Is there anyway the pyc file can be extracted from an Application bundle? I'm referring to an application bundle that was created by using py2app on python code. | false | 15,093,865 | 0.197375 | 0 | 0 | 1 | The pyc files are stored in a zipfile in the Resources folder. The name of the zip file depends on the Python version, for 2.7 it is .app/Contents/Resources/python2.7/site-packages.zip.
That zip file is a regular zipfile that can be manipulated with the usual tools. | 1 | 171 | 0 | 0 | 2013-02-26T16:10:00.000 | python,macos,py2app | extract pyc from Application bundle | 0 | 1 | 1 | 15,098,915 | 1 |
0 | 0 | I am making a little game app that allows users to load up textures manually. One such example would be a standard deck of 52 cards.
Would it be bad to store the processing info as:
Card_79x123_53_53.png
Upon getting the filename from a file dialog, I would split the underscores to get the following info:
ObjectType :... | false | 15,104,090 | 0 | 0 | 0 | 0 | Is there a reason why this is a bad idea or should I keep toying with it?
This is essentially like encoding file type by file extension. The only bad thing about encoding file metadata in the filename is it's quite limited in space. You can encode much richer metadata if you used proper PNG metadata field or in a sepa... | 0 | 65 | 0 | 0 | 2013-02-27T04:13:00.000 | python,png | Is it a bad idea to use a PNG image's filename to store the info on how to process it? | 0 | 2 | 2 | 15,104,289 | 1 |
0 | 0 | I am making a little game app that allows users to load up textures manually. One such example would be a standard deck of 52 cards.
Would it be bad to store the processing info as:
Card_79x123_53_53.png
Upon getting the filename from a file dialog, I would split the underscores to get the following info:
ObjectType :... | true | 15,104,090 | 1.2 | 0 | 0 | 0 | Probably it would be better to ask user about how to process image explicitly either by adding extra controls into file dialog, or by showing another dialog after file dialog is submitted. In this case information taken from file name could be used as hints to preliminary fill these extra controls with values, but use... | 0 | 65 | 0 | 0 | 2013-02-27T04:13:00.000 | python,png | Is it a bad idea to use a PNG image's filename to store the info on how to process it? | 0 | 2 | 2 | 15,104,140 | 1 |
0 | 0 | I wanted to create a file copy program in which progress bar indicates progress. Now if I started n copy/paste operations, that many progress bars should be displayed like windows 8 does.
The program should be like one window, say "SHOW", is displaying QProgressbar for copy/paste of 1st operation. When 2 copy/paste wi... | false | 15,119,751 | 0 | 0 | 0 | 0 | Well create a layout (a vertical layout i suppose) and then create as many QProgressbar you need and add them to your layout with addWidget and that's it.
If you need scrolling, try using a QScrollArea. | 0 | 104 | 0 | 0 | 2013-02-27T18:40:00.000 | python,multithreading,pyqt | How to add new QProgressbar to an existing window? | 0 | 1 | 1 | 15,119,949 | 1 |
0 | 0 | I am using Python 3 with gobject introspection for Gtk. How can I have more than one toggle button linked together so they behave similar to tabs or radiobuttons - e.g. one is selected by default, and when another is clicked the previously active one is de-selected.
I have tried using set_sensetive, but that greys out ... | true | 15,120,746 | 1.2 | 0 | 0 | 3 | Use set_active() (or props.active). Alternatively, you can create some Gtk.RadioButton widgets and set draw_indicator property to False. In the latter case you can create radio groups in normal way, without custom handling. | 0 | 1,466 | 0 | 3 | 2013-02-27T19:32:00.000 | python,button,gtk,radio-button,toggle | How can I link a set of toggle buttons like radio buttons? | 0 | 2 | 3 | 15,123,955 | 1 |
0 | 0 | I am using Python 3 with gobject introspection for Gtk. How can I have more than one toggle button linked together so they behave similar to tabs or radiobuttons - e.g. one is selected by default, and when another is clicked the previously active one is de-selected.
I have tried using set_sensetive, but that greys out ... | false | 15,120,746 | 0.066568 | 0 | 0 | 1 | You listen to the toggle signals on the toggle button then call set_active() on the other ones. You need to block the toggled signals while calling set_active()so that you don't get into a loop. | 0 | 1,466 | 0 | 3 | 2013-02-27T19:32:00.000 | python,button,gtk,radio-button,toggle | How can I link a set of toggle buttons like radio buttons? | 0 | 2 | 3 | 15,135,787 | 1 |
0 | 0 | I am making a GUI in wxpython.
I want to place images next to radio buttons.
How should i do that in wxpython? | false | 15,128,404 | 0 | 0 | 0 | 0 | I'm not sure what you mean. Are you wanting images instead of the actual radio button itself? That is not supported. If you want an image in addition to the radio button, then just use a group of horizontal box sizers or one of the grid sizers. Add the image and then the radio button. And you're done! | 0 | 348 | 0 | 0 | 2013-02-28T05:51:00.000 | wxpython | Adding images next to radio buttons in wxpython | 0 | 2 | 3 | 15,138,009 | 1 |
0 | 0 | I am making a GUI in wxpython.
I want to place images next to radio buttons.
How should i do that in wxpython? | false | 15,128,404 | 0.066568 | 0 | 0 | 1 | I suggest using wx.ToggleButton with bitmap labels if you are using 2.9, or one of the bitmap toggle button classes in wx.lib.buttons if you are still on 2.8. You can then implement the "radio button" functionality yourself by untoggling all other buttons in the group when one of them is toggled. Using the bitmap its... | 0 | 348 | 0 | 0 | 2013-02-28T05:51:00.000 | wxpython | Adding images next to radio buttons in wxpython | 0 | 2 | 3 | 15,145,613 | 1 |
0 | 0 | I have application with QtGui.QSystemTrayIcon and a Qmenu in it. Is there a way to disable and enable it.
I want this to disable when my application is launching, so that user have no option to access the menu items. | false | 15,131,690 | 0 | 0 | 0 | 0 | There are .show() and .hide() methods and a .visible property that allows to show or hide a QSystemTrayIcon.
Is that what you were looking for? | 0 | 798 | 0 | 0 | 2013-02-28T09:18:00.000 | python,pyqt4,system-tray | Disabling System Tray icon in pyqt | 0 | 1 | 1 | 15,135,837 | 1 |
0 | 0 | I currently have a wxPanel that I draw lines, text etc on to in response to paint events by using a device context from wx.PaintDC. However, my drawing can exceed the size of the panel and it continues off the visible screen. The only way to see more of the drawing is to expand the application window, which is impracti... | true | 15,143,323 | 1.2 | 0 | 0 | 2 | It should work with a ScrolledPanel but if you are not going to have other widgets on the panel it is probably not the right answer since it depends on having a sizer to set the virtual size.
Try using a wx.ScrolledWindow instead, and see its sample in the demo for some code. Basically you just need to set the virtua... | 0 | 1,073 | 0 | 0 | 2013-02-28T18:48:00.000 | wxpython,paint,gdi | Scrolling a painted frame in wxPython | 0 | 1 | 2 | 15,146,608 | 1 |
0 | 0 | I am coding for a mouse drag and drop effect on images. Meanwhile, I want to take record of the upper-left point of image each time I dragged and dropped it, are there any ways to get it? | false | 15,171,378 | 0.099668 | 0 | 0 | 1 | What methods are you using to draw the images? It's hard to answer this question without that.
If you aren't already doing this, you could use a class to hold data about your image, such as position and geometry. | 0 | 1,791 | 0 | 0 | 2013-03-02T06:07:00.000 | python,image,drag-and-drop,pygame | How to get image position in Pygame | 0 | 2 | 2 | 15,173,810 | 1 |
0 | 0 | I am coding for a mouse drag and drop effect on images. Meanwhile, I want to take record of the upper-left point of image each time I dragged and dropped it, are there any ways to get it? | false | 15,171,378 | 0.099668 | 0 | 0 | 1 | If you derive your classes from pygame.sprite.Sprite , you can get the position by guy.rect. Depending on if you want center, or toplef, or the full rect:
guy.rect.topleft or guy.rect.center or guy.rect | 0 | 1,791 | 0 | 0 | 2013-03-02T06:07:00.000 | python,image,drag-and-drop,pygame | How to get image position in Pygame | 0 | 2 | 2 | 15,177,879 | 1 |
0 | 0 | In most pygtk widget pages, they contain sections called 'Attributes', 'Properties', and 'Style Properties'. How can I change these properties and attributes? | false | 15,180,320 | 0.049958 | 0 | 0 | 1 | You can change a Widget property by using the Gtk.Widget.set_property(property, value) method. property should be a string. | 0 | 3,329 | 0 | 3 | 2013-03-02T22:44:00.000 | python,styles,gtk,pygtk,pygobject | Editing GtkWidget attributes/properties | 0 | 2 | 4 | 15,180,684 | 1 |
0 | 0 | In most pygtk widget pages, they contain sections called 'Attributes', 'Properties', and 'Style Properties'. How can I change these properties and attributes? | true | 15,180,320 | 1.2 | 0 | 0 | 4 | There are three ways to change properties:
As in zheoffec's answer, use the set_property() function (or set_style_property() for style properties.) This function is actually not necessary in Python, but it is there for completeness because it is part of the C API.
Use the props attribute. Any property that you find in... | 0 | 3,329 | 0 | 3 | 2013-03-02T22:44:00.000 | python,styles,gtk,pygtk,pygobject | Editing GtkWidget attributes/properties | 0 | 2 | 4 | 15,184,441 | 1 |
0 | 0 | I have both text and image in QLabel, so setPixmap won't satisfy my requirement.
As far as I know, QLabel can load image from file by setting HTML label <img src="path_to_file" />. But how can I load image from memory(e.g. QImage)? Because some images are frequently used, it may have performance problem loading the sa... | false | 15,195,880 | 0 | 0 | 0 | 0 | You have two choices:
use two labels, one with the text and one with the image.
use a QPainter to draw the text over the image. | 0 | 1,496 | 0 | 0 | 2013-03-04T06:34:00.000 | python,qt,python-3.x,pyqt | How to insert QImage(or sth like that) into QLabel? | 0 | 2 | 3 | 15,195,943 | 1 |
0 | 0 | I have both text and image in QLabel, so setPixmap won't satisfy my requirement.
As far as I know, QLabel can load image from file by setting HTML label <img src="path_to_file" />. But how can I load image from memory(e.g. QImage)? Because some images are frequently used, it may have performance problem loading the sa... | false | 15,195,880 | 0 | 0 | 0 | 0 | You can also set stylesheet for your QLabel as:-
QLabel{
background-image: url(/images/button.png); | 0 | 1,496 | 0 | 0 | 2013-03-04T06:34:00.000 | python,qt,python-3.x,pyqt | How to insert QImage(or sth like that) into QLabel? | 0 | 2 | 3 | 15,198,050 | 1 |
0 | 0 | I'm creating a program in python, and use GTK for part of it.
Whenever GTK opens, it causes the whole program to stop responding, and not move on to the next process. Ideally, i would like it if the gtk window opened independently to the rest of the program, since the GTK window is just to display information, and the ... | false | 15,271,870 | 0 | 0 | 0 | 0 | If your program has a Gtk UI then the program is supposed to be driven by the GTK main loop. You may be able to run a gtk main loop in a secondary thread, but that it not really a supported configuration and you may run into many more problems | 0 | 159 | 1 | 0 | 2013-03-07T12:58:00.000 | python,gtk | gtk allow background processes | 0 | 1 | 1 | 15,276,223 | 1 |
0 | 0 | I am having some problems with a app we are making with wxWidget/wxPython and PyInstaller.
We have compiled the app into a single exe for windows but:
1) On some machines it will not launch at all. It doesn't generate a error or anything in the app logs. It just stops almost immediately.
2) On some machines it will lau... | true | 15,298,618 | 1.2 | 0 | 0 | 1 | There are a few things you may want to look into:
Did you compile it as "one file"? I have heard that one exe may be blocked by some antivirus programs. It uses a few of hacks to get everything in one executable which may be considered malicious.
Did you compile it as Windows app (no console)? You may want to enable c... | 1 | 374 | 0 | 0 | 2013-03-08T16:24:00.000 | windows,wxpython,wxwidgets,pyinstaller | PyInstaller Created App WIll Launch from cmd but not from explorer | 0 | 1 | 1 | 15,678,526 | 1 |
0 | 0 | Are there any Python game libraries (Pygame, Pyglet, etc.) with support for RPython? Or game libraries specifically made for RPython? Or bindings for a game library for RPython? | false | 15,317,707 | 0 | 0 | 0 | 0 | RPython is not Python. They are different languages even though it just so happens that you can execute RPython code with a Python interpreter and get similar effects (much more slowly) to running the compiled RPython program. It is extremely unlikely for there to ever be any reasonable Python library (game library or ... | 0 | 255 | 0 | 1 | 2013-03-10T00:53:00.000 | python,game-engine,pypy,rpython | Game Library with Support for RPython | 0 | 1 | 2 | 15,564,865 | 1 |
1 | 0 | I will be in charge of teaching a small group of middle school students how to program phone applications. After much research I found that Python might be the best way to go.
I am a website development senior at my university, but I have not used Python before. I understand both ActionScript and Javascript and I thin... | false | 15,319,018 | 0 | 0 | 0 | 0 | Dr. python is a good ide/editor, but its simple to use. If your using linux, you can install it in the software center. I don't know how to install it on OSX/Windows | 0 | 91,831 | 0 | 28 | 2013-03-10T04:46:00.000 | android,python | How do I program an Android App with Python? | 0 | 1 | 5 | 27,331,662 | 1 |
0 | 0 | I have a bunch of objects interacting with each other. They all draw ovals that constitute representations of themselves on a Tkinter Canvas, and store the representation's Tkinter id as an attribute.
How can I make it so when I click one of the ovals, my program will print the other attributes of the object which that... | true | 15,344,185 | 1.2 | 0 | 0 | 1 | When you click on an item, you can get the canvas item id of the one that was clicked on. You would then use this information to look up the actual object. You can either iterate over all your objects looking for one with the given id, or you can keep a dictionary which maps ids to objects. Once you have the actual obj... | 0 | 177 | 0 | 0 | 2013-03-11T16:55:00.000 | python,tkinter | Returning object information after clicking its representation in a Tkinter canvas | 0 | 1 | 1 | 15,344,805 | 1 |
0 | 0 | I am writing a python script(using python clang bindings) that parses C headers and extracts info about functions: name, return types, argument types.
I have no problem with extracting function name, but I can't find a way to convert a clang.cindex.Type to C type string. (e.g. clang.cindex.TypeKind.UINT to unsigned int... | true | 15,388,961 | 1.2 | 0 | 0 | 2 | For RECORD, the function get_declaration() points to the declaration of the type (a union, enum, struct, or typedef); getting the spelling of the node returns its name. (Obviously, take care between differentiating the TYPEDEF_DECL vs. the underlying declaration kind.)
For FUNCTIONPROTO, you have to use a combination o... | 0 | 1,599 | 0 | 4 | 2013-03-13T15:04:00.000 | python,clang,llvm-clang | Extract type string with Clang bindings | 0 | 1 | 1 | 18,359,608 | 1 |
0 | 0 | I have written a very simple script for my raspberry pi that loads an uncompressed WAV and plays it - however when I run the script as root (to be able to use GPIO and ServoBlaster), there is no sound output.
I have set the default audio device to a USB sound card, and this works - I have tested this using aplay fx.w... | true | 15,405,082 | 1.2 | 1 | 0 | 1 | The issue was the sudo command changing the directory in which the script was being run - so running python with sudo -s or simply using an absolute path for the sound fixed it. | 0 | 1,087 | 0 | 0 | 2013-03-14T09:08:00.000 | python,audio,pygame,sudo,raspberry-pi | When running a pygame script as root, no sound is output? | 0 | 1 | 1 | 15,428,577 | 1 |
0 | 0 | So I have a lot of python scripts that I have written for my work but no one in my lab knows how to use Python so I wanted to be able to generate a simple Mac App where you can 'Browse' for a file on your computer and type in the name of the file that you want to save . . . everything else will be processed by the appl... | true | 15,469,799 | 1.2 | 0 | 0 | 0 | Open Automator
Choose "Application"
Drag a "Run Shell Script" onto the workflow panel
Choose "/usr/bin/python" as the shell. Paste in your script, and select Pass Input: "to stdin"
Or, choose bash as the shell, and simply have the automator script run your Python script with Pass Input "as arguments" selected on the to... | 0 | 3,884 | 1 | 3 | 2013-03-18T04:31:00.000 | python,xcode,interface | Is it possible to create Python-based Application in Xcode or equivalent? | 0 | 1 | 3 | 15,469,982 | 1 |
0 | 0 | I have a game, written in Python, and I use Panda3d.
Now I want to have a possibility for restart, that is, I want to press a button with the result that the main is executed again, just as if the current instance of the game had never existed.
Is there a simple way to do this? | false | 15,486,091 | 0.291313 | 0 | 0 | 3 | Not really. Panda3D doesn't really make this abstraction, that's up to the application developer. It depends on the specific case what "restart" really means; do you want to close the existing window and then reopen a new one? If not, then that means that you have to keep many Panda3D objects in place and can't simp... | 0 | 583 | 0 | 1 | 2013-03-18T20:17:00.000 | python,application-restart,panda3d | panda3d - how to restart a game | 0 | 1 | 2 | 15,522,504 | 1 |
0 | 0 | Do you have to have pygame installed to run pygame games? I have programmed a game in pygame on my Raspberry Pi (using the Adafruit WebIDE), and I don't want to have to run it on the Pi itself, so I am planning to use it on my Windows 8 box, and I don't have pygame installed on the Windows box. | false | 15,488,944 | -0.066568 | 0 | 0 | -1 | You cannot run a python program without python installed. However you could make the program an exe file by using a certain converter. Some converters are py2exe, pyinstaller, and cx_freeze. I personally recommend cx_freeze. If you use cx_freeze you must add the line import pygame._view to your source code due to a bug... | 1 | 4,043 | 0 | 1 | 2013-03-18T23:36:00.000 | python,pygame | Do you have to have pygame installed to run pygame games? | 0 | 2 | 3 | 15,625,491 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.