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 run python in my Android Terminal and want to run a .py file with: python /sdcard/myScript.py The problem is that python is called in my Android enviroment indirect with a shell in my /system/bin/ path (to get it direct accessable via Terminal emulator). My exact question, how the title tells how to pass parameter through multiple Shell scripts to Python? My direct called file "python" in /System/bin/ contains only a redirection like: sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh and so on to call python binary. Edit: I simply add the $1 parameter after every shell, Python is called through like: sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh $1 so is possible to call python /sdcard/myScript.py arg1 and in myScript.py as usual fetch with sys.argv thanks
true
35,928,155
1.2
1
0
0
I don't have experience in Android programming, so I can only give a general recommendation: Of course the naive solution would be to explicitly pass the arguments from script to script, but I guess you can't or don't want to modify the scripts in between, otherwise you would not have asked. Another approach, which I sometimes use, is to define an environment variable in the outermost scripts, stuff all my parameters into it, and parse it from Python. Finally, you could write a "configuration file" from the outermost script, and read it from your Python program. If you create this file in Python syntax, you even spare yourself from parsing the code.
0
373
1
0
2016-03-10T21:58:00.000
android,python,shell,qpython
Pass parameter through shell to python
0
2
2
35,935,344
1
0
0
I run python in my Android Terminal and want to run a .py file with: python /sdcard/myScript.py The problem is that python is called in my Android enviroment indirect with a shell in my /system/bin/ path (to get it direct accessable via Terminal emulator). My exact question, how the title tells how to pass parameter through multiple Shell scripts to Python? My direct called file "python" in /System/bin/ contains only a redirection like: sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh and so on to call python binary. Edit: I simply add the $1 parameter after every shell, Python is called through like: sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh $1 so is possible to call python /sdcard/myScript.py arg1 and in myScript.py as usual fetch with sys.argv thanks
false
35,928,155
0
1
0
0
I have similar problem. Runing my script from Python console /storage/emulator/0/Download/.last_tmp.py -s && exit I am getting "Permission denied". No matter if i am calling last_tmp or edited script itself. Is there perhaps any way to pass the params in editor?
0
373
1
0
2016-03-10T21:58:00.000
android,python,shell,qpython
Pass parameter through shell to python
0
2
2
36,178,959
1
0
0
Total beginner here, so please be gentle. I have a example.cpp file which has one main function which accepts some input parameters and returns an integer value. How would I run this .cpp file from within Python such that I can specify the input parameters from within Python and access the output of the .cpp so that it is stored in Python? Thanks I've modified the main function to accept command line input. What do you mean by "returns its result as its exit code", kindall? Also, want to add that I'd want to return a vector created from the .cpp so that the variable is in Python
false
35,929,840
0
0
0
0
You can't run a .cpp file, as you need to compile a binary from your .cpp file before you can execute it. first, try to compile it using your terminal, after that you might port it to python, and automate it in a Python script (I guess, that's why you want to do it in Python).
1
684
0
0
2016-03-11T00:08:00.000
python,c++
Python/C++: Running .cpp in Python
0
1
2
35,929,867
1
0
0
I am currently writing a wxPython GUI with Twisted Python integrated to be able to send basic text over LAN to a RaspberryPi. I am at a point where I want some help figuring out the design path that would be best for this project when it comes to the way I should implement my networking. To briefly give more context to the project I have been tasked to create a GUI that connects to a RaspberryPi which controls a research grade CCD, (basically an Astronomy use only camera) a very expensive piece of equipment. I will be sending commands, given by the user over, the local network to a TwistedPython server that uses a "parser" to send the commands to the CCD drivers. On to figuring out the network design philosophy. I am at the point where the major components of my GUI are implemented and just start needing to talk over the network. As for the network coding, I have successfully implemented in a few buttons the code needed to send text over the network (e.g. when I hit the camera expose button it sends the file name and time of exposure). It is at this point where I need to decide on whether I should be using threading or not. I have some experience in threading through C programming with openMP, MPI, and Pthreads, but I can't wrap my head around what "kind" of threading I should be using. Some research has lead me to see that there is the Python built in threading and then threading with TwistedPython. I fail to see the big differences in the two when it comes to how they work. Overall, I think I want it so I can just simply open up a separate thread for Twisted and then send a line of text off and then close it when I am done. However, I am not sure which way of threading I should implement this. There is also the possibility that I don't even need to implement threading if I am only sending small bits of data over the area network. There is one part in my GUI that I know will need threading and that would be a progress bar that updates via a clock. The GUI should still be usable while this is going on, because in Astronomy you can have exposures lasting over ten minutes. Anyway can some of you folks help me pose the right questions for my needs? Thanks
false
35,931,803
0
0
0
0
It looks like this is an really "old" question without any answer. I hope you have figured it out by now, if not I have a solution you might be interested. I have done something similarly, except I was using an Arduino with an EthernetShield. I use socket to communicate through LAN and python built-in thread (threading.Thread) to do whatever task it needs to be done. Now the question is that are you having your GUI inside your Twisted framework? If so, then you should simply rely on the Twisted framework to make your code more maintainable. If not, since your GUI is already built, you can use the method I mentioned above to communicate to the server. If my understanding is wrong, you should clear with me on the architecture/relationship of the GUI, Twisted, and server.
1
89
0
3
2016-03-11T03:44:00.000
python,multithreading,wxpython,twisted
Python GUI implementation direction
0
1
1
48,219,389
1
0
0
So, I'm creating a client manager software for a local club. I'm using Python 3.5.1 and Tkinter. Used a Notebook to nest my Frames. On my first frame I made the form to add new clients (labels and textboxes) and an "add" button at the end. Problem is that it executes the function associated with the button insted of onclick, and the button actually does nothing on click. Been searching everywhere and it seems a rare problem. Help?
false
35,966,578
-0.099668
0
0
-1
I would try using lambda: before the command. For instance, replace readFile(file) with lambda: readFile(file). This will ensure an anonymous ("lambda") function with no parameters is passed, which upon execution will run the intended code. Otherwise, the function is executed once when the behavior is set, then the returned value is simply re-evaluated every time rather than the appropriate function being called.
0
451
0
0
2016-03-13T04:43:00.000
python
Python 3.5.1, Tkinter: Functions execute on start instead of button click
0
1
2
35,966,622
1
0
0
I have written a program in Python which draws parts of the Mandelbrot set using pygame. However, when I leave it running to generate for a long time and then save the file I get this error: pygame.error: SavePNG: could not open for writing I'm not sure why this would happen and saving works fine usually. Perhaps when the computer goes to sleep something stops working? But more importantly does anyone know how to fix this?
false
35,968,464
0
0
0
0
Are you on windows or on mac? If you're on windows look if you wrote the location like this "\folder\thing.png", that's an error because you put the starting "\". Remove that and try again.
0
1,146
0
1
2016-03-13T09:08:00.000
python,image,crash,save,pygame
pygame.error: SavePNG: could not open for writing?
0
1
1
51,588,818
1
0
0
I made a program with using sqlite3 and pyqt modules. The program can be used by different persons simultaneously. Actually I searched but I did not know and understand the concept of server. How can i connect this program with a server. Or just the computers that have connections with the server is enough to run the program simultaneously?
true
35,986,526
1.2
0
1
2
Do u want to connect to sqlite database server? SQLite Is Serverless. It stores your data in a file. U should use maria db for db server. Or u can store your sqlite database file in a network shared drive or cloud or...
0
59
0
0
2016-03-14T11:38:00.000
python,sqlite,server
How to connect my app with the database server
0
1
1
35,986,703
1
0
0
Is there a way to cut a transparent rectangle in the background of a wxFrame to see the desktop or other windows behind that rect? Custom shape is not an option since I want to capture mouse events there too.
true
35,991,038
1.2
0
0
1
No, the only possibilities here are using a custom shape or SetTransparent() but the latter can only set the transparency uniformly. SetTransparent() could probably be extended to be more flexible, but so far nobody has done it.
0
107
0
0
2016-03-14T15:03:00.000
wxpython,wxwidgets
Transparent hole in wxFrame background
0
1
1
35,992,362
1
0
0
Hi have been scavenging the web for answers on how to do this but there was no direct answer. Does anyone know how I can find the version number of tkinter?
false
35,999,344
0.132549
0
0
4
Run Tkinter.TclVersion or Tkinter.TkVersion and if both are not working, try Tkinter.__version__
0
40,994
1
27
2016-03-14T22:30:00.000
python-3.x,tkinter
How to determine what version of python3 tkinter is installed on my linux machine?
0
2
6
35,999,383
1
0
0
Hi have been scavenging the web for answers on how to do this but there was no direct answer. Does anyone know how I can find the version number of tkinter?
false
35,999,344
0.16514
0
0
5
Type this command on the Terminal and run it. python -m tkinter A small window will appear with the heading tk and two buttons: Click Me! and QUIT. There will be a text that goes like This is Tcl/Tk version ___. The version number will be displayed in the place of the underscores.
0
40,994
1
27
2016-03-14T22:30:00.000
python-3.x,tkinter
How to determine what version of python3 tkinter is installed on my linux machine?
0
2
6
63,566,647
1
0
0
I am trying to set up Cocos2d-x for Android in Windows using python, but my ROOT values give me an error. My path to my ndk folder is: C:\Users\user\AppData\Local\Android\ndk\android-ndk-r11 When I try to run setup.py is asks "Please enter the path of NDK_ROOT: ". I enter in my path to the ndk but it then says: "Error: "ndk folder path here" is not a valid path of NDK_ROOT. Ignoring it. I have also tried manually entering it in my environmental variables, but it still does not work. What is my error here? My adk folder contains the following: build (folder) platforms (folder) prebuilt (folder) python-packages(folder) sources (folder) toolchains (folder) CHANGELOG.md (md file) ndk-build (Windows command script) source.properties (properties file) Edit: I have now gotten the NDK to accept on the build folder in my previous location, but there is still an issue with the NDK when I try to create a project.
true
36,001,080
1.2
0
0
2
There are some changes made on the new NDK r11 release and some tools were moved to different folders, I guess cocos2d-x scripts need to be updated to support the latest NDK release. You can wait for a new cocos2d-x release or use the previous NDK (r10e) version.
0
3,355
0
0
2016-03-15T01:25:00.000
android,python,android-ndk,cocos2d-x
NDK_ROOT path for ndk r11 in Cocos2d-x
0
5
5
36,012,463
1
0
0
I am trying to set up Cocos2d-x for Android in Windows using python, but my ROOT values give me an error. My path to my ndk folder is: C:\Users\user\AppData\Local\Android\ndk\android-ndk-r11 When I try to run setup.py is asks "Please enter the path of NDK_ROOT: ". I enter in my path to the ndk but it then says: "Error: "ndk folder path here" is not a valid path of NDK_ROOT. Ignoring it. I have also tried manually entering it in my environmental variables, but it still does not work. What is my error here? My adk folder contains the following: build (folder) platforms (folder) prebuilt (folder) python-packages(folder) sources (folder) toolchains (folder) CHANGELOG.md (md file) ndk-build (Windows command script) source.properties (properties file) Edit: I have now gotten the NDK to accept on the build folder in my previous location, but there is still an issue with the NDK when I try to create a project.
false
36,001,080
0
0
0
0
Try adding a "\" at the end. I know it sounds silly, but I had the same problem when setting up on my MacOs. Beyond that, see if you'll encounter other problems like.... wrong toolchain version when compiling
0
3,355
0
0
2016-03-15T01:25:00.000
android,python,android-ndk,cocos2d-x
NDK_ROOT path for ndk r11 in Cocos2d-x
0
5
5
36,040,698
1
0
0
I am trying to set up Cocos2d-x for Android in Windows using python, but my ROOT values give me an error. My path to my ndk folder is: C:\Users\user\AppData\Local\Android\ndk\android-ndk-r11 When I try to run setup.py is asks "Please enter the path of NDK_ROOT: ". I enter in my path to the ndk but it then says: "Error: "ndk folder path here" is not a valid path of NDK_ROOT. Ignoring it. I have also tried manually entering it in my environmental variables, but it still does not work. What is my error here? My adk folder contains the following: build (folder) platforms (folder) prebuilt (folder) python-packages(folder) sources (folder) toolchains (folder) CHANGELOG.md (md file) ndk-build (Windows command script) source.properties (properties file) Edit: I have now gotten the NDK to accept on the build folder in my previous location, but there is still an issue with the NDK when I try to create a project.
false
36,001,080
0
0
0
0
I know android studio should set you ndk path in local.properties,there is the setting: ndk.dir=C:\android-ndk-r10e sdk.dir=C:\Studio_SDK
0
3,355
0
0
2016-03-15T01:25:00.000
android,python,android-ndk,cocos2d-x
NDK_ROOT path for ndk r11 in Cocos2d-x
0
5
5
36,001,423
1
0
0
I am trying to set up Cocos2d-x for Android in Windows using python, but my ROOT values give me an error. My path to my ndk folder is: C:\Users\user\AppData\Local\Android\ndk\android-ndk-r11 When I try to run setup.py is asks "Please enter the path of NDK_ROOT: ". I enter in my path to the ndk but it then says: "Error: "ndk folder path here" is not a valid path of NDK_ROOT. Ignoring it. I have also tried manually entering it in my environmental variables, but it still does not work. What is my error here? My adk folder contains the following: build (folder) platforms (folder) prebuilt (folder) python-packages(folder) sources (folder) toolchains (folder) CHANGELOG.md (md file) ndk-build (Windows command script) source.properties (properties file) Edit: I have now gotten the NDK to accept on the build folder in my previous location, but there is still an issue with the NDK when I try to create a project.
false
36,001,080
0.039979
0
0
1
if you want to set relative path that work on all other fellow system without changing again and again then set ndk root path in such a way. NDK_ROOT="$APP_ROOT/../your ndk name" your ndk is placed one directory behind the proj.android file.
0
3,355
0
0
2016-03-15T01:25:00.000
android,python,android-ndk,cocos2d-x
NDK_ROOT path for ndk r11 in Cocos2d-x
0
5
5
38,472,553
1
0
0
I am trying to set up Cocos2d-x for Android in Windows using python, but my ROOT values give me an error. My path to my ndk folder is: C:\Users\user\AppData\Local\Android\ndk\android-ndk-r11 When I try to run setup.py is asks "Please enter the path of NDK_ROOT: ". I enter in my path to the ndk but it then says: "Error: "ndk folder path here" is not a valid path of NDK_ROOT. Ignoring it. I have also tried manually entering it in my environmental variables, but it still does not work. What is my error here? My adk folder contains the following: build (folder) platforms (folder) prebuilt (folder) python-packages(folder) sources (folder) toolchains (folder) CHANGELOG.md (md file) ndk-build (Windows command script) source.properties (properties file) Edit: I have now gotten the NDK to accept on the build folder in my previous location, but there is still an issue with the NDK when I try to create a project.
false
36,001,080
0
0
0
0
I have figured out that at the time of this post, the NDK11 has just been released and the current version of Cocos2dx does not support it. I had to find a download link elsewhere to download an older version.
0
3,355
0
0
2016-03-15T01:25:00.000
android,python,android-ndk,cocos2d-x
NDK_ROOT path for ndk r11 in Cocos2d-x
0
5
5
36,167,731
1
0
0
I have created a GUI on Python 2.7.11 that consists of a main page along with page 1 and page 2 that are linked through buttons on main page. Converted main page to a python exe file using PyInstaller and there were no errors in the conversion. main page.exe appeared in the dist folder but on clicking it, a DOS screen flashed and the main page did not open nor persist on the screen. Being a beginner, I am not sure about how to proceed further. Please help.
false
36,007,373
0.099668
0
0
1
There were multiple issues associated with converting the Python Script that links modules through button clicks. Keeping in mind these factors, it would be best to convert it to exe using Cx_Freeze. It is more user-friendly and was highly effective for the GUI when compared to PyInstaller and Py2Exe.
1
265
0
1
2016-03-15T09:34:00.000
python-2.7,tkinter,exe
Tkinter exe file - DOS screen flashes but GUI does not persist
0
2
2
36,943,399
1
0
0
I have created a GUI on Python 2.7.11 that consists of a main page along with page 1 and page 2 that are linked through buttons on main page. Converted main page to a python exe file using PyInstaller and there were no errors in the conversion. main page.exe appeared in the dist folder but on clicking it, a DOS screen flashed and the main page did not open nor persist on the screen. Being a beginner, I am not sure about how to proceed further. Please help.
true
36,007,373
1.2
0
0
1
If you've got a line like root.mainloop() at the end (with root standing for your main Tk window) to make sure the event loop runs, then you'll need to debug your code. Try running a small segment of the code at a time to see if all goes well, and see where it is that all doesn't go well; then examine the offending part closely to find the error, maybe running some lines of code in the interpreter from the command line to see what (if any) error messages you get. On the other hand, if you don't have a line like root.mainloop() at the end, that could produce the error you saw. Being a Python beginner myself, and having learned to program in Tcl where the Tk event loop runs automatically, I've seen that error a few times myself. :o(
1
265
0
1
2016-03-15T09:34:00.000
python-2.7,tkinter,exe
Tkinter exe file - DOS screen flashes but GUI does not persist
0
2
2
36,009,578
1
0
0
When I try to use the turtle module with the python 2.7.11 shell, the turtle graphics window that does not respond. Can I use the python 2.7.11 shell with the turtle module?
true
36,073,457
1.2
0
0
0
With the 2.7.11 python shell it won't let use use the features of the turtle module. Sorry
0
138
0
0
2016-03-17T23:24:00.000
python-2.7,turtle-graphics
Can I use python 2.7 shell with the turtle module?
0
1
1
36,073,624
1
0
0
I have two questions regarding tkinter that I cant seem to find the answer too. 1) I currently have 2 radio buttons. I have programmed them in such a way that when one of them is clicked another definition is called and that creates a regular button on the screen. Now my problem is, if the user toggles between the both radio buttons, each time a new button will be created (instead of just having 1 the first time he toggles the options). Is there any way I can stop the extra buttons from being created if one already exsists? 2) Is there a widget that can easily be used to create check box lists? EDIT: Sorry, I meant check box list not radio button list.
true
36,085,002
1.2
0
0
2
1> Define you button outside the eventHandler of the radiobutton. inside the event handler only grid/pack it,whenever the radiobutton is pressed. In this way the button will not be defined multiple times. N.B. Use fix row & column with the grid if you need.
0
26
0
0
2016-03-18T12:57:00.000
python,python-3.x,tkinter
Doubts about checking if button is already displayed and making a list of radio buttons
0
1
1
36,085,149
1
0
0
Simple question, have parsed numerous search results, haven't found a simple answer. I set a very urgent button to red if something is not found so users click it first. Once clicked, I want to set the background back to normal like button.config(bg=''). I tried 'grey' but it's not the right color. What do I set it to?
false
36,093,839
0.049958
0
0
1
The default background color of tkinter is #f0f0f0. Hope this helps ;)
0
15,651
0
14
2016-03-18T20:40:00.000
python,tkinter
How to reset background color of a python tkinter button?
0
2
4
68,903,355
1
0
0
Simple question, have parsed numerous search results, haven't found a simple answer. I set a very urgent button to red if something is not found so users click it first. Once clicked, I want to set the background back to normal like button.config(bg=''). I tried 'grey' but it's not the right color. What do I set it to?
false
36,093,839
1
0
0
7
The default colour for buttons is SystemButtonFace. I am not sure how many versions of Windows this spans back to, but it is the default system colour for buttons. You can find the default colours by using @Bryan Oakley's answer above, and then print() it to the console.
0
15,651
0
14
2016-03-18T20:40:00.000
python,tkinter
How to reset background color of a python tkinter button?
0
2
4
44,747,033
1
0
0
I have been learning how to make GUIs with Tkinter and a question has occurred to me. As I'm testing the program, I often end up building the code while an instance of it already exists in the background. Are these two independent of each other in terms of performing their functions? I've always read that when I create the instance of the Tk() and then run its mainloop(), that is what takes care of everything. Can I have two or more loops running if each pertains to a different Tk() instance?
false
36,141,010
0.197375
0
0
1
Each instance of Tk is separate from any other instance of Tk. It gets its own copy of an underlying tcl interpreter. Two instance of Tk in the same process means you have two active tcl interpreters. As a general rule you should only ever have exactly one instance of Tk, but I suppose if you fully understand how they work, it should be possible to have two or more. I think this falls into the category of things you shouldn't do until you understand why you shouldn't do them. And once you understand, you won't want to do it.
1
291
0
1
2016-03-21T20:32:00.000
python,python-2.7,tkinter
Is each instance of Tk() class running independent of each other?
0
1
1
36,141,286
1
0
0
I have python 2.7.6, the newest kivy and buildozer installed. Now I want to use firebase for python, downloaded by: sudo pip install python-firebase. I can add this to the requirements in the buildozer.spec file as python-firebase. This all works fine and in the folder .buildozer/applibs/ I got: firebase, python_firebase-1.2.dist-info, requests, requests-2.9.1.dist-info. So I expect that I could import firebase in my application, but that doesn't work. when I add: from firebase import firebase the app on android can not even run (I see the kivy app logo, but then the app shuts down). Can anyone explain me why and what the next steps are? edit 1: I/python (14201): File "/home/notwaka/Desktop/App/.buildozer/android/app/_applibs/firebase/__init__.py", line 3, in <module> I/python (14201): File "/home/notwaka/Desktop/App/.buildozer/android/app/_applibs/firebase/async.py", line 1, in <module> I/python (14201): File "/home/notwaka/Desktop/App/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/multiprocessing/__init__.py", line 84, in <module> I/python (14201): ImportError: No module named _multiprocessing I/python (14201): Python for android ended.
true
36,158,037
1.2
0
0
2
The multiprocessing module is not supported in Android due to incompatibilities with bionic (Android's libc). I would suggest trying to use the Firebase Android SDK via pyjnius, or just make web requests using Kivy's UrlRequest or via Twisted - it's just a REST API, after all.
0
1,125
0
0
2016-03-22T15:06:00.000
android,python-2.7,firebase,kivy,buildozer
Implement python-firebase in android
0
1
1
36,160,691
1
0
0
Pygame module is installed but not working. ImportError: No module named 'pygame.locals'; 'pygame' is not a package it worked when I import it in idle without creating a file but not working when .py file is executed through interpreter
false
36,214,865
0.197375
0
0
1
Make sure that you're not using pygame.py as a script filename. It will prevent the import of pygame module you want. Rename the file not to conflict. Also make sure there's no remaning pygame.pyc file.
1
74
0
0
2016-03-25T06:03:00.000
python,pygame
pygame module is not working in python 3.4.2
0
1
1
36,214,891
1
1
0
I want to use a phone number field in my form. What I need is when this field is tapped on Android phone, not general keyboard, but digital only appears. I learned that this can be achieved by using <input type="tel" or <input type="number". How do I use the tel or number input types in WTForms?
false
36,240,900
0.099668
0
0
1
Ok. I found it. IntegerField(widget = widgets.Input(input_type="tel"))
0
5,419
0
6
2016-03-26T21:06:00.000
python,flask,wtforms,flask-wtforms
How do I use "tel", "number", or other input types in WTForms?
0
1
2
36,382,378
1
0
0
I am trying to use a Qlabel as a message center for relaying messages to users of the application. Some messages might be longer than allowed for the Qlabel and I want it to just scroll horizontally until the end of the text. How can I do this in a Qlabel? I cannot seem to find anything in designer and don't want to work out some sort of truncation method in code that just takes off pieces from the front of the string, that seems silly.
false
36,297,429
0
0
0
0
There's nothing in Qt that does that by default. You will indeed need to create an animation that changes the text. You can use QFontMetrics (label.fontMetrics()) to determine if the label text is larger than then QLabel (to know if you need to scroll it or not). You need a way to repaint the QLabel every half second or so to animate the scrolling. The easiest way is probably a QTimer. The easiest method would probably be to subclass QLabel and have it check if it needs to scroll itself and reset the text every half second or so to simulate the scrolling. If you wanted scrolling to be even smoother (at a sub-character level), you'd have to override the paint method and paint the text yourself translating and clipping it as necessary.
0
2,078
0
1
2016-03-30T00:16:00.000
python-2.7,pyqt,pyqt4,qwidget,qlabel
Smooth scrolling text in Qlabel
0
1
3
36,314,912
1
0
0
So I am learning to use python 3 and now the "pyautogui" module. When I try to use "pyautogui.click(x, y)". I get this error "[WinError 5] Access is denied". It still clicks the coordinates, but why I get this error. I have tried to run this from normal and administer CMD. I am using windows 10. If you can help me please help! Thanks for advice!
false
36,307,621
0
0
0
0
I had the same problem using Windows 8.1. I solved making a bat file calling the python script and running the bat file as administrator. To run the bat file as administrator I made a right click on bat file and run as administrator.
1
1,059
0
1
2016-03-30T11:35:00.000
python,python-3.x,pyautogui
Pyautogui.click(x, y) error
0
2
3
38,230,687
1
0
0
So I am learning to use python 3 and now the "pyautogui" module. When I try to use "pyautogui.click(x, y)". I get this error "[WinError 5] Access is denied". It still clicks the coordinates, but why I get this error. I have tried to run this from normal and administer CMD. I am using windows 10. If you can help me please help! Thanks for advice!
false
36,307,621
0
0
0
0
The root cause is when you have a mouse options app installed (at least in my case). I know it from this story: I had a python script that used click (twice). It worked well, but in the meantime, I installed a mouse settings app on my comp. After that I run my script, but got this access denied error. (However, the first click worked, only the second one gave that error). Then I uninstalled this mouse software (almost unusable anyway), and voila, the clicking was again all right. Hope this helps you as well.
1
1,059
0
1
2016-03-30T11:35:00.000
python,python-3.x,pyautogui
Pyautogui.click(x, y) error
0
2
3
39,370,746
1
0
0
Hi i noticed that whenever you have the focus property of a textinput widget set to True, the hint_text is not displayed when the textinput is actually in focus. Please is there a way to combine them both, i.e the hint_text gets displayed even when the text input is in focus?
true
36,314,303
1.2
0
0
4
This is an issue with Kivy 1.9.1, where the hint text disappears as soon as the TextInput is focused. It has been fixed in the development branch, and now only disappears when there is content in the field.
0
443
0
4
2016-03-30T16:14:00.000
python,kivy
Kivy TextInput how to combine hint_text and focus
0
1
1
36,314,717
1
0
0
wrote a small application which is composed of a QT GUI module which in turn initiate an object that inherits from ShowBase class. Problem is, if I close the Panda App, the ShowBase class calls finalizeExit() which in turn shuts the whole process by calling exit. If I avoid calling the finalize method by overriding userExit(), the resources for the App are not being deleted and the task manager keeps on working. Is there a way to close the Panda App without calling exit?
true
36,339,195
1.2
0
0
1
At least in recent development builds of Panda, you should be able to call base.destroy() to shut down ShowBase and unload (most) resources. You would still need to override finalizeExit() to not quit the application when the main window is closed.
0
928
0
1
2016-03-31T16:44:00.000
python,python-2.7,panda3d
Closing a Panda3d app without shutting down the whole Process
0
1
2
43,324,179
1
0
0
I am using a pygtk application and I have added a Treeview inside a ScrolledWindow. Now I want to freeze the first column (fix the column position), so that when scrolling the Treeview horizontally the column position is fixed and still visible (as it's done in excel for the row column). So how I can freeze the Treeview column in pygtk?
false
36,427,596
0
0
0
0
The closest I've been able to get is a bit of a kludge. I use Perl, not Python, so I'll just describe my technique. Connect to the treeview's scroll-event signal and watch for direction=left/right (or smooth with get_scroll_deltas() returning non-zero for the X axis). Be sure to return FALSE for vertical scrolling so that remains unaffected. Then show/hide the columns after the fixed one(s) and return TRUE. For example: when scrolling right, hide column 2, then 3, etc. When scrolling left, show the highest number column that's hidden. There are a couple drawbacks: It's not as smooth as what you're looking for (columns can't be partially hidden). Doesn't work with the scrollbar, only when tilting the mouse wheel. Not all mice have tiltable wheels.
0
544
0
2
2016-04-05T13:20:00.000
python,gtk,pygtk,gtktreeview
Freeze the first column in Treeview pygtk
0
1
1
36,670,919
1
0
0
I am running El Capitan, when I type python --version the terminal prints Python 2.7.10, I have successfully downloaded pygame for Python 2.7.10 but I want to develop in python 3.5.1, I know I can do this by entering python3 in the terminal, but how do I properly set up pygame for this version of python?
false
36,456,584
0.197375
0
0
1
Use python3.5 -mpip install pygame.
0
44
0
0
2016-04-06T16:10:00.000
python,pygame
How to download pygame for non default version of python
0
1
1
36,456,629
1
0
0
Is there a way to "rip" Qt stylesheet from Python app? .styleSheet() returns an empty string.
true
36,475,003
1.2
0
0
1
You're assuming two things: The app has implemented its styling using stylesheets, and The app uses an application-wide stylesheet. Either of these assumptions is wrong in your case. You might need to extract stylesheets from individual widgets. Or the application might be using a custom QStyle and not stylesheets.
0
171
0
2
2016-04-07T11:35:00.000
python,qt,pyside
Get Qt stylesheet from Python app
0
1
1
36,476,989
1
0
0
I made a app with Python 3.4 and Tkinter. My app runs several (3-5) threads, and each thread does below. endless loop of recvfrom() to get message from socket(UDP) endless loop which displays the message and write it to a file I use my app on windows embedded OS which is based on XP, and I watch memory usage with TaskManager, because I want to run my app for a long (maybe more than month) without shutdown. Then, a problem is Mem Usage(physical) gradually increase, but sometimes drastically decrease. So overall it looks okay. But Virtual Memory Size(VMSize) is increasing with long-term view. For example, when I started app, VMSize was 26MB. and next day, it become 29MB, and next day, it become 32MB. It sometimes increase a little, sometimes decrease a little(e.g. 20KB). but overall it's on upward trend. This is not so large volume but "increasing" makes me uneasy. I expected GarbageCollection could help so I inserted gc.collect() on my code, so that it will be invoked every 3 hours. But nothing changed, and print(gc.collect()) showed always 0 (except right after start-up of app itself). Is this memory-leak? I read definition of del() and reference cycle can lead to memory leak in Python, but I never define del() by myself. Thank you in advance.
true
36,478,336
1.2
0
0
0
I discovered the cause by myself, so I write it here and close the question. The cause of memory leak was I was calling tkinter functions from multiple threads. tkinter is not thread safe so I was violating its rule. I modified my program so that only main thread use tkinter function then memory leak has gone. Thank you.
1
232
0
0
2016-04-07T13:54:00.000
python,sockets,memory-leaks,tkinter
Windows Task Manager: Python app memory usage increase
0
1
1
38,483,492
1
0
0
Is there a way to insert text to a textinput without overwriting the previous text? Textinput().text = "something" deletes the previous text.I also want to add it everytime in a new line.
true
36,529,242
1.2
0
0
3
It has nothing to do with kivy, these are basics of python language. Instead of overwriting the varliable with = sign, use += to append.
1
799
0
0
2016-04-10T11:41:00.000
python,kivy
Insert text to TextInput() in Kivy
0
1
1
36,529,332
1
0
0
I'm using Pygal (with Python / Flask) relatively successfully in regards to loading data, formatting colors, min/max, etc., but can't figure out how to format a number in Pygal using dollar signs and commas. I'm getting 265763.557372895 and instead want $265,763. This goes for both the pop-up boxes when hovering over a data point, as well as the y-axes. I've looked through pygal.org's documentation to no avail. Does anyone know how to properly format those numbers? UPDATE: I'm not quite ready to mark this question "answered" as I still can't get the separating commas. However, I did find the following native formatting option in pygal. This eliminates trailing decimals (without using Python's int()) and adds a dollar sign: graph.value_formatter = lambda y: "$%.0f" % y Change the 0f to 2f if you prefer two decimals, etc.
true
36,552,029
1.2
0
0
3
graph.value_formatter = lambda y: "{:,}".format(y) will get you the commas. graph.value_formatter = lambda y: "${:,}".format(y) will get you the commas and the dollar sign. Note that this formatting seems to be valid for Python 2.7 but would not work on 2.6.
0
784
0
2
2016-04-11T14:48:00.000
python,flask,formatting,pygal
Properly formatting numbers in pygal
0
1
1
36,914,709
1
0
0
I have a python code. I need to execute the python script from my c# program. After searching a bit about this, I came to know that there is mainly two ways of executing a python script from c#. One by using 'Process' command and the other by using Iron Python. My question might seem dumb, is there any other way through which I can execute a python script? To be more specific, can I create a class , lets say 'Python' in c# and a member function 'execute_script' which doesn't use any api like iron python or doesn't create a process for executing the script, so that if call 'execute_scipt(mypythonprogram.py)' , my script gets executed. Sorry if this seems dumb. If this is possible, please do help me. Thanks in advance.
false
36,563,002
0
1
0
0
Can you create a C# class that calls a Python script without using Iron Python and without using any external API? No. That is not possible. You have a few other choices: Integrate the Python runtime into your program. Smead already described one way to do this. It will work, and it does avoid creating another process, but it will be a lot of work to get it running, and it is still technically using an API. I do not recommend this for a single Python script where you don't need to pass data back and forth, but it's good to know that option exists if your other options don't pan out. Use the Process module. This is probably what I would do. Process has security concerns when a malicious user can cause you to execute bogus shell commands, or if the malicious user can replace the contents of the Python script. It is quite safe when you can lock down those two things. The speed is unlikely to be a concern. It will literally only take a few minutes to set up a C# program with a process call, so if your mentor is concerned about speed, just write it and measure the speed to see if it's actually a problem. Consider rewriting the script in C# C# is a very expressive language with a very strong standard library, so assuming your script is not thousands of lines long, and does not use any obscure Python libraries, this might actually not be much work. If you really must not use Process, this would be the next solution I would consider.
1
74
0
0
2016-04-12T03:15:00.000
c#,python
Creating a class that executes python in c#
0
1
2
36,647,773
1
0
0
I was wondering if it is possible to save a canvas that had several textures painted on it as an image file. I know I can save regular Image's (kivy.core.image) or Texture's (kivy.graphics.texture) as an image file with the save() function, so if I am able to convert the canvas to an Image or a Texture it should be easy, but so far I wasn't able to do this.
true
36,600,993
1.2
0
0
9
Widgets have an export_to_png method. Call this from the Widget whose canvas you have drawn on.
0
2,200
0
3
2016-04-13T14:09:00.000
python,python-3.x,kivy
How to save a kivy canvas object as an image file
0
1
1
36,601,394
1
0
0
I want to add a simple password check to a Python/wxPython/MySQL application to confirm that the user wants to carry out a particular action. So far I have a DialogBox with a textCtrl for password input and Buttons for Submit or Cancel. At the moment the password appears in the textCtrl. I would prefer this to appear as asterisks whilst the user input is captured but cannot figure out how to do this. How could I implement this?
true
36,643,784
1.2
0
0
2
Set the style on the text ctrl as TE_PASSWORD: The text will be echoed as asterisks.
0
493
0
0
2016-04-15T09:49:00.000
python-2.7,wxpython
Creating Simple Password Check In wxPython
0
1
2
36,649,037
1
0
0
I'm searching for a way to get the path of the directory of the file that I have chosen by QFileDialog.getOpenFileName(). I know that you can access it by os.path.dirname(os.path.realpath(filename), but I'm searching for a better way because I need to work in this directory. I don't really understand why you can access the file by open(filename, 'r') though your current working directory (when typing print(os.getcwd()) is not the directory of the file. Maybe there is a way by accessing something like the current working directory of the Qt.Application, but I had no success.. Also I have functions where you need arg1 = directory and arg2 = filename1 (in the directory) as arguments. Funnily enough they suddenly seem to work with just(!) arg1 = 'C:' as directory and arg2 = filename2 when filename2 is the file I've accessed by QFileDialog.getOpenFileName(). I'm happy about any explanation!
false
36,645,478
0.53705
0
0
3
It turns out that the filename which is accessed by QFileDialog.getOpenFileName() is actually not only the filename but the whole path..
0
5,334
0
2
2016-04-15T11:06:00.000
python,directory,pyqt,qfiledialog,getopenfilename
pyqt QFileDialog.getOpenFileName() get path of the directory of the file
0
1
1
36,650,012
1
0
0
How would you be able to create multiple screens using Pygame and events performed by the user? For example, if I had a menu screen with 2 buttons ('Start' and 'Exit') and the user clicked on 'Start', a new screen would appear in the same window with whatever is next in the game. From that screen, a user could click on another button and move on to another screen/ return to the menu, etc.
true
36,667,149
1.2
0
0
4
Make classes for each one, where each class is a subclass of pygame.Surface, of the same size as the display. Then you could have 3 variable TITLESCREEN, PLAYING, HIGHSCORES and change them on key press. Then you would be able to blit the correct screen to the display.
0
3,094
0
1
2016-04-16T17:08:00.000
python,pygame
Making multiple 'game screens' using Pygame
0
2
3
36,670,152
1
0
0
How would you be able to create multiple screens using Pygame and events performed by the user? For example, if I had a menu screen with 2 buttons ('Start' and 'Exit') and the user clicked on 'Start', a new screen would appear in the same window with whatever is next in the game. From that screen, a user could click on another button and move on to another screen/ return to the menu, etc.
false
36,667,149
0
0
0
0
What I did for this was have a literal main loop that checks to see what "Screen" the player wants to go to. Like if they press the exit button, it returns where to go next. The main loop then runs a the new script for the new screen.
0
3,094
0
1
2016-04-16T17:08:00.000
python,pygame
Making multiple 'game screens' using Pygame
0
2
3
62,853,674
1
0
0
I am new to using emacs as python ide. I am using Emacs 24.5.1 with its default python mode. I am writing a game with pygame and pyganim modules, but i am not able to run the code and test it because sometimes when i hit C-c C-c for eval buffer at the down window (i think it calls mini buffer?) i see only Sent: import pygame... (if i have imported pygame for example) and nothing more happens. How can i evaluate the whole code and why is this happening?
false
36,668,587
0.197375
0
0
1
You need to start the interpreter first with C-c C-p (run-python). Then you can C-c C-c (python-shell-send-buffer) to send the entire buffer to the python process or even C-c C-r (python-sheel-send-region) to only send the selected region to the python process. See more keybindings for your current buffer with C-h m (describe-mode).
0
459
0
0
2016-04-16T19:17:00.000
python-2.7,ubuntu,emacs
Emacs+python C-c C-c not working
0
1
1
36,672,978
1
0
0
I'd like to try Qpython on a Samsung Galaxy Tab 4 running Android 4.4.2. Which would be better, in terms of stability, functionality, supported libraries, etc., Qpython or Qpython3? Or can they be installed side-by-side? Thanks.
false
36,680,852
0.197375
0
0
1
You can install and run both the apps.It is better to install both because qpython uses python2.7 where as qpython3 uses python3.x.The syntax are different for both the versions so obviously the libraries. There is a pip console in qpython to install libraries where as in qpython3 it is not there.
0
2,861
0
0
2016-04-17T18:58:00.000
android,galaxy-tab,qpython,qpython3
Qpython or Qpython3?
0
1
1
39,323,926
1
0
0
I thought it meant everything in the module. But in tkinter I would have to specifically import things like messagebox, colorchooser and filedialog despite having a "from tkinter import *" command. So exactly what does "import *" mean?
false
36,695,687
-0.066568
0
0
-1
It just means that you import all(methods, variables,...) in a way so you don't need to prefix them when using them.
1
11,100
0
1
2016-04-18T13:40:00.000
python,python-3.x
What exactly does " from module import * " mean?
0
1
3
36,695,749
1
0
0
I installed theano but when I try to use it I got this error: WARNING (theano.configdefaults): g++ not detected! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. I installed g++, and put the correct path in the environment variables, so it is like theano does not detect it. Does anyone know how to solve the problem or which may be the cause?
false
36,722,975
0.099668
1
0
3
This is the error that I experienced in my mac running jupyter notebook with a python 3.5 kernal hope this helps someone, i am sure rggir is well sorted at this stage :) Error Using Theano backend. WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string. Cause update of XCode (g++ compiler) without accepting terms and conditions, this was pointed out above thanks Emiel Resolution: type g++ --version in the mac terminal "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." is output as an error launch Xcode and accept terms and conditions return g++ --version in the terminal Something similar to the following will be returned to show that Xcode has been fully installed and g++ is now available to keras Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Restart you machine… I am sure there are some more complicated steps that someone smarter than me can add here to make this faster Run the model.fit function of the keras application which should run faster now … win!
0
31,119
0
18
2016-04-19T15:31:00.000
python,g++,theano
theano g++ not detected
0
3
6
40,705,647
1
0
0
I installed theano but when I try to use it I got this error: WARNING (theano.configdefaults): g++ not detected! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. I installed g++, and put the correct path in the environment variables, so it is like theano does not detect it. Does anyone know how to solve the problem or which may be the cause?
false
36,722,975
1
1
0
7
I had this occur on OS X after I updated XCode (through the App Store). Everything worked before the update, but after the update I had to start XCode and accept the license agreement. Then everything worked again.
0
31,119
0
18
2016-04-19T15:31:00.000
python,g++,theano
theano g++ not detected
0
3
6
39,568,992
1
0
0
I installed theano but when I try to use it I got this error: WARNING (theano.configdefaults): g++ not detected! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. I installed g++, and put the correct path in the environment variables, so it is like theano does not detect it. Does anyone know how to solve the problem or which may be the cause?
false
36,722,975
1
1
0
6
On Windows, you need to install mingw to support g++. Usually, it is advisable to use Anaconda distribution to install Python. Theano works with Python3.4 or older versions. You can use conda install command to install mingw.
0
31,119
0
18
2016-04-19T15:31:00.000
python,g++,theano
theano g++ not detected
0
3
6
37,846,308
1
0
0
I just started a new job. Existing code is wxpython GUI that is partially implemented. The jist is that there are 2 independent GUIs: one is a "status monitor with test abort button" and the other is a test executive, running tests that might take a few minutes. At any time, the status monitor GUI abort button should be able to be pressed to stop the long running test script process running in the executive GUI. The long script process is started in a new thread and is working from the test executive GUI, but no matter what I do, the status monitor GUI is frozen. Ive done similar things in pyside and it didnt seem to be as much of a bear as with wxpython. I don think this is a thread problem. seems like its a wxpython problem. Is it possible to have 2 independent wxpython GUIs started from the same script? I seem to have read somewhere that im required to have only one main loop. Any hints/examples of 2 parallel independent GUIs would be great!
false
36,757,558
0
0
0
0
Yes and no. As far as I know, it is not possible to run 2 GUIs just seperated by threads. We had a quite similar problem. And as we are using Windows mainly, we needed to work around the Python GIL, to enable the GUI to stop the subprocess which executes the tests. In order to do so, we moved to multiprocessing library and we are using a Processpool which executes the tests (we are running multiple items at the same time - you can use just a process for your purpose). In a new process you will also be able to execute a second GUI, which is completely independent (We are doing this as well). When using another process, it gets a PID, which can be used with os.kill. The main GUI will stay stable throughout this. To communicate with the new process we use Pyro4, but you could also use a approach with Queues to get the communication done. You cannot directly access data from another process if you are using Windows like with the threading approach. Hope this helps. Regards, Michael
0
144
0
0
2016-04-21T00:29:00.000
multithreading,user-interface,parallel-processing,wxpython
2 "parallel" wxpython GUIs possible?
0
1
1
36,760,661
1
0
0
I want to make a msi for my PyGame game with cx_Freeze : (I already created an execute file) So, i used python setup.py bdist_msi, but I got this message : File "C:\Python34\lib\msilib\__init__.py", line 213, in commit FCICreate(filename, self.files) ValueError: FCI error 1 An idea ?
false
36,802,811
0
0
0
0
I had that problem, the build was created and worked ok, but an ValueError: FCI error 1 take place in the msi creation. In my case, it was due to data files containing a point in your name (example AB_12345.1.fasta). I replaced the point by the underscore symbol (example AB_12345_1.fasta) and everything worked properly. I hope it helps you on something.
1
1,671
0
3
2016-04-22T20:29:00.000
python,pygame,cx-freeze
Building msi with cx_Freeze : ValueError: FCI error 1
0
3
4
38,202,398
1
0
0
I want to make a msi for my PyGame game with cx_Freeze : (I already created an execute file) So, i used python setup.py bdist_msi, but I got this message : File "C:\Python34\lib\msilib\__init__.py", line 213, in commit FCICreate(filename, self.files) ValueError: FCI error 1 An idea ?
false
36,802,811
-0.049958
0
0
-1
I had the same problem. I solved my problem by deleting the build directory. Then run python setup.py bdist_msi. That works for me. I wish it will help you.
1
1,671
0
3
2016-04-22T20:29:00.000
python,pygame,cx-freeze
Building msi with cx_Freeze : ValueError: FCI error 1
0
3
4
47,951,324
1
0
0
I want to make a msi for my PyGame game with cx_Freeze : (I already created an execute file) So, i used python setup.py bdist_msi, but I got this message : File "C:\Python34\lib\msilib\__init__.py", line 213, in commit FCICreate(filename, self.files) ValueError: FCI error 1 An idea ?
false
36,802,811
0
0
0
0
I had the same problem. I used non-ascii characters at the path contains. I solved that by changing the path contains into ascii characters.
1
1,671
0
3
2016-04-22T20:29:00.000
python,pygame,cx-freeze
Building msi with cx_Freeze : ValueError: FCI error 1
0
3
4
49,082,133
1
0
0
I'm working on a simple program in Python 3.5 that contains turtle graphics and I have a problem: after the turtle work is finished the user has to close the window manually. Is there any way to program the window to close after the turtle work is done?
false
36,826,570
-0.132549
0
0
-2
Try exitonclick() or done() at the end of the file to close the window .
0
42,886
0
16
2016-04-24T17:30:00.000
python,python-3.x,turtle-graphics
How to close the Python turtle window after it does its code?
0
2
3
36,827,757
1
0
0
I'm working on a simple program in Python 3.5 that contains turtle graphics and I have a problem: after the turtle work is finished the user has to close the window manually. Is there any way to program the window to close after the turtle work is done?
true
36,826,570
1.2
0
0
18
turtle.bye(), aka turtle.Screen().bye(), closes a turtle graphics window. Usually, a lack of turtle.mainloop(), or one of its variants, will cause the window to close because the program will exit, closing everything. turtle.mainloop() should be the last statement executed in a turtle graphics program unless the script is run from within Python IDLE -n which disables turtle.mainloop() and variants. turtle.Screen().mainloop() and turtle.done() are variants of turtle.mainloop(). turtle.exitonclick() aka turtle.Screen().exitonclick() binds the screen click event to do a turtle.bye() and then invokes turtle.mainloop()
0
42,886
0
16
2016-04-24T17:30:00.000
python,python-3.x,turtle-graphics
How to close the Python turtle window after it does its code?
0
2
3
42,283,059
1
0
0
I have designed a gui with PYQT4. It has two buttons. One of start button. It starts a start.py file. And another button execute stop.py file that stop start.py pid. This start.py and stop.py files are on a remote location. I am connecting there with ssh and paramiko. When I click to start button, gui is freezing and never answering. I can only get rid of the situation by closing the program . I know the problem. Because there is a while loop in start.py and it never ends. When i click to start button its wait for the while loop. I want to run start.py and i dont want to wait for the loop. It must be run in background or etc.. What can i do ? I tried to trigger it with another .py file. I used subprocess method. But no success. Still have same problem.
true
36,828,383
1.2
0
0
0
I found the solution. I covered that function in thread. And now its working properly without freeze or lag.
0
236
0
0
2016-04-24T20:11:00.000
python,debugging,pyqt4
Qt freezing cause of the loop?
0
1
2
36,916,323
1
0
0
I developed a GUI app in Python 3. I want to be able to launch it by clicking on the script itself or in a custom-made launching script. I have changed permissions and it's now opening with "Python Launcher" on double-click. But everytime I run my app, I get a lot of windows: My Python application (that's the only one I need to be on screen) The Python launcher preferences (I could live with this one, but would prefer it to be hidden) A Terminal window with the default shell (don't need this one) Another Terminal window showing the output of the app (like print, errors... I don't want this window) What is the easiest way to get only the GUI on screen, without any Terminal windows?
false
36,864,537
0
0
0
0
By changing the file extension to .pyw (Python Windowed), any terminal/shell/cmd would be hidden by default (I even don't know about the preferences window). Hope this helps!
0
3,492
0
3
2016-04-26T12:08:00.000
python,macos,python-3.x,tkinter
How to run a Python 3 tkinter app without opening any Terminal windows in Mac OS X?
0
1
2
36,864,625
1
0
0
I am making a program that will display images on a Tkinter canvas, but I need to use images in a different folder than the program is in so I can't use what I usually do: img = PhotoImage(file=some_img) I have an os path like C:\Users\SomeUser\Documents\some_img. I need to access some_img to make it a PhotoImage while it is in a different folder. How would I go about doing that?
true
36,898,571
1.2
0
0
1
If you have the full path then that should work fine as it is.
0
252
0
0
2016-04-27T18:56:00.000
python-2.7,tkinter,tkinter-canvas
Using an os path in Tkinter PhotoImage
0
1
1
36,898,667
1
0
0
I am trying to create a label for a string in TKinter. The string can be very long, and greater than the length of the label. Therefore, I wanted to implement a label which can scroll sideways, to show the entirety of the string. How would you do this in TKinter?
true
36,959,902
1.2
0
0
3
You cannot scroll a label. I suggest using an entry widget. You can set the state to disabled to prevent users from using it like an entry widget, and you can change the borders to make it look like a label.
0
379
0
1
2016-04-30T20:28:00.000
python,user-interface,tkinter
Scrollable label for TKinter?
0
1
1
36,961,427
1
0
0
I guess this might be a trivial question, nonetheless I couldn't find the answer anywhere. I am currently building a small rpg style game and I am starting to have quite a few sprite groups. I was wondering if there was a way to ask Pygame to refer to all existing groups ? I would need this function to be able to move sprites which are deleted from my game to a deleted_sprite_group that I have. At the moment I am adding all the groups to a list and iterating through that list but this requires some maintenance. Note: I am not that lazy as to mind using a list but I try and optimize and clean up my code every so often. ;) Thank you for your help !
false
36,968,992
0
0
0
0
Try making one group for all sprites in your game, and filling it while filling the separate groups
1
36
0
0
2016-05-01T16:26:00.000
python-2.7,loops,pygame,sprite
Is there a way to iterate through all existing groups automatically?
0
2
2
37,002,212
1
0
0
I guess this might be a trivial question, nonetheless I couldn't find the answer anywhere. I am currently building a small rpg style game and I am starting to have quite a few sprite groups. I was wondering if there was a way to ask Pygame to refer to all existing groups ? I would need this function to be able to move sprites which are deleted from my game to a deleted_sprite_group that I have. At the moment I am adding all the groups to a list and iterating through that list but this requires some maintenance. Note: I am not that lazy as to mind using a list but I try and optimize and clean up my code every so often. ;) Thank you for your help !
true
36,968,992
1.2
0
0
0
From @Ni. Sprite.kill() removes a sprite from all its groups
1
36
0
0
2016-05-01T16:26:00.000
python-2.7,loops,pygame,sprite
Is there a way to iterate through all existing groups automatically?
0
2
2
37,038,660
1
0
0
so i'm going to be as in depth as possible, here's my problem: I'm using the turtle.addshape() command to add images onto the turtle. In order to do this I have to do turtle.addshape(C:\Users\Username Here\Desktop\Game\Images\an image.gif) The problem is with this, is that if I were to distribute my file, it would search for C:\Users\Username Here\Desktop\Game I want it to find the image, WHEREVER the file is and WHOEVER is using it, for example: C:\Users\ the computers user here \ where ever the file is located here \Game\Images\an image.gif If You Can Help Me Please Do, It's Been Driving Me CRAZY - Thanks :D
false
36,971,884
0
0
0
0
For this to happen you need to use a relative path from your Game directory (assuming this is the working directory for your game). Eg. "Game\Images\an image.gif"
0
179
0
0
2016-05-01T21:00:00.000
python,file
Python - File Directory Issue
0
1
2
36,971,947
1
0
0
I know how to use ctypes to call a function from a C++ .dll in Python by creating a "wrapper" function that casts the Python input types to C. I think of this as essentially recreating the function signatures in Python, where the function body contains the type cast to C and a corresponding .dll function call. I currently have a set of C++ .dll files. Each library contains many functions, some of which are overloaded. I am tasked with writing a Python interface for each of these .dll files. My current way forward is to "use the hammer I have" and go through each function, lovingly crafting a corresponding Python wrapper for each... this will involve my looking at the API documentation for each of the functions within the .dlls and coding them up one by one. My instinct tells me, though, that there may be a much more efficient way to go about this. My question is: Is there a programmatic way of interfacing with a Windows C++ .dll that does not require crafting corresponding wrappers for each of the functions? Thanks.
true
37,002,150
1.2
0
0
2
I would recommend using Cython to do your wrapping. Cython allows you to use C/C++ code directly with very little changes (in addition to some boilerplate). For wrapping large libraries, it's often straightforward to get something up and running very quickly with minimal extra wrapping work (such as in Ctypes). It's also been my experience that Cython scales better... although it takes more front end work to stand Cython up rather than Ctypes, it is in my opinion more maintainable and lends itself well to the programmatic generation of wrapping code to which you allude.
1
1,193
0
2
2016-05-03T10:51:00.000
python-3.x,dll,ctypes
How to programmatically wrap a C++ dll with Python
0
1
1
38,547,145
1
0
0
I am trying to do make a virtual keyboard using tkinter. Is there any method that allow tkinter window focus out? For example in java we can have setFocusableWindowState(false) Thank you very much for your help.
false
37,026,046
0
0
0
0
I believe you can accomplish what you want with tkinter, but it's not about not getting focus. I don't think, that other GUI tools will make it any easier. It's part of operation system, or more precisely window manager to give focus to some window, when it is clicked. So, in case of virtual keyboard: User has focus in text editor (for example). User presses a button on your virtual keyboard. OS/Window manager gives focus to your keyboard window and sends mouse click event to the GUI library (tkinter). Here you need to identify where was the focus before your window got it, i.e. get the text editor window handler somehow. Send the button press event to that window and return focus. Repeat. You'll use tkinter to draw the keyboard window and handle mouse clicks/touches on virtual keyboard keys. But you'll need to work with OS/Window manager to identify other windows by handlers and send keypress events to them. May be you will be able to prevent focus switch by working with OS/Window manager, but it's not tkinter or other GUI library functionality.
0
440
0
0
2016-05-04T11:07:00.000
python,tkinter
How to set tkinter window focus out?
0
1
1
37,028,844
1
0
0
Currently in my work placement, I have to creat a GUI thanks to Tkinter. In this GUI I have to embed a console, this console has to be interactive that is to say stdout & stderr will display in this console and user can type up a commande. With my first research, I think xterm can be useful, but I didn't find how we can redirect stdout & stderr to it Thanks
false
37,026,175
0
0
0
0
You should start with an analysis of what you expect: input from user: what do you want, how you want to process it? (is this really shell input?) feed back: what do you want to display, how is it produced? (direct shell output?) xterm is just a graphic interface around a shell. That means that is captures keyboard input coming to its window, submit it to is shell, and in turn display its shell stdout and stderr to the window, with respect to formatting code (not for from vt220 terminal + ANSI color codes). It is uncommon to use xterm in a GUI. The shell can be any command line program that processes standard input and uses standard output and standard error streams. It is commonly /bin/sh or bin/bash but could be any program. If you really want to do that, you could start xterm in a subprocess, with a special shell that passes all input lines to your main program for example through a Unix domain socket, and in turn echoes back what your main program sends to it. More commonly, GUIs use an text widget to get input from the user and another or the same widget to display feedback. Until you have analyzed things at that level and designed a global architecture please do not think too much about subprocess module syntax.
0
1,028
0
0
2016-05-04T11:13:00.000
python,tkinter,console,stdout,xterm
Python, Tkinter, embed an interactive console and redirect stdout
0
1
1
37,031,498
1
0
0
I have a GridView inside of a ScrollView. I am trying to create and display approximately ~12,000 items in the GridView (which clearly will not display appropriately on screen), but the number of items could feasible be ~40,000. Currently ~18 seconds are spent constructing all of the items (Labels), and any resizing of the window results in another significant delay. How can I speed up the construction and rendering of the items? I don't know how to do paging or delayed, on-demand loading on a ScrollView.
false
37,064,168
0
0
0
0
How can you imagine a user scrolling through 40000 labels? You should rethink your app design. Consider adding a text input, and based on the given string, fetch filtered data from the database you have.
0
525
0
0
2016-05-06T04:19:00.000
python,kivy
Kivy ScrollView (with Gridview) Suffering Performance Issues
0
1
1
37,085,902
1
0
0
I found ways to hide something after pressing a button, but what I would like to do is having an invisible button that can still be pushed. A secret button of some sort, using Tkinter. It doesn't need to do anything yet
true
37,111,267
1.2
0
0
0
You don't need an invisible button to register a secret click Simply bind <1> to the root window and it will register whenever you click on anything (unless you click on some other widget that is listening for that event). You can then check the coordinates of the click to see where the use clicked.
0
1,995
0
1
2016-05-09T08:44:00.000
python,tkinter
Is there a way to make an invisible button in Tkinter?
0
1
1
37,117,837
1
0
0
I searched on the web and couldn't find anything. How can I install PyQt5 for Python 3.4 version?
false
37,150,509
0
0
0
0
I am using pyCharm and it allows me to install PyQt5 from the settings menu, just go to the "Project Interpreter" and install it.
1
10,671
0
4
2016-05-10T23:23:00.000
python,python-3.4,pyqt5
How to install PyQt5 for Python 3.4 version?
0
1
2
37,150,609
1
0
0
In my build I am required to copy header files in a flat structure while source code files are copied in a hierachical structure. By default when specifying duplicate = 1 (my build is a variant dir build) in SCons all header files and .c/.cpp files are duplicated in a hierarchical structure. Is there a way to deactivate duplication of header files ? What I tried until now: To provide an empty list to CPPPATH. To remove source scanners from my builders. I want to install them by myself in a separate folder. I don't want to turn off duplication since I need that for .c/.cpp files.
true
37,271,162
1.2
0
0
1
You can't turn off the duplicate method for only a subset of files (based on their extension for example). Installing a subset of source and target files to a specific directory is usually handled by calling the Install() method. Independent of whether you plan to use duplicate=0 or duplicate=1 for your actual builds, I'd suggest to not interfere with what happens in the variant dirs...and just letting SCons do its thing.
0
82
0
0
2016-05-17T08:41:00.000
python,scons
How to deactivate header files duplication in SCons?
0
1
1
37,272,718
1
0
0
I'm creating a program that I would like to use as a normal program as well as continue to code it on the side. To do this I first tried creating a shortcut of the .py file in my PyCharms project folder and sent it to desktop. When I double-clicked the shortcut the command prompt would open for a second and then shut. It's a PyQt4 program so I'm not sure if this has any bearing. The program has been coded in Python 3.4. I've noticed that when I open the command prompt and type 'python' it shows Python 3.5 for some reason so I'm not sure if this has any bearing on the situation. If you've ever programmed in C# I'd like to be able to build a solution and then rebuild the solution when I've updated the code so that I can access the program as a normal program as well as continue to improve the code of it. Thanks for any help.
false
37,297,917
0
0
0
0
Managed it thanks to the link above. Uninstalled Python 3.5 and set my PATH variable to C:\Python34. Downloaded pyinstaller and installed it using PIP. Then navigated to Python34/Scripts and dragged myFile.py (the one to be made an .exe) into it. Ran pyinstaller.exe --windowed myFile.py to create the exe which then went to my dist folder. Created a shortcut and it worked perfectly.
1
883
0
0
2016-05-18T11:13:00.000
python,pyqt
How can I run my Python program like a normal program from the desktop?
0
2
2
37,298,956
1
0
0
I'm creating a program that I would like to use as a normal program as well as continue to code it on the side. To do this I first tried creating a shortcut of the .py file in my PyCharms project folder and sent it to desktop. When I double-clicked the shortcut the command prompt would open for a second and then shut. It's a PyQt4 program so I'm not sure if this has any bearing. The program has been coded in Python 3.4. I've noticed that when I open the command prompt and type 'python' it shows Python 3.5 for some reason so I'm not sure if this has any bearing on the situation. If you've ever programmed in C# I'd like to be able to build a solution and then rebuild the solution when I've updated the code so that I can access the program as a normal program as well as continue to improve the code of it. Thanks for any help.
false
37,297,917
0
0
0
0
Go to your environmental variables (Right click on Computer > Properties > Advanced system settings > Environment Variables...). Find Path in System variables, select it, and click edit. Remove the Python 3.5 path and replace it with your python 3.4 or virtual environment folder that has python.exe in it. Make a shortcut on your desktop that points to the .py file that you are editing. If you have all of the dependencies right then double clicking the .py file's shortcut should run your program. Other wise you can pip install cx_freeze and use cx_freeze like setuptools. Create a setup.py file and build the executable. If you want to install this executable I suggest using Inno Setup. It is pretty straight forward on how to use and has an easy wizard that helps you build a basic installer.
1
883
0
0
2016-05-18T11:13:00.000
python,pyqt
How can I run my Python program like a normal program from the desktop?
0
2
2
37,299,236
1
0
0
I am working on an GUI based application, that is developed using python and go. I am using python(+Kivy) to implement UI and Go to implement middleware / core on windows OS. my problem statement is : 1) I want to run the exe of the core on launching the application and it should remain in the background till my application is closed. 2) When an event is triggered from the application, a command is sent to the core, which it turns execute the command on the remote device and returns with the result of command execution. I want to know, how I control the lifetime of the exe and how I can establish a communication between the UI and Core. Any ideas!!
true
37,319,345
1.2
0
0
1
There are many ways you can tackle this but what I would recommend is having one of the parts (GUI/Core) as the main application that does all of the initializations and starts the other part. I would recommend using the core for this. Here's a sample architecture you can use, though the architecture you choose is highly dependent on the application and your goals. Core runs first, performing initialization actions including starting the GUI, sets up the communication between the GUI (using pipes, sockets, etc), then waits for commands from the GUI. If the GUI signals to close, the core can perform whatever clean up necessary and then exits. With this scenario, the lifetime of the exe is controlled by the GUI.(GUI sends a signal to the core when the user hits the exit button to let the core know it should exit) If the core starts the GUI, then it can set up the STDIN/STDOUT pipes for it and listen for commands on the STDOUT, while sending results on the STDIN. You can also take the server approach, having the core listen on a socket, and the GUI sends requests to it and wait for a response. With the server approach, you can have some sort of concurrency unlike the serial pipes, but I think it might be slower than the pipes (the difference might be negligible but its hard to say without knowing what exactly you're doing).
1
105
0
2
2016-05-19T09:37:00.000
python,user-interface,go,communication,core
Communication between UI and Core on windows machine
0
1
1
37,328,359
1
0
0
I have a QComboBox and say I type the word "info" in the box, followed by "INFO". Why doesn't it remember both as 2 distinct words and instead convert "INFO" to "info"? How can I go about solving this issue so that both words would end up in the list. Also the back-end is in python. Note: I would prefer a solution without setDuplicatesEnabled. I read the documentation and searched the web but with no luck and I cannot figure this one out. Most answers on SO were outdated(5+ years )
true
37,336,002
1.2
0
0
0
The easiest way - to use setAutoCompletion(false) on your QComboBox.
0
47
0
0
2016-05-20T00:08:00.000
python,qt,qcombobox
QComboBox: same words with different cases are seen as duplicates
0
1
1
37,339,381
1
0
0
I have just installed kivy in python 2.7.11. After installing it, whenever i try to open IDLE, it is giving subprocess startup error. Actually i installed kivy on my windows 7 PC through command prompt. After installation, I copied programs of kivy from my android tab to run them on my pc. When I tried to open them, IDLE doesn't respond for some time and after some time it gives startup error. Since then IDLE is not starting . But it is quite strange that, on running python builtin module, there is no error. I had reinstalled python but still there is no change.
false
37,346,844
0
0
0
0
reason for subprocess startup error can be a new python file that you have created recently with the same name as same existing libraries or module name e.g. 're.py','os.py' etc beacuse re,os are the predefined libraries just go and find the file and rename it hope so it will be resolved
0
566
1
0
2016-05-20T12:32:00.000
python-2.7,kivy,startup,python-idle
Python IDLE giving startup error
0
1
1
48,363,806
1
0
0
Ok so I am very bad at sprites and I just don't get how to use sprites with blitted images. So I was wondering, if I make the image and just make a rectangle around that object that follows that image around, would that be a good replacement for sprites, the rectangle would be the one that's colliding for instances... Or should I try learning sprites. If I should is there any tutorial that could help me with using blitted images to make sprite characters that use python 3.4? Thank you!
true
37,381,061
1.2
0
0
0
In my experience, most uses for sprites can work with rectangular collision boxes. Only if you had an instance where a ball needed to be collided with then you would have to use an actual sprite. In the long run, I would recommend learning sprites, but if you need help with sprites, the pygame documentation has loads of information!
0
25
0
2
2016-05-23T00:28:00.000
python-3.x,pygame
Replacing sprites idea
0
1
1
37,381,094
1
0
0
OptionMenu is working perfectly in my application to select one option among several possible. However, I need to allow the user to select more than one option. Is it possible?
true
37,394,199
1.2
0
0
2
It's not designed for that. If you want that sort of behavior you can create your own widget. An optionmenu is just a menubtton and a menu, and a tiny bit of code.
0
230
0
2
2016-05-23T14:51:00.000
python-3.x,tkinter,optionmenu
How to allow more than one selection in tkinter OptionMenu?
0
1
1
37,395,425
1
0
0
I searched the web and SO but did not find an aswer. Using Python, I would like to know how (if possible) can I stop the screen from updating its changes to the user. In other words, I would like to buid a function in Python that, when called, would freeze the whole screen, preventing the user from viewing its changes. And, when called again, would set back the screen to normal. Something like the Application.ScreenUpdating Property of Excel VBA, but applied directly to the whole screen. Something like: FreezeScreen(On) FreenScreen(Off) Is it possible? Thanks for the help!!
true
37,419,778
1.2
0
0
1
If by "the screen" you're talking about the terminal then I highly recommend checking out the curses library. It comes with the standard version of Python. It gives control of many different aspects of the terminal window including the functionality you described.
0
1,178
0
0
2016-05-24T17:03:00.000
python,screen,freeze,display
Using Python, how to stop the screen from updating its content?
0
1
1
37,421,436
1
0
0
I'm still relatively new to Python and Kivy (much more so for Kivy). I'm running Python 3.5 and Kivy 1.9.1 on OS X. I installed Kivy using pip install, and I was never really able to get Kivy to work using the download and putting in my Applications folder like the instructions were asking. Everything seems to work fine, and I've made a few apps; however, I seem to encounter a problem whenever I try to resize the window. The window goes white while I'm resizing it, and then it turns blank/black afterwards. The terminal just says that it reloaded the graphics and the amount of time it took. I was hoping that after I made my apps using Pyinstaller that this would go away, but the problem still persists. Has anyone else encountered this problem? I haven't been able to test this on another computer yet to see if the problem persists. Any help would be appreciated. Thanks!(:
true
37,476,505
1.2
0
0
3
The problem was caused because Kivy was using Pygame. I had to brew install the SDL2 dependencies and reinstall Kivy. This fixed the problem.
0
556
0
1
2016-05-27T06:41:00.000
python,kivy
Kivy window goes blank after being resized
0
1
1
37,493,470
1
0
0
I am starting to learn Tkinter and have been creating new windows with new instances of Tk every time. I just read that that wasn't a good practice. If so, why? And how could this be done better? I have seen others create windows with Toplevel and Frame instances. What are the benefits/drawbacks of using these instead? In case this makes a difference: The application that I am writing code for starts off with a login window and then proceeds to a second window is the entered password is correct.
true
37,502,942
1.2
0
0
3
Every tkinter program needs exactly one instance of Tk. Tkinter is a wrapper around an embedded tcl interpreter. Each instance of Tk gets its own copy of the interpreter, so two Tk instances have two different namespaces. If you need multiple windows, create one instance of Tk and then additional windows should be instances of Toplevel. While you can create, destroy, and recreate a root window, there's really no point. Instead, create the root window for the login screen, and then just delete the login screen widgets and replace them with your second window. This becomes trivial if you make each of your "windows" a separate class that inherits from tk.Frame. Because tkinter will destroy all child widgets when a frame is destroyed, it's easy to switch from one "window" to another. Create an instance of LoginFrame and pack it in the root window. When they've input a correct password, destroy that instance, create an instance of MainWindow and pack that.
0
1,757
0
0
2016-05-28T19:17:00.000
python,python-2.7,user-interface,tkinter
Tkinter Creating Multiple Windows - Use new Tk instance or Toplevel or Frame?
0
1
1
37,503,535
1
0
0
I have made a GUI application using wxpython and some other packages (matplotlib, pandas, numpy). I tried to compile this into a standalone executable. However, when I run the 'my_script.exe' I get the following error in my command prompt: Intel MKL FATAL ERROR: Cannot load mkl_avx2.dll or mkl_def.dll. The versions I am using are: Anaconda 2.0.0 (Python 2.7) 64 bit Setuptools 19.2 (downgraded from 20.3 because of import error) Thanks in advance for helping me!
true
37,511,165
1.2
0
0
2
Search for mkl_avx2.dll & mkl_def.dll files and paste them in your .exe folder.
1
2,841
0
1
2016-05-29T14:37:00.000
python,executable,anaconda,pyinstaller
Pyinstaller Intel MKL fatal error when running .exe file Python 2.7
0
1
2
37,513,422
1
0
0
I have a Python function that takes no parameters. In my code, I call this function twice. Once as a command behind a Tkinter Button and once as a function to an event that I bind to a window. For the command, I call the function as func and that works fine. For the event, it will only work if I call it as func() and change the definition of the function to be: func(self). Why? How can I make both these calls compatible?
true
37,514,795
1.2
0
0
-1
This is because when you bind a function to a button you are not calling the function, only binding it so that tkinter knows what to do when the button is pressed. You only need to use func() when you are calling the function as you are doing in the the event.
0
116
0
1
2016-05-29T20:44:00.000
python,tkinter
What is the difference between "func" and "func()" in TkInter?
0
1
1
37,514,847
1
1
0
I want to set my QGroupBox's title with HTML expressions in python program, e.g. : ABC. (subscript) Does anybody have an idea how to do this?
true
37,527,124
1.2
0
0
1
QGroupBox's title property does not support HTML. The only customization you can do through the title string (besides the text itself) is the addition of an ampersand (&) for keyboard accelerators. In short, unlike QLabel, you can't use HTML with QGroupBox.
0
372
0
1
2016-05-30T13:38:00.000
python,html,qt,groupbox
How can I set QGroupBox's title with HTML expressions? (Python)
0
1
3
37,535,825
1
0
0
to elaborate, I'm currently creating a maze layout using wall sprites. however, I want the maze to be invisible when I am actually playing the game, while still able to be able to have collision detection. Is this possible in any way? Thanks.
false
37,535,998
0.197375
0
0
1
Are you using images to show your walls? Because if you are, you can use a program called paint.net to create a transparent sprite. Just create a file with the desired dimensions and use the eraser tool to make the whole thing transparent (click on the little squiggly arrow up at the top to make it easier). Save it as a png in your pygame folder and you have a transparent square.
1
318
0
0
2016-05-31T02:38:00.000
python,python-2.7,pygame
How to make an invisible sprite in pygame? (python)
0
1
1
42,210,427
1
0
0
I know how to make message boxes, and I know how to create textboxes. However, I don't know how to make a message box WITH a textbox in it. I've looked through the tkinter documentation and it seems message boxes are kind of limited. Is there a way to make a message box that contains a text entry field, or would I have to create a new pop up window from scratch?
true
37,556,808
1.2
0
0
0
simpledialog.askstring() was exactly what I needed.
0
392
0
1
2016-05-31T22:40:00.000
user-interface,python-3.x,tkinter,textbox,messagebox
Python: Create a message box with a text entry field using tkinter
0
1
1
37,559,356
1
0
0
I know "adb push" command could be used to push files to android device. But in Python how do i push single file for example file.txt(size of about 50 KB) into android sdcard with different names(for ex. file1.txt, file2.txt etc) until the device storage is full. Any idea much appreciated.
false
37,559,502
0
0
0
0
I found an alternative solution to this problem. In a python while loop push a single file into SD Card and use "adb mv" to rename the file in the SD Card after pushing the file, continue this until the device memory is full.
0
227
0
1
2016-06-01T04:34:00.000
python
Python push single file into android device with different names until the device runs out of memory
0
1
1
37,658,540
1
0
0
I am trying to make a grid on a QGraphicsView and QGraphicsScene with custom QGraphicsWidgets, but I am not sure how the best way to do this would be. I'm working with PyQt4, but this is a general Qt question. My current implementation contains the following. One QGraphicsScene (with view) and one QGraphicsWidget that contains the QGraphicsGridLayout onto which I insert my custom widgets. The problem I'm having is that each of these custom widgets has different sizes, and they overlap and I'm not sure as to how I would go about changing the sizes for each widget separately. Also, the grid needs to be "responsive" i.e. if the widget is some width, then there should be 3 columns, but if the widget is smaller, only 2 columns should be displayed. I've read this may be solvable by implementing the size hints, but I haven't really found any good documentation on that topic. So my questions are: Is there a better way to make the hierarchy of widgets, my current one seems excessive (Scene > Widget > Layout > Widgets) What's the best way to make different sized widgets the same size (so they would all appear the same size in the grid and not overlap)? My main QGraphicsWidget (on which the grid is displayed) doesn't take up the whole width of the view, what is the best way to achieve this? How would I go about making my QGraphicsGrid "responsive"?
true
37,592,580
1.2
0
0
1
Is there a better way to make the hierarchy of widgets, my current one seems excessive (Scene > Widget > Layout > Widgets) When I use the QGraphics.... classes, I generally will subclass QGraphicsView. The view will create it's own scene and have convenience methods for creating all the child items as well. From an api standpoint, only the view widget is really exposed. What's the best way to make different sized widgets the same size (so they would all appear the same size in the grid and not overlap)? It depends what types of widgets they are. If they are images/pixmaps, you can just scale them to a certain size. If they are actual widgets with controls, you probably don't want to scale them and should just set their actual height/width using setGeometry. Otherwise, all QGraphicsItem's support scaling. My main QGraphicsWidget (on which the grid is displayed) doesn't take up the whole width of the view, what is the best way to achieve this? On the view, you can get the .viewport() size, then just set the size of your graphics widget to the size of the viewport. You'll have to override the resizeEvent on the QGraphicsView to also resize your QGraphicsWidgets whenever the view resizes. How would I go about making my QGraphicsGrid "responsive"? For this, you'd probably be better off not using a grid and computing the placement of each item in your graphics scene manually. It depends somewhat on how you want your items placed. Are some widgets supposed to be below or next to others? Do you just want a tightly packed grid? Can an item span two grid lines? Does everything have to fit on a single "page", or is vertical scrolling allowed. You'll have to answer these questions first before you get any good answers. But generally, you know the size of the viewport. If you have a list of graphics items, you can just iterate through them and set their position based off the items you've already placed. Again, override the resizeEvent on the graphics view so that you can re-compute item positions whenever the view resizes.
0
464
0
0
2016-06-02T12:58:00.000
python,c++,qt,qt4,pyqt4
Adjusting widget size in QGraphicsGridLayout
0
1
1
37,598,213
1
0
0
Well I need to scale (kinda like changing the screen resolution on your PC) the TkInter window up and down and I have checked like 200 answers and they are all for Python 2.0 so please do any of you guys have any help on this?
false
37,607,312
0.197375
0
0
1
You can't do what you want. You can simulate it partly by setting up bindings that can grow and shrink the size of fonts as a window is resized, and you can double or halve the size of images. You can also have widgets like the canvas, text widget, and frames grown and shrink to fit. However, widgets in general won't scale. For example, checkboxes, radiobuttons, scrollbars, sliders will all stay the same size.
0
53
0
0
2016-06-03T06:26:00.000
python-3.x,tkinter
How can I scale the contents of a tkinter window up and down?
0
1
1
37,613,354
1
0
0
I tried a lot of technics but nothing work, I want to convert my .ui file to a .py file, using the pyuic4 in cmd, but the result is : from PyQt4 import QtCore ImportError: DLL load failed: %1 [...] is not a valid Win32 application I'm using a 64bits system with python27 and "PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe" from Riverbank, I think it's because I install a 64bits version but i'm not sure. If someone could have an idea, it could be awesome ! :)
true
37,623,661
1.2
0
0
0
Maybe try PYQT 3. Version 4 has some bugs in it
0
127
0
0
2016-06-03T21:24:00.000
python,qt,user-interface
Python Error When creating a .py file from a .ui file (from Qt designer)
0
1
1
37,623,811
1
0
0
I have a Matlab function that takes a 3D binary object as input, saves it as temporary file, then loads a python script through cmd (I made this before Matlab's python integration). The python script loads and reorganizes the 3D data and displays them through VTK. The python script also creates some VTK controls that I would like to control through Matlab GUI sliders rather than VTK sliders. Is there a way to open a realtime data flow between VTK and Matlab, either through Matlab's new python integration or python's Matlab engine API (or any other way)? I haven't found any way to control VTK actors other than VTK-created controls right in the VTK interactor window so far. EDIT: I also ran into an odd issue when trying to figure this out. When I run the VTK visualization with system(['pythonw ' folder '\vizualize.pyw" &']); (and adding the main() so that the script executes itself) everything runs smooth, but when I do it with py.vizualize.main() and attempt to close the vizualization window, it doesn't close but it does return control to matlab command line. On the second attempt, it kills the matlab window instead and then after a while itself. The scripts are identical. EDIT 2: Adding renderWin.Finalize() right after renderInteractor.Start() fixed this issue for some reason. Thanks for any answers or ideas!
true
37,632,614
1.2
0
0
0
I kind of got it to work. Here's what I did: matlab session running the GUI converts to shared session through matlab.engine.shareEngine('shared_matlab_session') and keeps track of the matlab GUI slider position in matlab_slider_pos variable the python script connects to the session through MatEng=matlab.engine.connect_matlab('shared_matlab_session') before initializing VTK objects the VTK render window adds an observer for TimerEvent that triggers SliderSync python callback function every 0.1 seconds the SliderSync function checks if the current VTK slider value corresponds with result of calling MatEng.eval('matlab_slider_pos') and if it doesn't, update the VTK slider value along with the rest of VTK pipeline. Of course at this point the VTK slider is no longer needed and the function can directly update what needs updating. I really hope there is a more elegant way to view a 3D volume in matlab than the abomination I created (it works pretty smooth though). Comments are still welcome!
0
204
0
0
2016-06-04T16:36:00.000
python,matlab,vtk
controlling VTK through Matlab
0
1
1
37,661,211
1
0
0
So I spent a lot of time trying to fugure out what Cython and Jython are and I'm still (more) confused as anyone who just started computer programming. I heard that Cython is an extension, but..is also and indepent language?? What I think I've understood is that: Cython/Jython is just Python and you can use C or C++/Java libraries respectively with just a little bit of Cython/Jython syntax. It's meant to speed up performance as well as improve code readability when a task would be more efficient to write in C or C++/Java and, this is done by using statically typed variables. Or is Cython/Jython just some sort of extension that is used sometimes but not independently? What I mean is, you'd still write everything in Python and then, for the tasks you'd rather use C or C++/Java for, you'd use Cython/Jython instead? (I know I still need Python installed and similar things as it's dependent.) Because if it really is better, other than the barrier that it's still being developed since it's rather new, wouldn't the need for C or C++/Java completely go away as these are as easy as Python but as powerful as C or C++/Java?
false
37,643,172
0
0
0
0
Jython is a implementation of Python language on the Java Virtual Machine, so Jython is Python but is not CPython. Cython is an extension to CPython and has not much in common with Python except some similarities in Syntax.
1
3,486
0
3
2016-06-05T14:44:00.000
java,python,c,jython,cython
Is Cython/Jython an independent language?
0
3
4
37,643,350
1
0
0
So I spent a lot of time trying to fugure out what Cython and Jython are and I'm still (more) confused as anyone who just started computer programming. I heard that Cython is an extension, but..is also and indepent language?? What I think I've understood is that: Cython/Jython is just Python and you can use C or C++/Java libraries respectively with just a little bit of Cython/Jython syntax. It's meant to speed up performance as well as improve code readability when a task would be more efficient to write in C or C++/Java and, this is done by using statically typed variables. Or is Cython/Jython just some sort of extension that is used sometimes but not independently? What I mean is, you'd still write everything in Python and then, for the tasks you'd rather use C or C++/Java for, you'd use Cython/Jython instead? (I know I still need Python installed and similar things as it's dependent.) Because if it really is better, other than the barrier that it's still being developed since it's rather new, wouldn't the need for C or C++/Java completely go away as these are as easy as Python but as powerful as C or C++/Java?
false
37,643,172
0.099668
0
0
2
Ok. Jython is an implementation of Python that converts python source code into java bytecode or object code as most people call it. So you basically write your programs using the python syntax, but the output of the source code when compiled to an object code is the java bytecode Cython on the other hand is an implementation where by standard modules in the python language have been translated into the C language. So here, when you basically use a module, it is the python standard module, but for efficiency sake, under the hood, its C language or code that is executed
1
3,486
0
3
2016-06-05T14:44:00.000
java,python,c,jython,cython
Is Cython/Jython an independent language?
0
3
4
37,643,398
1
0
0
So I spent a lot of time trying to fugure out what Cython and Jython are and I'm still (more) confused as anyone who just started computer programming. I heard that Cython is an extension, but..is also and indepent language?? What I think I've understood is that: Cython/Jython is just Python and you can use C or C++/Java libraries respectively with just a little bit of Cython/Jython syntax. It's meant to speed up performance as well as improve code readability when a task would be more efficient to write in C or C++/Java and, this is done by using statically typed variables. Or is Cython/Jython just some sort of extension that is used sometimes but not independently? What I mean is, you'd still write everything in Python and then, for the tasks you'd rather use C or C++/Java for, you'd use Cython/Jython instead? (I know I still need Python installed and similar things as it's dependent.) Because if it really is better, other than the barrier that it's still being developed since it's rather new, wouldn't the need for C or C++/Java completely go away as these are as easy as Python but as powerful as C or C++/Java?
false
37,643,172
0.049958
0
0
1
CPython is comparable to Jython. They're the implementation of the Python language. CPython is the de-facto standard and was written in C. Jython is written in Java and runs on the JVM. It also allows accessing the Java ecosystem to a great extent. There are also other implementation of the language, like PyPy or Pyston. Cython is totally different. It allows us to write extensions for Python in C or Pyrex, a subset of the Python language. Cython speeds up the execution speed for the parts written with it.
1
3,486
0
3
2016-06-05T14:44:00.000
java,python,c,jython,cython
Is Cython/Jython an independent language?
0
3
4
37,643,279
1
0
0
I'm trying to make a GUI in tkinter that uses one image as an overlay on top of another, but when I place the image over the lower one, the transparent area of the image appears as grey. I've searched for solutions to this, but all the results that I've found have pointed towards using PIL. Is it possible for me to use transparent, or partially transparent images in the python tkinter module without using PIL?
false
37,667,631
0
0
0
0
You could use some basic photoshop tools like the magic wand tool to remove the background, but keep in mind, some PNG format images have a faint background. This is either in the from of a watermark, or the image background was rendered with a lower opacity than the rest of the image. Your GUI may also have a layer placed above the images by default. Does it appear on each image seperatly when loaded into the GUI?
1
234
0
0
2016-06-06T22:10:00.000
python,user-interface,tkinter,transparent
How can I make the background of an image appear transparent without PIL?
0
1
1
37,801,513
1
0
0
Right now I have an image processing algorithm that is roughly 100 lines or so in Python. It takes about 500ms using numpy, PIL and scipy. I am looking to get it faster, and as the actual algorithm seems pretty optimized thus far, I'm wondering if using a different approach such as Cython would improve the times. I believe that I have several different things I could do: Use Cython to expose relevant parts of the C library to Python. Use Ctypes to just write everything in C but still have it pure Python (not leaning towards this at all) Create an extension module in C/C++ and them import it and call the functions. I'm not sure if I would be able to use numpy this way though. Create a DLL and have Python load it. This doesn't get to use numpy or those modules, but would still be very efficient. I'm just looking for speed here, not worried about difficulty of the implementation. Is there any one option that is better in this case, are they all the same, or is it even worth doing?
true
37,712,561
1.2
0
0
6
It helps to know what you need to do here. If you're not using ctypes for function calls, it's unlikely that it will save you anything to just have ctypes types involved. If you already have some DLL lying around with a "solve it for me" function, then sure, ctypes it is. Cython creates extension modules, so anything you can do with Cython could also be done with an extension module, it just depends on how comfortable you are writing extensions by hand. Cython is more limited than writing extension by hand, and harder to "see" performance in (the rules for optimizing Cython are basically the opposite of optimizing CPython code, and if you forget to cdef the right things, you gain nothing), but Cython is generally simpler too. Writing a separate non-extension DLL is only worthwhile if you have non-Python uses for it; otherwise, a Python extension is basically just the DLL case, but better integrated. Basically, by definition, with infinite time and skill, a CPython extension will beat any other option on performance since it can do everything the others do, and more. It's just more work, and easy to make mistakes (because you're writing C, which is error prone).
0
929
0
5
2016-06-08T20:43:00.000
python,cython,ctypes,python-extensions
Differences between Cython, extending C/C++ with Python.h, etc
0
1
1
37,712,741
1
0
0
I'm using length based message framing with python twisted framework with a C# client running BeginRecieve async reads and I'm having trouble grabbing the value of the length of the message. This is the twisted python code self.transport.write(pack(self.structFormat, len(string)) + string) And this is the C# code: int bytesRead = client.EndReceive(ar); if (bytesRead > 0) { int msg_size = BitConverter.ToInt32(state.buffer, 0); Problem is the len(string) value is not correct when I grab it via Bitconverter on the c# side. The value should be 15 but its coming across as 251658240. Any insight would be much appreciated.
false
37,718,216
0
0
0
0
Sorry the question was badly asked. I did find the solution though. int netmsg_size = BitConverter.ToInt32(state.buffer, 0); int msg_size = IPAddress.NetworkToHostOrder(netmsg_size); This converts the network integer back into a regular integer.
0
72
1
0
2016-06-09T06:19:00.000
c#,python,sockets,twisted,beginreceive
Python Twisted frameowrk transport.write to a c# socket BeginReceive reading length based message framing value
0
1
1
37,736,839
1
0
0
I am having a problem with running pillow for python 3.4.2. I tried installing Pillow using 3 different files: Pillow-3.2.0.win-amd64-py3.4.exe, Pillow-3.2.0-cp34-cp34m-win_amd64.whl, Pillow-3.2.0-cp34-none-win_amd64.whl. Every time I try to import Image or tkimage I get the not a valid win32 error in shell. Also, the 2 wheel files said they were incompatible with my system when using pip to install so I had to extract the data and place manually. I am running windows 10 64bit but when I request what platform I'm running with python it says windows 8! In my system info from control panel it says the correct information though. Please help if anyone knows the solution!
false
37,753,121
0
0
0
0
Solved: I finally figured it out! I had a 32 bit and a 64 bit version of python installed. I had pillow installed to my 32 bit directory, so when python ran from 32 bit was why I got the win32 error. And when I ran python 64bit it said module not found. Uninstalled both and reinstalled the 64 bit to the normal install direc in C, reinstalled 64 bit pillow and it worked! After updating pip it was able to read the wheel files.
1
115
0
0
2016-06-10T16:31:00.000
python,python-imaging-library,pillow
Unable to use Pillow (not a valid WIN32 error)
0
1
1
38,139,040
1
0
0
This is my first time posting a question here as most of my questions have already been answered by someone else! I am working on a GUI application in python and am attempting to use pyinstaller to package it into a single folder and .exe for easier portability. Currently, I am using windows 10 and anaconda3 to manage my python packages. The application relies on tkinter, pillow, numpy, scikit-learn, opencv, ffmpeg, and matplotlib. The application is formatted with a main GUI.py file that creates objects of a number of other files (many of which are stored in a subfolder as this GUI is replacing a command line utility that served the same purpose). The issue I am running into (as you can see in the title) is that the .exe is throwing the error block: Traceback (most recent call last): File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in File "c:\users\gurnben\anaconda3\envs\opencv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources__init__.py", line 68, in File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources\extern__init__.py", line 60, in load_module ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution. Failed to execute script pyi_rth_pkgres When I look at the warn.txt it gives a massive list of missing packages including parts of some packages that are actually in the single folder package. I have, however, successfully gotten it to recognize the dll files from opencv and it is not listed among the missing (nor is ffmpeg however I did not see any ffmpeg files in the folder). I had to pass in a custom path to get it to include the opencv files as they are not in anaconda at this time. Any hints or ideas for next troubleshooting steps? I am overly greatful for all of the help you an offer and I can upload any code, files, etc. that would help you diagnose the issue. In the meantime I will continue searching for a solution myself!
false
37,815,371
1
0
0
33
Extending Vikash Kumar's answer, build the application by adding the --hidden-import argument to the command. For example, running the command given below worked for me. "pyinstaller --hidden-import=pkg_resources.py2_warn example.py" update: added missing "="
1
55,660
0
33
2016-06-14T14:49:00.000
python,opencv,ffmpeg,pyinstaller
Pyinstaller "Failed to execute script pyi_rth_pkgres" and missing packages
0
2
8
59,979,390
1
0
0
This is my first time posting a question here as most of my questions have already been answered by someone else! I am working on a GUI application in python and am attempting to use pyinstaller to package it into a single folder and .exe for easier portability. Currently, I am using windows 10 and anaconda3 to manage my python packages. The application relies on tkinter, pillow, numpy, scikit-learn, opencv, ffmpeg, and matplotlib. The application is formatted with a main GUI.py file that creates objects of a number of other files (many of which are stored in a subfolder as this GUI is replacing a command line utility that served the same purpose). The issue I am running into (as you can see in the title) is that the .exe is throwing the error block: Traceback (most recent call last): File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in File "c:\users\gurnben\anaconda3\envs\opencv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module exec(bytecode, module.dict) File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources__init__.py", line 68, in File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources\extern__init__.py", line 60, in load_module ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution. Failed to execute script pyi_rth_pkgres When I look at the warn.txt it gives a massive list of missing packages including parts of some packages that are actually in the single folder package. I have, however, successfully gotten it to recognize the dll files from opencv and it is not listed among the missing (nor is ffmpeg however I did not see any ffmpeg files in the folder). I had to pass in a custom path to get it to include the opencv files as they are not in anaconda at this time. Any hints or ideas for next troubleshooting steps? I am overly greatful for all of the help you an offer and I can upload any code, files, etc. that would help you diagnose the issue. In the meantime I will continue searching for a solution myself!
false
37,815,371
0.07486
0
0
3
this is because he did not copy a dependency.I solved it like this. pyinstaller my_program.py this creates a my_program.spec. it is a base configuration file. open it with any text editor. search for hiddenimports=[] edit to. hiddenimports=["pkg_resources.py2_warn"] now let's call pyinstaller passing our configured file instead of our program pyinstaller my_program.spec
1
55,660
0
33
2016-06-14T14:49:00.000
python,opencv,ffmpeg,pyinstaller
Pyinstaller "Failed to execute script pyi_rth_pkgres" and missing packages
0
2
8
62,305,689
1
0
0
I'm developing a project (in Python) that does video processing using OpenCV. Now I'm planning to implement that in my android phone. I read that Qpython supports python on android. So is there any way to import third party libs like OpenCV in Qpython. Thanks in advance.
false
37,833,638
0.099668
0
0
1
You can install opencv from qpython libraries(install from QPypi). QPython --> Libraries --> QPypi --> opencv-qpython --> install Use it as import cv
0
7,472
0
3
2016-06-15T11:05:00.000
android,python,opencv,qpython
OpenCV in Qpython
0
2
2
45,597,300
1
0
0
I'm developing a project (in Python) that does video processing using OpenCV. Now I'm planning to implement that in my android phone. I read that Qpython supports python on android. So is there any way to import third party libs like OpenCV in Qpython. Thanks in advance.
false
37,833,638
0
0
0
0
In Qpython3 there is a pip program (not sure if on qpython too) but running that program you can "pip install [your module]" Worked for me installing sqlalchemy and youtube_dl
0
7,472
0
3
2016-06-15T11:05:00.000
android,python,opencv,qpython
OpenCV in Qpython
0
2
2
38,175,636
1
0
0
Using Python 2.7 and PyQt4. So I need a way to make a text of the QPushButton editable when click on it, like on QTextEdit.
true
37,933,629
1.2
0
0
1
There is no builtin way to edit a push button in the sense that you have a cursor and can type along. Probably the easiest solution is to bring up a QInputDialog. If that feels to heavy, you could also place a floating QLineEdit over or next to the QPushButton. Close that on <Enter> and set the typed text to the QPushButton. If you really want an editable Button, you'll have to subclass QPushButton and implement the desired functionality yourself. To get started with this, you need to reimplement mousePressEvent() for starting your editing mode. Reimplement keyPressEvent() for handling key strokes. If you need to display a cursor, reimplement paintEvent(). I have no particular resource at hand that describes what exactly you have to do, but the terms above should be sufficient to look it up yourself.
0
302
0
1
2016-06-21T00:01:00.000
python,pyqt4,qtextedit,qpushbutton
How to make QPushButton editable text when one click on it?
0
1
1
37,933,711
1