Web Development
int64
0
1
Data Science and Machine Learning
int64
0
1
Question
stringlengths
35
6.31k
is_accepted
bool
2 classes
Q_Id
int64
5.14k
40.5M
Score
float64
-1
1.2
Other
int64
0
1
Database and SQL
int64
0
1
Users Score
int64
-6
163
Answer
stringlengths
19
4.91k
Python Basics and Environment
int64
0
1
ViewCount
int64
12
475k
System Administration and DevOps
int64
0
1
Q_Score
int64
0
346
CreationDate
stringlengths
23
23
Tags
stringlengths
6
68
Title
stringlengths
12
138
Networking and APIs
int64
0
1
Available Count
int64
1
31
AnswerCount
int64
1
35
A_Id
int64
5.3k
72.3M
GUI and Desktop Applications
int64
1
1
0
0
I have been playing with basic Python and be familiar with Turtle module in Python. Then, I download Kivy, and write some basic application with that. my problem is that I couldn't use Turtle module in Kivy. I search a lot, but I couldn't find any example or tutorial on it. is it possible to use turtle module in Kivy application? is there any example to use turtle in their Kivy application?
true
33,763,674
1.2
0
0
3
The default turtle gui uses tkinter (a different graphics toolkit), it can't draw in a kivy app. You can certainly use the turtle module with Kivy, it should be very easy to draw the turtle's path, but you'd need to write some code to actually do this - turning the turtle position stuff into kivy graphics instructions.
0
984
0
2
2015-11-17T17:47:00.000
android,python,kivy,turtle-graphics
Turtle and Kivy
0
1
1
33,767,341
1
0
0
I have downloaded the package 'Kivy-1.9.0-py3.4-win32-x64' from their website. I extracted it and gives me a folder with gstreamer, kivy34, MinGW, etc. As I have searched to some tutorials I clicked the kivy-3.4.bat file to set the paths. Now I'm lost, what to do next? I wanted to do Kivy applications through Python IDLE. Help!
false
33,782,926
0
0
0
0
Make sure you have PIP installed (it gives the option to install when you download python). Then, open a command shell (CMD on Windows; enter the search bar and type in 'cmd') and type pip install kivy. Some would recommend setting up a virtualenv and stuff but as a quick answer this should work.
0
2,161
0
0
2015-11-18T14:40:00.000
python,kivy
How to install Kivy on Windows?
0
1
1
43,096,978
1
0
0
I have been trying to install the pygame module and get the error ImportError: No module named 'pygame'. I currently have Python version 3.3.4 and installed pygame cp33 32-Bit. It is currently a whl file and I have tried following tutorials etc in order to import it but I'm having no luck.
false
33,786,307
0
0
0
0
You can easy install and check which version fits you by downloading PyCharm IDE. When you download it, go to: File Settings Project <project's name> Python Interpreter Then press the plus icon on your right (install), and type pygame. When you find the module, check the box Specify version and select the version you want. If this version does not want, you can easily select and check the other versions.
1
346
0
1
2015-11-18T17:17:00.000
python,pygame
Installing Pygame Module
0
1
3
63,551,510
1
0
0
Is it possible to have dynamic text alignment with kivy listview? I have a list of responses from a web lookup. I would like to have the text alignment (left or center) of each list item depending on the quality of the response item. I can't find a way to access 'halign' for each list item.
false
33,789,249
0
0
0
0
You can use your own item class, I think this is an option on the ListAdapter (maybe named cls). In doing so, you can add whatever logic you like to how the item is displayed.
0
383
0
0
2015-11-18T20:00:00.000
python,widget,kivy
Kivy listview text alignment
0
1
1
33,792,073
1
1
0
I am working on a screen written in wxPython, and Python, that has five groups of CheckBoxes. Three of the groups can have between none and all the CheckBoxes selected. However with two of the groups only none or one can be selected. RadioButtons have been considered and disregarded as you cannot select none and their appearance is different making the look and feel of the page inconsistent. Obviously I could write numerous OnCheckBox events that would all be very similar. Is there an easier and more elegant way of achieving this?
true
33,829,421
1.2
0
0
0
Have you considered cycling through them on EVT_CHECKBOX. Each box can be tested with IsChecked(), if the test is True then you can use SetValue(False) on the others or whatever suits your requirements. Also, there is nothing to stop you creating a radiobutton with the value None.
0
915
0
0
2015-11-20T14:43:00.000
python,checkbox,wxpython
Need To Select Only One Checkbox In Group
0
1
1
33,853,583
1
0
0
After researching a little I found some libraries like pygame, tkinter, etc. I was able to install pygame easily but am not able to find any help on how to install tkinter for v3.2. I know many of these type of q's heve been answered but most of them show only errors when importing Python or it is for Linux/mac. I have a Windows based os.
true
33,968,542
1.2
0
0
0
Tkinter is already installed with Python so you just need to import tkinter. Don't import Tkinter as you might see in some tutorials because Python 3+ has a different version.
0
189
0
0
2015-11-28T06:43:00.000
python,tkinter
Tkinter install in Python version 3.2
0
1
1
33,969,234
1
0
0
So far I am using Tkinter to make textfields in Python. My question is how do I make it so there are placeholders, preferably in the style of mathematica or something similar so that when a user starts a new line, a right and left place holder appear on that line and the user can only enter text in these placeholders? Eventually I would like to be able to make it so all the right placeholders are aligned as well, but that may be too complicated. I can't seem to find a way to do this in Tkinter. Is there possibly a better package for this? I'm not sure how to generate and format "text placeholders" Edit: I think this question is coming down to: how do I dynamically add text placeholders within already existing text fields based on certain key commands?
false
33,974,018
0
0
0
0
tkinter doesn't have anything built-in to support this. Tkinter likely has all of the fundamental building blocks in order to build it yourself, but it will require a lot of work on your part.
1
62
0
0
2015-11-28T17:06:00.000
python,tkinter,textfield
Adding dotted text placeholders within a textfield in Python?
0
1
1
34,096,603
1
0
0
I trying to make an application with a pop-up menu - when I type SPACE-R_ALT on my keyboard, globally across the OS (Windows in my case). When that happens, I want to pop-up a window (I know how to do that), and it is crucial that I can happen to be using Chrome or Word, then tap Space-Right Alt, then be able to open up this little menu. Tkinter event bindings have two problems: First, when I use an event binding for <Key> and then, in the function, use evt.keysym, I can see that the program can't register both at the same time. I could use a timer and then see if it works, but I would prefer one line that fixes it all. Second, I find that tkinter event bindings only work when the binded widget's window (or window itself) is FOCUSED. I will hide my root and TopLevel at all times, and so is not focused. I would appreciate any help on this. If your suggestion uses another module, I don't really care, as long as it works on Windows 10 (not Mac OS X, not Linux, but Windows). I'm also using Python 3, but any version (aka 2) would also be okay, as I could either try to port YOUR suggestion to Py3, or port MY code to Py2. Thanks!
true
33,980,603
1.2
0
0
0
I figured it out with Furas's help - with Pyhook I can wait for events globally, and then tie in the event with tkinter events.
0
65
0
0
2015-11-29T07:52:00.000
python,tkinter
Check for tkinter events globally (across OS)
0
1
1
33,993,563
1
0
0
I can't seem to get Tkinter to load up in the pip search menu. This is what I have done so far: view>python enviorments>updated/installed setuptools>pip search menu> input"Tkinter" with no luck.Please help, Thanks guys!
false
34,014,148
0.53705
0
0
3
Tkinter should be installed by default, so there's no need to install it. If you don't have it, open Programs and Features, find Python and select Change, then make sure that the Tcl/Tk option is selected.
1
11,918
0
2
2015-12-01T06:41:00.000
python-3.x,tkinter,visual-studio-2015
How to install Tkinter to visual studio 2015
0
1
1
34,078,641
1
0
0
I own a raspberry pi 2 and i start learning Python. I would like to do something very basic : the window of my Python program on top of omxplayer window like a notification system. I have been able to make an "always on top" window with TKinter but when i launch omxplayer my window is no more on top. I would apreciate some help ! Thanks
false
34,031,727
0
0
0
0
My solution is to used Hello_font from the hello_pi examples on the raspberry pi.
0
985
0
0
2015-12-01T22:51:00.000
python,omxplayer
Python + TKinter + OMXPlayer window on top
0
1
2
34,075,563
1
0
0
The title says it all, really. I am writing functions that deal with pygame.Surface objects from multiple sources. Among other operations, these functions will ensure that the Surface objects they return have been convert()ed at least once (or, according to user preference, convert_alpha()ed), as is required to optimize them for blitting in the current display mode. But I don't want to run the the convert() or convert_alpha() methods needlessly since they create copies of the surface and therefore take up time and memory. How do I tell whether I need to do it? I have looked at the output of S.get_flags() before and after S = S.convert_alpha() but it doesn't seem to change. The scalar value of S.get_alpha() does change (from 255 to 0) but I'm not convinced that's meaningful or reliable (and it doesn't solve the problem of knowing whether you have to .convert() in the case where alpha blending is not desired).
true
34,033,149
1.2
0
0
1
I do not believe the existing API provides a way to do this. I think the intended use is to convert all your surfaces (why wouldn't you?) so you never have to worry about it. Perhaps it is possible to subclass pygame.Surface and override the convert methods to set a flag in the way you wish.
0
86
0
1
2015-12-02T01:02:00.000
python,pygame,pygame-surface
how can you tell whether convert()/convert_alpha() has already been run on a pygame.Surface?
0
1
1
34,033,205
1
0
0
I am a making a blackjack game with cards using turtle and each time I play a hand turtle just prints over the last game instead of clearing the window. Is there a method that closes the window when it is called or is there another why of doing this?
true
34,033,701
1.2
0
0
18
I want to clarify what various turtle functions do as there are misunderstandings in this discussion, including in the currently accepted answer, as the method names themselves can be confusing: turtle.mainloop() aka turtle.Screen().mainloop() Turns control over to tkinter's event loop. Usually, a lack of turtle.Screen().mainloop() (or turtle.Screen().exitonclick(), etc.) will cause the window to close just because the program will end, closing everything. This, or one of its variants, should be the last statement in a turtle graphics program unless the script is run from within Python IDLE -n. turtle.done() (Does not close window nor reset anything.) A synonym for turtle.mainloop() turtle.clear() Deletes everything this turtle has drawn (not just the last thing). Otherwise doesn't affect the state of the turtle. turtle.reset() Does a turtle.clear() and then resets this turtle's state (i.e. direction, position, etc.) turtle.clearscreen() aka turtle.Screen().clear() Deletes all drawing and all turtles, reseting the window to it's original state. turtle.resetscreen() aka turtle.Screen().reset() Resets all turtles on the screen to their initial state. turtle.bye() aka turtle.Screen().bye() Closes the turtle graphics window. I don't see a way to use any turtle graphics commands after this is invoked. turtle.exitonclick() aka turtle.Screen().exitonclick() After binding the screen click event to do a turtle.Screen().bye() invokes turtle.Screen().mainloop() It's not clear that you can close and reopen the graphics window from within turtle without dropping down to the tkinter level that underpins turtle (and Zelle's graphics.py) For purposes of starting a new hand in your blackjack game, I'd guess turtle.reset() or turtle.resetscreen() are your best bet.
0
46,320
0
7
2015-12-02T02:07:00.000
python,turtle-graphics
Python: How to reset the turtle graphics window
0
1
2
42,260,054
1
0
0
I am trying to build the android app from kivy application. I used the Buildozer image as given on the kivy.org downloads page, but that Virtual Machine never runs on the virtualbox. Is there any other way to do this. I have seen some SO questions regarding this but they seem to be very old and hasn't been of much help till now.
false
34,035,329
0
0
0
0
You need to provide information about what goes wrong when you try to run the VM - nobody can help if we know only that something doesn't work. Alternatively, you can make a new VM with any linux distro (a recent Ubuntu is a good choice) and install all the dependencies. Kivy's VM is nothing special except that it has them preinstalled.
0
145
0
1
2015-12-02T05:08:00.000
android,python,apk,kivy
Building Android apk from kivy application
0
1
1
34,042,147
1
1
0
I'm writing Android app. The problem is that it should execute some calculations and library for this is written in Python. What is the best way to invoke Python from Android/Java? I heard about Kivy and even managed to run application, but python code returns latex formulae, that can't be rendered within Kivy app.
false
34,069,428
0
0
0
0
You can probably render LaTeX in Kivy fairly easily using a png exporter (such as presumably exists for web export tools, and modes like emacs' preview mode). If you need to run python as part of a java app, probably a practical way to do it is to use kivy's python-for-android tools with your own java frontend, invoking the python interpreter via JNI. This would require some thinking and experimentation but should be possible. There are also other projects for building python for android, which might be able to do the same things.
0
231
0
0
2015-12-03T15:11:00.000
android,python,kivy
Run Python Code from Android
0
1
1
34,069,875
1
0
0
I have code which runs immediately when I run using python. The code has tkinter module and bunch of if statements. I created a standalone executable and it takes about 8 minutes to give the output for the GUI. I was wondering why it takes so much time to run ? Thanks in advance.
false
34,099,639
0
0
0
0
If you do a bunch of work before calling mainloop, you won't see anything appear until you call mainloop or update. The only way a window will appear is in response to an event that asks for the window to be displayed, and tkinter can't process events if mainloop isn't running.
1
275
0
0
2015-12-05T00:16:00.000
python,tkinter,pyinstaller
pyinstaller executable takes more than 8 minutes print out?
0
1
1
34,137,551
1
0
0
I am working on an assignment for school, and didn't realize that I needed to install the pygame/livewires package to use the program I am writing, because I have been using a school laptop while in class and haven't used my personal laptop. It is a really simple program, but I still can't run it because the pygame setup I downloaded isn't working. When I type "import pygame" into the shell it works, but when I try something like "from livewires import games" it says that the module livewires cannot be found. I am using Python3.1.1 but I also have Python3.4.3 installed. PLEASE HELP and thank you in advance.
false
34,123,018
0
0
0
0
For python3 this works for me: First you need to install pip module (it will help to install livewires in last step) sudo apt install python3-pip Install pygame module which is required for livewires sudo apt install python3-pygame And at last install needed module pip3 install livewires But most likely livewires will not work well, as it isn't working for me. So you can use updated version - superwires. Installation is almost the same: pip3 install superwires And just use superwires instead of livewires in your instructions. Note, that this didn't work for me: sudo apt install python3-livewires with error: E: Unable to locate package python3-livewires
1
3,136
0
1
2015-12-06T21:30:00.000
python,installation,pygame,livewires
Installing livewires for python
0
1
3
66,070,964
1
0
0
I use LinuxMint 17.3 Cinnamon in VirtualBox, 1920*1080 resolution is used in this machine, the Hi-DPI option is turned on. The host machine is Windows 10, with 3840*2160 resolution. Despite turning on Hi-DPI option in LinuxMint, some applications become to look good for comfortable work, in terms of scaling, but python-tk GUI (python2) hasn't been changed - font size is tiny, changing of Font options in Cinnamon doesn't change fonts in tk. Is there any way to scale correctly already written tk GUI applications?
false
34,132,203
-0.099668
0
0
-1
you can use the Clmage module to increase the resolution of your GUI render
0
15,979
0
9
2015-12-07T11:14:00.000
python,python-2.7,tkinter,tk
Scaling of Tkinter GUI in 4k (3840*2160) resolution?
0
1
2
68,737,194
1
0
0
I am currently using the turtle.goto cords from a text file. I have the triangle drawn and everything but I don't know how to fill the triangle.
false
34,160,995
0.379949
0
0
2
You are ending fill after every new coordinate. You need to call t.begin_fill() before your for loop and call t.end_fill() after the last coordinate, otherwise you are just filling in your single line with each iteration.
1
812
0
2
2015-12-08T16:26:00.000
python,colors,turtle-graphics
Python Turtle fill the triangle with color?
0
1
1
34,161,243
1
0
0
I use QListView (in PyQt5) to display strings. I want to have the background color of each item in that list changing between two colors to make it easier to read. I tried Qt.DecorationRole but this only create an "icon" on the left side of each item.
true
34,188,594
1.2
0
0
1
self. listWidget.setAlternatingRowColors(True) this will give you Alternate color for each row.
1
963
0
0
2015-12-09T20:43:00.000
python,c++,qt,pyqt,qlistview
QListView with row background in two different colors
0
1
1
34,188,907
1
0
0
I have a Python script and a C++ program running at the same time, both accessing the GPIO pins (not the same ones, though) in this order: C++ Python C++ The access of the C++ program worked (I used wireless transmitters and received the message). After that the Python access (light up an LED) worked as well. But when I tried to send another message using the wireless transmitters with C++, nothing happened, I don't receive messages anymore. Is there a way to find out, whether the GPIO pins are blocked or something?
false
34,200,159
0
1
0
0
If you clean up the GPIO Headers in both scripts, it should be possible, otherwise it wont work. You can clean up in python by using GPIO.cleanup(), then it sould work, cause it is clean again to your c++ Code.
0
250
0
0
2015-12-10T10:58:00.000
python,c++,raspberry-pi,gpio
Is it possible to access GPIO pins from a Python script and a C++ program at the same time?
0
1
2
40,125,816
1
0
0
Trying to install python-poppler-qt4 on Windows (8.1) but i've been having issues building/installing it (error fatal error C1083: Cannot open include file: 'QMetaType' : No such file or directory. #include QMetaType) Before this error I had a missing poppler-qt4.dll issue. After locating and installing the dll I get the error above It's pretty annoying how I cant install this package like any other .. suggestions? Really need to use poppler for PDF rendering.
false
34,213,429
0
0
0
0
In C:\poppler-0.24.5\include\src replace it C:\poppler-0.24.5\include\qt4\src
0
627
0
1
2015-12-10T23:09:00.000
python,qt,pyqt4,poppler
Python Poppler install issues
0
1
2
34,292,822
1
0
0
Kind all, I'm really new to python and I'm facing a task which I can't completely grasp. I've created an interface with Tkinter which should accomplish a couple of apparently easy feats. By clicking a "Start" button two threads/processes will be started (each calling multiple subfunctions) which mainly read data from a serial port (one port per process, of course) and write them to file. The I/O actions are looped within a while loop with a very high counter to allow them to go onward almost indefinitely. The "Stop" button should stop the acquisition and essentially it should: Kill the read/write Thread Close the file Close the serial port Unfortunately I still do not understand how to accomplish point 1, i.e.: how to create killable threads without killing the whole GUI. Is there any way of doing this? Thank you all!
false
34,284,335
0
0
0
0
First you can use subprocess.Popen() to spawn child processes, then later you can use Popen.terminate() to terminate them. Note that you could also do everything in a single Python thread, without subprocesses, if you want to. It's perfectly possible to "multiplex" reading from multiple ports in a single event loop.
1
1,596
0
4
2015-12-15T08:34:00.000
python,multithreading,kill-process
How to integrate killable processes/thread in Python GUI?
0
1
2
34,284,612
1
0
0
There are multiple questions about "how to" call C C++ code from Python. But I would like to understand what exactly happens when this is done and what are the performance concerns. What is the theory underneath? Some questions I hope to get answered by understanding the principle are: When considering data (especially large data) being processed (e.g. 2GB) which needs to be passed from python to C / C++ and then back. How are the data transferred from python to C when function is called? How is the result transferred back after function ends? Is everything done in memory or are UNIX/TCP sockets or files used to transfer the data? Is there some translation and copying done (e.g. to convert data types), do I need 2GB memory for holding data in python and additional +-2GB memory to have a C version of the data that is passed to C function? Do the C code and Python code run in different processes?
true
34,284,421
1.2
1
0
2
You can call between C, C++, Python, and a bunch of other languages without spawning a separate process or copying much of anything. In Python basically everything is reference-counted, so if you want to use a Python object in C++ you can simply use the same reference count to manage its lifetime (e.g. to avoid copying it even if Python decides it doesn't need the object anymore). If you want the reverse, you may need to use a C++ std::shared_ptr or similar to hold your objects in C++, so that Python can also reference them. In some cases things are even simpler than this, such as if you have a pure function in C or C++ which takes some values from Python and returns a result with no side effects and no storing of the inputs. In such a case, you certainly do not need to copy anything, because you can read the Python values directly and the Python interpreter will not be running while your C or C++ code is running (because they are all in a single thread). There is an extensive Python (and NumPy, by the way) C API for this, plus the excellent Boost.Python for C++ integration including smart pointers.
0
397
1
2
2015-12-15T08:39:00.000
python,c++,c,language-binding
How does calling C or C++ from python work?
0
1
1
34,284,538
1
0
0
I have an interface made with Kivy, which has an image in part of it. I want to fade one edge of this image. What's the easiest way of achieving this?
false
34,324,386
-0.197375
0
0
-1
You can just create another image with faded edge and load it.
0
243
0
0
2015-12-16T23:56:00.000
python,kivy
How to add a gradient to an image
0
1
1
34,325,646
1
0
0
I'm trying to set up a complete build environment with SCons and I came across this problem: My project can be compiled with two different compilers (c or cpp compilers) and the resulting object files linked with the same linker. Because of this, I need to know how to split the compilation part from the linking part. Also, there are cases when I only need the .o files so I want to avoid linking. Is this possible using the same environment ?
false
34,333,808
0
0
0
0
Create two Environments, one with each compiler, use where necessary. Then use whichever Environment you need for linking object from either Environment.
1
657
0
0
2015-12-17T11:45:00.000
python,build,scons
How to compile with two different compilers using SCons?
0
1
2
34,335,139
1
0
0
I am trying to run a Tkinter GUI on Python 3.x and When I use the .get command to get the number off a scale, this error pops up Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1482, in __call__ return self.func(*args) File "C:\Users\Danny\Downloads\Space RPG. Alpha 0.2 (2) (1).py", line 39, in close print (w1.get(), w2.get()) File "C:\Python34\lib\tkinter\__init__.py", line 2840, in get value = self.tk.call(self._w, 'get') _tkinter.TclError: invalid command name ".52674064" What is happening?
true
34,344,624
1.2
0
0
1
That usually means that you're trying to call a method on a widget that has been destroyed. The string .52674064 is the internal name of a specific widget. This can easily happen if you call a function via a binding or via after, if the widget is destroyed before the binding or after call has been triggered.
0
642
0
0
2015-12-17T21:32:00.000
user-interface,python-3.x,tkinter
tkinter.TclError: invalid command name ".52674064
0
1
1
34,344,977
1
0
0
I have a QTableView on top of a QSqlTableModel. My database is sqlite. I know QSqlTableModel lazily loads the data from the database (it actually loads 256 rows at a time), so when the users scrolls the view to the bottom, the model loads the 256 next rows. I would like to know: What is the signal emitted when the users reaches the bottom of the view ? What is the model's method called to load the 256 next rows ?
true
34,357,818
1.2
0
0
0
The view asks the model for data by calling data function for all table cells that are visible. The model then queries the database if needed. How this happens in detail depends on the underlying database. The QSqlQueryModel documentation says that: "if the database doesn't return the number of selected rows in a query, the model will fetch rows incrementally. See fetchMore() for more information". Apparently this is the case for sqlite. The query happens in the fetchMore method of the model, I don't think there are any signals involved. You should be able to use the canFetchMore method to test if all records have been retrieved (not sure if this is want you want, perhaps you can tell us what you are ultimately trying to achieve.) Edit after discussion: You can inherit from the model and override the data method. I don't know where it's called in the view, probably in many places. You could try to look in the Qt source. If you need to do this from the view: when I look in the documentation of QAbstractScrollArea (which is an ancestor of QTableView) it seems that you can connect to a scroll bar's QAbstractSlider.actionTriggered signal to detect if the scroll bar is at the maximum.
0
304
0
0
2015-12-18T14:27:00.000
python,qt,pyqt
What model's slot is called when Qtableview scrolled
0
1
1
34,370,666
1
0
0
I am new to 3d world. I would like to open 3ds files with python and visualize the objects. I could not find any easy and straight forward way to play with 3ds max files. Can you let me know how can I achieve this?
false
34,400,788
0
0
0
0
According to my understanding, there are some advanced graphics libraries out there for advanced usage, however Blender, (an application developed in python) supports python scripting. There are even a simple drag and drop game engine for simpler tasks.
1
717
0
1
2015-12-21T16:59:00.000
python,file,3d,3dsmax
how to open 3ds files with python
0
1
1
34,401,590
1
0
0
Running brew install pyqt --with-python3, I get Error: Failed to determine the layout of your Qt installation. Adding --verbose to the brew script, the problem is that ld can't find -lgcc_s.10.5. (This is on Mac OS X 10.10.5 Yosemite)
true
34,502,194
1.2
0
0
0
Answering to help other people who encounter this: The solution was to first upgrade XCode to XCode 7.2 and open it once to accept the license and have it install additional components. Then, a brew update and a brew install pyqt --with-python3 finally worked.
0
900
1
0
2015-12-28T23:17:00.000
python-3.x,pyqt,homebrew
`Error: Failed to determine the layout of your Qt installation` when installing pyqt for python3 on Mavericks
0
1
1
34,502,219
1
0
0
I have data in an excel spreadsheet (*.xlsx) that consists of 1,213 rows of sensitive information (so, I'm sorry I can't share the data) and 35 columns. Every entry is a string (I don't know if that is screwing it up or not). The first row is the column names and I've never had a problem importing it with the column names embedded before (it's just easier to click that they're embedded so I don't have to name every column by hand). I put the path to the data in the quick start wizard and hit the next button and it doesn't do anything. I hit it again and it turns the mouse into the loader as if it's loading. I've waited for it for 15 minutes before, but every time I click on QlikView the program just crashes. I have a deadline I have to meet here and I can't afford to not finish this project. It's extremely important that I get it working. Just as a NB, I used Python to merge two Excel spreadsheets together so I don't know if that may be what's causing the problem either. I can open the file perfectly fine in Excel though.
false
34,532,708
0
0
1
0
I have had QlikView crash when importing an Excel spreadsheet that was exported with the SQuirreL SQL client (from a Firebird database). Opening the spreadsheet in Excel, and saving it again solved the problem. I know that this is no longer relevant to your problem, but hopefully it can help someone with a similarly appearing issue.
0
626
0
0
2015-12-30T15:52:00.000
python,excel,qlikview
Why does QlikView keep crashing when I try to load my data?
0
1
3
34,534,891
1
0
0
Is there a way to programmatically install an Android .apk in Python? Could you please show me how? I'm new to Python. Thanks in advance.
true
34,538,988
1.2
0
0
1
As @Swing mentioned in his comment, subprocess.call("adb install path-to-file.apk ") solves the issue.
0
2,635
0
3
2015-12-30T23:43:00.000
android,python,apk,android-install-apk
How to install an Android .APK using Python code?
0
1
2
62,234,030
1
0
0
If this question could be worded better/needs to be split into many questions, please alert me I need to package Python scripts in order to ship them as single-executables (ideally), or single-executables with supporting files (non-ideally). I have seen py2app and py2exe. They do not fit my requirements, as I am looking for a single method to do this, and in the future may need to have the packaged scripts interact with the executable that they are being run from. What is the best way to go about this? The scripts which I would be embedding may even require multiple files, which complicates matters I'm sure. If I wanted to use an interpreter other than CPython (ie: PyPy or Stackless) in the future, would the process be different (other than API calls in the C++ executable)? Does Python have to be installed on the computers which would be running the package, or does embedding Python mean that it is fully embedded? I saw on the Python Wiki something about Py_SetPythonHome(), which would indicate to me that it needs Python (or at least its libraries) to be installed. Am I correct?
false
34,583,134
0
1
0
0
Are you sure that you need to embed the Python files? I ask because you mention you want to package the Python files as single executables. Couldn't you install Python on the target machine and since Python scripts are executables on their own, you would only need something to kick them off. A master python script could kick off all the rest of the scripts. Otherwise you should look in C++ what can run a Python script. Then have the master python script run all the other scripts.
1
1,476
0
1
2016-01-04T00:10:00.000
python,c++,python-embedding
Embedding Python into C++
0
1
3
34,583,312
1
0
0
I would like to set a dictionary as an event object, but SetEventItem is expecting an object of type wxObject. What's the best way to go around this? Basically, I have a settings dialog. If the "Apply All" button is pressed, an event is generated which will propagate up to some parent window, which can then set the settings to all the appropriate children. I have these settings stored in a dictionary. Is there a better way to do this? This seemed the simplest to me.
true
34,621,426
1.2
0
0
0
SetEventObject is used to set the originating GUI element not to pass data to the event listeners ... you could certainly add a GetValue method to your GUI element that returned your dictionary... and then use GetEventObject().GetValue() to get your dictionary alternatively the wx.lib.pubsub module is designed to pass data to event subscribers and I would recommend using this, for this particular use case ...
1
90
0
0
2016-01-05T21:20:00.000
python,user-interface,wxpython
wxPython - Set dictionary as event object
0
1
1
34,621,808
1
0
0
I have a class derived from wx.Panel that creates an image in a large border area (e.g. a little over 30 pixels across on the left edge). I want to be able to derive subclasses from it for the panels in part of my application, but I can't figure out how to adjust the position the children in the derived panels - they think the added border area is part of the client window and quite happily position themselves under it (and are subsequently erased by the base class' EVT_PAINT handler). I've tried tracking a client area and overriding the various GetClient... methods in my base class, but it doesn't seem to change anything about the child behavior. I suppose I could manually reposition the child windows in the subclasses, but that's a lot of repeated code and it seems like it shouldn't be necessary. Searching for answers on the Internet has not been a successful enterprise. I also tried looking through the wx code for an answer, but I haven't had any luck there either. What's the best way to define the client area in the window so that children automatically position themselves away from the edge of the parent? Is there a way to tell new objects that their parent's client area doesn't start at (0,0) (it seems like overriding GetClientAreaOrigin should do this, but doesn't seem to work)? Should I be moving them manually in the context of Layout() or a wx.EVT_SIZE handler? What's the elegant and/or appropriate solution?
true
34,625,218
1.2
0
0
0
I abandoned this approach as unwieldy after some effort, but I did have some limited success, and I wanted to point out some of the things I learned in case someone else is considering it. Look at PyPanel - it is designed to be overridden fairly extensively and responded well to most of what I was doing. The best approach I found in my original effort was to create a panel instance as a child of the control to work as a content manager. I overloaded AddChild and SetSizer in the control to redirect them to the child panel; I also implemented a protected flag that I could set in the control to prevent that redirection (otherwise I'd be trying to add the content panel to itself instead of the control when I created it). I still encountered some weirdness with certain controls (SpinCtrl in particular wanted to position itself in very strange ways, often partially outside the content panel, despite all my efforts to prevent it). I also had some trouble with getting the sizers to behave well as regards the best/minimum size for the controls. I think the best piece of advice I could give is to consider looking at other ways to do this; in my case, I was able to create a control that could be included in a panel that facilitates the desired behavior of the parent; the hooks in the parent's routines were much easier to manage than the Frankensteinian mess of a derived class that I had created in my original effort.
0
119
0
0
2016-01-06T03:37:00.000
wxpython
How to reposition children in wx.Panel derived class with a large border?
0
1
1
34,937,077
1
1
0
I am making an app with Kivy and Python,is there a native way to create a field with a spinbox to select the number like in HTML for the tag input (type = "number") ?? I see there are checkboxes for Kivy but not this spinbox number; should I use a normal text input provided by Kivy and get the number from that?
false
34,629,190
0.197375
0
0
1
You can use a Spinner widget._
0
547
0
0
2016-01-06T09:04:00.000
python,html,kivy,qspinbox
Kivy native spinbox number widget for insert number
0
1
1
34,631,685
1
0
0
I have a number of wxPython textCtrls that are used for data input. Use is made of various Validators to make sure the data is of the correct type. I now need to validate that the data is within range, e.g. where two textCtrls are used for feet and inches that the inches are less than 12, before the user can move to the next field. I did try wx.lib.intctrl.IntValidator() but seemed to have an issue because I am using Python 2.7 and wxPython 2.8. This must be a problem for others but a Google has not found anything.
true
34,634,735
1.2
0
0
0
Bind the textctrl to wx.EVT_KILL_FOCUS and then check the contents of the textctrl. If there is invalid input, issue your error message and then self.my_textCtrl.SetFocus() which will put you back in the textctrl for input again.
0
165
0
0
2016-01-06T13:49:00.000
python-2.7,validation,wxpython
Validating wx.textCtrl Field For Sensible Values
0
1
1
34,651,896
1
0
0
I'm learning to use Tkinter and in the tutorials it tells me to import W from Tkinter, but W is just a str ("w"). My question is why use Tkinter.W not "w". Is it because Tkinter will sometimes have the var equal something else dependent upon system?
false
34,699,869
0.099668
0
0
1
This is done mostly for user convinience. Consider the Image class from PIL/Pillow. It has a method to create a thumbnail out of an image, in the process resizing it. The method takes two arguments, the new size in a tuple and a resampling method. This can be antialias, bilinear, cubic, etc. These are internally represented with integer values, like 0, 1, etc. If you don't know which value represents which resampling method, it's cumbersome to look it and may also lead to more errors. But access it from the constant Image.BILINEAR and boom, you're done. In your case, importing W just for the string "w" seems to be needlessly polluting the namespace and typing tkinter.W is longer than "w". This might be so. However, remember, constants in a program are defined in one place so if you ever have to change them, it will be easy to so. You never know, the module may be internally use the constant W, even if you see no point in it. This also leads to the reason you pointed out. A constant may have a different value depending on the system or version. By using the internally consistent constant and not a static, hardcoded value, you make your life easier when you reuse that code on a diferent system or version.
1
535
0
1
2016-01-09T22:53:00.000
python,tkinter,python-2.x
Python Tkinter: Why use Tkinter.W not str "w"
0
2
2
34,700,366
1
0
0
I'm learning to use Tkinter and in the tutorials it tells me to import W from Tkinter, but W is just a str ("w"). My question is why use Tkinter.W not "w". Is it because Tkinter will sometimes have the var equal something else dependent upon system?
true
34,699,869
1.2
0
0
2
I always use the string value. I see absolutely no benefit in using the constants. The chance of them changing is virtually zero. These constants have remained unchanged since Tkinter was created. tkinter takes backwards compatibility pretty seriously, so even if they are changed, the string values will undoubtedly continue to work for a year or two. My recommendation is to never use the constants.
1
535
0
1
2016-01-09T22:53:00.000
python,tkinter,python-2.x
Python Tkinter: Why use Tkinter.W not str "w"
0
2
2
34,703,004
1
1
0
I want to develop an app to track people's Whatsapp last seen and other stuff, and found out that there are APIs out there to deal with it, but the thing is they are writen in python and are normally run in Linux I think I have Java and Android knowledge but not python, and wonder if there's a way to develop the most of the app in Java and get the info I want via calls using these python APIs, but without having to install a python interpreter or similar on the device, so the final user just has to download and run the Android app as he would do with any other I want to know if it would be very hard for someone inexperienced as me (this is the 2nd and final year of my developing grade), for it's what I have in mind for the final project, thx in advance
false
34,710,059
0
1
0
0
Instead of running it as one app, what about running the python script as separate from the original script? I believe it would bee possible, as android is in fact a UNIX based OS. Any readers could give their input on this idea an if it would work.
0
49
0
0
2016-01-10T19:50:00.000
java,android,python
how to write an Android app in Java which needs to use a Python library?
0
1
1
34,710,122
1
0
0
I'm writing an experimental GUI framework. The GUI is constructed by combining components (similar to widgets). There are a few "native" classes of components. The framework user specializes by providing certain methods that define configuration, bindings, etc. This can be done by extending a native class and overriding its methods, which is fine, but many of the derived classes will be instantiated just once. Alternatively, I could provide a factory function that would take a native class and the specializing methods (functions, really). This function would instantiate the native class and replace the appropriate methods. Any reason to prefer one approach over the other?
false
34,710,277
0
0
0
0
What most GUI toolkits (wxpython,kivy,pyQT) in python are doing is the inheritance approach. I guess both approach should work but using inheritance will be more familiar to your potential users What you may also want to look at is a template language (suck as kv lang or html) to layout the UI since it is a modern approach
1
1,540
0
4
2016-01-10T20:10:00.000
python,inheritance,monkeypatching
Monkey patching vs inheritance and overriding in Python
0
1
2
34,710,599
1
0
0
Hey i'm new here so if I've done something wrong i apologize. I have been searching for hours though and i figured i would just open a new question. I want to have a python program that will open another window so it can display different information on that window whilst still displaying it's own information. For ex: I have "hello.py" and it opens up another python window "goodbye.py" i dont want what ever is in "goodbye.py" to show up on "hello.py" i want it to stay in its own window. Any ideas?
false
34,793,777
0
0
0
0
Assuming your question is to open 2 programs at the same time, couldn't you just open 2 tabs and open the 2 programs side by side like that? Ex. on mac, double click open new window and open a new tab.
1
17
0
0
2016-01-14T15:47:00.000
python-3.x
Python 3 opening more than one .py program instead of just calling it in the same window
0
1
1
34,801,497
1
0
0
I made a program using the pygame module on Python 3 and it works fine within python, but when I try to compile is using py2exe it won't run. (I just get the programName.exe has stopped working error upon trying to run it). I managed to narrow down this problem to the pygame.font module as when I comment all the lines that use that module everything works fine. I tried to forcefully include the module using the -i flag in py2exe, but it doesn't appear to change anything... What am I doing terribly wrong? Edit: I managed to get the reason of the program not working - it crashes as it can not find build\executable.exe\pygame\freesansbold.ttf . What I don't understand is why the hell is the pygame folder supposed to be located in a folder with the name of my executable? (Of course, I can not create a folder with the same name as an existing file in the directory). If anyone has a clue to how to fix it, please help!!
false
34,800,524
0.099668
0
0
1
I had the same problem using cx_Freeze, so hopefully this will work for you as well. Open up your pygame package folder. It should be C:\Python34\Lib\site-packages\pygame. There should be a True Type Font File titled freesansbold.ttf. Copy that file then open the folder containing your exe program. There should be a zipped file called library. Open it up and go to the pygame folder inside the zipped file. Should look something like this \build\exe.win32-3.4\library.zip\pygame. And just paste the freesansbold.ttf file in that folder and it should work perfectly.
1
319
0
0
2016-01-14T21:55:00.000
python,python-3.x,compilation,pygame,py2exe
Py2Exe won't successfully compile the pygame.font module on Python 3
0
2
2
34,801,623
1
0
0
I made a program using the pygame module on Python 3 and it works fine within python, but when I try to compile is using py2exe it won't run. (I just get the programName.exe has stopped working error upon trying to run it). I managed to narrow down this problem to the pygame.font module as when I comment all the lines that use that module everything works fine. I tried to forcefully include the module using the -i flag in py2exe, but it doesn't appear to change anything... What am I doing terribly wrong? Edit: I managed to get the reason of the program not working - it crashes as it can not find build\executable.exe\pygame\freesansbold.ttf . What I don't understand is why the hell is the pygame folder supposed to be located in a folder with the name of my executable? (Of course, I can not create a folder with the same name as an existing file in the directory). If anyone has a clue to how to fix it, please help!!
false
34,800,524
0
0
0
0
I managed to find a way! By including -l library.zip argument in the build_exe command and then following the instructions given by DeliriousSyntax in the answer above I managed to get it to work!
1
319
0
0
2016-01-14T21:55:00.000
python,python-3.x,compilation,pygame,py2exe
Py2Exe won't successfully compile the pygame.font module on Python 3
0
2
2
34,867,493
1
0
0
I'm using PyQtGraph to plot mesh surfaces. I would like to see the 3D world with perspective turned off. Is this possible in pyQtGraph? I have searched through the documentation and the google groups and can't find any reference to this. I think it is possible in principle with openGL so is there a way to bring this out and control perspective on/off in pyQtGraph?
false
34,801,254
0
0
0
0
A cursory inspection of the docs renders no help ... however if you decrease the field of view (FOV) while also increasing the distance you will approximate an orthographic projection to arbitrary precision as you vary those two parameters
0
1,275
0
2
2016-01-14T22:49:00.000
python-3.x,opengl,pyqtgraph
PyQtGraph - Turn off perspective in 3d view
0
2
4
34,801,690
1
0
0
I'm using PyQtGraph to plot mesh surfaces. I would like to see the 3D world with perspective turned off. Is this possible in pyQtGraph? I have searched through the documentation and the google groups and can't find any reference to this. I think it is possible in principle with openGL so is there a way to bring this out and control perspective on/off in pyQtGraph?
false
34,801,254
0
0
0
0
I would recommend trying out the newer vispy; it is much more flexible with regards to the types of cameras and mouse interactions supported. In particular, orthographic projection happens to be the default for the 'arcball' camera type, and probably the others too; it's set by setting camera.fov to be 0. As a bonus, ergonomics with ipython are also much improved, i.e. your ipython shell stays responsive at the same time the scene is active, and you can kill the scene without killing your ipython instance, and launch another.
0
1,275
0
2
2016-01-14T22:49:00.000
python-3.x,opengl,pyqtgraph
PyQtGraph - Turn off perspective in 3d view
0
2
4
37,876,896
1
0
0
In a PyQt application is it possible to kill only the GUI (Qt) part? Any Python commands running should be unaffected, only the graphics should disappear.
true
34,803,369
1.2
0
0
2
how about QtGui.QWidget.setVisible(visible) PySide.QtGui.QWidget. setVisible ( visible ) Parameters: visible – PySide.QtCore.bool This property holds whether the widget is visible. Calling setVisible(true) or PySide.QtGui.QWidget.show() sets the widget to visible status if all its parent widgets up to the window are visible. If an ancestor is not visible, the widget won’t become visible until all its ancestors are shown. If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown. If the widget has not been resized yet, Qt will adjust the widget’s size to a useful default using PySide.QtGui.QWidget.adjustSize() . Calling setVisible(false) or PySide.QtGui.QWidget.hide() hides a widget explicitly. An explicitly hidden widget will never become visible, even if all its ancestors become visible, unless you show it. A widget receives show and hide events when its visibility status changes. Between a hide and a show event, there is no need to waste CPU cycles preparing or displaying information to the user. A video application, for example, might simply stop generating new frames. A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop (on platforms that support this concept). A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again. You almost never have to reimplement the PySide.QtGui.QWidget.setVisible() function. If you need to change some settings before a widget is shown, use PySide.QtGui.QWidget.showEvent() instead. If you need to do some delayed initialization use the Polish event delivered to the PySide.QtGui.QWidget.event() function.
0
237
0
0
2016-01-15T02:20:00.000
python,qt,pyqt
Kill only Qt in PyQt
0
1
1
34,803,713
1
0
0
I've installed Kivy some time ago, and since then I've tried many ways to run Kivy, but till today I'm not successful. I am able to "import kivy" in python but while importing app module by "from kivy.app import app" It shows error 'no module named app', while there is a folder in Kivy named "app". The location of this folder is "D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy" Here's my environment path which I have setup for Kivy: KIVY_DATA_DIR : D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy\data KIVY_EXTS_DIR : D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy\tools\extensions KIVY_HOME : D:.kivy; D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy KIVY_MODULES_DIR : D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy; D:\utils\Kivy\Kivy-1.9.0-py2.7-win32-x64\kivy27\kivy\modules Can anyone please help me....
false
34,813,877
0
0
0
0
Why are you trying to use a old version of kivy? Use the latest version 1.9.1. follow the documentation Ensure you have the latest pip and wheel: python -m pip install --upgrade pip wheel setup tools . Install the dependencies (skip gstreamer (~90MB) if not needed, see Kivy’s dependencies): python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew \ kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/packages/simple/ Install kivy: python -m pip install kivy That’s it. You should now be able to import kivy in python.
1
983
0
0
2016-01-15T14:58:00.000
python,kivy
I'm getting error while importing app from kivy
0
1
1
35,005,349
1
0
0
I have an .so file which I pulled from an Android APK (Not my app, so I don't have access to the source, just the library) I want to use this shared object on my 32 bit Ubuntu machine, and call some functions from it (Preferably with Python) . Is it possible to convert an Android .so to a Linux .so? Or is there any simple solution to accessing the functions in the .so without resorting to a hefty virtual machine or something? Thanks
false
34,883,612
0.197375
1
0
1
Most likely not. It's very probably the Android you pull it from is running on the ARM architecture, and therefore the .so library was compiled for that architecture. Unless your desktop machine is also on the ARM architecture (it's most likely x86 and it would have to be specific such as ARMv7) the .so binary will be incompatible on your desktop. Depending on what the .so library actually is, you may be able to grab the source code and compile it for your x86 machine. Disclaimer: Even if you obtain a library compiled for the same architecture as your desktop (from x86 phone), there is no guarantee it will work. It may rely on other libraries provided only by Android, and this may be the start of a very deep rabbit hole.
0
1,289
1
3
2016-01-19T17:47:00.000
android,python,linux,shared-libraries
How to use Android shared library in Ubuntu
0
1
1
34,883,727
1
0
0
If I set a pygame window to resizable and then click and drag on the border of the window the window will get larger but nothing blit onto the surface will get larger with it. (Which is understandable) How would I make it so that when I resize a window all blit objects resize with it and fill the window properly? For example: Say I have a window of 200 x 200 and I blit a button at window_width/2 and window_height/2. The button would be in the center of the window at 100 x 100. Now if I resize the window to 300 x 300 the button stays at 100 x 100 instead of 150 x 150. I tried messing around with pygame.Surface.get_width ect, but had no luck. Basically I'm trying to resize a program's window and have all blit images stay proportionate.
false
34,910,086
0
0
0
0
Recently with pygame2.0 You can use the SCALED flag
0
12,690
0
7
2016-01-20T20:41:00.000
python,pygame,resizable,surface,blit
Pygame. How do I resize a surface and keep all objects within proportionate to the new window size?
0
1
3
58,898,639
1
0
0
I'm currently creating a Snake game on Python using the TKinter library. So right now, I've implemented the movements, the food system, and the score system. I still need some help on how I can make the snake grow when it eats the food.
true
34,914,142
1.2
0
0
0
I do not see the associated code that actually displays the current position of the snake on the screen and remove it after movement, but this is where you can change the size if you make the length of the snake variable and have it drawn and removed in an iterate fashion. When food is eaten, you can simply increase the size of the snake length variable and pause the erasing of the snake movement as it proceeds along its vector until the desired growth has occurred, at which time removal can proceed at the new length rate. Please clarify the part of the code that actually renders the snakes position.
0
1,681
0
1
2016-01-21T02:03:00.000
python,tkinter
Need help for a Python Snake game
0
1
1
34,914,501
1
0
0
I have wrote python(2.7) GUI desktop application using TKinter library and it is working fine. Now i want to convert it into web application. I have looked into pyjaco and pyjamas but not getting it done. How can i convert it into Web App ? Thanks in advance..
true
34,921,411
1.2
0
0
5
You will have to rewrite your app. There is simply no way to convert a tkinter application to run on the web. You could potentially use pyjs to convert some of the business logic, but the entire GUI will have to be rewritten.
0
9,730
0
6
2016-01-21T10:39:00.000
python-2.7,web-applications,tkinter
How to Convert python Tkinter desktop App to Web App
0
1
2
34,924,538
1
0
0
Is there a problem with using sys.exit() to stop a Tkinter program? I know normally people use root.destroy() why is that?
false
34,935,100
0
0
0
0
I use both. root.destroy() is used to destroy all windows (parent, child) within the root tkinter instance, but it doesn't end the python program. sys.exit() stops all active applications used by python. In short, if your python code runs a tkinter GUI exclusively and it's functionality ends after the window is closed then use both root.destroy() followed by sys.exit() to effectively end the session.
1
2,199
0
2
2016-01-21T21:57:00.000
python,python-2.7,tkinter,tk
Can I use sys.exit() to stop a Tkinter program
0
1
2
34,935,285
1
0
0
When I run my Tkinter application, a command line/terminal opens. How can I run my application without it invoking a command line/terminal session?
false
34,937,925
0.379949
0
0
2
Save your file with ".pyw" extension instead of ".py".
0
1,518
0
1
2016-01-22T02:21:00.000
python,tkinter,terminal,window
How to run a Tkinter program without opening a terminal
0
1
1
34,939,110
1
0
0
I am rendering a virtual object on a video feed, and I want to try zooming in on it. Right now, I: rotate and translate the camera by where it actually is with respect to the object, make a 2D texture of the latest frame filling up the entire screen, and draw the object at the origin after multiplying the vertices by a rotation matrix. The position is a 3D-vector, and the orientations of the object and camera are quaternions. How can I zoom in on the object while simultaneously magnifying the texture?
false
34,990,774
0
0
0
0
If you are using perspective matrix adjust you field of view. Smaller fov bigger the object
0
206
0
1
2016-01-25T10:51:00.000
python,opengl,pyopengl
Zooming onto an object and background in OpenGL
0
1
1
34,991,608
1
0
0
I've spent some time looking online and so far haven't found anything that answers this without using PIL, which i can't get to work is there another way to do this simply?
false
35,024,118
-0.132549
0
0
-2
Luke, this is too late , however may help others. Your image has to be in the same sub directory with .py script. You can also type './imageFileName.png'
0
33,691
0
6
2016-01-26T21:16:00.000
python,image,python-3.x,tkinter
How to load an image into a python 3.4 tkinter window?
0
1
3
54,412,011
1
0
0
I wanted to write python code in my local computer and transfer it to Android device to execute the codes in mobile or Tablet. Is it possible to transfer? If yes, in which location do I need to transfer.
true
35,032,917
1.2
0
0
1
In QPython in Programs I see /storages/emulated/0/com.hipipal/qpyplus/scripts/
0
330
0
0
2016-01-27T09:05:00.000
android,python,qpython
Qpython in Android
0
1
1
35,033,063
1
0
0
There are many questions dealing with pyglet and pygame, but what I want to know is difference in theses two, in simple terms. Not in technical terms, not experimental features and all that. They are both libraries, both API, both for creation of games and multimedia apps, right? Just in plain English, for someone like me, relative begginer, who has finished course about Python in Codecademy and read Head first Python book.
false
35,044,298
-0.132549
0
0
-2
I've tried pyglet and pygame and rate pygame as the best .
0
3,694
0
2
2016-01-27T17:36:00.000
python,api,pygame,pyglet
Difference between pyglet and pygame, in simple words?
0
2
3
56,559,014
1
0
0
There are many questions dealing with pyglet and pygame, but what I want to know is difference in theses two, in simple terms. Not in technical terms, not experimental features and all that. They are both libraries, both API, both for creation of games and multimedia apps, right? Just in plain English, for someone like me, relative begginer, who has finished course about Python in Codecademy and read Head first Python book.
false
35,044,298
0.066568
0
0
1
PyGame is low-level library. You have to do all on your own - starting at mainloop and all functions called by mainloop. You can do it in different ways. (And you can learn something about mainloops in Pyglet, Tkinter, PyQt, wxPython and other GUIs, not only in Python) Pyglet is framework - it has already mainloop and you can't change it and you can't see how it works. You override functions which mainloop calls. You have to keep its rules.
0
3,694
0
2
2016-01-27T17:36:00.000
python,api,pygame,pyglet
Difference between pyglet and pygame, in simple words?
0
2
3
35,044,912
1
0
0
I wonder if it is possible to change the weight of one word on a tkinter button? So the result would look something like this: [ yes, I agree ] I've tried using tags but neither tk.Button nor tk.Button['text'] seem to allow it. Thanks!
true
35,064,212
1.2
0
0
1
No, it's not possible. If you want a button with rich text you'll have to create your own. Or, create an image that has the look you want, and use the image with a standard button. You can create your own using a text widget that is one character tall and a few characters wide. Then, you can place bindings on the button to handle clicks, and to change the relief to simulate a button. Unfortunately, it won't have the look of the platform-specific buttons.
0
33
0
1
2016-01-28T14:31:00.000
python,python-3.x,tkinter
Modifying a Part of Text on tk.Button
0
1
1
35,066,487
1
0
0
I'm running Qpython (andoid) 1.2.3 (the latest as of 2016-01-31) and I can get scripts to run. I've been able to create a shortcut on my homescreen for a simple test script that put the current date in yyyy-mm-dd format into the clipboard, and speaks the content. I have #qpy: console directing the script to execure in the console. When I click the shortcut, the clipboard is happily updated, and read out to me. But... the console window stays open, telling me to hit enter to close the window. I have tried: adding "exit" adding "exit(0)" adding import sys sys.exit() I have tried printing ctrl-d I still get the console staying open until I manually hit enter. I tried reheadering my script to run as kivy instead of console, and I could get it to exit, but it takes several seconds to load up kivy, and it's silly to load a huge amount of gui capability, when I neither need nor want them. How can I close the console automatically?
false
35,113,618
0
0
0
0
edit the file end.sh. Remove or comment the "read" command.
0
1,803
0
4
2016-01-31T12:03:00.000
android,console,qpython
How do I exit Qpython (android) console automatically afer script completes?
0
1
2
52,803,215
1
0
0
In tkinter I am creating a Toplevel widget to prompt the user with "Are you sure you want to exit?" every time they try to exit my application. While this is happening, I want the Toplevel widget to have full focus of my application and the user to be unable to click anything on the root window, if possible. While trying to figure out to do this, I discovered grabs and the ability to set the focus of the application. What is the difference between these two things? Thanks in advance.
true
35,140,140
1.2
0
0
1
Focus means that your window will receive all keyboard events until some other window gets the focus. A grab tells the window manager that your window should have the focus until you explicitly tell it that it is allowed to take it away (ungrab).
0
1,583
0
2
2016-02-01T20:55:00.000
python,macos,python-3.x,tkinter
Tkinter: What's the difference between grab and focus?
0
1
1
35,140,293
1
0
0
Quick question everyone. I apologize for how simple it is but why is it that when I add something to a frame like a checkbutton or label the formatting of the frame goes away and it's size snaps to whatever it is I put inside it? Thank you, Mark
true
35,143,105
1.2
0
0
1
That's simply how it's designed to work. It's a very powerful feature. You worry about what widgets you want in a frame and thinter can take care of doing all the math to make sure everything fits.
0
30
0
0
2016-02-02T00:40:00.000
python,tkinter
TKInter Frame formatting not working
0
1
1
35,143,172
1
1
0
I would like to verify the style of an element i.e. the color of the text shown in a textview. Whether it is black or blue ex. textColor or textSize. This information is not listed in the uiautomatorviewer. I can get the text using elem.get_attribute("text") as the text value is seen in the Node Detail. Is there a way to check for the style attributes?( I can do this fairly easy with straight selenium.)
false
35,164,413
0.197375
0
0
1
Update. As it turns out that cannot be done with appium webdriver. For those of you who are wondering this is the answer I rec'd from the appium support group: This cannot be done by appium as underlying UIAutomator framework does not allow us to do so. In app's native context this cannot be done In app's webview's context this will be same as below because webview is nothing but a chromeless browser session inside and app print searchBtn.value_of_css_property("background-color"). Summary for element inside NATIVE CONTEXT ==>> NO for element inside WEBVIEW CONTEXT ==>> YES Hope this helps.
0
1,771
0
1
2016-02-02T21:48:00.000
android,python,appium,python-appium
Appium Android UI testing - how to verify the style attribute of an element?
0
1
1
35,277,434
1
0
0
I'm new to GUI-programming and using now tkinter for python. In the past my "non-GUI" programs always consisted out of a few classes but if I look to the examples with a GUI it appears that only one class is used. All functions are included in this one class. Is this the normal way or is it possible to write a gui class which "calls" functions from other classes? As I look at it now it seems the concept of object oriented programming dissapears by implementing the GUI in an OOP manner
false
35,165,461
0.53705
0
0
3
It is definitely possible to use multiple classes in GUI apps. For example you can have one class which defines and layouts GUI elements (like buttons, text fields, scrollbars etc.) and the second class would subclass it adding some functionality on top of it.
1
110
0
1
2016-02-02T23:01:00.000
python,oop,user-interface,tkinter
Only one Class possible for GUI programming
0
1
1
35,166,083
1
0
0
I'm really sorry if this question sounds really simple but I couldn't figure out the solution yet... I'm using wxPython in order to create a GUI. I've used wx.Notebook, and created some tabs, all default configuration are located in the last tab. My question is, how can I get these default values from the last tab and use it?!? I tried "pub" (wx.lib.pubsub), but I only get these default values after an event (e.g. button click). Also there is/are any magic to get these values after user modification without a button click? Thanks all, Regards,
false
35,188,282
0
0
0
0
When you create the UI, you can keep the default config in a variable. A dictionary would probably work. Then when you create the tabs, you can pass them a dictionary. Alternatively, you could just save the defaults to a config file and then use Python to read it and load it into the UI. Python can parse csv, json, xml and whatnot right out of the box after all.
0
47
0
0
2016-02-03T21:40:00.000
python,user-interface,wxpython
Default values from wxPython notebook
0
1
1
35,229,531
1
0
0
I am currently working on a Battleship game project (for learning purposes) that uses tkinter for the UI and, because I want this program to be able to run on two computers for multiplayer, twisted for data transfer. This is my first time using twisted however I have used tkinter many times. I know both twisted and tkinter run in loops so it is normally not possible to have these running in the same thread. So I found out there's two ways to get around this: tksupport and running twisted's reactor in a separate thread. However, I tried to import tksupport from twisted.internet but it said that it didn't exist. I checked my twisted folder in my site-packages to be sure and it is indeed not there, but even the twisted docs claim it is. I assuming that this is because I am running python 3.5 and tksupport hasn't been ported over yet, but If this is not the case, please let me know. Also, as for the solution with threading, I discovered there's some controversy over putting twisted's reactor in it's own thread. Is it ok to put the reactor in its own thread, and, if so, what precautions should I take? Thanks.
false
35,229,352
0
0
0
0
I currently have twisted 17.9.0 and python 3.6. In reference to the answer above, tksupport for python 3 is now available with twisted, so no need to create your own tksupport module.
1
698
0
1
2016-02-05T16:48:00.000
python,python-3.x,tkinter,twisted
Threading with Twisted with Tkinter
0
1
2
49,701,788
1
0
0
I have downloaded the 3.5 version of python on my windows 7 home premium computer with version 6.1 software. I wish to use a C main program with python library extensions. I have aded the path to the include folder and the library folder to the dev studio c-compiler. I am testing with the supplied test program that prints out the time but I get a compile error. While it can find Python.h, it can't find python35_d.lib. I can't either. Is it missing from the download or is this another name for a one of the libraries in the download? Thanks
false
35,250,175
1
0
0
12
Maybe a little too late, but I found a work around for the missing 'python3x_d.lib' : When installing the python with pythoninstaller.exe, choose the advanced setup options in the first command window of the installation wizard, there choose the option "download debug binaries", then the file python3x_d.lib is automatically installed. I faced this error when trying to build opencv with python bindings
0
4,011
1
4
2016-02-07T05:43:00.000
c,python-3.x
I cannot find python35_d.lib
0
1
1
36,926,551
1
0
0
I'm making a python app that triggers an action when the print screen key is pressed. I'm using pyhook library. However, every time I press a character written with the language of my country (ãíé and others) is doubling the characters . For example : ~~a ''e ''i , causing problems in the normal user written use. Is there any way to fix ?
false
35,259,943
-0.099668
0
0
-1
try to add this line: # -* - coding: utf-8 -* -
1
208
0
0
2016-02-07T22:29:00.000
python,utf-8,pyhook
Pyhook UTF-8 issue
0
1
2
35,260,023
1
0
0
I made a simple chat program in python that uses tkinter and mysql db. It connects to db first, gets the messages and shows them to user. But when another user send a message to the user, the user can not see the new messages. So, I made a refresh button. But, everybody knows, people don't want to use a chat program that you always should press a button to see messages. The question is, how can I make a instant message app without clicking any buttons? It doesn't require to use tkinter for gui. It can be run with other gui libs.
false
35,294,239
0
0
0
0
in order to periodically refresh the user messages, just make an infinite while loop and set it to update every 5 seconds or so. this way every 5 seconds you check to see if database has new messages. alternatively you can make the while loop update if the database has been updated at any point but this is more complex.
0
294
0
0
2016-02-09T14:12:00.000
python,mysql,tkinter
Python3 - Tkinter - Instant messaging
0
1
1
35,295,077
1
0
0
We're building off of the Tower app, which was built with dronekit-android, and flying the 3dr solo with it. We're thinking about adding some sort of collision detection with it. Is it feasible to run some python script on the drone, basically reading some IR or ultrasound sensor via the accessory bay, and basically yell at the Android tablet when it detects something? That way, the tablet will tell the drone to fly backwards or something. Otherwise, would we use the dronekit-python libs to do that? How would use a tablet / computer to have a Tower-like functionality with that? Thanks a bunch.
false
35,308,103
0
1
0
0
I don't really know what you are asking for but: if the distance between the centers of two circles < the sum of their radii then they have collided.
0
208
0
1
2016-02-10T06:12:00.000
dronekit-python,dronekit-android
Implementing collision detection python script on dronekit
0
1
1
54,972,589
1
0
0
I am trying to run the Invensense motion_driver_6.12. I compiled the code with IAR and the STM32 works ok - all the test I've done with the board are ok: UART, I2C.. etc. But when I run the python client demo program "eMPL-client-py" the program shows only one empty black window and nothing occurs. I tried to run first the program and then switch on the board and vice-versa. Thanks
false
35,313,998
-0.099668
0
0
-1
which type of Invensense chip you are using? I think you need to check if you use the right COM Port in windows. Check if you could get data from your MPUxxxx Board through I2C Check log_stm32.c if this function work well fputc(out[i]);
0
733
1
0
2016-02-10T11:30:00.000
python,stm32,discovery
Invensense Motion Driver 6.12 STM32 demo python don't work
0
1
2
38,325,794
1
0
0
I have a Python PyQt program which has a QWidget on the main window. I added 2 different views into the same QWidget. When the user clicks Button1, I show view1 and hide view2. When the user clicks Button2, I show view2 and hide view1. Each view has its own KeyPressEvent for using arrow keys to page through records in the view. I don't want to page through records in both views simultaneously, I just need to page the records of the active view. How can I disable/enable the appropriate KeyPressEvent when the corresponding view is active. Or is the a better approach? Apologies for no code, but it is difficult to simplify my working example.
true
35,324,749
1.2
0
0
0
If you setFocus on an object in the corresponding view that was just made visible, then only that view's keyPressEvent will be triggered. No need to disable or enable keypress events. The focus does this automatically. The solution above is the answer to the question. However, I may change from using QAction buttons to trigger changing the views, to using a tabwidget to change the views instead.
0
80
0
0
2016-02-10T20:00:00.000
python,view,pyqt4
PyQt: Independent KeyPressEvent between 2 different views on a form
0
1
1
35,326,282
1
0
0
Ok, so our world map for a Risk-style conquest game we are making is made of a matrix of mouse-interactive "country" objects containing their own values like name, owner, and unit counts. Right now the entire map is sized to fit within the game screen; we are considering making the map scrollable. A possibly I found was that we generate the map on its own surface that's bigger than the game screen, then blit a portion of the map surface onto a subsurface of the game screen and let player input offset what portion of the map is being drawn at a given time. I know this type of scrolling works- that's not what this question is about- the question is would using this kind of scrolling prevent us from letting the player properly interact with the countries on the map using the mouse? We already tried a form of scrolling where we just offset the indexes of the map matrix to move the countries positions that way, but this gave the server problems handling attack orders as the same two countries could be at different coordinates for different players. The scrolling method I described would allow the map itself to remain stationary for all players, but how would we determine the mouse's position relative to the world map as opposed to its position on the game screen?
true
35,330,326
1.2
0
0
1
You have to translate the mouse position on the screen to the world coordinates. When you scroll your map, you generate an offset, and you have to use that for translation. Say if the map is not scrolled ((0, 0) of the map is at (0, 0) of the screen), and a player clicks on (12, 12), you know she clicked on (12, 12) of the world. When this player scrolled the map to the right (let's say 100px), then you blit the map surface at (-100, 0) of the screen. Now if the player clicks on (12, 12), you can calculate that (12, 12) of the screen is actually (112, 12) on the map (screenX - scrollX, screenY - scrollY). So if you want to determinate which country a player clicked on, always use the translated coordinates (not the screen coordinates), and the issue you describe disappears.
0
192
0
1
2016-02-11T03:35:00.000
python-3.x,scroll,pygame,interactive
pygame- Making mouse-interactive elements on a "scrolling" surface
0
1
1
35,336,224
1
0
0
I have designed my whole pygame to work for 1920x1080 resolution. However, I have to adapt it for smaller resoltion. There is a lot of hardcoded value in the code. Is there a simple way to change the resolution, like resizing the final image at the end of each loop, just before drawing it ?
false
35,333,875
0.099668
0
0
1
i usually create a base resolution and then whenever the screen is resized, i scale all the assets and surfaces by ratios. This works well if you have assets that are of large resolution and you have scaled then down but would pixelate for smaller images. you can also create multiple assets file for each resolution and when ever your resolution goes above one of the available asset resolution you can change the image. you can think in in context of css media query to better understand.
0
1,469
0
1
2016-02-11T08:09:00.000
python,pygame,resolution
Pygame, change resolution of my whole game
0
1
2
35,334,029
1
0
0
Is there a widget that shows a thread visually for Tkinter? reason why. I want to open a Vpython window inside a Tkinter window. I know there is a possibility to open a Vpython thread on the side while Tkinter is active, but can i show it inside Tkinter? (Like in some sort of Frame)
true
35,349,113
1.2
0
0
0
No, there is no widget to do that.
1
96
0
0
2016-02-11T20:10:00.000
python,multithreading,tkinter,vpython
can Python Tkinter widget show a thread?
0
1
1
35,349,400
1
0
0
Is there any way to open push notification tray for iOS on hardware device using Appium and Python. Regards
false
35,358,825
0
0
0
0
No, there no way to open push notification tray for iOS on hardware device using Appium and Python, or any iOS public API.
0
322
0
0
2016-02-12T09:20:00.000
python,ios,iphone,selenium-webdriver,appium
Open push notification tray on iOS hardware device using Appium
0
1
1
35,365,816
1
0
0
I'm building a small project for my android phone using kivy. I am trying to get the android back key to do a make Toast saying 'press back again to exit', and then exit when the back key is pressed twice. I checked online and saw a tutorial on how to do this. I had to useimport android but the problem is that it just doesn't work on my phone. Not on kivy launcher when i tested it. I even compiled to an android apk using buildozer, but it still doesn't work. Please im still very new to kivy and android api. Help me get this right. Or if there is another way to do this i also appreciate it. Please include an example in your response.
true
35,376,747
1.2
0
0
2
Hello guys I finally found the problem. The import android actually works. The problem was that I used it wrongly . I was trying to do a makeToast like dis 'android.makeToast'. Evidently dat was wrong. Found out there was another way to do it with pyjnius. Thanks so ooo much for your assistance
0
614
0
1
2016-02-13T06:11:00.000
android,python,kivy,buildozer
kivy import android doesnt work
0
1
1
35,383,918
1
0
0
I have created a model using QSqlTableModel, then created a tablview using QTableView and set the model on it. I want to update the model and view automatically whenever the database is updated by another program. How can I do that?
false
35,383,018
0.197375
0
1
1
There's no signal emitted for that currently. You could use a timer to query the last update timestamp and refresh the model data at designated intervals.
0
255
0
0
2016-02-13T17:31:00.000
python,pyqt,auto-update,qtableview,qsqltablemodel
Automatically updating QSqlTableModel and QTableView
0
1
1
35,392,361
1
0
0
I would like to deploy a Python3 app that uses tkinter on OpenShift. I added the following to setup.py: install_requires=["Tcl==8.6.4"]. When I ran git push I received the following error: Could not find suitable distribution for Requirement.parse('Tcl==8.6.4'). Can anyone provide the correct syntax, distribution package name and version?
true
35,395,843
1.2
0
0
0
Bryan has answered the question. Tkinter will not work with WSGI. A web framework such as Django must be used.
0
105
1
0
2016-02-14T19:01:00.000
python,openshift
Using Tkinter with Openshift
0
1
1
35,442,172
1
0
0
I'm working on an application using Python (3.4) and PyQt. The goal of the program is to manage and analyze large amount of data - up to ~50 binary files, which might be of total size up to 2-3 GB. When I tried to load a couple files into the program, it stops responding during loading and then takes ~1.5GB RAM just to keep running. My question is quite general - what are the possible methods in python/PyQt for handling such data sets?
false
35,514,886
0.099668
0
0
1
You might consider the HDF5 format, which can access using h5py, pytables, or other python packages. Depending on the dataformat, HDF5 could enable you to access the data on the HD in an efficient manner, which in practice means that you can save memory. The downside is that it requires some effort on your side as a programmer.
1
367
0
1
2016-02-19T20:57:00.000
python,pyqt,pyqt4,python-3.4,large-data
Python - managing large data
0
1
2
35,515,404
1
0
0
I have a multithreaded cython application and would like to pass an extension type between threads that holds a pointer to a thread safe Circular buffer that also makes various calculations. Is there any way to make a c++ container handle a Extension type?
true
35,538,946
1.2
0
0
1
I guess you can just cast to void *, pass it into your container, then convert back to your extension type. It's up to you to ensure you still have a reference to it in order to not let the pointer being invalid.
1
143
0
0
2016-02-21T16:53:00.000
python,cython
Gil-less container for cython extension type
0
1
1
35,573,200
1
0
0
I am programming a game with multiple script files and I am wondering, on the files that I have used pygame.init(), do I have to call pygame.quit() at the end of the file?
true
35,544,448
1.2
0
0
3
You should only call pygame.init() and pygame.quit() on 1 and same file. this the main file where your game loop runs. You will need other scripts for different things but all those you can just import in this main file where game loop runs. If you find this confusing checkout some pygame projects on github that will help you understand the structure. Also studing a little object orientation will help you a lot for making games.
1
62
0
0
2016-02-22T01:32:00.000
python,pygame
Python & Pygame - Does pygame.quit() have to be written at the end of every .py file?
0
1
1
35,544,509
1
0
0
I'm using xlwings on a Mac and would like to set the foreground color of text in a cell from Python. I see that range.color will change background color which I could use but it has an additional problem that the cell borders are overwritten by the new BG color. Is there any way to change foreground text color from Python and/or prevent the cell borders being overwritten by a new BG color?
false
35,584,309
0
0
0
0
This solution is working fine for me. from xlwings.utils import rgb_to_int import xlwings as xw sht.range('A1').api.Font.Color = rgb_to_int((192, 192, 192))
0
5,576
0
3
2016-02-23T17:32:00.000
python,text,colors,xlwings
xlwings: set foreground text color from Python
0
1
4
70,505,321
1
0
0
I want to create an app for Windows but I've to developed it on Mac OS X. I've created a desktop app with Python using PyQt5. The steps that I followed are: Step 1. Create a desktop app (On Mac OS X): Install Qt. Install Sip. Install PyQt5. ¡Develop! Step 2. Package the Python app with PyInstaller(On Windows 8): Install Python. Install Pip-Win. Install PyWin32. Install PyInstaller. Create the executable. The problem is that, when I execute the app on Windows, it shows a window with the following message: Fatal error: app returned -1. Anybody knows what is wrong? Maybe I need to do the Step 1 on Windows too?
false
35,598,908
0.197375
0
0
1
PyInstaller brings together every dependancy of your python script. But you need to install all dependancies before running pyinstaller. So, before running it on windows, you must install qt5, sip and pyqt5.
1
520
0
1
2016-02-24T10:02:00.000
python,windows,macos,qt,pyqt5
Desktop app created with PyInstaller doesn't run
0
1
1
35,684,613
1
0
0
I am unable to find a pygame download for Python 3.5 and the ones I have downloaded don't seem to work when I import to the shell. Help? This is the message I receive on the shell: import pygame Traceback (most recent call last): File "", line 1, in import pygame ImportError: No module named 'pygame'
false
35,609,592
0
0
0
0
Even when you have windows 64 bit you need to get the win32.whl file , then follow the standard instructions
1
27,913
0
6
2016-02-24T17:59:00.000
python,python-3.x,pygame
How do I download Pygame for Python 3.5.1?
0
1
6
39,562,265
1
0
0
I am currently trying to create a canvas which will have other objects on it and I want to use a scroll-bar for when the objects on the canvas take too much space so that the size of the window will stay the same. The problem is that although I set an initial size for the canvas it changes to fit all of the objects on it. Can I make the canvas to keep a specific size so that I can use the scroll-bar instead?
false
35,669,264
0
0
0
0
myscrollbar = Scrollbar(myframe,orient="vertical",command=canvas.yview) canvas.configure(yscrollcommand=myscrollbar.set)
0
1,958
0
0
2016-02-27T11:42:00.000
python,canvas,tkinter
tkinter fixed canvas size
0
1
2
35,670,592
1
0
0
So recently I made a script, and I also finished gui and managed to merge those two together. Now i wish when I start the exe file that cmd doesn't appear but instead only GUI? Any idea on how to manage this? So far my searching didn't yield any satisfying results. Some more info is: Python 3.5, using pyinstaller to convert to exe, Tkinter Gui, pycharm 5.0.1. Thanks!
false
35,685,734
0
0
0
0
Since your question mentions .exe executables, I'wll assume you work in the Windows environment. Try using a .pywextension instead of a .py extension for the python program.
1
89
0
0
2016-02-28T17:23:00.000
python,user-interface,python-3.x
How do I stop cmd from appearing when i run exe file (python 3, gui)
0
1
1
35,685,792
1
0
0
I have a problem statement- to develop an application for processing DICOM images for diagnostic applications from scratch. It includes: Image processing- model based segmentation and registration (C++) Visualization- 2D and 3D image visualization (C++) Graphical User Interface (Python) Is it feasible to develop this using C++ (for large chunk of image data) and Python for the GUI? What are the pros and cons of using openCV? Which libraries would be suitable for this?
true
35,715,313
1.2
0
0
0
I would say go with VTK, ITK and Qt. Python brings nothing to the table in terms of GUI compared against Qt. VTK/ITK can read DICOM for you and probably also do segmentation and registration as needed.
0
803
0
1
2016-03-01T05:27:00.000
python,c++,opencv,visualization,dicom
DICOM image processing, visualization and GUI- C++ and Python
0
1
1
35,716,718
1
0
0
I am using Pyinstaller (after spending a long time with py2exe) to convert my REAL.py file to .exe. I used Anaconda to make .py file which is running perfectly on my computer. But when I make .exe file, it shows no error and an application is created in dist\REAL folder. But when I run the .exe file, the console opens and closes instantly. It should ideally show a GUI window and take inputs and use them to make plots. It does so when I run REAL.py file. I am using Tkinter, Matplotlib, numpy, scipy which comes with Anaconda. EDIT: I tried to run simple code to check the compatibility with matplotlib: import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.ylabel('some numbers') plt.show() The same issue persists with this. Opens console window and then closes but no plot is given out.
false
35,737,188
0
0
0
0
Try using the --hidden-import=matplotlib when calling pyinstaller. For example, in the command prompt you would type: Pyinstaller --hidden-import=matplotlib your_filename_here.py and you could try giving it a shot with tkinter in there as well. Pyinstaller --hidden-import=matplotlib --hidden-import=tkinter your_filename_here.py
1
2,158
0
1
2016-03-02T02:13:00.000
python-2.7,anaconda,pyinstaller
Pyinstaller with Tkinter Matplotlib numpy scipy
0
1
2
47,044,598
1
0
0
I have tried following the steps on the website but they're not working for me. At least I must be doing something for them not to work. Firstly, before the steps, the site tells me to open the command line and type python --version. So I typed on the windows search bar 'command line'. Python (command line) came up and I went ahead and typed python --version and I got the error python is not defined along with other stuff. So I decided to try the command prompt, the second option to come up when I typed 'command line' in on my windows search. It returned saying that it was not recognized as an internal or external file. I attempted step 1, just to try my luck, on both the Python command line and the command prompt and nothing really happened. I'm not really sure what to do now.
false
35,779,145
0.039979
0
0
1
i have encountered a simillar setback while trying to install kivy on python. in python version 3, py is used instead of python for launching python in the command prompt i.e py (to launch python3) py -m pip install kivy (to install kivy) N.b: before installing kivy it is recommended to install cython and other python dependencies using py -m pip install cython
1
12,655
0
0
2016-03-03T17:37:00.000
python,kivy
How to install kivy on Windows 10
0
1
5
41,786,561
1
0
0
I'm fairly far along developing a Kivy app. Its targeted for android, but will also work (simultaneously with a different skin) on desktops and hopefully iOs eventually. The basic dependencies I'm heavily using are:- twisted - using this as an IPC, my app has a server/client relationship between the data manipulation and the UI Whoosh - for text search xmltodict - for easy XML manipulation I'm having REALLY long app startup times on android, on a relatively recent phone, which doesn't bode well. From my rough timings (based on time.time() and subtracting from my App's init time):- My app gets control from kivy startup at about 1 second in My initialization of custom classes etc. is done at the 2.4 second mark At the 14.4 second mark, I finally complete the bulk of my data loading At the 17 second mark, I start sending the data out to the client UI using twisted At the 22 second mark, the UI receives the data There's multiple points I want to address there. For example the roughly 5 second gap for data send can be easily broken into pieces and updated in the UI piecemeal, so I'm keeping that for later, but I need to ask about the long 12 second gap for data loading. This data loading involves creating about a 1000 instances of a custom class, with the following steps (cumulative time over 1000 instances):- Reading data from 1000 text XML files (0.734 seconds) Parsing the XML in the read data (9.198 seconds) Filling the object's variables based on the parsed XML (0.585 seconds) Directory tree traversal (use this to locate a certain base folder, 0.0824 seconds) mtime measurement for the xml files (0.12 seconds) The measured timings surprised me, because the equivalent timings for running the same code on my laptop are 0.041, 0.9, 0.062, 0.009, and 0.016). Everything's about 10 times slower. What, if anything, can I do about this? The phone being used for testing has 3GB of RAM and a Snapdragon 801 processor, so I'm quite worried about using this app on slower/older models. My initial thoughts were that the slow-down was due to sd cards being inherently slower than my laptop's hard disk drive, but the fact that xml parsing (non IO related) took so long seems to indicate processing problems. Suggestions/criticisms welcome.
false
35,788,298
0.197375
0
0
1
The immediate possibility is that you're just seeing the android processor be slower than the desktop one. I'm not sure what the benchmark comparisons are nowadays, but I've seen this be a problem in the past. That said, I'd have guessed the same as you that the difference shouldn't be that big. I don't know if it would make a difference, but one general thing to try might be to compile for armeabi-v7a (rather than the default armeabi). This enables hardware floating point calculation, amongst other things. I don't know if it makes a difference in generic apps, but it certainly could. You can target this using the python-for-android master branch with --arch=armeabi-v7a, or the android_new target in the buildozer master branch (the rest of buildozer operation is the same, and it automatically uses v7a). Another question would be, do you have access to a more efficient xml parser? If you can find one in e.g. cython rather than python (I don't know what you're using right now), this could make a difference. I see the other alternative of using a more efficient data structure has already been raised in a comment. Sorry that neither of these suggestions are very specific. If you ask on the kivy support channels you may find someone who's found and resolved similar issues.
0
1,330
0
1
2016-03-04T04:58:00.000
android,python,optimization,kivy
Python on android (kivy) - speed bottlenecks for certain operations?
0
1
1
35,795,097
1
0
0
Recently , I wanted to install OpenCV (in Win10 64 bit ) using Cmake 3.5.0-rc3 and Visual studio 2015 . I have python 3.5 as root and 2.7 as python2 . The issue is while configuring it recognizes python 3.5 as main interpreter but i want it to be 2.7.Is there a possible way to make cmake recognize 2.7 as my main python while maintaining python 3,5 in my PC . I can probably do it by deleting python 3.5 but i dont want that . Help is very much appreciated.Thanking you , P.S. If there is a simpler way to install OpenCV along with extramodules in WIndows ,please do tell me thanks in advance
false
35,805,904
0.197375
0
0
1
You should look for Python related variables in the CMake GUI. There may be some variables you could set to force paths to the python2.7 interpreter, libs and include dirs.
0
102
1
0
2016-03-04T20:58:00.000
python,visual-studio,opencv,cmake,cmake-gui
Managing OpenCV python Cmake Studio Windows
0
1
1
35,806,266
1
0
0
New to Theano when I tried to use the package I keep getting the following error: ImportError: ('The following error happened while compiling the node', Dot22(, ), '\n', 'dlopen(/Userdir/.theano/compiledir_Darwin-14.3.0-x86_64-i386-64bit-i386-2.7.11-64/tmpEBdQ_0/eb163660e6e45b373cd7909e14efd44a.so, 2): Library not loaded: libmkl_intel_lp64.dylib\n Referenced from: /Userdir/.theano/compiledir_Darwin-14.3.0-x86_64-i386-64bit-i386-2.7.11-64/tmpEBdQ_0/eb163660e6e45b373cd7909e14efd44a.so\n Reason: image not found', '[Dot22(, )]') Can someone tell me how to fix this issue? Thanks.
false
35,811,941
0
0
0
0
get rid of theano and reinstall. If that doesn't work, reinstall all of python
0
46
0
0
2016-03-05T08:34:00.000
python-2.7,anaconda,theano
Running Theano on Python 2.7
0
1
1
42,725,755
1
0
0
I am using kivy to create an android app. However some important pieces of code are based on the python os module. Now since the os is supposed to be system-dependant, i was wondering if it would work on a mobile device running android. If it doesn't work is there some other way to achieve the same results? Also, the app needs to save and retrieve data based on the user's actions. Currently, i am reading and writing to plain .txt files to achieve that, but will it work on an android device? Is there a more flexible alternative?
true
35,816,195
1.2
0
0
4
Yes, It'll work. os works on windows, linux and mac and android is well.. linux. If python runs on it, os will too. For simple storing you can use os.path.dirname(os.path.abspath(__file__)) and it'll store data in your data/<app>/ or data/data/<app>/ on android, so common user will not access it. Of course if your app is built that way. It's nice to make yourself a folder for such files, because it can become messy when you use too much files. If it's built the way it will use sdcard, it'll place data to your sdcard/<app>/ if I remember correctly.
0
2,556
0
2
2016-03-05T15:51:00.000
android,python,kivy
Will python os module work on android?
0
1
1
35,817,419
1
0
0
I'm in the process of making a simple game in pygame. Its looking to be a platformer RPG. But that is neither final or relevant per this question. So far i have very little functionality in the game. Its just a skeleton at this point if that. My question is kind of two fold: Whats the best (in terms of performance and flexibility) way to add gravity to classes in pygame? What are the best practices for adding gravity in general? For example, do you just simply do a "if keyPressed == k_W then subtract 2pixels per tick from player-y for 20 ticks" or something with velocity in the up or negative-y direction? I've seen other posts on adding gravity to games after the fact, where adding it really wasn't thought about during initial development. I want to add it in as early as possible so instead of adding gravity to other things, i can add other things to gravity. I'm going to continue to read up on this, so if you prefer to point me in the direction of some online resources, I'd much appreciate that as well!
false
35,820,336
0
0
0
0
Quick dislaimer: I do not know multiple ways to incorporate gravity, so I can not say which is "best". But, if you're fighting the performance battle in Python, you've probably fighting the wrong battle. For gravity, you can use a vector system. Say a character jumps off the ground and has initial velocity of [5, -15] (negative y because positive y is down!), you can move your character's rect by this velocity every frame to simulate movement. To throw gravity into this, you need to add 9.8 to your y velocity component value every second. So 1 second in, the velocity will be about [5, -5]. This will have your character slow to a stop, and begin moving down. For key pressed movement, I recommend using booleans. An example, upon pressing k_U , a variable that says you are moving up becomes True. Then, if this variable is True, you move him, say, [0, -5]. Upon keyup, set variable to false. Do this for north/east/south/west, and then you have a movement system in 4 directions, that moves you while you hold the key down.
0
238
0
3
2016-03-05T21:49:00.000
python,pygame,gravity
Pygame - Gravity Methods
0
1
2
35,822,375
1
0
1
I get a gtk-WARNING when trying: cv2.imshow("WindowName", image) I'm using this to watch a live stream one frame at a time. Are there any alternative libraries I could use? I tried several other options like PIL and Tkinter as well as wand, but could get none of them to work for various different reason.
false
35,901,246
0.379949
0
0
2
You need to use a windowing system to display images using imshow. (That can be enabled in settings running sudo raspi-config) If you absolutely, positively need to display images without using a windowing system, consider providing an html/web interface. Two options that come to mind when serving a web interface are: Creating an HTTP video stream (serve the output image as if it's an IP camera, kind of) Stream the output matrix as a jpg blob via websockets
0
1,687
0
2
2016-03-09T19:48:00.000
python,linux,opencv,terminal,raspberry-pi
Show image using OpenCV in Python on a Raspberry Pi terminal
0
1
1
35,901,608
1
0
0
I have a .cpp and .h source file pair which is a manager (I guess a wrapper also) for a c++ library I have made. I want to let people use this manager to work with my library in python. I have heard about several different ways to wrap this library into python like cython and boost.python but Im having trouble with understanding the process. If I want to make this manager usable in python, do I need to wrap it in a different way for each version of python? (2.7 vs 3.4) Do I also need to wrap it in a different way for each operating system for each version? So 2.7/3.4 for Windows vs 2.7/3.4 for Linux?
true
35,901,908
1.2
0
0
1
Concerning your confusion about the process, just follow any tutorial for any of the wrapper libs you found or where suggested in the comments. If I want to make this manager usable in python, do I need to wrap it in a different way for each version of python? (2.7 vs 3.4) Yes. You might be able to load binary modules compiled for Python 3.4 into Python 3.5, but it's unlikely to work across major versions. Do I also need to wrap it in a different way for each operating system for each version? Yes. Just as you need to compile your C++ code for different operating systems (and possibly versions) and CPU architectures, Python modules are not different. However, the "wrap it in a different way" just means "compile for the target environment".
1
85
0
0
2016-03-09T20:28:00.000
python,c++,wrapper
Confusion wrapping c++ library to python
0
1
1
35,902,761
1
0
0
I begun to develope with Python and Kivy and I really like it :-) For daily business I'm a Java developer and also a an eclipse child. So i decided to setup eclipse (Mars) with Python, means install PyDev-Plugin and create the settings (done in one button-click). But I have a problem, my eclipse do not want to recognize the kv-files as python files. So my question has anyone experience with this set up? Do anyone knows a good set up tutorial? Thanks for your help
false
35,903,034
0.379949
0
0
2
*.kv files aren't Python files. I don't think trying to treat them as such is really what you want to do. If you must, you can choose to treat *.kv files as python files by going to Preferences > General > Editors > File Associations and adding an entry for *.kv with the Python Editor as an associated editor. My own personal preference, however, is to use YEdit YAML editor for *.kv files. It won't recognize Python syntax in expressions, but it works well enough for me. If you're willing to use an external editor, you can get Kv-lang syntax highlighting in Vim. If you're willing to learn to use Vim. Which you should, because Vim is awesome. Finally, if you're willing to pay, the developer of PyDev also develops a closed source fork of Eclipse called Liclipse, which, if I recall correctly, has syntax highlighting, outlining, and autocomplete in kv files.
0
451
0
1
2016-03-09T21:31:00.000
python,ubuntu-14.04,kivy,pydev
Kivy development in eclipse PyDev on Ubuntu 14.04 SetUp
0
1
1
35,906,874
1
0
0
I have python 2.7 under windows x64, I have been trying to make a simple GUI using PyQt4, like this: from PyQt4 import * from ui_mainwindow import Ui_MainWindow class MainWindow(QtGui.QMainWindow, Ui_MainWindow): when I run the program I have this error: " No module named ui_mainWindow" -I have pyqt4 installed - I have tried to replace um_mainwindow with ui_simple and clientGUI but the same error resulted. What am I doing wrong and how to fix this? thank you
false
35,914,596
0
0
0
0
As far as I know, ui_mainWindow is a python file generated by some Qt Tool, that transforms .ui file from QtDesigner to Python class. I have no real experience with PyQT, but I know both C++/Qt and python. In C++/Qt QtCreator does the job of transforming .ui file to C++ class, but probably in python You need to do this Yourself.
0
831
0
0
2016-03-10T11:02:00.000
python,python-2.7,pyqt4
python 2.7 under windows: cannot import ui_mainwindow
0
1
1
35,914,964
1
0
0
I'm working with Openslide's python bindings. I am using Tif images, which are supported by Openslide. It seems I am able to use the methods read_region and get_thumbnail with a smaller, binary masked Tif of about 100 mb's. However, with a larger, RGBa Tif of about 1.5 Gb, I get the following error: openslide.lowlevel.OpenSlideError: Wrong JPEG library version: library is 90, caller expects 80 I have libjpeg8d installed, and everything seems fine with a smaller Tif. Any suggestions on how fix this issue?
true
35,924,270
1.2
0
0
1
I would guess your smaller TIFF is not JPEG-compressed, but your larger one is. When libtiff starts the jpeg decoder, it checks that the version number in the libjpeg library binary matches the version number in the libjpeg headers that it was compiled against, and if they do not match, it prints the warning you are seeing. The error means that you have installed a new jpeg library, but not recompiled libtiff or perhaps openslide. You don't say what platform you are using, but on linux these issues should all be handled for you by your package manager, as long as you stick to the supported versions. If you've built any parts of the system yourself, you'll need to recheck how each part was configured and installed, and how your environment has been set up.
0
574
0
0
2016-03-10T18:19:00.000
python,error-handling,libjpeg,openslide
Openslide libjpeg error: Wrong JPEG library version
0
1
1
35,983,246
1