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 | There is a command validatecommand in Entry widget. But there is not a simulated command in Text widget.
How to implement the function in Text widget in tkinter? | true | 31,364,987 | 1.2 | 0 | 0 | 0 | If you want to validate the data when the widget loses focus, you would simply bind a function to the <FocusOut> event. | 0 | 39 | 0 | 0 | 2015-07-12T06:16:00.000 | python,python-2.7,user-interface,python-3.x,tkinter | How to validate the content of a Text widget while this Text widget loses focus? | 0 | 1 | 1 | 31,366,766 | 1 |
0 | 0 | Is there any easy method for opening the text file if you are running your app from the same directory? I can't seem to find anything easy.
I am asking because you can do that with most of the things in kivy (for image: "name.png", for .kv: load_kv("name.kv") and so on) and I don't understand why it wouldn't be similar with finding a text document. | false | 31,368,383 | 0 | 0 | 0 | 0 | Just open('filename') - the path is relative, so if its in the same directory you don't have to do anything special.
If this appears not to work, perhaps it isn't your syntax that is the issue. | 1 | 1,130 | 0 | 0 | 2015-07-12T13:41:00.000 | python,kivy | Open (read, write) a file in same directory as main app - python/kivy | 0 | 1 | 2 | 31,368,591 | 1 |
0 | 0 | What is the scope of root if I have a custom widget embedded in another custom widget? Is there a rule of thumb to avoid confusion? | false | 31,387,311 | 0 | 0 | 0 | 0 | root is global to every widget rule and refers to the top most widget which in most cases is the instance of the class... | 1 | 199 | 0 | 1 | 2015-07-13T15:22:00.000 | python,kivy | Scope of root in kivy language | 0 | 1 | 2 | 31,411,920 | 1 |
0 | 0 | How I can use the Kivy framework in Qpython3 (Python 3.2 for android) app?
I know that Qpython (Python 2.7 for android) app support this framework.
pip_console don't install kivy. I have an error, when I try to install it. Please help me. | true | 31,387,660 | 1.2 | 0 | 0 | 0 | Edit: Kivy now supports python3 on Android, though qpython would still have to include this (or a similar build process) to have kivy work in qpython3.
You can't right now, as kivy does not have a python3-supporting backend on android.
We're working towards adding one, at which point I quess qpython may look at adding support in qpython3. | 0 | 6,003 | 0 | 0 | 2015-07-13T15:39:00.000 | kivy,qpython,qpython3 | Kivy on Qpython3 (Android) | 0 | 1 | 2 | 31,388,789 | 1 |
0 | 0 | I want to create a ToolBarToolBase object without adding it visibly to the toolbar. I've tried instantiating ToolBarToolBase, but I'm using wxPython version 2.8.12.1 (I can't upgrade, I'm doing this for work) so I don't think it's fully implemented. Is there any way to do this? | false | 31,393,074 | 0 | 0 | 0 | 0 | No. That widget is part of the toolbar. Just use a BitmapButton or a PlateButton. They both support images and would be more flexible to use anyway. | 1 | 25 | 0 | 0 | 2015-07-13T20:42:00.000 | python,user-interface,wxpython,toolbar,wxwidgets | wxPython Create a LabelTool without adding it to a Toolbar | 0 | 1 | 1 | 31,393,184 | 1 |
0 | 0 | Is it possible to trigger a function when the mouse stop moving?
For example, I have a scale, and I want to trigger a function when I still holding a button and stop dragging. I used 'ButtonRelease-1' but I had to release a mouse button to be able to trigger a function, it's not what I want.
Hope you guys can help me.
Thank you in advance. | false | 31,399,631 | 0 | 0 | 0 | 0 | No, you can't bind to "mouse stopped moving". However, you can bind to <B1-Motion>, and with each callback set a timer to run in the future. If the mouse hasn't moved within that time the function will be called. Within that function you could use event_generate to generate a custom <<MouseStopped>> event. If the mouse moves before the timer expires, reset the timer.
You get the exactly the same effect as if you bound to the mouse not moving. | 0 | 753 | 0 | 0 | 2015-07-14T06:50:00.000 | python,events,binding,tkinter,mouse | Binding mouse events on 'stop' motion in tkinter python3 | 0 | 1 | 1 | 31,418,783 | 1 |
0 | 0 | I have a wx Popupmenu appear when I left-click on a toolbar LabelTool. I already have a binding to have a handler run when I left click an item in the menu, but I want another popup menu to appear when I right click an item in the original popup menu. I've already tried binding it to wx.EVT_RIGHT_DOWN but it doesn't do it. Whenever I try right clicking on a menu object, it seems it still calls the wx.EVT_MENU, which calls the same handler as a left-click would. How would I implement this? | true | 31,464,191 | 1.2 | 0 | 0 | 0 | As far as I can tell, that is not supported. Besides, no user is going to expect that they need to right click on a context menu anyway. You should rethink your design so it's more intuitive. Perhaps by using a sub-menu instead of a secondary popup menu | 0 | 67 | 0 | 0 | 2015-07-16T20:44:00.000 | python,wxpython,right-click,wxwidgets,popupmenu | Have a popupmenu appear on a popupmenu on right-click | 0 | 1 | 1 | 31,477,578 | 1 |
0 | 0 | I have desktop application in wxpython. User will get notification whenever there is new release available. I would like to create new beta update channel for specific customers. I was thinking of adding check box in the AboutBox. If check box is checked, then user will get update from beta location. There is no way to add check box or other controls in AboutBox. Is there any to achieve this? | false | 31,468,947 | 0 | 0 | 0 | 0 | Not really. But you can create your own about box by rolling your own dialog with wx.Dialog. Then you can put any widgets that you want to in your custom about box. | 0 | 30 | 0 | 0 | 2015-07-17T05:31:00.000 | wxpython | How to add check box control in AboutBox wxpython? | 0 | 1 | 1 | 31,476,854 | 1 |
0 | 0 | I have just started learning OpenCV using Python and the first tutorial starts with capturing video using either in built laptop webcam or external webcam. And as it would happen, I have neither. So I thought if it would be possible to use Camera of my Android Smartphone and then capture that video using IP for further processing.
My Smartphone: Moto E
OS: Windows 7
Language: Python
Android Application : IP Webcam
I have searched the net extensively but am unable to find any working solution, so can anyone please guide me on how to capture the video from my smartphone using IP Webcam.
Sorry for posting no code as I am just trending into this field so am completely clueless.
Thanks. | false | 31,478,137 | 0 | 0 | 0 | 0 | download Droidcam. It can be used by wifi and after that in
cv2.VideoCapture(n) where n can be 1 or 2 for me its 2 you can use mobile cam in python open_cv2 | 0 | 29,328 | 0 | 15 | 2015-07-17T14:25:00.000 | python,opencv,video | Capturing Video from Android Smartphone using OpenCV Python | 0 | 1 | 7 | 71,733,031 | 1 |
0 | 0 | Right now I'm working on a program using wxPython, and I want to make a GUI in which under certain conditions, the widgets become inactive and the user can't interact with them. I'm pretty sure I have seen this in programs before, but I can't come up with a specific example. Is there a way to do this in wxPython? I have no idea what the technical name for this is, so even giving me that would be helpful. | true | 31,480,224 | 1.2 | 0 | 0 | 1 | When you say "the objects", what do you mean? If you mean a wx Frame, then you can call Frame.Freeze() to disable the frame, and Frame.Thaw() to unfreeze it. If you want to create a new dialog that must be interacted with and make all background windows unuseable, you can call Dialog.ShowModal(). Finally, many widgets have a Widget.Enable() function, to which you can pass True or False depending on if you want to enable it or not. | 0 | 85 | 0 | 0 | 2015-07-17T16:14:00.000 | user-interface,wxpython | wxPython inactive state? | 0 | 1 | 1 | 31,480,387 | 1 |
0 | 0 | I need a user input for my pygame program, but I need it on my GUI(pygame.display.set_mode etc.), not just like: var = input("input something"). Does anybody have suggestions how to do this? | false | 31,485,636 | 0 | 0 | 0 | 0 | There are some answers already here. Anyway, use PGU (Pygame GUI Utilities), it's available on pygame's site. It turns pygame into GUI toolkit. There is an explanation on how to combine it and your game. Otherwise, program it yourself using key events. It's not hard but time consuming and boring. | 0 | 113 | 0 | 0 | 2015-07-17T22:30:00.000 | python,pygame | Pygame, user input on a GUI? | 0 | 1 | 1 | 31,485,743 | 1 |
0 | 0 | I'm having an instance of QTablewidget with some columns a few rows and some data in it.
Now I am searching for a way to make the columns fill the full width of the tablewidget. Also, I want all the columns to have the same width.
Is there a way to achieve this? | true | 31,493,324 | 1.2 | 0 | 0 | 4 | This code worked fine for me:
self.tablewidget_preview.horizontalHeader().setStretchLastSection(True) self.tablewidget_preview.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) | 0 | 2,439 | 0 | 0 | 2015-07-18T16:39:00.000 | python-3.x,pyqt,qtablewidget | Make columns fill the full width of QTableWidget | 0 | 1 | 1 | 31,641,703 | 1 |
0 | 0 | I use Python 2.x and Pygame to code games. Pygame has a built-in rect (Rectangle) class that only supports ints instead of floats. So I have made my own rect class (MyRect) which supports floats. Now my question is as follows:
A 2D platformer char moves its position (x, y -> both floats). Now when I blit the char onto the screen, is the position rounded to an int (int(round(x))) or just converted into an int (int(x))? I know this might sound a bit stupid, but I've got an issue with this and I'd like to know how this is usually handled. | false | 31,520,331 | 0.197375 | 0 | 0 | 1 | You should assume that when blitting a pygame.Surface, the position gets converted to an int via int() | 0 | 68 | 0 | 3 | 2015-07-20T15:21:00.000 | python,animation,pygame,2d,sprite | Movement in 2D Games (round position when blitting?) | 0 | 1 | 1 | 31,527,282 | 1 |
0 | 0 | I downloaded some python library package (for example uncompile2) from GitHub. How I can install it into Qpython from the directory in my android device with pip-console? Or at least to try install... | false | 31,526,259 | 0 | 0 | 0 | 0 | You could copy the modules you want installed into the site-packages folder
using a file manager open up the folder:
/sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/
that is where you can put the modules, i have not tried it with the pip console. | 1 | 9,530 | 0 | 3 | 2015-07-20T20:59:00.000 | python,python-2.7,qpython,qpython3 | How to install library with pip-console? | 0 | 1 | 2 | 32,291,741 | 1 |
0 | 0 | I wanted to insert an icon in my GUI. I have already tried inserting one but I need help and want to make it transparent. Can I make the icon transparent in any way? Any help would be appreciated. | false | 31,568,442 | 0 | 0 | 0 | 0 | If you are using tkinter, you can use Python 3: tkinter.iconbitmap(yourIconFilePath) Python 2: Tkinter.iconbitmap(yourIconFilePath)
NOTE: Icon files have the *.ico extension | 0 | 1,083 | 0 | 1 | 2015-07-22T16:07:00.000 | python,tkinter | Make the logo transparent in Python tkinter 3.4 | 0 | 1 | 2 | 31,597,337 | 1 |
0 | 0 | There are two games (A and B), on the left and right screen sides. The game A responds to mouse clicks, the game B — to left/right keydowns.
There is also a server which handles games behaviour:
start(A), start(B)
pause(A), pause(B)
unpause(A)
user clicks on window A, window A gets focus
pause(A), unpause(B)
user tries to press left/right keys, it obviously doesn't focus window B and I can't read keydown events from the game B
I run games as two separate subprocesses (using subprocess.Popen I start a.py and b.py).
Where a.py and b.py are simple pygame games that listen my server events inside their game loop.
Is it possible to share event loop between two different pygame windowed apps?
Or may be it's better to change focus in some OS-specific way? | false | 31,612,336 | 0 | 0 | 0 | 0 | Okay, I have got a solution which works like a charm.
Since we have a server for handling some game events,
we decided to grab a focus inside one game and share all keyboard events
to other games through the server using web sockets. | 0 | 198 | 0 | 0 | 2015-07-24T13:51:00.000 | python,pygame,event-loop | How to switch focus between multiple pygame apps? | 0 | 1 | 1 | 32,638,692 | 1 |
0 | 0 | I would like to change the font size globally in a Python3/Tkinter program. I've managed to do it in the buttons and labels in the main window, but I also have a messagebox in the program that only displays the default font size. | false | 31,622,397 | -0.197375 | 0 | 0 | -1 | Im not certain but I believe you can use ttk to change global font size | 0 | 1,191 | 0 | 0 | 2015-07-25T02:52:00.000 | python-3.x,fonts,tkinter | Changing all font sizes in Tkinter/Python3 | 0 | 1 | 1 | 31,623,769 | 1 |
0 | 0 | I am trying to importing pygoogle by import pygoogle in my main.py but when i make an app via buildozer , in logcat i am finding that no module named pygoogle I have installed pygoogle in my kali linux os and then i went to usr/local/lib/python2.7 and copied pygoogle folder to my home folder where my main.py is.....then i tried again but still same error and then i went distribute.sh -m 'kivy pygoogle everything went good but still was facing same error and then i went to buildozer and in requirments added pygoogle but in aviable module pygoogle is not showing by buildozer .... not with pygoogle only ..with all lbrary i am facing same problem ... any solution some know ???I am not linux expert | false | 31,636,560 | 0 | 0 | 0 | 0 | Since it's a pure python module, and it's on pypi, you can just add it to requirements in buildozer, it doesn't need a specific recipe. | 0 | 49 | 0 | 0 | 2015-07-26T11:43:00.000 | android,python,linux,kivy | Facing issues while importing third party (pygoogle) library in main.py for making android apk via buildozer | 0 | 1 | 1 | 31,639,040 | 1 |
0 | 0 | I am using wxPython to write an app. I have a menu that pops up. I would like to know how to keep it on the screen after the user clicks an item on the menu. I only want it to go away after the click off it or if I tell it to in the programming. Does anyone know how to do this?
I am using RHEL 6 and wxPython 3.01.1 | false | 31,661,138 | 0 | 0 | 0 | 0 | I don't think the regular wx.PopupMenu will work that way. However if you look at the wxPython demo, you will see a neat widget called wx.PopupWindow that claims it can be used as a menu and it appears to work the way you want. The wx.PopupTransientWindow might also work. | 0 | 55 | 0 | 1 | 2015-07-27T18:58:00.000 | python,wxpython | Keep menu up after clicking in wxPython | 0 | 1 | 1 | 31,680,789 | 1 |
0 | 0 | I am new to Python and Tkinter and I am needing to move a button.
I have been using button1.pack() to place the button.
I am not able to move the button from its original position at the bottom of the screen. | false | 31,699,447 | 0.066568 | 0 | 0 | 1 | button1.grid(row = 0, column = 0, padx = 0, pady = 0)
But this cannot be used together with pack(), you need to stick to either one.
And this only orders objects relatively, so if you have only one object and you set the row and column to 40 and 50, respectively, the object will still be on the top left corner. | 0 | 12,820 | 0 | 2 | 2015-07-29T11:40:00.000 | python,python-2.7,button,tkinter | How to move a Tkinter button? | 0 | 1 | 3 | 31,700,809 | 1 |
0 | 0 | I add a vertical gauge which counts from 0 to 100. It works perfectly however it moves from bottom to top. Is there a way to change rotation of it? There is no any setting for that in gauge class. | true | 31,699,938 | 1.2 | 0 | 0 | 0 | Have you considered using a vertical slider as a work around? | 1 | 40 | 0 | 0 | 2015-07-29T12:05:00.000 | wxpython,gauge | Change rotation of vertical gauge in wxpython | 0 | 1 | 1 | 31,782,512 | 1 |
0 | 0 | I've probably been completely oblivious to the answer but I want to turn a Tkinter program into an exe file and all the programs I've found that do so either don't work for Python 3.4 or I can't install properly and I don't know why. Can I have some help please? | true | 31,716,514 | 1.2 | 0 | 0 | 0 | Turns out I was being a derp after all and just downloaded the wrong version of the program I was trying to use which was cx_freeze. | 1 | 171 | 0 | 0 | 2015-07-30T06:25:00.000 | tkinter,exe,python-3.4 | Tkinter program into exe | 0 | 1 | 2 | 31,782,009 | 1 |
0 | 0 | I am trying to make four buttons in a panel receive focus at once. Is this possible? | true | 31,726,919 | 1.2 | 0 | 0 | 1 | No, it is not possible. wxPython does not support setting focus to multiple widgets at once. | 0 | 32 | 0 | 1 | 2015-07-30T14:43:00.000 | widget,wxpython,focus | Can multiple widgets receive focus at once in wxPython? | 0 | 1 | 1 | 31,727,286 | 1 |
0 | 0 | I'm designed a small tool with MFC and python.
In this program, I use C++ to cooperate with python API.
I need:
C++ function A calls Py_Initialize(), and then call python function B with Python API.
In the python script Python function B starts a new python thread E, which will create a new file and make some output to this file.
Then C++ function F calls Py_Finalize(). End.
But things works unexpectedly.
B can be called, but E will not start. After calling F, Py_Finalize() is called, then E will start and create the new file.
I'm wondering what's wrong with this? It seems python is blocked by C++. Does this related with python GIL? If so, what should I do? | false | 31,737,012 | 0 | 0 | 0 | 0 | I solved the problem and would like to paste it here if someone else needs.
After A calls Py_Initialize(), PyEval_InitThreads() is also needed.
After A calls Python function B, GIL needs to be released by PyEval_ReleaseThread(PyThreadState_Get()). Then thread E can startup.
After E is over, PyGILState_Ensure() should be called in C++ to get back the lock. | 1 | 93 | 0 | 0 | 2015-07-31T02:07:00.000 | python,c++,mfc,gil | Create a new Thread in a python script, which is embeded in MFC | 0 | 1 | 1 | 31,738,521 | 1 |
0 | 0 | I appreciate this is a VERY novice question but I just want to check in regard to Tkinter Photoimage class, is it only GIF/PGM/PPM images that it can read from files and nothing else unless I download the Python Image Library.
If thats the case I now know exactly where I went wrong in the code I'm writing. IE: wrong file format | false | 31,762,577 | 0 | 0 | 0 | 0 | That sounds right. There may be another format or two that native Tkinter supports, but it's very limited. There's a more up-to-date version of PIL named Pillow that you might want to look into. It doesn't seem like PIL is being actively maintained, last I looked. If you want to work with JPEG for example, you need PIL (or Pillow). | 0 | 2,941 | 0 | 0 | 2015-08-01T13:50:00.000 | python,tkinter | Python Tkinter PhotoImage file formats supported? | 0 | 1 | 1 | 31,762,715 | 1 |
0 | 0 | When changing the foreground colour of an IntCtrl it acted as if it was not set on every subsequent update, as the colour of the text reverted back to black.
Is there a way to avoid this? | true | 31,764,392 | 1.2 | 0 | 0 | 0 | It took a while to find the answer, so if you have a similar issue the answer lies in default_color and oob_color.
Define it similar to this:
self.Client_rate = ic.IntCtrl(self.panel3,-1,value=0,size=(25,22),default_color=self.txt_colour,oob_color="red")
Then if you need to change the foreground colour alter like this:
self.Client_rate.SetColors(default_color=self.txt_colour, oob_color="red")
I trust this helps someone. Note: requires the spelling "color"! | 1 | 17 | 0 | 1 | 2015-08-01T17:36:00.000 | wxpython | How to prevent IntCtrl() ignoring SetForegroundColour | 0 | 1 | 1 | 31,764,393 | 1 |
0 | 0 | I am using Qt Designer to build a UI. In Qt Designer, in the Signal/Slot editor I set up the following:
Sender: radioButton,
Signal: toggled(bool),
Receiver: checkbox,
Slot: setChecked(bool)
When I run my .py file, as expected, when I select radioButton with the mouse in the user interface, checkbox is checked.
However. if I add a button that calls a function, which includes the following code:
print(checkBox.isChecked())
The boolean value I get in return is 'False', even though the checkbox is visibly checked.
Does anyone know why?
Thanks. | false | 31,779,148 | 0 | 0 | 0 | 0 | the problem is that the
checkBox.isChecked()
method was in the wrong place. It was checked whenever the program was run (where the checkbox was empty) but not afterwards. As it turns out, the signal is generated via mouse after the program is run.
So I added the method to the function that checks the state of the checkbox after a button is clicked.
Please be merciful in grading this post thread :). New to stackoverflow. | 0 | 404 | 0 | 0 | 2015-08-03T03:49:00.000 | python,qt,pyqt4 | PyQt4 isChecked() method | 0 | 1 | 1 | 31,779,357 | 1 |
0 | 0 | I've been writing a Kivy graphical program on Raspberry Pi, with the KivyPie OS (Linux pre-configured for Kivy development).
For some reason, it's running extremely slow if started with sudo.
Normally, running "python main.py", the program runs at about 30 cycles per second.
However, if I do "sudo python main.py", it runs as slowly as 1 cycle per 5-10 seconds.
I need to use sudo to access Raspberry's GPIO. (unless I try some other way to do it, that I see people discuss).
I'm interested, though, what could be the cause of such a massive performance drop with sudo? And is it possible to work around that?
PS: Running the same program on my PC (Linux) with and without sudo doesn't seem to cause such problem. Only on Raspberry. | true | 31,786,122 | 1.2 | 1 | 0 | 0 | Well, I would call this problem solved, even if a few questions remain.
Here are the key points:
The slowdown is caused by Kivy being unable to load the proper video driver under "sudo", and using software rendering instead.
I haven't figured out why the driver isn't loading with sudo or how to fix it. However...
After compiling the program with Pyinstaller, everything works fine. The executable can be started with sudo, GPIO is working, Kivy loads the appropriate driver, everything works fast, as it should.
To sum it up, the reason of the initial problem has been found, no fix for launching the program directly with Python was yet found, but the problem was removed by compiling the program with Pyinstaller. (still, not a convenient way for debugging.) | 0 | 2,524 | 0 | 6 | 2015-08-03T11:31:00.000 | python,raspberry-pi,kivy,sudo | Raspberry Pi Python (Kivy) extremely slow with sudo | 0 | 1 | 2 | 31,861,791 | 1 |
0 | 0 | I'm having some trouble with my Kivy apps when run from the QPython launcher.
If I run the standard pong example, I don't see any output.
This used to work.
So, I suspect that QPython, or Kivy has taken an 'upgrade' which has broken something.
In the past I would be able to swipe down to see the log output icon.
But, now that's no longer there.
Well done QPython, Kivy !!!!
So, what's changed?
And, how am I supposed to check program log output to see why it no longer runs?
Regards
Nick | false | 31,852,534 | 0 | 0 | 0 | 0 | I don't know about qpython's log stuff, but you can see the kivy log output by viewing the logcat stream, e.g. from an attached computer (with developer mode enabled) using adb logcat.
This has always been possible and is the standard way to view the log output with kivy (and with android in general). It sounds like your direct problem relates to a change in qpython. | 0 | 429 | 0 | 1 | 2015-08-06T09:52:00.000 | android,kivy,qpython | Kivy QPython app on Android Moto G phone - no log output | 0 | 1 | 2 | 31,858,806 | 1 |
0 | 0 | I'm creating a program using Python/Tkinter and it involves a main screen with a bunch of buttons. Each button will launch another Python script in the same folder.
I'm trying to create a function that will quit the script and open another. How can this be done?
People have recommended os.system on other similar threads, however everything I've tried has failed to work.
Any ideas/help would be greatly appreciated,
Jarrod | false | 31,867,145 | 0 | 0 | 0 | 0 | I'd consider using subprocess library in python.
import subprocess
p=subprocess.Popen(["python", "my_script_1.py"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output=p.communicate()[0]
Hope this helps. | 0 | 428 | 0 | 0 | 2015-08-06T22:59:00.000 | python,tkinter,launch,os.system | Function to Launch Another Python Script | 0 | 1 | 1 | 31,867,275 | 1 |
0 | 0 | I have a 10 x 10 GridLayout with 100 Image widgets, and on_touch_down, I want the picture that was touched to change to a different picture. Since the touch signal will bubble through GridLayout and all its 100 Image children, I want to do a check in on_touch_down to see if the touch coordinates are within the area occupied by the Image that was touched. How can I find the vertices of the Image, or is there an alternative to my approach? Calculating each Image's four vertices as they are added would be rather difficult since I am stretching these Images.
Many thanks in advance. :) | true | 31,887,058 | 1.2 | 0 | 0 | 0 | self.pos and self.size would have sufficed. How silly of me. | 0 | 74 | 0 | 0 | 2015-08-07T21:42:00.000 | python,python-2.7,user-interface,kivy | How Can I Find the Area/Vertices Occupied By a Widget in Kivy? | 0 | 1 | 2 | 31,888,122 | 1 |
0 | 0 | I was looking for a faster way to blit multiple objects in pygame than the traditional blitting method, in which you have an array or list, and you use a for loop to go and insert each image at its position.
Maybe there is a way of blitting the whole array at once, without having to go value by value throughout the whole array?
Thanks for the ideas and help! | false | 31,926,126 | 0.099668 | 0 | 0 | 1 | use pygame.sprite.Group or multithread the blit method. In pygame 1.9.2alpha, it releases the python gil and allows multi-cpu rendering.
Also look up for pygame dirty rendering. Depending on what you want to draw, this can give you significant speed increase. | 1 | 662 | 0 | 0 | 2015-08-10T17:58:00.000 | python,arrays,pygame,blit | Using arrays to blit multiple objects in pygame? | 0 | 1 | 2 | 31,948,684 | 1 |
0 | 0 | I'd like build the kivy application which will work on 64bit Windows (and if possible 32bit also).
Is it possible that one app will work on both platforms?
Can I use 32bit system to build 64bit app?
This is probably simple questions, but I've never write code for these systems. | true | 31,973,865 | 1.2 | 0 | 0 | 1 | A lot of windows software is still shipped as 32bit-only, because for some reason compat with obsolete 32bit-windows still matters. Alternatively, 32 and 64bit builds are available.
If you write your source code properly (without any assumptions about being able to store a possibly-64bit type in an int), you can make 32 and 64bit builds from the same source. I think this is really unlikely to be a problem for python!
Building 64bit software on a 32bit platform is no problem. You'll only run into trouble if you have a complicated build system that builds some tools (which are part of what gets shipped, so you build them for the target instead of host), but also want to run those tools during the build. | 0 | 302 | 0 | 0 | 2015-08-12T19:32:00.000 | python,windows,x86,x86-64,kivy | Kivy - build 64bit application on 32bit Windows | 0 | 1 | 1 | 31,977,726 | 1 |
0 | 0 | I am a newbie with PySide. I have a QGridlayout with QLabel's and I want to add/remove/update QLabel.
Is it possible to create QList of QLabel with PySide similar to Qt in C++? After I populate the QGridlayout with QLabel and I want to dynamically increase/decrease the number of items in QGridlayout.
Is QListWidget/QListWidgetItem only way to create list in PySide? Can it be used with QLabel/QPixmap? | true | 31,996,847 | 1.2 | 0 | 0 | 0 | Sure. The python code will look just like C++ would look, sans syntax adaptations.
No. You can use a QStandardItemModel, or a custom model. In addition, there's no point to creating QLabel delegates for model data, since all standard views handle images and pixmaps available from Qt::DecorationRole. If all you want is a list of images, even a custom model would be trivial. | 0 | 432 | 0 | 0 | 2015-08-13T19:28:00.000 | python,qt,pyqt,pyside | List of QLabel in PySide/Qt | 0 | 1 | 1 | 31,998,434 | 1 |
0 | 0 | "pygame ImportError: No module named pygame"
I get this on my Android Moto G phone when running a simple QPython script.
I should point out that this script used to work - so I suspect that QPython, Android, pygame, or something has taken an auto upgrade which has gone bad.
I tried to install pygame in the pip console, but it told me that pygame was already installed.
So, what's gone wrong !!! ????
Thanks. | false | 32,010,208 | 0.197375 | 0 | 0 | 1 | The shell is telling you it cannot find the module named "pygame"
The module "pygame" is either not installed or you have typed the name incorrectly.
Try reinstalling the pygame module | 0 | 986 | 0 | 0 | 2015-08-14T12:32:00.000 | android,pygame,kivy,qpython | What does this mean?: "pygame ImportError: No module named pygame" | 0 | 1 | 1 | 32,010,262 | 1 |
0 | 0 | When using TextInput in Kivy, everything that is entered is kept as a string, even when the input is restricted to characters that represent floats or ints using input_filter. How can TextInput.text be converted into an actual float or int type so that I can do calculations with it? | false | 32,028,928 | 0 | 0 | 0 | 0 | Why couldn't you just grab the TextInput.text and convert it using float or int? ie text = TextInput.text for an int.. conversion = int(text) | 1 | 3,422 | 0 | 0 | 2015-08-15T20:13:00.000 | python,kivy | Kivy: How to convert user input into int or float | 0 | 1 | 3 | 32,028,953 | 1 |
0 | 0 | I'm running Windows 8.1 64bit but have Python 2.7.10 32bit. Now I'm trying to install PyQt using Windows installer. What version should I download?
PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe Windows 64 bit installer
PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe Windows 32 bit installer
I have 64bit windows but 32bit Python and I want to make a 32bit executables.
I think that I should install 32bit, is it true? | false | 32,139,820 | 0.197375 | 0 | 0 | 1 | Yes I would guess you're right since python will link to PyQt they should be based on the same architecture ! | 1 | 1,155 | 0 | 1 | 2015-08-21T12:02:00.000 | python,windows,pyqt,32bit-64bit | What version of PyQt should I install (32 vs 64) | 0 | 1 | 1 | 32,139,874 | 1 |
0 | 0 | Is it possible to capture a screenshot of a wxpython GUI program when the program menu on the menu bar drops down?. I attempted to do this by pressing the print screen key on my keyboard but it didn't work.
Nevertheless, the print screen function key works fine when the menu on the menubar does NOT drop down.
I noticed I can take screenshots of other GUI programs on my system when their menu options are seen .
If this is possible, what codes can I place in my program to facilitate a successful screenshot when any menu is showing? | false | 32,148,604 | 0.197375 | 0 | 0 | 2 | I just tried "Shift-prt scr" on my Windows 8.1 to capture a screen with a menu shown (used the wxPython demo) and it worked for me.
You can also use a screen capture utility, e.g. I often use IrfanView, to do this, with it I set a timer to capture things which go away when the window looses focus. | 0 | 320 | 0 | 1 | 2015-08-21T20:14:00.000 | python,wxpython | How to take a screenshot of a Wxpython GUI program when menu drops down on menubar | 0 | 1 | 2 | 32,154,356 | 1 |
0 | 0 | I know that you can set undo=True for a Text widget, and then press CTRL + Z and CTRL + Y for undo and redo.
But I was wondering if there was a function I could bind to a button or something like that. | true | 32,150,994 | 1.2 | 0 | 0 | 1 | The text widget has both an edit_undo() and edit_redo() method, which is what the built-in bindings use. You can call these methods from a button or menu item if you wish. | 0 | 115 | 0 | 0 | 2015-08-22T00:13:00.000 | python,text,tkinter,undo-redo | Calling a function when undoing or redoing in a Text widget | 0 | 1 | 1 | 32,151,274 | 1 |
0 | 0 | I've got PyQt4 and pyqt4-dev-tools installed on my raspberry pi but I'm getting
ImportError: No module named PyQt4 on my Raspberry Pi
with the following includes when I run python3
from PyQt4 import QtGui
from PyQt4 import QtCore
I've got another Pi that PyQT4 is found so I'm not sure what I've done wrong on this one. Can anyone tell me what I can do to get Python to find the PyQt4 modules? | true | 32,173,695 | 1.2 | 1 | 0 | 0 | Most likely you installed PyQt4 and pyqt4-dev-tools for Python 2.x, but not for Python 3.x.
Check if PyQt4 is in your site-packages directory for Python 3.x. For me this is under /usr/lib/python3.4/site-packages/PyQt4.
If it's not there, you need to grab the correct Python 3 version of the packages. What distro are you using? | 0 | 8,273 | 0 | 0 | 2015-08-24T02:27:00.000 | python,python-3.x,import,pyqt4 | ImportError: No module named PyQt4 on my Raspberry Pi | 0 | 1 | 1 | 32,173,862 | 1 |
0 | 0 | I have a C-function which returns a struct data type with several items in it (size_t, char*, int, unsigned and other structs). When I call this function there is no output in python. After some googling I think the problem is that I didn't declare the data type in my interface file. But this turns out to be not that easy. What is the right approach: typemaps or just a simple typedef?
Can someone help me? | true | 32,178,005 | 1.2 | 0 | 0 | 2 | You need to %include the header first. You need the headers for the nested structs too, in dependency order!
After you've done that, Swig should automatically wrap the struct so that a call to your function will return a proxy object with the appropriate members.
A typemap is for when you want to change Swig's default behaviors. | 0 | 667 | 0 | 0 | 2015-08-24T08:47:00.000 | python,c,struct,swig,return-type | Return Struct data type from C-function in Python via SWIG | 0 | 1 | 1 | 32,178,123 | 1 |
0 | 0 | Is there any way to have an event for hovering/clicking on a drawn line on the Canvas widget (not the widget itself)? | false | 32,186,447 | 0.197375 | 0 | 0 | 1 | You can put a tag on the line and then bind Enter or Button-1 to the tag with the tag_bind method of the canvas widget. | 0 | 59 | 0 | 1 | 2015-08-24T15:46:00.000 | python,tkinter,tkinter-canvas | Run event on hovering on drawn line on canvas in python's tkinter gui | 0 | 1 | 1 | 32,186,808 | 1 |
0 | 0 | I've tried everything to get this to work and nothing worked. I tried installing all of the binary directories for Kivy but it didn't work. Is there a very simple way to allow Sublime Text to understand Kivy language.
I am using Windows 10 with Python 2.7.10. | false | 32,195,042 | 1 | 0 | 0 | 6 | For enabling highlighting of Kivy language in Sublime Text make following steps:
Press Ctrl + Shift + P
Write IP (install package)
Chose "Install Package"
Write KV
Found KIVY install pack.
Press it.
In right bottom part of window Sublime Text you will seen "Plain Text". Press this and in this Syntax Bar choose Kivy Syntax.
Maybe it's not what you looking for, but when I looking solutions for my problem I found this topic and here was solution without method explanation. | 1 | 2,803 | 0 | 2 | 2015-08-25T03:22:00.000 | python,text,sublimetext2,kivy | How do you add the Kivy directories so Sublime Text can compile using Kivy language? | 0 | 1 | 2 | 60,463,882 | 1 |
0 | 0 | I'm developing an app using wxpython for use specifically with a Microsoft surface, which requires text input. Is there a way to automatically bring up the onscreen keyboard when an input box is selected? | false | 32,228,920 | 0 | 0 | 0 | 0 | You can create an onscreen keyboard with wxPython for your applications. If you want keyboard to appear when you click your app's wx.TextCtrl, you just need to bind wx.EVT_LEFT_DOWN and/or wx.EVT_LEFT_UP events to it. However, if you want keyboard to appear when any app's input is clicked then it is really hard to achieve, instead you can assign a function key to popup. | 0 | 397 | 0 | 0 | 2015-08-26T14:05:00.000 | windows,input,wxpython,tablet,on-screen-keyboard | Opening onscreen keyboard wxpython | 0 | 1 | 1 | 32,413,608 | 1 |
0 | 0 | I think my question is already asked, but I didn't find any topic about that.
When I try somme script with kivy, I have sometimes errors (such as undeclared variable, bad indentation...), but Qpython don't display them.
I lunch kivy with:
"#qpy:kivy"
and consequently, there is no console. A log is however present, but it's empty.
Is there a way to remedy this ?
Should I add a line to display error ?
Thanks
Simon
PS: The "print" command is also useful, but not working (no console). I think it's the same problem. | false | 32,247,747 | 0 | 0 | 0 | 0 | The newest 1.2.0 version had fixed this blank log issue. | 1 | 143 | 0 | 0 | 2015-08-27T11:07:00.000 | kivy,qpython | How to display error occurred in script? | 0 | 1 | 1 | 32,610,342 | 1 |
0 | 0 | That is, without doing focus_set on some other widget?
The original post ended with the sentence above, but it did not meet quality standards. These standards demand that the problem is described completely, including what one has tried. They insist on proper grammar too.
Well, it is not really a problem, just a question. I tried to find a widget method, say, focus_unset, that would do the trick. I didn't. My grammar is proper. Maybe the robotic police is confused with terms like focus_set? | false | 32,255,872 | 0 | 0 | 0 | 0 | No. Some widget must have focus. You can set focus to the root window if you don't have any other widgets that naturally accept keyboard input. | 0 | 193 | 0 | 0 | 2015-08-27T17:29:00.000 | python,tkinter | Is there a way to make s tkinter widget lose focus? | 0 | 1 | 1 | 32,257,282 | 1 |
0 | 0 | So I was looking around at different things to do on Python, like code for flashing text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you're not meant to copy them straight in, but one error I got was 'no module named wx'. I learned that I could get that module by installing wxPython. Problem is, I've tried all 4 options and none of them have worked for me. Which one do I download and how do I set it up using Windows?
Thanks | false | 32,284,938 | 1 | 0 | 0 | 7 | 3 steps to install wx-widgets and pygame in python IDLE
Install python 3xxx in your system opting (Add 3xxx to your path).
open python CLI to see whether python is working or not.
then open command prompt (CMD).
type PIP to see whether pip is installed or not.
enter command : pip install wheel
enter command : pip install pygame
To install wxpython
enter command : pip install -U wxPython
Thats all !! | 1 | 91,741 | 0 | 20 | 2015-08-29T10:15:00.000 | python,windows,download,wxpython | How to properly install wxPython? | 0 | 2 | 10 | 48,046,623 | 1 |
0 | 0 | So I was looking around at different things to do on Python, like code for flashing text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you're not meant to copy them straight in, but one error I got was 'no module named wx'. I learned that I could get that module by installing wxPython. Problem is, I've tried all 4 options and none of them have worked for me. Which one do I download and how do I set it up using Windows?
Thanks | false | 32,284,938 | 0 | 0 | 0 | 0 | Check the version of wxpython and the version of python you have in your machine.
For python 2.7 use wxPython3.0-win32-3.0.2.0-py27 package | 1 | 91,741 | 0 | 20 | 2015-08-29T10:15:00.000 | python,windows,download,wxpython | How to properly install wxPython? | 0 | 2 | 10 | 54,313,732 | 1 |
0 | 0 | I have a WPF application.It has a iron python script editor using AvalonEdit. We were able to validate and run the iron python scripts using this application.
But we need to integrate an iron python debugger in to this application.
Can anyone suggest better solution for this? | false | 32,353,881 | 0 | 0 | 0 | 0 | You could take a look at pdb and dbd. This are some very useful modules. You could go through the code and integrate it in your application. | 1 | 256 | 0 | 3 | 2015-09-02T12:59:00.000 | wpf,ironpython,avalonedit | Iron python debugger for my application | 0 | 1 | 1 | 33,526,046 | 1 |
0 | 0 | I have created a .py and .kv file for my game, now I must package it. I, however, do not own a mac. I have a linux and a windows computer, I prefer linux. Is it possible for me to make an Iphone app without using a Mac? | false | 32,445,682 | 0.53705 | 0 | 0 | 3 | I think it's technically possible (though against apple's TOS) to use a virtual machine, though there are many problems you can encounter in setting this up.
It may also be possible to use some online provider, but I don't think I've seen an example of this with kivy in particular.
There's no way to do it natively on linux, due to apple's toolchain requirements. | 0 | 1,543 | 0 | 5 | 2015-09-07T20:32:00.000 | python,ios,linux,kivy | How can I package a Kivy IOS app while on linux? | 0 | 1 | 1 | 32,484,689 | 1 |
0 | 0 | I'm using a ttk treeview like a table full of testdata and I'd like to highlight now the values which are out of range.
Therefore I'd like to color single values (or the background color of this value) in a item and not the whole item (row).
Is this possible?
I've found one example where this problem is solved with a treeview per column, but this is not possible, because I don't want to color the whole column, but just one value...
r | false | 32,495,332 | 0.197375 | 0 | 0 | 1 | The Treeview widget doesn't allow you to change the color of individual values. You can change the color of an entire row, but not just a single value within a row. | 0 | 1,417 | 0 | 2 | 2015-09-10T07:07:00.000 | python,treeview,ttk | python ttk treeview: Different background or font color for values in item | 0 | 1 | 1 | 32,788,603 | 1 |
0 | 0 | I am looking to take a .exe file I've built using cx_Freeze, move it to my desktop, and have the ability to execute it while allowing it to reference the necessary directory. When I copy and paste the application, it tries to find its necessary files on the desktop rather than in the original directory.
Currently, all my files (including the .exe file) for this program are in the directory C:\Users\my_name\PycharmProjects\PROGRAM_DIRECTORY\build\exe.win32-3.4. I would like to take the file PROGRAM.exe, move it to my desktop (for more accessible execution) while still permitting it to reference all of the necessary files in the C:\...\exe.win32-3.4 directory. Is this possible? | false | 32,526,329 | 0 | 0 | 0 | 0 | Copying the .exe file from the directory and pasting it to the desktop will create a shortcut that has a default reference directory of its new location (the desktop), and this cannot be changed. A way around this is:
-Right click on the desktop
-Select "New > Shortcut"
-Browse for the .exe file or copy the directory into the field and add \PROGRAM.exe after it
-Name the shortcut
This shortcut will direct the execution to the parent file which remains in its necessary directory (C:\...\exe.win32-3.4) rather than trying to reference the desktop as the directory. | 0 | 146 | 0 | 0 | 2015-09-11T14:51:00.000 | python,windows,tkinter,exe,cx-freeze | Python/ Tkinter/ cx_Freeze: Creating standalone .exe application outside directory | 0 | 1 | 1 | 32,526,330 | 1 |
1 | 0 | I have just started using django imagekit. I have a list view page where the images are of dimensions 270 x 203 (30 KB approx.) and same images have a size of 570 x 427 (90 KB approx.) in the details view page.
I wanted to know;
Should have create 2 different images for each image with different size and dimensions.
if the answer to the 1st query is yes. How to do it on Django Imagekit.
PS: I am planning to use django Imagekit on the form level. | true | 32,531,308 | 1.2 | 0 | 0 | 0 | Based on the answer provided by kicker86. I plan to retain single image. | 0 | 95 | 0 | 1 | 2015-09-11T20:03:00.000 | python,django,django-class-based-views,django-imagekit | django imagekit - list view and details view image | 0 | 1 | 1 | 32,639,949 | 1 |
0 | 0 | I'm using Fedora 21. Installed the python3-tkinter package using yum install python3-tkinter. The package gets stored in the /usr/lib64/python3.4 directory. Is there a way to use pip to install tkinter?
Have a virtualenv setup with python3. When I try to run my program within that virtualenv I get:
ImportError: No module named 'tkinter'.
Does it make sense to copy the package directories from /usr/lib64/python3.4 to the site_packages folder associated with the virtualenv? | false | 32,540,787 | 0 | 0 | 0 | 0 | I was using python 3.3.2 interpreter. Turns out the default packages installed when running the command yum install python3-tkinter are set to work with python 3.4.1 interpreter. Configuring my virtualenv to use the python 3.4.1 interpreter proved to be the solution as the python interpreter was then able to find the required libraries in it's path. | 1 | 1,536 | 0 | 0 | 2015-09-12T15:55:00.000 | python-3.x,tkinter,virtualenv,yum,fedora-21 | Installation of tkinter on python3 | 0 | 1 | 1 | 32,723,786 | 1 |
0 | 0 | I have Python 3.4.3 installed on an older laptop (Pentium 4) with Windows XP.
It seems that half the time when the Python shell is open, the CPU usage goes up to 12-13%.
It is the Python shell itself, not any Python script it may have launched, and not the IDLE text editor.
I have yet to figure out the pattern when it goes up and when it does not. CPU usage actually goes to zero when I begin to debug a tkinter based script.
The shell window is opened by clicking on IDLE shortcut, if it makes any difference.
I have resorted to closing the shell until I need it, while I am working in IDLE editor.
Any idea why this happens and can this be remedied? | false | 32,551,405 | 0 | 0 | 0 | 0 | IDLE normally runs in two processes: one to run the graphical user interface, one to run your code. The processes currently communicate through a socket. Each process polls the socket for input 20 times a second. The user process also calls tk update in case the use is using tkinter but is not running mainloop.
I have a 6-core Pentium with gigabytes of memory and SSD main drive running 64-bit Win10. I currently have 5 IDLE shells running and 5 corresponding user processes: installed 2.7, 3.4, 3.5, 3.6, and development build of 3.6. Task Manager mostly shows each at 0%. One occasionally bumps up to .7%. This would be a much higher % on a single core machine. This seems to happen more often with the 3.4 IDLE.
I can only speculate that some combination of less memory, slower memory, less CPU cache space, much slower swap to disk, old single-core laptop chip with fewer instructions, and older OS with fewer system calls results in the difference.
Does your laptop have its maximum memory?
How often when using IDLE is the 12% an actual problem? (I guess that partly depend on time on battery versus power cord.) | 0 | 2,211 | 0 | 1 | 2015-09-13T15:40:00.000 | python,shell,python-idle | Python Shell High CPU Usage | 0 | 1 | 1 | 38,809,051 | 1 |
0 | 0 | Is it possible with gspread or other Python-based access to Google Spreadsheets to insert an image into a spreadsheet?
Also, is it possible to make rich text cells (e.g., bold, italic, different fontsize, colors, etc.)? | true | 32,570,491 | 1.2 | 0 | 0 | 5 | The question is a bit old, but today I had to check this for myself, so this may be useful for people that arrive here.
Insert an image: I'm not sure if inserting images as objects (as in the Google Sheets UI) is possible, but one way of doing it is setting the content of the cell to =IMAGE("<url of image>"). I believe the image here needs to be a public link, so a direct link to a protected Google Drive resource wouldn't work (even if the user has permission to access it).
Formatting cells: Now there is package gspread-formatting to do this, but it could be also done calling the v4 of spreadsheets API. | 0 | 1,698 | 0 | 9 | 2015-09-14T17:28:00.000 | python,google-sheets,gspread | Does the Google Spreadsheet Python API or gspread allow images or rich text? | 0 | 1 | 1 | 56,837,998 | 1 |
0 | 0 | I use %include wchar.i in C# and it seems to work correctly for all wchar_t values and arrays mapping to C#'s string. Swig's library for Python also contains the typemaps for wchar_t in wchar.i file.
Java's library doesn't have wchar.i. What's the reason for that? And also how I can achieve type mapping from wchar_t types in C++ to String in Java? | false | 32,572,114 | 0 | 0 | 0 | 0 | As you are using c++, than you can try with std::wstring as it has typemaps for all: C#, Python and Java. It is in std_wstring.i | 0 | 426 | 0 | 2 | 2015-09-14T19:07:00.000 | java,c#,python,c++,swig | SWIG: wchar_t support for Java | 0 | 1 | 1 | 32,615,679 | 1 |
0 | 0 | During IPython 3 times, I could make my custom IPython.html.widgets.DOMWidget span the full width of the notebook by setting it's width trait (corresponding to the CSS width of the widget div) to 100 %. In Jupyter 4, that does not work anymore, the widget gets squashed to the left edge of the notebook. Web inspector tells me that the parent div.widget-subarea essentially has zero width up to padding. Is that a new feature or a bug? What is the exact widget API to achieve a full-width widget? I guess I'm bound for trouble if my widget's JS just sets the width of the parent wrapper to 100 % as well... | true | 32,585,703 | 1.2 | 0 | 0 | 0 | Apparently, that was due to a bug in the version of Jupyter I was using. The style for .widget-subarea in widget.css has gained a flex: 2 1 0%; property since, which was missing before, despite display: flex;. | 0 | 686 | 0 | 0 | 2015-09-15T12:08:00.000 | widget,ipython-notebook,jupyter | IPython/Jupyter notebook widget span full width | 0 | 1 | 1 | 33,165,242 | 1 |
0 | 0 | I'm using pygame with a joystick controller. The joystick controller is not calibrated correctly, though. The right horizontal controller continually outputs bad values and does not zero correctly upon return to center position. Is this fully a hardware issue, or is there a method of calibration/continual calibration using pygame or another library? | false | 32,595,475 | 0 | 0 | 0 | 0 | I had to calibrate my joystick by using software provided when I bought the joystick. I couldn't find a way to do so with pygame.
Are the outputs actually incorrect though? My outputs are never zero'd, but my program functions properly when using them. | 0 | 378 | 0 | 0 | 2015-09-15T20:56:00.000 | python-2.7,pygame,user-input,joystick | Python pygame calibrate joystick controller | 0 | 1 | 1 | 32,722,976 | 1 |
0 | 0 | I am trying to capture text from a Text Input box and fire off a function after the text is inputted. Only problem is the event is fired everytime a character is entered. I would like the event fired after all characters have been entered in the text input box. How could i delay the firing until all characters have been entered?
I tried to override the on_text method but did not solve my problem as it is this method that is being called 20 times. I also tried putting in a sleep in the on_text but it just buffered the responses and still fired 20 times. | false | 32,639,137 | 0.197375 | 0 | 0 | 1 | Do exactly what you're already doing, but have the function you're calling check if whatever condition you're after is met. For instance, if you want to call it after 5 characters have been entered, check the length of the string.
This seems an awkward way of working though, are you sure you want to check after every character rather than, say, wait for the user to press enter? | 0 | 133 | 0 | 0 | 2015-09-17T20:10:00.000 | python-2.7,kivy | How do I delay an event in Kivy? | 0 | 1 | 1 | 32,649,566 | 1 |
0 | 0 | I have a tkinter-based gui that has a sidepanel with comboboxes. They are all contained within a frame for easy packing.
Thing is if I put a "long_test_level_for_instance" the width of the combobox grows to accommodate that(whether such a string is selected or not)
What I would like is a fixed width combobox/frame. Is this doable? it was a pain todo it in GTK but I found a way, it is automatic in qt and I am wondering now for tk
--edit--
self.framePLOTSEL.pack_propagate(False) in conjunction with width=...
This however clips the content of the combobox when it is expanded (its expected to be clipped when collapsed) | true | 32,683,912 | 1.2 | 0 | 0 | 0 | The combobox widget has a width attribute which you can use to control the width of the combobox. However, the dropdown menu will always be the same width as the control, so you won't be able to see all of the characters in long items. | 0 | 61 | 0 | 0 | 2015-09-20T20:22:00.000 | python,python-3.x,tkinter,ttk | TK combo boxes & restricting their size | 0 | 1 | 1 | 32,696,645 | 1 |
0 | 0 | After a ttk.Button has been created, the name of the callback function can be obtained in various ways. But is there a way to obtain the callback function itself?
The use case is that I want to use the button's callback function in the callback function to be assigned to another widget.
Currently I'm assigning the button's callback function to an additional attribute of the Button object after creating it. That's redundant, though, and I'd like to get the callback function directly from the Button object itself, if possible. | true | 32,719,789 | 1.2 | 0 | 0 | 2 | No, there is no supported way to get the command via introspection. Your solution of adding it as an attribute is a perfectly reasonable thing to do. If you're bothered by the fact it takes two lines of code instead of one, you can subclass the button to hide that detail. | 0 | 34 | 0 | 1 | 2015-09-22T14:36:00.000 | python,tkinter | How can the command function be obtained from a Tkinter button? | 0 | 1 | 1 | 32,720,291 | 1 |
0 | 0 | I just made an apk app using kivy. In the code, I defined the positions of all widgets according to scale of the screen. However, when I rotate the screen, say, from portrait to landscape, the absolute coordinates still stay the same, and it doesn't fit in very well.
Is there a method to identify whether portrait or landscape is being displayed? I need this in order to re-define the positions of my widget when user rotates the phone. | true | 32,751,538 | 1.2 | 0 | 0 | 0 | It would be much better to just not use absolute coordinates, but rather to use kivy's layout classes to achieve relative positioning (you can also specify the relative positioning manually but that's harder and more verbose, and you're just reinventing the layouts if you do it).
In any case, the direct answer to your question is that there may be an android api function you can call to get the orientation if you really want, or in reality you presumably care specifically about the window size which is exposed by kivy.core.window.Window.size | 0 | 888 | 0 | 0 | 2015-09-24T00:29:00.000 | android,python,rotation,kivy,buildozer | How to identify whether the screen is in Portrait or Landscape in Kivy | 0 | 1 | 2 | 32,758,159 | 1 |
0 | 0 | I'm just wondering (as im starting to make a game with pygame) is there a way to 1) Run a program that only opens a GUI and not the shell
and
2) Run the program without having to edit with idle (I'd like to do this so the game will look more professional.
I would like to just have a desktop shortcut or something that when clicked, runs only the GUI and doesnt show my code or show the shell. | false | 32,771,481 | 0.197375 | 0 | 0 | 1 | If you're on windows, a quick thing could be to make a one-line batch script.
start pythonw.exe <filename>
The start keyword causes the shell to not wait for the program to finish.
pythonw vs python prevents the python terminal from appearing.
If you're on linux/mac, you could do the same with shell scripts. | 0 | 87 | 0 | 0 | 2015-09-24T21:48:00.000 | python,pygame,python-idle | How to make the text shell not appear when running a program | 0 | 1 | 1 | 32,771,570 | 1 |
0 | 0 | I don't really want to move the whole world in my game but I do want the screen to follow my character.
So for example, normally pygame would render at the position of 0,0 and the window height width would allow you to expand that viewing area. But I want to move the starting position so that I can view something at coordinates 1000x1000 even if my screen is only 500x500 big. | false | 32,802,726 | 0 | 0 | 0 | 0 | Is it possible to make camera tracking without moving the whole world?
No.
By relativity, moving the player within the world is the same as moving the world around the player. Since your camera is fixed on the player, by definition you will see the world moving when the player moves within it. Therefore, you must draw your world in a different place.
It is more explicit in 3D graphics; we represent the scene's motion as one matrix, and the camera's as another. The renderer uses their product. It doesn't care which contributed to the motion. | 0 | 24 | 0 | 0 | 2015-09-26T22:39:00.000 | python-3.x,pygame | Is it possible to make camera tracking without moving the whole world? | 0 | 1 | 1 | 32,802,814 | 1 |
0 | 0 | Is there a command in Tkinter that allows the program to pop up a window that lets the user pick a printer from the list of drivers that they have installed?
Sorry that I can't provide any details, but I haven't found anything about this topic on the web. | false | 32,811,951 | 0 | 0 | 0 | 0 | No, there is not. You'll have to create your own popup window for that specific problem. | 0 | 62 | 0 | 0 | 2015-09-27T19:26:00.000 | python,printing,tkinter | Tkinter Print function[filedialog] | 0 | 1 | 1 | 32,812,217 | 1 |
0 | 0 | I've got a Python GUI (wxPython) which wraps around a fortran "back-end," using f2py. Sometimes, the fortran process(es) may be quite long running, and we would like to put a progress bar in the GUI to update the progress through the Fortran routine. Is there any way to get the status/progress of the Fortran routine, without involving file I/O? | false | 32,873,308 | 0 | 0 | 0 | 0 | At high risk of being down voted, if you know roughly how long each task is going to take, the simplest option is base the progress on how much time has elapsed since the task started, measured against the expected duration of the task.
To keep it relevant you could always store the run duration for the task each time and use that, or an average, as your base time-line.
Sometimes, we can over over complicate things ;) | 0 | 185 | 0 | 1 | 2015-09-30T18:34:00.000 | python,fortran,wxpython,f2py | Updating long-running Fortran subroutine in Python GUI using f2py | 0 | 1 | 3 | 32,882,987 | 1 |
0 | 0 | I'm using Tkinter to create a window in python and a canvas to display graphics in the window. This is working fine so far.
But I have a two dimensional list containing colours that I would like to directly place on the canvas.
Example
I have a class defined (named CRGB) that has three variables: r, g and b. These are the red, green and blue values of a colour, and are integers between 0 and 255.
I also have a two-dimensional list, which contains CRGB objects with the colour data.
I then have a Canvas (defined in a variable called screenCanvas) which is the same size as the 2D list.
How would I transfer the pixels from the 2D list to the canvas?
Notes: I would like the code to work on Mac AND Windows, and not use any external libraries (libraries not included in Python by default.) | true | 32,922,630 | 1.2 | 0 | 0 | 2 | The canvas has no way to draw an individual pixel, except to draw a line that is exactly one pixel long and one pixel wide.
If you only need to place pixels, and don't need the other features of the canvas widget, you can use a PhotoImage object. An instance of PhotoImage has methods for setting individual pixels. | 0 | 2,388 | 0 | 1 | 2015-10-03T12:35:00.000 | python,list,canvas,tkinter | Drawing individual pixels to a canvas in tkinter | 0 | 1 | 1 | 32,924,414 | 1 |
0 | 0 | I had a pretty general question.
I'm used to programming my main code inside def main():
But when I made a GUI using TKinter and put it inside my main code none of my variables worked! After putting my GUI on indent 0 code the GUI finally worked, but any functions I activated using my GUI didn't have my variables! Does anyone know what to do?
Also, if my GUI takes input values and stores them in a variable and activates a function, will that function need to have this variable passed into it? Or does it already know?
Programming on Jetbrains Pycharm in Python 3.4. | false | 32,939,832 | 0 | 0 | 0 | 0 | The simple fact is, GUI code is no different than any other python code. It can go wherever you want. The exact same rules apply for widgets as they do for integers and strings and anything else in a python program. Local variables are only visible locally, global variables are visible everywhere within a module, and instance variables are accessible to anything inside an object, or anything that has a reference to an object. | 1 | 41 | 0 | 0 | 2015-10-05T00:37:00.000 | function,user-interface,python-3.x,tkinter,parameter-passing | Where do GUI's go in a general application | 0 | 1 | 1 | 32,940,178 | 1 |
0 | 0 | Is there a way to get a clear window in Pygame?
I know that I can have a borderless window, but is it possible to get rid of everything inside of the window to make it clear? I want to make some stuff that works on top of my desktop, but it needs a shape that isn't rectangle. I do know that it would still be a rectangle, I just don't want it to look like one. | true | 32,950,512 | 1.2 | 0 | 0 | 0 | I do not believe this is possible within regular Pygame. A Google search turned up "Window Manager Extensions", though, which explicitly supports non-rectangular windows. | 0 | 85 | 0 | 0 | 2015-10-05T14:02:00.000 | python,window,pygame | How Do I Make A Clear Window in Pygame | 0 | 1 | 1 | 32,959,873 | 1 |
0 | 0 | Last week I was given a requirement for an already crowded display/input screen written in wxPython (data stored in MySQL database) to show the first 24 characters of two free format comment fields but to allow up to 255 characters to be displayed/input. For instance on entry the screen might show “Right hip and knee X-ra” whilst the full entry continues “ys requested 24th September in both laying and standing positions with knee shown straighten and bent through 75 degrees”. Whilst I can create a wxtextCtrl that holds more characters than displayed (scrolls) I cannot work out how to display/enter the contents as a multiline box when selected. I have gone through our wxPython book and searched online with no joy. | false | 32,965,937 | 0.099668 | 0 | 0 | 1 | The simplest way to do it I see would be to store only the abbreviated contents in wxTextCtrl itself normally and only replace it with the full contents when the user is about to start editing it (i.e. when you get wxEVT_SET_FOCUS) and then replace it with the abbreviated version again later (i.e. when you get wxEVT_KILL_FOCUS). | 0 | 109 | 0 | 0 | 2015-10-06T09:07:00.000 | wxpython,wxwidgets | wxtextCtrl To Allow Input/Display Of More Text Than Default Display | 0 | 2 | 2 | 32,968,457 | 1 |
0 | 0 | Last week I was given a requirement for an already crowded display/input screen written in wxPython (data stored in MySQL database) to show the first 24 characters of two free format comment fields but to allow up to 255 characters to be displayed/input. For instance on entry the screen might show “Right hip and knee X-ra” whilst the full entry continues “ys requested 24th September in both laying and standing positions with knee shown straighten and bent through 75 degrees”. Whilst I can create a wxtextCtrl that holds more characters than displayed (scrolls) I cannot work out how to display/enter the contents as a multiline box when selected. I have gone through our wxPython book and searched online with no joy. | false | 32,965,937 | 0 | 0 | 0 | 0 | Have you considered using my.TextCtrl.SetToolTipString() and setting it to the same value as the textctrl contents. In this manner only the first 24 characters show in the textctrl but if you hover over it the entire string will be displayed as a tooltip. | 0 | 109 | 0 | 0 | 2015-10-06T09:07:00.000 | wxpython,wxwidgets | wxtextCtrl To Allow Input/Display Of More Text Than Default Display | 0 | 2 | 2 | 33,018,442 | 1 |
0 | 0 | Do you know an easy way to make an "history" on a QLineEdit in PySide/PyQt?
Example: Whenever Enter is pressed, the typed text will be stored, and pressing the "up" or "down" arrows allows you to navigate through the history.
Thank you very much | true | 32,972,145 | 1.2 | 0 | 0 | 6 | Blah....
I just figured that the QComboBox does exactly what I want to do when the "setEditable" is on...
It has a completer, and an history of whatever was typed in the textfield! | 0 | 1,457 | 0 | 5 | 2015-10-06T14:09:00.000 | python,pyqt,pyside,maya,qlineedit | PyQt QLineEdit with history | 0 | 1 | 1 | 32,972,495 | 1 |
0 | 0 | I have an image of a map. I would like to make the left and right (East and west) edges of the map connect so that you can scroll forever to the right or left and keep scrolling over the same picture. I've looked around and can't find anything on the topic (likely because I don't know what to call it). I would also like to have the picture in a frame that I can grab and drag to move the picture around. I was trying to do this in Tkinter, but I have a feeling there are probably easier ways to do this. | false | 33,000,288 | 0 | 0 | 0 | 0 | (actually, you are asking 2 different, not very precise questions)
scroll forever: Independent from python a common approach is to
mirror the images at the edges so you can implement a virtually
endless world from 1 or some images (tiles of the map).
GUI framework/API: From my experience Qt (so in your case maybe PyQt) is
well documented and designed to quite easily realize OS independent
GUI. | 0 | 180 | 0 | 0 | 2015-10-07T18:57:00.000 | python,tkinter,python-imaging-library,tkinter-canvas | Connecting edges of picture in python | 0 | 1 | 2 | 33,000,636 | 1 |
0 | 0 | When I change the defaulttheme-0.png of my Python Kivy installation, my App appears different when launching it as .py on Ubuntu. But if I now "convert" it to an .apk and run it on my mobile (Android 5.1.2) it appears as before, without the theme being changed.
What do I have to do, to tell kivy/buildozer to integrate the theme into the .apk?
What I tried:
- Normally running "sudo buildozer android debug"
- Deleting all files created by "sudo buildozer init" and calling that one again
- And of course I searched Google, but as I didn't found anything, I hope you can help me, because my App would be almost done after fixing that problem... | true | 33,002,726 | 1.2 | 0 | 0 | 2 | Instead of changing the theme in a local kivy installation, place the image in a folder named data/images in your app's directory (i.e. ./data/images/defaulttheme-0.png from your app script).
Edit: it is also necessary to copy the atlas file to this location, as noted by Tshirtman. | 0 | 358 | 0 | 0 | 2015-10-07T21:29:00.000 | android,python,apk,kivy,buildozer | Python Kivy: Changing defaulttheme-0.png won't change final .apk design | 0 | 1 | 1 | 33,002,817 | 1 |
1 | 0 | I have a working program written in Java (a 3d game) and some scripts in Python written with theano to process images.
I am trying to capture the frames of the game as it is running and run these scripts on the frames.
My current implementation grabs the binary data from each pixel in the frame, saves the frame as a png image and calls the python script (using ProcessBuilder) which opens the image and does its thing.
Writing an image to file and then opening it in python is pretty inefficient, so I would like to be able to pass the binary data from Java to Python directly.
If I am not mistaken, processBuilder only takes arguments as strings, so does anyone know how I can pass this binary data directly to my python script? Any ideas?
Thanks | false | 33,029,293 | 0 | 0 | 0 | 0 | If there is no limit to the length of the string argument for launching the python script, you could simply encode the binary data from the image into a string, and pass that. The only problem you might encounter with this approach would be null characters and and negative numbers. | 0 | 250 | 0 | 0 | 2015-10-09T03:13:00.000 | java,python,subprocess,jython,processbuilder | Passing binary data from java to python | 0 | 1 | 1 | 38,824,000 | 1 |
0 | 0 | I'm currently working on a simple GUI written using the Tkinter library for Python that makes use of two different frames. With a button I can switch between the two frames making only one of the two visible at a time.
There's one specific button that I would require to use in both frames. Is it possible to place it in different frames?
Of course I have several back-door solutions to my problem, like creating a button that makes use of the same variables and commands, but what I would like to know is if it is possible to use exactly the same button. | true | 33,038,821 | 1.2 | 0 | 0 | 1 | You can place a button in whatever frame you want (with the exception you can't move a widget between toplevel windows). However, the button can't appear in two frames at the same time.
It's certainly possible to move the button when you switch frames, though I would either move the button to a common toolbar, or just have two buttons that call the same functions. Moving the button around adds complexity without giving much extra value in return. | 0 | 154 | 0 | 0 | 2015-10-09T12:53:00.000 | python,tkinter,widget | Using the same button in different Tkinter frames | 0 | 1 | 1 | 33,040,441 | 1 |
0 | 0 | I want to set a window's size, and then be able to resize it while the program is running. I've been able to make the window large, but I can't resize it smaller than the original set size. For a different project, I would also like to know how to make it so the window is not resizable at all. | true | 33,057,049 | 1.2 | 0 | 0 | 3 | For the first question: Gtk.Window.resize(width, height) should work. If you use set_size_request(width, height), you cannot resize your window smaller than these values.
For the second question: Gtk.Window.set_resizable(False) | 0 | 41 | 0 | 1 | 2015-10-10T17:42:00.000 | python,resize,pygtk | PYGTK Resizing permissions | 0 | 1 | 1 | 33,057,480 | 1 |
0 | 0 | I'm interesting in making games in my future, and I've heard that my favourite game's engine is made with c++, but its embedded with python. I have little experience with programming, but I greatly understand how object orientation works. | false | 33,088,102 | 0.197375 | 1 | 0 | 2 | Why would someone need/want to embed a scripting language into a programming language?
The main reason obviously is to allow to provide extensions to the game engine without need to recompile the entire game executable program, but have the extensions loaded and interpreted at run time.
Many game engines provide such feature for extensibility.
... but I greatly understand how object orientation works.
Object orientation comes in with the interfaces declared, how to interact with the particular scripts.
So python is itself an object oriented language which supports OOP principles quite well.
For instance integration of non OOP scripting languages, like e.g. lua scripts (also oftenly used for extensions), makes that harder, but not impossible after all. | 0 | 159 | 0 | 2 | 2015-10-12T18:44:00.000 | python,c++,scripting,embedded-language | What is the purpose of embedding a scripting language into a programming language in a game engine? | 0 | 1 | 2 | 33,088,189 | 1 |
0 | 0 | What do I have to do so that the function that I bind with the <KeyPress> event only triggers once, even when I hold the key? | false | 33,088,597 | 0 | 0 | 0 | 0 | There may be nothing you can do. It could very well be that the keyboard itself is sending multiple events (ie: it's a hardware problem that can't be solved with software).
These events are probably coming very close together -- maybe every 100ms or so. You can use that knowledge to affect how you process events. For example, you can only do something special on a key release if it was at least 200ms after the last press. | 0 | 836 | 0 | 0 | 2015-10-12T19:16:00.000 | python,events,triggers,tkinter,keypress | Python: Tkinter Keypress Event Trigger once: Hold vs. Pressed | 0 | 1 | 2 | 33,089,284 | 1 |
0 | 0 | I have a ship that shoots lasers. It draws a line from itself to (mouseX, mouseY). How can I have the ship accelerate in the exact opposite direction as if being pushed backwards?
I have been working through some trig and ratios but am not making much progress. Acceleration is constant so how far the mouse is doesn't matter, just the direction.
I've been primarily working on trying to create a vector that only works with integers in the range (-4,4), as I cannot have the ship move across the screen at a Float speed, and the (-4,4) range would at least give me... 16 different directions for the ship to move, though I'd like that not to be a limitation. | false | 33,172,753 | 0 | 0 | 0 | 0 | The vector of acceleration will be in the direction from the mouse cursor to the ship, away from the mouse position - so if the line from mouse to ship is at angle theta to horizontal (where anticlockwise theta is +ve, clockwise is -ve), so will the force F acting on the ship to accelerate it. If ship has mass M then using f=ma, acceleration A will be F/M. Acceleration in x axis will be A * cos(theta), in y A * sin(theta) - then use v=u+at after every time interval for your simulation. You will have to use floating point maths for this calculation. | 0 | 185 | 0 | 0 | 2015-10-16T14:19:00.000 | python,vector,pygame,trigonometry | How to have an object run directly away from mouse at a constant speed | 0 | 1 | 3 | 33,172,964 | 1 |
0 | 0 | I am creating an application with Tkinter that contains a grid of widgets. Is there anyway to mimic the behavior of bootstrap such that all the elements appear on the window after it is collapsed? | false | 33,280,111 | 0 | 0 | 0 | 0 | There are three ways to insert elements in a tkinter window.
First you could use only yourelement.pack() to put the element, and every element you put after, it will be downside the first align at the center.
You could use yourelement.pack() and yourelement.place(x=xx,y=xx,width=xx,height=xx) to place the element where you want according to your x and y values.
And last of all but not less important, you could use yourelement.grid(row=xx,column=xx) to place the element in the window on a grid you have previously defined.
This last way to place the element is redimensionable, but a little bit difficult to assemble all the things in the window, but it's a thing of try and fail. | 0 | 1,698 | 0 | 2 | 2015-10-22T11:38:00.000 | python,tkinter | Bootstrap Behavior in Tkinter | 0 | 1 | 1 | 44,626,762 | 1 |
0 | 0 | I have made a GUI for my application. All scripts are in Python (2.7) and the GUI is created with Tkinter. I work on Linux, but I needed this app to be executable on Windows. So I've used py2exe, to create an executable. After a while it is working almost perfectly, but I have the following problem:
Somewhere in the application, I need to call external programs, namely ImageMagick and LaTeX. I use the commands convert, pdflatex, simply by importing os module and running os.system(build), where build = 'convert page.pdf page.gif'etc. When those commands are called from the *.exe application the console pops up (meaning a console window opens up for a split of a second and closes again). Is there a way, to prevent this behaviour?
It does not interrupt the application, but it is ugly and not a desired behaviour.
[Note] I chose not to add any samples, since there are lots of files and other content, which, I think, is not related to the problem. I could however try to post minimal (not)working example. But maybe it is not needed.
Thanks! | false | 33,352,574 | 0 | 0 | 0 | 0 | import subprocess
subprocess.Popen("application.exe", shell = True) | 1 | 893 | 0 | 0 | 2015-10-26T18:01:00.000 | python,windows,tkinter,console,py2exe | How to stop console from poping up when command is called from python GUI? | 0 | 1 | 1 | 33,352,759 | 1 |
0 | 0 | I can not find which is the main event for the checkbox in the kv file.
I tried on_checkbox_active but raise an error.
I tried on_active but does nothing (and do not raise any error)
on_release, on_press but obviously give me an error.
this is my basic test code line: on_active: print("hello")
What is the event that run when click on a checkbox?
thank you guys | true | 33,399,351 | 1.2 | 0 | 0 | 0 | The event raised when the state of the checkbox is changed is on_active. If you have a problem with it, post a simple runnable example demonstrating the issue. | 0 | 730 | 0 | 0 | 2015-10-28T18:55:00.000 | python,user-interface,checkbox,event-handling,kivy | Why Kivy checkbox active event not work? | 0 | 1 | 1 | 33,402,193 | 1 |
0 | 1 | I want to use "tkinter", "opencv" (cv2) and "numpy" in windows(8 - 64 bit and x64) with python2.7 - the same as I have running perfectly well in Linux (Elementary and DistroAstro) on other machines. I've downloaded the up to date Visual Studio and C++ compiler and installed these, as well as the latest version of PIP following error messages with the first attempts with PIP and numpy
first I tried winpython, which already has numpy present but this comes without tkinter, although openCV would install. I don't want to use qt.
so I tried vanilla Python, which installs to Python27. Numpy won't install with PIP or EasyInstall (unless it takes over an hour -same for SciPy), and the -.exe installation route for Numpy bombs becausee its looking for Python2.7 (not Python27). openCV won't install with PIP ("no suitable version")
extensive searches haven't turned up an answer as to how to get a windows Python 2.7.x environment with all three of numpy, tkinter and cv2 working.
Any help would be appreciated! | false | 33,418,678 | 0 | 0 | 0 | 0 | Finally did it with .whl files. Download them, copy to C:\python27\Scripts and then open "cmd" and navigate to that folder with "cd\" etc. Once there run:
pip install numpy-1.10.1+mkl-cp27-none-win_amd64.whl
for example.
In IDLE I then get:
import numpy
numpy.version
'1.10.1' | 0 | 170 | 0 | 0 | 2015-10-29T15:41:00.000 | python,windows,opencv,numpy,tkinter | tkinter opencv and numpy in windows with python2.7 | 0 | 2 | 2 | 33,434,056 | 1 |
0 | 1 | I want to use "tkinter", "opencv" (cv2) and "numpy" in windows(8 - 64 bit and x64) with python2.7 - the same as I have running perfectly well in Linux (Elementary and DistroAstro) on other machines. I've downloaded the up to date Visual Studio and C++ compiler and installed these, as well as the latest version of PIP following error messages with the first attempts with PIP and numpy
first I tried winpython, which already has numpy present but this comes without tkinter, although openCV would install. I don't want to use qt.
so I tried vanilla Python, which installs to Python27. Numpy won't install with PIP or EasyInstall (unless it takes over an hour -same for SciPy), and the -.exe installation route for Numpy bombs becausee its looking for Python2.7 (not Python27). openCV won't install with PIP ("no suitable version")
extensive searches haven't turned up an answer as to how to get a windows Python 2.7.x environment with all three of numpy, tkinter and cv2 working.
Any help would be appreciated! | false | 33,418,678 | 0 | 0 | 0 | 0 | small remark: WinPython has tkinter, as it's included by Python Interpreter itself | 0 | 170 | 0 | 0 | 2015-10-29T15:41:00.000 | python,windows,opencv,numpy,tkinter | tkinter opencv and numpy in windows with python2.7 | 0 | 2 | 2 | 33,441,221 | 1 |
0 | 0 | ok, I've got into programming with python and thus far was having a fair amount of success. I've typed up a program that uses pyautogui to automates atask I need to do on a monthly basis.
I took Screenshots of where I needed the mouse to click and when all was done I had a working program that searched the screen for the button to clicked, controlled the mouse that location, and printed out the report I needed. So, all I needed to do was plug it into the task scheduler and it would do the work for me!
Several days afterwards, I decided to go ahead and schedule it. I ran the program again, and it crashed! Long Story short, the screen shots didn't match. I took a screen shot again, and zoomed both images 800% in Paint, and check the pixel next to the "I" in The two different images and sure enough the rgb values are different.
I tried several other places to, and while they looked the same... The rgb values are different by maybe one or two points! I'm curious as to why is this happening! | false | 33,426,380 | 0 | 0 | 0 | 0 | Use confidence, default value is 0.999. Reason is pyscreeze is actually used by pyautogui which has the confidence value which most likely represents a percentage from 0% - 100% for a similarity match. Looking through the code with my amateur eyes reveals that OpenCV and NumPy are required for confidence to work otherwise a different function would be used that doesn't have the confidence value.
for example:
by doing pyautogui.locateCenterOnScreen('foo.png', confidence=0.5) will set your confidence to 0.5, which means 50%. | 0 | 1,631 | 0 | 1 | 2015-10-29T23:25:00.000 | python,pyautogui | Pyautogui - Problems with Changing Screenshots | 0 | 1 | 1 | 38,478,105 | 1 |
0 | 0 | I know that tkinter has issues working with virtual envs due to the binaries not being copied and that there are workarounds if I'm just using virtual envs, but what about the autogenerated virtual envs generated by tox? Is there any way to use something like tkinter with tox? | false | 33,442,707 | 0.197375 | 0 | 0 | 1 | Not yet but hopefully soon someone will address this problem and create a compatible virtual env. | 1 | 88 | 0 | 0 | 2015-10-30T18:31:00.000 | python,windows,tkinter,virtualenv,tox | Can tkinter work with tox (on windows)? | 0 | 1 | 1 | 33,454,458 | 1 |
0 | 0 | I'm trying to run a sample Theano code that uses GPU on windows.
My python (with python-dev and Theano and all required libraries) was installed from Anaconda.
This is the error I run into:
Cannot open include file: 'Python.h': No such file or directory
My Python.h is actually in c://Anaconda/include/
I'm guessing that I should add that directory to some environmental variable, but I don't know which. | false | 33,473,848 | 1 | 0 | 0 | 14 | If you are using Visual Studio in Windows, right-click on your project in the Solution Explorer and navigate as follows: Properties -> C/C++ -> General -> Additional Include Directories -> Add C:/Anaconda/include/ (or wherever your Anaconda install is located) | 1 | 20,029 | 1 | 13 | 2015-11-02T08:54:00.000 | python,windows,theano | Windows missing Python.h | 0 | 1 | 1 | 46,394,599 | 1 |
0 | 0 | I have an large frame of a wide array of elements. Within this frame, there are basically two different sides to the frame. Consider a widget x on the left side, which is placed by .grid(row=4, column=0). Padding is added to this object x, so it is actually x.grid(row=4, column=0, pady=10) Well, the opposite object, object y, is placed on the same row by y.grid(row=4, column=4), or something along those lines. I have this setup, but the pady on x is adding padding to y as well. I want there to be padding on one widget in the row-- not the entire row. Therefore, my paraphrased question is, how does one add padding to only one widget in a row, without adding padding to every object in that respective row? | false | 33,506,328 | 0 | 0 | 0 | 0 | The very definition of a row is that is the same height all the way across. That's what makes it a row. The same can be said for columns.
Therefore, the tallest item in a row (height plus padding) is what controls the overall height of the row. The only control you have over smaller widgets is which sides of their too-large cell they stick to.
For example, if you want all widgets to be aligned along their tops, use sticky="n", which causes the top of the widgets to "stick" to the top (north) side of the space they have been allocated. If you want them aligned along their bottoms, use sticky="s". Providing neither "n" or "s" means they will be aligned along their midpoints. | 0 | 767 | 0 | 0 | 2015-11-03T18:19:00.000 | python,tkinter,widget | How to add padding to a widget, but not the entire row's widgets, in tkinter? | 0 | 1 | 2 | 33,507,438 | 1 |
0 | 0 | So i think this is possible but I'm not sure...
Im creating a login system for my program, the main screen is a tinter GUI root window, when this is created it is then .withdraw() and the top level login window is opened (this is stored in another module in a class). When the username and password are correct in the login top level window i want to .deiconify() the root window from within a method of the login window class. Is this possible and if so how....
Sorry i haven't got the code with me so can't upload any right now
Thank You! | true | 33,511,004 | 1.2 | 0 | 0 | 3 | Sure it's possible. Just call root.deiconify(). You can either pass root as a parameter to the login window, or make it a global variable. | 0 | 3,137 | 0 | 1 | 2015-11-03T23:23:00.000 | python,user-interface,tkinter | Tkinter GUI - deiconify() top level window from a top level window class in another module | 0 | 1 | 1 | 33,511,107 | 1 |
0 | 0 | Being new to QPython, didn't find any reference
about developing on a Mac or Pc, eventually
deploying the code on the Android device.
In contrast to developing the code itself on the Android device
which seems very awkward specially for larger projects.
I wish to write the code using a "normal" IDE such as IntelliJ
using my Mac or Windows, eventually deploy it on an Android device,
and execute with QPython.
So the following questions come to mind:
Best practice to transfer source code to an Android device with QPython installed (not using the QR Code which is limited to few KB's of code)
Is it possible to develop QPython code on Mac/Windows namely using the SL4A (androidhelper) or is it strictly available on the Android device itself
I have more questions but would be better to have the basic best practices.
Ps. to give a context in relation to question #1 we need to rapidly deploy QPython code on many devices quickly, so copying the .py files manually is out of the question, and the QR code feature is very limited, so perhaps create a script that imports a script? (via git or HTTP) | false | 33,511,359 | 0.379949 | 0 | 0 | 2 | You can develop qpython project as other python projects with your pc or MC, and upload the project into your mobile's /sdcard/com.hipipal.qpyplus/projects/ then run it in qpython.
The qpython project should contain the main.py which is used for the project first launch script.
Besides adb (android develop tool), you can use the qpython's FTP service ( You could find it in setting page ) or other FTP app to upload the project into your mobile.
GOOD NEWS: In the newest qpython(1.2.2), it contains a qedit4web.py which allow you develop from browser and edit and run code from your mobile. | 0 | 2,614 | 0 | 3 | 2015-11-03T23:53:00.000 | android,python,sl4a,qpython | QPython development environment using mac or windows | 0 | 1 | 1 | 34,069,082 | 1 |
0 | 0 | I would like plot circles or ellipses in Pyqtgraph gl.GLViewWidget(). However I did not find a function to do that.
Anyone know the way to do that? | false | 33,525,279 | 0.066568 | 0 | 0 | 1 | As a regular user of pyqtgraph I do not believe that it has functions for generating circles or ellipses. I believe that you would have to define the circle and ellipse functions yourself and generate the points of the circle or ellipse from those. | 0 | 2,153 | 0 | 0 | 2015-11-04T15:11:00.000 | python,plot,geometry,ellipse,pyqtgraph | Pyqtgraph: How do I plot an ellipse or a circle | 0 | 1 | 3 | 34,653,828 | 1 |
0 | 0 | I have to create a game in Python for University and it should run on Windows.
Now I have found kivy and I am asking myself, if kivy is even better than pygame or is it just for touch displays and I better use pygame?
We don't have touch displays btw!
The questions are, is kivy easier to program, easier to learn or more efficiently?
P.S.: I'm aware of the fact, that pygame is part of kivy! | true | 33,562,616 | 1.2 | 0 | 0 | 3 | I personally find kivy better than pygame. The latter one is kind of outdated and doesn't get much support today while kivy is still growing and gaining new possibilities. It's also not true that kivy is only for touch displays. It's completely multiplatform so you can create a kivy app for almost any operating system without needing to change anything in your code! Although you might get a little bit better performance with pygame, kivy is much more intuitive framework and if you don't aim to create a Crysis I'd go with kivy. Cheers!
P.S. You couldn't make anything like Crysis even with pygame :D If you want to create a 3D game in Python you better use kivent, a 3D engine written in C with Python API dedicated for kivy. | 0 | 4,160 | 0 | 2 | 2015-11-06T08:39:00.000 | python,touch,kivy | When I write a game for Windows, should I use kivy or pygame? | 0 | 1 | 1 | 33,562,894 | 1 |
0 | 0 | I created a Pyside QT GUI app (Python 2.7) and part of the spec is to launch it automatically when the system starts. Normal init.d stuff doesn't seem to work since it's a GUI app.
So far I've tried x11 init.d and xdg xyz.desktop solutions and they don't seem to work.
How would you solve this?
How are Pyside apps auto started on system boot?
(Debian Wheezy) | false | 33,599,791 | 0 | 0 | 0 | 0 | Ok after hours and hours of fooling around I figured it out. I actually used the built-in startup manager in GNOME. I tried this before but it didn't work. So this time I created an entry to start gnome-calculator.. the built in calculator.
Then I edited the entry in ~/.config/autostart/gnome-calculator.desktop using gedit (gedit ~/.config/autostart/gnome-calculator.desktop). I changed Exec=gnome-calculator to Exec=python /home/me/myapp.py
and it works.
Yes it is a lame solution and it doesn't identify what the problem was but it's a start. Thanks for the help. | 0 | 121 | 0 | 0 | 2015-11-08T22:30:00.000 | python,qt,debian | How can I auto start a python/pyside GUI | 0 | 1 | 2 | 33,642,196 | 1 |
0 | 0 | I am making a p2p chat program in Python 3 using Tkinter. I can paste Korean text into the Entry widget and send to the other user and it works.
However, I can't 'type' Korean into the widget directly.
Why is this happening?
I am using Mac OS X Yosemite. | true | 33,603,442 | 1.2 | 0 | 0 | 0 | As mentioned by @mohit-bhasi, upgrading my python version to 3.8 which has tkinter 8.6 in it solved the problem. I can now type Korean directly into the widgets.
Only caveat is that I need to press right arrow once when I finished typing to have the last letter appear. Otherwise, the last letter is not recognized. | 0 | 669 | 0 | 4 | 2015-11-09T06:16:00.000 | python,unicode,tkinter,tkinter-entry | Python Tkinter Entry. I can't type Korean in to the Entry field | 0 | 1 | 2 | 61,833,731 | 1 |
0 | 0 | I'm looking to write a program to change the DPI setting on my logitech G502 mouse (My goal being to use the program with AutoHotkey to help automate a task where I switch my DPI allot and to learn a bit about USB). I'm fairly fluent in C++ , C# and python. But I'm not at all knowledgeable on USB or drivers.
So far I have: used the program USBlyser to identify a Control transfer sent to my mouse when using Logitech's software, which byte of the data corresponds to my DPI setting, and the product ID and Vendor ID of my mouse.
After looking around on the net I decided PyUSB would be a good option for communicating to my mouse. After installing libUsb for use with PyUSB I realised that this then replaces my current mouse driver and makes it unusable.
Am I just going about this all wrong? In my head all I want to do is send to my mouse the data "10 FF 0E CA 01 00 00", should I instead be somehow communicating with my existing logitech driver to do this? Or can I set-up libUsb without interfering with existing drivers?
Any help will be appreciated, cheers Bradley. | false | 33,638,747 | 0.197375 | 0 | 0 | 1 | libusb doesn't interfere with anything. In PyUSB you choose to communicate directly with the device. To do this any other app holding this USB port have to be stopped.
Windows driver in your mouse case.
I think it may be possible for you to push the DPI activation code while driver is still using mouse, but how, I have no idea now.
Or you may detach mouse temporarily , pass the code, and then release mouse back to Windows, hoping that DPI config wouldn't be reseted.
If that doesn't pass, you may always completely emulate mouse driver. It is very easy.
There are code samples for PyUSB on internet on how to interpret mouse data. So you do it and you pass the recognized command to OS either directly through Windows API or using PyMouse library.
In this case you do not need driver, because your program is one, and it sends to mouse whatever you want.
You have a lot of options how to do what you want.
For instance, if this is only for your local use, and there is interface already doing what you want, automate that interface using pywinauto to perform a macro to activate/disable higher DPI.
There are more possibilities.
You can replace Windows driver with your own version, which will support what you wish, thus making your own layer in mouse stack. But this is extreme.
I think you should start in order I wrote:
See whether you can use PyUSB to send bytes needed without detaching mouse from OS
If not, see whether detaching mouse, changing DPI, and returning mouse back to OS using PyUSB keeps the set DPI.
3.1 If not, make your own artificial driver using PyUSB and PyMouse
or
3.2 Use pywinauto to automate the existing interface to change DPI for you. | 0 | 800 | 0 | 1 | 2015-11-10T20:15:00.000 | python,usb,driver,libusb,pyusb | Communicating to USB devices in windows 7 and still use pre-existing drivers? | 0 | 1 | 1 | 33,641,552 | 1 |
0 | 0 | If so, how would this be done? If not, is there a conventional way to achieve the same effect? | true | 33,646,840 | 1.2 | 0 | 0 | 0 | Thank you, PM 2Ring.
For posterity, the answer is that you can bind multiple callbacks to a signal in GTK3. They will be called in the order they were bound in. | 0 | 463 | 0 | 0 | 2015-11-11T08:39:00.000 | python,callback,gtk3 | Is it possible to set multiple callback functions for a given event with GTK (Python)? | 0 | 1 | 1 | 33,658,899 | 1 |
0 | 0 | I have a window with a treeview and an entry widget. I would like to be able to write in the entry widget while still being able to use the up/down arrows to navigate the treeview. There are a few ways I've tried doing this:
Send all keyboard events to both widgets (I have tried using custom bind_tags, unsuccessfully)
Use the entry <Up> and <Down> bindings to navigate the treeview (I have not found a straightforward way to move up and down a tree with multiple parents and children, such as a file directory)
Use the root <Key> binding to selectively send raw keycodes to the entry widget so things like backspace and left/right arrow work as expected (I haven't come across a method to send keycodes/events directly to the entry widget) | true | 33,646,953 | 1.2 | 0 | 0 | 1 | Your #2 is the right approach. You will have to write methods that calculate how to move up and down the tree. You can get the currently selected item, then use the .next() method to get the next child of the same parent. If that returns an empty string you can get the parent (by calling .parent()) and call .next() on it. You can recursively keep doing that until you hit the end of the tree (the parent is the root node, and .next() returns the empty string). | 0 | 112 | 0 | 0 | 2015-11-11T08:46:00.000 | python,user-interface,tkinter,widget,treeview | Split keyboard entry between two Tkinter widgets | 0 | 1 | 1 | 33,649,692 | 1 |
0 | 0 | So I am attempting to make a little audio player using Pygame. I wanted to add a little audio visualizer similar to in Windows Media Player. I was thinking of starting with an audio wave that scrolls across the screen. But I'm not sure where to start.
Right now I'm just using pygame.mixer to start, stop, and pause the music. I think I would have to use pygame.sndarray and get some samples but I don't know what to do from there. What can I do to turn those samples into a visual audio wave? | false | 33,701,621 | 0.197375 | 0 | 0 | 1 | Check out the pygame.draw methods.
You can probably take the audio values and map them to one of the draw options - like draw.arc or draw.line. You will have to map the signal output to values that remain within the X and Y max and min of the viewport.
Processing can do the same thing, but is a bit easier to implement if you are interested in learning the scripting language. It has methods specifically for doing the mapping for you and you can do some pretty extreme visuals without a lot of code. | 0 | 753 | 0 | 2 | 2015-11-13T20:56:00.000 | python,audio,pygame | Audio visualization | 0 | 1 | 1 | 33,701,749 | 1 |
Subsets and Splits