[{"Question":"I'm trying my hand at pysimplegui to build my first UI. However, I keep getting an error but in a flash a stack trace appears before the screen, the program ends and unable to read it. Is there anyway to print the stack trace from pysimplegui to the console in PyCharm to use as a way of debugging?\nHad a look at the docs but sadly nothing I can see and the docs are not as simple as the library.\nCheers","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":309,"Q_Id":63220801,"Users Score":0,"Answer":"I manged to get it worked, I ran it in debug mode in the command line and I now see the issue","Q_Score":0,"Tags":"python,stack-trace,pysimplegui","A_Id":63236572,"CreationDate":"2020-08-02T20:39:00.000","Title":"pysimplegui print stack trace to console","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am rewriting python import system in C. I encountered a problem: in Python\/importlib.h, it says it is generated by Lib\/importlib\/_bootstrap.py, but even if I changed some code in Lib\/importlib\/_bootstrap.py, Python\/importlib.h remains unchanged.\nI have 3 questions:\n1: How can I change the bytecode in Python\/importlib.h?\n2: What is the relationship between Lib\/importlib\/_bootstrap.py and Python\/importlib.h?\n3: How does the cpython import system work in total?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":70,"Q_Id":63246403,"Users Score":1,"Answer":"After several weeks of reading the source code of Python-3.6.10, I write an answer here to offer my understanding.\n\nPython\/importlib.h is generated by Programs\/_freeze_import.c. \"make regen-all\" is need to rerun the _freeze_import.c file. _freeze_import.c take the input of Lib\/importlib\/*.py to generate Python\/importlib.h and Python\/importlib_external.h.\nLib\/importlib\/*.py is the source of Python\/importlib.h and Python\/importlib_external.h.\nYou need to dive into the source code.","Q_Score":0,"Tags":"import,cpython","A_Id":63336902,"CreationDate":"2020-08-04T11:58:00.000","Title":"How does importlib.h generated from importlib._bootstrap in Cpython?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the difference between .quit and .destroy on Tkinter, they seem to do the same thing.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":259,"Q_Id":63271131,"Users Score":1,"Answer":".quit() causes mainloop to exit, but doesn't directly cause any widgets to be destroyed. However, if there's no code after calling mainloop then the script exits, and all widgets will be destroyed.\n.destroy() will destroy a widget. If you destroy the root window then all other widgets will be destroyed and mainloop will stop.","Q_Score":0,"Tags":"python,tkinter","A_Id":63271292,"CreationDate":"2020-08-05T18:09:00.000","Title":"Difference between .quit and .destroy on tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I created an application in tkinter python and I want it to run automatically when windows boots up for any user who installs it on their computer just like spotify.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":58,"Q_Id":63288168,"Users Score":0,"Answer":"Click on Start Windows, search for Task Scheduler, and open it.\nClick Create Basic Task at the right window.\nGive a name and a description.\nChoose your trigger time.\nSelect the script\nClick finish","Q_Score":1,"Tags":"python,tkinter","A_Id":63288404,"CreationDate":"2020-08-06T16:40:00.000","Title":"Autorun for application stored on computer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to create an app and tkinter is really helpful, just want to confirm if Tkinter will successfully lead me to an app for IOS or Android.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":10464,"Q_Id":63292696,"Users Score":1,"Answer":"Tkinter is meant for desktop applications, not mobile apps. You won't be able to make a mobile app with Tkinter. However, I've found that developing in Tkinter has given me a taste of what developing apps is like, and so I figure some of the thought processes I've learned will transfer over to Swift and Java, which are the main languages for developing mobile apps.","Q_Score":0,"Tags":"python,android,ios,tkinter","A_Id":63294290,"CreationDate":"2020-08-06T22:35:00.000","Title":"Is it possible to use Tkinter to create an app for Android or iOS?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to create an app and tkinter is really helpful, just want to confirm if Tkinter will successfully lead me to an app for IOS or Android.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":10464,"Q_Id":63292696,"Users Score":1,"Answer":"Unfortunately Tkinter won't work for creating mobile apps as it is meant to be used on desktop only. However check out Swift with Xcode that has a really good user interface for building app interfaces where you can drag and drop different items you want onto the screen - you will need a Mac for that.\nAlternatively Android Studio is continually being updated which has a similar interface for creating app screens - available for Windows and Mac.\nThere are loads of tutorials for starting of on Xcode or Android Studio which should help you get started.","Q_Score":0,"Tags":"python,android,ios,tkinter","A_Id":63300700,"CreationDate":"2020-08-06T22:35:00.000","Title":"Is it possible to use Tkinter to create an app for Android or iOS?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've compiled an app using python, js, html and css (using eel to link them). It's all working but when I load the exe that is compiled, it opens the app logo, bounces up and down (as apps do on Macs when loading) then the logo disappears, and then the app opens after about 8 seconds from google chrome.\nIs this normal for Pyinstaller executables i.e. opening from chrome, or is there something in my code? If so, leave a comment and I will update this question with relevant snippets of my code!\nThanks","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":127,"Q_Id":63294222,"Users Score":0,"Answer":"is it possible that while compiling your app with Pyinstaller, you used --onefile? If this is the case, try compiling again without this command and see if the problem still persists.\nfrom the Pyinstaller docs:\n\n... the single executable is a little slower to start up than the\none-folder bundle.\nBefore you attempt to bundle to one file, make sure your app works\ncorrectly when bundled to one folder. It is is much easier to diagnose\nproblems in one-folder mode.","Q_Score":0,"Tags":"javascript,python,html,python-3.x,pyinstaller","A_Id":63315352,"CreationDate":"2020-08-07T02:11:00.000","Title":"Why does Pyinstaller exe open and close then open again?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I've compiled an app using python, js, html and css (using eel to link them). It's all working but when I load the exe that is compiled, it opens the app logo, bounces up and down (as apps do on Macs when loading) then the logo disappears, and then the app opens after about 8 seconds from google chrome.\nIs this normal for Pyinstaller executables i.e. opening from chrome, or is there something in my code? If so, leave a comment and I will update this question with relevant snippets of my code!\nThanks","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":127,"Q_Id":63294222,"Users Score":1,"Answer":"I've made a work around and am posting it as the answer to this question incase someone has a similar issue in the future.\nAfter doing research I found that PyInstaller is simply just slow in most cases where there is a larger python file i.e. machine learning. There were also other issues with integrating PyInstaller and JS\/HTML\/CSS, where you have to use Eel to communicate between the documents, and subsequently, every desktop\/web application you make will have to involve google chrome.\nSOLUTION:\nAs an alternative to building the desktop application via PyInstaller, I am building it using Blazor\/Electron. There is no direct link between Blazor\/Electron and Python, as Blazor relies on C#, JS\/HTMLCS. Therefore, I ported in IronPython into my C# file, this allows me to communicate along the following path. C# -> Python -> C# -> JS\/HTML\/CSS. An additional advantage to Blazor\/Electron is that the application can be built as a local desktop application without internet connection, and it boots up much faster. Lastly, C# allows for building Splash Screens (loading screen while the app boots up for the first time) for your application, so even if you're app is huge and it has a long load time, the user can be informed that the desktop app is loading!","Q_Score":0,"Tags":"javascript,python,html,python-3.x,pyinstaller","A_Id":63315595,"CreationDate":"2020-08-07T02:11:00.000","Title":"Why does Pyinstaller exe open and close then open again?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Is there a way to find out what width a Label would be for a given text and font, without having to add it to the graphical elements currently being displayed.\nI need to get the information without any effect on the GUI, however momentary that effect may be. And, in any case, packing appears to work in a top-down fashion, meaning that controls may expand to fill others higher in the hierarchy but I can't get them to adjust those higher to allow for their actual size.\nI'm more used to QML where I can just give an off-screen element the text and font details then just read out the bounding box.\nDoes anyone know how to do something similar in Tkinter?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":58,"Q_Id":63295132,"Users Score":2,"Answer":"You can create the Label without calling pack() \/ grid() \/ place(), then call winfo_reqwidth() and winfo_reqheight() on the label to get its size.","Q_Score":0,"Tags":"python,tkinter,width,tkinter-label","A_Id":63299693,"CreationDate":"2020-08-07T04:19:00.000","Title":"TkInter get width of specific text","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I mean, how am I supposed to do something like this, when I click a button, a browser opens, on the page it url gives?\nMy guess is that a module is needed here, unless it can be done in the Tkinter module, because that's where I want this button (hyperlink, as in html)","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":355,"Q_Id":63314105,"Users Score":1,"Answer":"Try using the webbrowser module. You can have a look at this link for more information-https:\/\/docs.python.org\/2\/library\/webbrowser.html\nThe webbrowser module provides a high-level interface to allow displaying Web-based documents to users. Under most circumstances, simply calling the open() function from this module will do the right thing.\nUnder Unix, graphical browsers are preferred under X11, but text-mode browsers will be used if graphical browsers are not available or an X11 display isn\u2019t available. If text-mode browsers are used, the calling process will block until the user exits the browser.\nIf the environment variable BROWSER exists, it is interpreted to override the platform default list of browsers, as an os.pathsep-separated list of browsers to try in order. When the value of a list part contains the string %s, then it is interpreted as a literal browser command line to be used with the argument URL substituted for %s; if the part does not contain %s, it is simply interpreted as the name of the browser to launch. 1\nFor non-Unix platforms, or when a remote browser is available on Unix, the controlling process will not wait for the user to finish with the browser, but allow the remote browser to maintain its own windows on the display. If remote browsers are not available on Unix, the controlling process will launch a new browser and wait.\nThe script webbrowser can be used as a command-line interface for the module. It accepts a URL as the argument. It accepts the following optional parameters: -n opens the URL in a new browser window, if possible; -t opens the URL in a new browser page (\u201ctab\u201d). The options are, naturally, mutually exclusive.","Q_Score":2,"Tags":"python,hyperlink","A_Id":63314182,"CreationDate":"2020-08-08T10:01:00.000","Title":"What module for opening links in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have seen the term 'monospace' at dozen of places. Can you tell me what does monospace font mean and what monospace fonts are available in Python and Tkinter?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1067,"Q_Id":63318183,"Users Score":3,"Answer":"\"Monospace\" just means that all characters take the same, fixed width for each character.\nThe converse is a \"proportional\" font where narrower letters e.g i take less space and wider letters e.g. m take more space.\nWhich ones are available depend on what you have installed.","Q_Score":0,"Tags":"python,tkinter,fonts,monospace","A_Id":63318256,"CreationDate":"2020-08-08T17:13:00.000","Title":"What monospace fonts are available in Python and Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"My output is cluttered with hundreds of lines that look like this:\n'python.exe' (Python): Loaded 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\Lib\\struct.py'. Module was built without symbols. 'python.exe' (Python): Loaded 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\Lib\\ctypes\\_endian.py'. Module was built without symbols. 'python.exe' (Python): Loaded 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\Lib\\glob.py'. Module was built without symbols. 'python.exe' (Python): Loaded 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\Lib\\fnmatch.py'. Module was built without symbols. 'python.exe' (Python): Loaded 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\Lib\\posixpath.py'. Module was built without symbols.\nand it takes a minute or two to get to my code. It seems to be loading way more than necessary, including niche libraries that are only tangentially related to what I have imported (just pyqtgraph).\nI have tried various solutions, excluding symbols, and trying to specify modules. There doesn't seem to be a clear setting in Options > Debug to fix this. I should note that I believe this happened after enabling native debugging for a C++ extension I am using.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":69,"Q_Id":63330863,"Users Score":0,"Answer":"As of now, there is currently no \"Just My Code\" debug option when debugging native code in PTVS (Python for Visual Studio).","Q_Score":1,"Tags":"python,visual-studio,load,interpreter","A_Id":65547203,"CreationDate":"2020-08-09T20:11:00.000","Title":"Why is Python loading extremely slowly in Visual Studio?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I use spyder(ide) for writing python programs.\nI wrote a program on 'conway checkers' using tkinter(gui library).\nI then compiled this program using pyinstaller into a '.exe' file. However, this '.exe' file does not run on any other computer except mine.\nWhat else is required to make it run on all windows just like any other application does?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":39,"Q_Id":63353686,"Users Score":0,"Answer":"Your question is a bit vague.\nHowever, your problem is probably related to missing libraries on other people's computers.\nYou can either:\n\nUse a \"requirements.txt\" file, in which you specify what libraries is needed to run your program (tkinter in your case it would seem) and explain how to install it using pip in a Readme\nExport an environment and pack it in the .exe file\n\nTo troubleshoot your issue, run your exe file in a windows command prompt, you will get hints of what your issue is.","Q_Score":0,"Tags":"python,windows,pyinstaller","A_Id":63354153,"CreationDate":"2020-08-11T07:43:00.000","Title":"How can I make a program so that it runs on all window versions?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have had this problem for ages now with many different projects now, so I really want to find out how to fix it. For example, in one of my projects, I created a level editor for a game. The level editor had the option to save and load different levels from a file using tkinter.filedialog.\nNow after I select the file, the game will still work, but the 'X' close button doesn't work anymore, and I can't move the window.\nThe game itself works as usual, and I can still interact with everything inside of the window, but I can't move or close the window.\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":87,"Q_Id":63356374,"Users Score":1,"Answer":"Ok. I figured this one out. The problem went away when I called the tkinter functions from a key press, not a mouse press.","Q_Score":3,"Tags":"python,python-3.x,tkinter,pygame","A_Id":63358523,"CreationDate":"2020-08-11T10:34:00.000","Title":"Pygame window wont move or close after using tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have the output from using .dump() on a Text widget which uses formatting and I would like to use this to load it on another text widget. Is this possible or do I have to parse it back manually?\nExample .dump() output: [('mark', 'current', '1.0'), ('text', 'Sample text', '1.0'), ('mark', 'tk::anchor1', '1.11'), ('mark', 'insert', '1.11'), ('text', '\\n', '1.11')]","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":55,"Q_Id":63362081,"Users Score":1,"Answer":"There is no built-in function to load that data in another text widget. You will have to write the code to parse it and reconstruct the data.","Q_Score":0,"Tags":"python-3.x,tkinter","A_Id":63362320,"CreationDate":"2020-08-11T16:05:00.000","Title":"Is there a way to store and load formatted text from a text widget in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygame and I've been working so far in a large monitor, but now I need to work on a small laptop, whose screen is much smaller than the mentioned monitor. The dimensions I gave to the display surface and the items blitted to it work well on the previous monitor but it is too large on the laptop and therefore I cannot reach all buttons. Since I can't seem to find a way to resize everything proportionaly, is there an easy way to add a vertical and horizontal scroll bar in order to navigate around the display surface?\nThank you","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":342,"Q_Id":63479241,"Users Score":0,"Answer":"I don't think that you can add a scroll bar. What you can do is shift the x or y of everything when you press the corresponding arrow keys. But as said by Ted Klein Bergman, it is better to simply resize everything.","Q_Score":1,"Tags":"python,pygame","A_Id":63479501,"CreationDate":"2020-08-19T02:39:00.000","Title":"Adding a vertical and horizontal scroll bar to the display surface in Pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Scenario: Buildozer packaged python apk works fine on Android Emulator and shows Login screen. On hitting Login button I am getting details of logged in user from Mysql database\nMySql database server is a Ubuntu chromebook. Android Emulator is on Windows machine.\nI can access the database via from Windows machine using HeidiSql - i.e ip address and user name \/ password @ port 3306.\nHowever the app running on the emulator gives a permission denied error\nPlease advise how I can find root cause of the issue and rectify it","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":157,"Q_Id":63486031,"Users Score":0,"Answer":"The issue was happening because the buildozer spec file was missing the option\nandroid.permissions = INTERNET\nAfter putting this the sql queries started working.","Q_Score":0,"Tags":"android,mysql,python-3.x,kivy","A_Id":63639709,"CreationDate":"2020-08-19T11:29:00.000","Title":"Kivy+Python apk Mysql Remote Database access","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"is there a way I can embed videos in a python app using kivy?\nI couldn\u2019t find any module for that and not sure how to proceed","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":70,"Q_Id":63491523,"Users Score":1,"Answer":"Kivy can stream videos from the internet and play them in VideoPlayer. However, YouTube does not provide a streaming URL. Remember that YouTube only gets paid when they show ads, which means they want you on their site and need you to use their video player.\nI can think of two options:\nUse a YouTube downloader app to retrieve the video (or, alternatively, try to hack on one of the downloaders and see if you can figure out what they're doing and how to duplicate it in Kivy).\nUse the Chromium Embedded Framework to display an actual web page. I have no idea whether this will work with Flash or not, but in theory it would work for any HTML5 videos (but not all videos can be watched in HTML5). There is a CEFPython Garden widget available, as well as a non-Garden CEFKivy component which has more recent development.","Q_Score":1,"Tags":"python,video,kivy","A_Id":63491569,"CreationDate":"2020-08-19T16:48:00.000","Title":"Is there a way to embed YouTube vids with kivy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im new in kivy and Im trying to build helloworld in python\/kivy on linux and for some reason I get this error and idk what to do with it\nhere is buildozer.spec https:\/\/drive.google.com\/file\/d\/1kUigxxOkf-HBF4qXwtcmfrVLZtJTkHtK\/view?usp=sharing\nhere is full output from console https:\/\/drive.google.com\/file\/d\/19YCXJ73oEHnl78-R2DoKlFuECkLfO6OW\/view?usp=sharing \n(for some reason stackowerflow says it looks like a spam when i put there just error so i must upload it on googledrive)\nI hope somebody can help me with it","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":33,"Q_Id":63509061,"Users Score":0,"Answer":"ValueError: storage dir path cannot contain spaces, please specify a path with --storage-dir\n\nThis is the error it's printed for you. It seems fairly clear. Try building in a folder without a space in the name.","Q_Score":0,"Tags":"python,android,linux,kivy,buildozer","A_Id":63513592,"CreationDate":"2020-08-20T16:06:00.000","Title":"Problem with building apk on android with buildozer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I need a solution for this (I haven't tried it in mobile yet cause the program is in the development stage but I know the question will also get a late response) that if I have multiple modules installed via command prompt and if I use those modules to make an android app then will the app function as it did in the PC or will it say that the modules are missing and keep on crashing, I'm new to app development please help me.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":955,"Q_Id":63511637,"Users Score":0,"Answer":"If you include the module in the compilation process (I don't know what you're using for compiling\/developing so not sure how to help there) the app won't crash. In the worst case it will just not play the audio, but the rest of the app should work (unless some part of it requires the audio to be played).","Q_Score":1,"Tags":"python,android,python-3.x,speech-recognition,pyaudio","A_Id":63512101,"CreationDate":"2020-08-20T19:03:00.000","Title":"does python modules like pyaudio works in a android if an android app is make by using python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":1},{"Question":"I want to change the font size of kivymd List Items.\nIs there a way to change font_size of kivymd List Items. Be it OneLineListItems or any List item.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":701,"Q_Id":63529561,"Users Score":4,"Answer":"text=\"[size=54]Discard draft?[\/size]\"","Q_Score":1,"Tags":"python,kivy,kivymd","A_Id":63529923,"CreationDate":"2020-08-21T20:17:00.000","Title":"Kivymd ListItems text size","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am finishing up on my first Python project. It is a text-based program converting metric and standard units. What could I use to turn the program into a GUI program. I have looked into tkinter. However, I am not sure if this would be the best solution for my situation. I would appreciate a little guidance as I am really new to programming.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":172,"Q_Id":63542277,"Users Score":0,"Answer":"Tkinker is a simple and easy way to add GUI to your program and you actually can create some good looking interfaces, so If I were you I would use Tkinter.","Q_Score":0,"Tags":"python,tkinter","A_Id":63542407,"CreationDate":"2020-08-23T00:18:00.000","Title":"How to make a text-based program into a GUI? Would tkinter be the key?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"What allows Kivy to be cross-platform compatible?\nIn other words, how can the same Kivy source code generate apps on multiple kinds of hardware platforms, such as desktop, iOS, and Android?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":95,"Q_Id":63551976,"Users Score":2,"Answer":"I suppose there are two key extremes of achieving cross-platform compatibility:\n\nBy implementing things in a different way on each platform so that Kivy is running different code on each one, but hiding that difference from the user by making the output appear the same.\nBy using external APIs that are supported by all the different platforms, so that Kivy's own code is basically the same and the platforms themselves take care of making it work.\n\nKivy has a bit of both of these, but in particular all the drawing uses OpenGL ES 2 which is the second type: all of Kivy's drawing logic is just about identical across all supported platforms. Of course there are other types too, e.g. when working out display metrics such as the pixel density Kivy uses a different method on each platform but doesn't expose any of that detail to the user.\nOf course things are much more nuanced when considering things as a whole. For instance, Kivy uses SDL2 as a library for creating a window, setting its size\/pos handling pause\/resume etc., so Kivy's code is of the second type here as it calls SDL2 in the same way on every platform. However, SDL2 is not itself platform-native and is of the first type, implementing its API differently on different platforms but exposing the same API to Kivy on each one.","Q_Score":3,"Tags":"python,python-3.x,user-interface,kivy,cross-platform","A_Id":63553002,"CreationDate":"2020-08-23T21:04:00.000","Title":"How does Kivy achieve cross-platform compatibility?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to use PandasGui to show intermediate DataFrame results of my app. It works perfectly in Jupyter. However, once I create the executable (using PyInstaller) the app does not work - just cmd shows for a second. Generaly I have no problem with other GUIs after converting to exe (EasyGUI, tkinter, etc.). So this must be something very specific.\nAny ideas how to make it work?\nOr any alternative to PandasGui which works correctly?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":182,"Q_Id":63563714,"Users Score":1,"Answer":"What exactly was the pyinstaller command that you tried for compiling the executable?\nAlso, you may want to consider tkinter or PyQt5 if this problem persists and you're unable to get a solution here since at least the former has worked for you in the past.","Q_Score":0,"Tags":"python,pandas,dataframe,pyinstaller","A_Id":63564100,"CreationDate":"2020-08-24T15:08:00.000","Title":"GUI does not show after creating executable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a Python GUI using Tkinter, but when I run it directly (double click the file) it opens the black python window but automatically closes by itself in less than half a second. I found a way to make it open the IDLE editor but it just opens the editor and doesn't run it.\nI want it to run the way it runs when you open the IDLE editor and press Run Module. This runs it using Python Shell.\nIs there a way I can make it automatically run using Python Shell?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":487,"Q_Id":63583733,"Users Score":1,"Answer":"Based on Mark Tolonen's comment you should do two things\n\nrename your file to a .pyw from .py to prefer console-less runs\n\nset your system to open .pyw files with pythonw if that's not configured already\n\nLinux: configure xdg-open\nWindows: right click and choose an application from the context menu (you may need to find where Python is installed to select the pythonw.exe executable)","Q_Score":2,"Tags":"python,windows-10,python-idle","A_Id":63583958,"CreationDate":"2020-08-25T16:58:00.000","Title":"How can I make .py files run using Python Shell by default?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a Python GUI using Tkinter, but when I run it directly (double click the file) it opens the black python window but automatically closes by itself in less than half a second. I found a way to make it open the IDLE editor but it just opens the editor and doesn't run it.\nI want it to run the way it runs when you open the IDLE editor and press Run Module. This runs it using Python Shell.\nIs there a way I can make it automatically run using Python Shell?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":487,"Q_Id":63583733,"Users Score":1,"Answer":"Okay, one of the comments on the original question is correct.\nAs Terry Jan Reedy (user:722804) said,\n\nIt is possible that your mygui.py file is missing 'root.mainloop()' or the equivalent to start the GUI. IDLE lets you omit that during development so that one can interact with tkinter to retrieve values and make changes to widgets.\n\nAdding gui.mainloop() to the end of my program worked.","Q_Score":2,"Tags":"python,windows-10,python-idle","A_Id":63585658,"CreationDate":"2020-08-25T16:58:00.000","Title":"How can I make .py files run using Python Shell by default?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am having a problem with all the QPushButton buttons in my PyQt application.\nFor some reason, even if the window has focus, the first click on a button will not register (no 'click affect' or button action occurs). Following this, as though it now has focus, I can click the button, or any other button, on the first go. As soon as the focus changes to another non-button widget, again none of the buttons will click on the first attempt.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":112,"Q_Id":63597208,"Users Score":0,"Answer":"Update:\nThis issue was present for maybe 4 months. After continuing to try everything I could find online and nothing working, I gave up. After about 2 weeks, the issue randomly disappeared.\nI have not made any intentional changes to package versions, but it's possible the issue was fixed in a minor version update of PySide. It has now been good for a few weeks so I am convinced it is solved :)\nThe version of PySide I am currently using is 5.15.1, I'm not sure if this is the same as before but can confirm the issue is not present here","Q_Score":0,"Tags":"python,pyqt,click,focus,qpushbutton","A_Id":64462611,"CreationDate":"2020-08-26T12:01:00.000","Title":"PyQT Buttons do not get focus on first click","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have read a data array into pillow via the Image.fromarray method. While I am able to bring it into pillow and successfully paste it onto another image in memory, img.resize((1920,1080)) and img,thumbnail((1920, 1080)) have no effect (and no error).","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":91,"Q_Id":63599525,"Users Score":1,"Answer":"That's because this operations create copies affected by the corresponding transformation. Have you tried img = img.resize((1920, 1080))?","Q_Score":0,"Tags":"python,python-imaging-library,image-resizing","A_Id":63600142,"CreationDate":"2020-08-26T14:11:00.000","Title":"Issue using Python PIL\/pillow to resize image","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When I use a class for my tkinter GUI, seems like I don't have to deal with the order of the declaration of variables and the input parameters of functions. However, the main thing is that, when I don't use a class for my tkinter GUI, I cannot use any event handling for my buttons.\nSo, is it necessary to use a class for tkinter GUI event handling?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":35,"Q_Id":63613070,"Users Score":0,"Answer":"No, classes aren't required in order to be able to handle events.","Q_Score":0,"Tags":"python,user-interface,button,tkinter,event-handling","A_Id":63616020,"CreationDate":"2020-08-27T09:29:00.000","Title":"Python tkinter GUI simple noob question: Is it necessary to use a class for tkinter GUI event handling?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I believe the tittle itself is sufficient.\nI'm currently learning GUI programming using Tkinter in python.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":107,"Q_Id":63627125,"Users Score":1,"Answer":"I actually wanted to comment this (but seems like i don't have enough reputation), so here is a simple breakdown.\ntkinter is a really nice library (it's beginner friendly - fairly customized), I will highly recommend sticking with tk (because u r already learning it - it will totally comply with your requirement of less resources' consumption ).\nI would suggest you to give a try to kivy - if and only if u wish to target mobile devices - it allows native development. Although it uses fair amount of resources which might -in some cases- overlook your system resources.\nNOTE: Having said that, if you you require apps with powerful GUI experience, PyQT is definitely a better choice but from what I know, PyQt may not be able to fulfill your priority of less resources' consumption.","Q_Score":0,"Tags":"python,user-interface,widget","A_Id":63627627,"CreationDate":"2020-08-28T03:42:00.000","Title":"Which cross platform GUI toolkit to use if less resource consumption is a priority","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The app is a canvas-based app. For a certain box on the gui, when the user clicks it, I bring up a checkbutton dialog. The dialog contains a color coded gif image at the top. Below that are 48 checkbuttons arranged in groups of 4. Each group of four corresponds to a color in the gif image. So I set the background color of each checkbutton to its corresponding color in the gif image. This helps the user select the appropriate button. The colors are just rgb strings like \"#00cc00\", etc.\nMy problem is, when I run on Linux, the background colors of the checkbuttons do not appear unless I mouse over the checkbuttons. Otherwise they just have a gray background. When I run on Windows from MobaXterm, it works like a charm. The background colors appear immediately. However, the target platform is Linux.\nI've tried the following: Using ttk and not using ttk. Forcing a dialog update, forcing a \"do-nothing\" mouse enter event. None of this has worked though. The python 3 version is anaconda 3.7.6 with tkinter 8.6.10.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":47,"Q_Id":63637531,"Users Score":0,"Answer":"I found a solution. For each checkbutton, I bind events Enter and Leave to a callback that does nothing, just returns. Then, after the dialog is created, I call event_generate first to Enter then to Leave the checkbutton.\nThis appears to solve the issue, and the dialog works correctly as well.\nThough, if someone has a more elegant solution, I would like to see that as well.","Q_Score":0,"Tags":"python-3.x,tkinter","A_Id":63639042,"CreationDate":"2020-08-28T16:17:00.000","Title":"Python 3 tkinter checkbutton dialog with different background colors","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a web site using Django and Python as a backend language.\nWe need to integrate part of a Pascal\/Delphi code into our system, the thing is, that this pascal code has more than 4 k lines, and there are some math operations with bytes and binary generation (main idea of the Script) that could slow down the process for people that have not interacted before with this language.\nMy question would be, what would you do in this situation, So far we have received just an idea of translating the code to Python ( this would need to translate the Binary generations and most of the 4k lines of the code)... I would like to know if there is another workaround to approach this situation in your opinion.\nthanks!","AnswerCount":1,"Available Count":1,"Score":0.537049567,"is_accepted":false,"ViewCount":281,"Q_Id":63641015,"Users Score":3,"Answer":"You can easily convert the Delphi code in a high-performance REST backend and call the endpoints from your web solution in Python. As options for the backend you can consider RAD Server, DataSnap, Delphi MVC Framework, Horse, and many others available out there.","Q_Score":1,"Tags":"python,delphi,binary,pascal","A_Id":63641702,"CreationDate":"2020-08-28T21:23:00.000","Title":"Solution to use Pascal\/Delphi code in a python enviroment","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Let's say I have build an application in tkinter on my personal laptop and I have distributed the .exe of it to my friends in different parts of the world. Now, I want to add some features in that application for which I wrote some extra lines of code on that same .py file whose .exe I sent earlier. How can I push the updates to all my friends who are using that app without having to send them .exe file everytime I update the code?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":183,"Q_Id":63717822,"Users Score":1,"Answer":"Any answers to this questions won't specifically relate to python or tkinter since you are distributing an exe.\nHere is how this might work in high level terms.\n\nYou upload a new version of your exe to a web server\nWhen your friends open their version of the program, it or another smaller program, will\ncheck the website to see if there is a newer version of the program available\nIf there it it will prompt them to update the software if they want\nIf they click yes, your program will close and the updater program will fetch the latest exe from your website and copy it over the top of the existing program\n\nSo for this application, you need a webserver where you can store the exe files of the different versions and will respond to requests to tell the program what the latest version available is\nYou also need another program which will handle the download and copying of the files to the correct locations\nAs you're no doubt aware, there are plenty of examples of this occurring on \"App Stores\"","Q_Score":0,"Tags":"python,tkinter","A_Id":63720993,"CreationDate":"2020-09-03T06:11:00.000","Title":"How to push updates in a tkinter application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do you run your Python code on Kaggle without organizing it into a single notebook or script?\nHere's what I'm trying to achieve: I have several Python scripts containing class definitions as well as the application logic, and I would like to run them as-is on Kaggle and take advantage of their freely-available GPUs and TPUs.\nI'd rather not turn everything into a single .ipynb or .py file as it would get pretty messy due to the several import statements in each script (which would need to be fixed), although it seems to be the only way to do that. Are there any alternatives to run my code on Kaggle while taking advantage of GPUs\/TPUs? If not, are there any other platforms that offer \"free\" GPUs?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":83,"Q_Id":63726634,"Users Score":0,"Answer":"You can import the files into each other. That way, you can run it all on one separate file that imports all the files. If you can only run one file, I'd advise you run them all on one file, or perhaps look into threading to run them all at once through one file.","Q_Score":0,"Tags":"python,kaggle","A_Id":63727209,"CreationDate":"2020-09-03T15:15:00.000","Title":"Taking advantage of Kaggle's free GPUs and TPUs","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am reading a book on Tkinter and so far making good progress understanding the concepts for a gui I want to make. One thing unexplained in the book is the concept of focusIn and focusOut. I have looked at the tcl.tk explanation and cannot understand what the events mean from that either.\nIf this is not the correct place to post such a question I apologise but I don't know where else to ask.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":140,"Q_Id":63737483,"Users Score":3,"Answer":"The focusIn event occurs when you select a widget so that your keyboard input goes to that widget. For instance, when you click on an input field so you can type into it.\nThe focusOut event occurs when you leave the widget that previously had focus, by moving keyboard focus to some other widget.","Q_Score":1,"Tags":"python,tkinter,focus,tk,focusin","A_Id":63737547,"CreationDate":"2020-09-04T08:23:00.000","Title":"What do the focusIn and focusOut event types mean?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"There is a game where rectangles falls and we have to avoid them, if we collide once speed decreases by 1 , second time speed decreases by 2 and so on\nHow to find out how many times we collided","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":63,"Q_Id":63750182,"Users Score":2,"Answer":"You can create a variable which gets added to every time you collide and another variable which is set to true once it collides then you can make it false and send the rectangle somewhere else.","Q_Score":1,"Tags":"python,pygame,rect","A_Id":63750800,"CreationDate":"2020-09-05T03:33:00.000","Title":"How to know how many times my rectangle has collided with other rectangles in pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Every time i change something in .ui file from qt designer, then i compile with pyuic5 command.\nThen i put MainWindow.showMaximized() instead of MainWindow.show() command.\nIs there any way to do it from Qt Designer?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":60,"Q_Id":63757425,"Users Score":1,"Answer":"TL;DR; No, it is not possible.\n\nQt Designer is used to:\n\nConfigure the qproperties of QWidgets.\nMake connections between widgets.\nEdit some properties of the QActions.\nCreate and modify qresource.\n\nAnd in none of these possibilities does it involve method showMaximized.","Q_Score":1,"Tags":"python,pyqt,pyqt5,qt-designer","A_Id":63757509,"CreationDate":"2020-09-05T18:47:00.000","Title":"Maximaze window from qt designer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a program which merges data from several sources into a spreadsheet. If the data for a cell is different from different sources, a human needs to choose the best one, so I want it to be obvious which cells need to be reviewed.\nNot displaying the arrow when the data for the Combobox.set() has 0 or one item seems a good way, but I don't understand ttk styles and layouts well enough to do it.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":113,"Q_Id":63838221,"Users Score":0,"Answer":"I found a way to get the effect I want. I create both a Label and a Combobox at the same location and use .lift() to put the one I want on top.","Q_Score":1,"Tags":"python,tkinter,ttk","A_Id":63947807,"CreationDate":"2020-09-10T21:59:00.000","Title":"How to create a custom tkinter Combobox with no arrow if there are 0 or 1 items?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Was just wondering what is the pygetwindow module used for? Are there other modules that are similar to pygetwindow? Where could i read up on pygetwindow, i can find no tutorials on it on youtube or anything.","AnswerCount":2,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":1293,"Q_Id":63897653,"Users Score":-2,"Answer":"I test the sample on the Win10\ny.active() return the erroe code below:\nPyGetWindowException: Error code from Windows: 0","Q_Score":2,"Tags":"python","A_Id":69976619,"CreationDate":"2020-09-15T08:07:00.000","Title":"What is the pygetwindow module used for?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i just installed python on my mac and i had also installed VS code with it. Later i tried installing pygame but it didn't work so i found another version that installed the version that is not stable, or pygame2.0.0.dev6 - i think that is have you type it. So that went succesfull, but after i found out why i was not being able to install the stable version, so now i want to get rid of pygame2.0.0.dev6 and install the stable version because in my VS code editor it keeps saying that it is using pygame2.0.0.dev6 even when i have the stable version installed.\nPlease all i want is to uninstall pygame2.0.0.dev6. I tried going to the documentation and i tried uninstalling from the terminal itself but i still cannot uninstall it. Help would me much appreciated. Thank you!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":211,"Q_Id":63979096,"Users Score":1,"Answer":"pip3 uninstall pygame==2.0.0.dev6\nWindows users should use pip instead of pip3\nAlways use virtual environments. This version problem will be mitigated.","Q_Score":0,"Tags":"python,python-3.x,visual-studio-code,pygame,python-3.8","A_Id":63979133,"CreationDate":"2020-09-20T12:43:00.000","Title":"How to get rid of pygame 2.0.0.dev6?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to build Kivy application in which I need to have a text input field with multiple languages. I have a ComboBox or the kivy drop down to select the language and set the appropriate .ttf file. But the text appearing is not the correct transliteration of the English text input.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":164,"Q_Id":63996371,"Users Score":0,"Answer":"Perhaps try using a codec library. It will convert text of different character sets to be compatible with others.","Q_Score":0,"Tags":"python,python-3.x,kivy,kivy-language","A_Id":64000809,"CreationDate":"2020-09-21T16:28:00.000","Title":"How to use multi-language in text input Kivy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to python GUI and I'm writing a simple game that involves moving an image from one grid cell to another and I don't have to stack an image on top of another image. Therefore to place an image I have to check whether the new location is empty. In addition the image can only be moved either vertically or horizontally. The user clicks the image to be moved and then the location into which to place the image. I placed each image in a label on an 8x8 board. To check if the move is horizontal or vertical, I check if the row numbers or column numbers of the source and destination are the same respectively. If row number is the same, for instance from position (row=2,column=1) to (row =2, column =4), I want to loop through positions from column =2 to column = 4 and check if there an image or not. If there is an image in any of those cells i.e. (2,2,), (2,3) or (2,4), then the move is cancelled. But all the functions about grid only show how to get the column and row numbers but don't give any information on how to get the value if I already know the row and column numbers. Can anyone help on how to go about problem?\nThank you","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":52,"Q_Id":64036657,"Users Score":0,"Answer":"I believe the grid method you're looking for is grid_slaves(row, column).\n\nw.grid_slaves(row=None, column=None)\nReturns a list of the widgets managed by widget w. If no arguments are provided, you will get a\nlist of all the managed widgets. Use the row= argument to select only the widgets in one row, or\nthe column= argument to select only the widgets in one column.\n\nNote that although the documentation states to use row= or column=,\nin practice, you can specify both and get the widget(s) in a single grid cell.\nBeing frame the container widget (where the grid is located), calling frame.grid_slaves(row=3, column=2) will give you a list of widgets in that grid cell (or a list with a single item, in case there is only one widget there) or an empty list, if there is none.","Q_Score":0,"Tags":"python,tkinter,grid","A_Id":66271966,"CreationDate":"2020-09-23T21:42:00.000","Title":"how can I retrieve an image from a given grid location if I know the grid row and column in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So basically I am creating an app with BeeWare(Python). And I wanted to know whether it is possible to change the default icon of beeware and toga and use my own icons. If it is possible, then please someone provide a solution for it.\nThanks.","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":414,"Q_Id":64119895,"Users Score":-1,"Answer":"If you have made an android app and it is in your PC then to do so you will need winrar application just right click on it and choose open with and select winrar (or whatever unzipping tool you have) and browse to the resources folder and there are many folders there, there in the last 4 to 5 folders there is an image you have to replace them with an image of same format and resolution, if you replace then with some other format or resolution your application would not work..\nThanks","Q_Score":1,"Tags":"python-3.x,beeware","A_Id":64461831,"CreationDate":"2020-09-29T12:43:00.000","Title":"how to change the application icon of an app in beeware, python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How to delete python executable file after it finishes? I have tried the following:\n\nos.remove() - deleting the python exe file\nos.chmod() - removing the readOnly\nos.getcwd - combined with os.remove()\nshutile.rmtree - combined with os.getcwd()\nsys.argv[0]\n\nAll of these works when I still use .py extension, but when I convert it to exe it gives me permission error. How do I remove it?\nI want to delete the main.exe because I'm going to distribute it to my friends. I don't want the program to stay inside their system permanently that's why I decided to create an auto-delete script.\nThe code I'm running revolves under pyqt5.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":686,"Q_Id":64121273,"Users Score":0,"Answer":"I would start with ensuring that what you are trying to do is what you actually need. If you provide more details about your real purpose, probably we could find a better solution without using strange workarounds and\/or crutches to solve your problem\nIn Windows 10 it is not possible to remove an executable when it is running (no matter whether you are trying to remove the file from the inside or the outside of the executable), this is why you are getting permission error with the .exe file. Probably there is some workaround which would use some special Windows-only features (because as far as I'm concerned it's not possible to do what you are asking about with libraries such as threading\/multiprocessing), but if you really want to do this, the easiest way I see is using another executable intended specifically to delete the executable which calls it after the original executable finishes.\n\nBut, again, this is not a good solution and to be honest, I don't think there is a perfect one, because your goal seems an anti-pattern to me","Q_Score":0,"Tags":"python,python-3.x","A_Id":64121802,"CreationDate":"2020-09-29T14:03:00.000","Title":"How can I delete the application after it upon closing it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I was watching a tkinter tutorial in which the instructor used the grid_forget method to remove a label containing an image before adding a new one. He explained that this was to prevent the new image from overlapping the old one. However, later in the tutorial, he updated a button's functionality by creating a new button and adding it to the same cell in the grid, without ever calling grid_forget. He never explained why grid_forget wasn't needed here.\nIt seemed to me that, if the new image would overlap the old one without grid_forget, then the new button would overlap the old one too, which could cause a memory leak if this kept being called. But apparently this isn't the case. Why is this situation different?\nMore generally, when does a widget need to be explicitly cleared with grid_forget, and when will it be implicitly cleared simply by adding to the same cell?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":37,"Q_Id":64146645,"Users Score":1,"Answer":"That is a terrible tutorial. You should never update a widget by recreating it, you should use the config method to update the already existing one.\nBut to answer your question: He should have removed the old Button, but presumably didn't because the new Button was guaranteed to be the same size or bigger than the old one, therefore covering it completely. The old Button will still be in memory though, and as you build a stack of them they will slow down your program, so again it's a very bad idea to do this. It will never be implicitly cleared, only covered.","Q_Score":0,"Tags":"python,tkinter","A_Id":64146747,"CreationDate":"2020-09-30T22:33:00.000","Title":"When do you *not* need to use grid_forget when updating a widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make a GUI(using tkinter) for checking the code using test cases. Just like you see in Competitive Programming Websites like Hackerrank , SPOJ , CodeForces etc.\nNow I have somehow managed to print in the terminal for what test cases the code failed and for what the code passed.\nBut the catch is , I want to do the same in tkinter messageboxes.\nMy code runs in loop , so it checks each and every test cases and then prints out the result immediately rather than storing all the result in a list and checking them in the end.\nSo I want my Messagebox to also do the same i.e update everytime a test cases has been evaluated and show whether the test case was passed or not?\nIs it possible to implement?","AnswerCount":2,"Available Count":1,"Score":0.2913126125,"is_accepted":false,"ViewCount":85,"Q_Id":64181744,"Users Score":3,"Answer":"If you mean the messagebox module that comes with tkinter, then no. But you can easily make your own message boxes with the Toplevel widget, and those can do anything you want.","Q_Score":2,"Tags":"python-3.x,tkinter","A_Id":64181905,"CreationDate":"2020-10-03T07:23:00.000","Title":"Is there a way to update the tkinter messageboxes live?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been using QT Designer to design simple GUI and save as .ui file and then convert it to Python 3 code, But now I've found QT Design Studio which seems so much easier and better. But as I've seen it just create .qml files and it's a little bit harder to work with than .py UI file. Can I export .ui file with QT Design Studio and then convert it to Python 3 code?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1024,"Q_Id":64188695,"Users Score":0,"Answer":"At the first, you must save your file designed as .qml file in QT Design Studio, then open .qml file with QT creator and save as .ui\nAt the end, you can convert ui file to py file with the below syntax\npyuic5 -o ui_form.py form.ui","Q_Score":0,"Tags":"python,qt,pyqt5,qt-designer,qt-design-studio","A_Id":68583052,"CreationDate":"2020-10-03T20:29:00.000","Title":"Can I export .ui file from QT Design Studio?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently working on a small Python script that is running on my local server. I want to create a Ui for it with Qt because i work a lot with qml. Is it possible to make a PyQt web application that i can access through my browser inside my network?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":4484,"Q_Id":64198588,"Users Score":2,"Answer":"No.\nWeb apps and GUI programs are completely different beasts.\nUsually,\n\nGUI apps require just Python interpreter, your scripts, and proper GUI libraries. You access then from within your machine's operating system.\n\n(Python) Web apps require Python interpreter, running Web server software and making of HTML\/Python web pages instead of GUI components. Web page access happens (typically) from a browser environment, which might be local or remote.\n\n\nWhile it is not impossible that somebody could have made libraries for showing Python GUI interfaces over the Web, it wouldn't make much sense, because it is usually much easier to just use some remote desktop software to access your machine and use native GUI.","Q_Score":3,"Tags":"python,qt,pyqt,qml","A_Id":64198803,"CreationDate":"2020-10-04T18:47:00.000","Title":"Is it possible to create a PyQt web application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wrote a code with python that uses clustering to detect colours in an image, is there any API's or techniques that I can use the code in my ios application that I want to publish?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":24,"Q_Id":64208417,"Users Score":0,"Answer":"If the algorithm uses a library such as OpenCV, you can keep using that (but from C++). Otherwise, you have to rewrite the algorithm in Swift, Objective-C, or C\/C++.","Q_Score":0,"Tags":"python,ios,cluster-analysis,coreml","A_Id":64215766,"CreationDate":"2020-10-05T12:14:00.000","Title":"can I use a clustering model written in python in an iOS application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am doing animations in manim ...\nI know if you write:\n\nself.add_sound(\"name_file.mp3\")\n\nthe name_file.mp3 will play but if at some point of the animation I'd like to pause the music or remove it\nHow can I do it?\nThanks in advance","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":262,"Q_Id":64236768,"Users Score":2,"Answer":"Short Answer: At this time, Manim doesn't support pausing or stopping the sound file.\nManim only supports adding a complete sound file to the animation. If you need the sound file edited in any way other than a simple adjustment of the gain (which is a single setting that is applied to the entire sound clip), then you will have to do so outside of Manim.","Q_Score":2,"Tags":"python,manim","A_Id":66111332,"CreationDate":"2020-10-07T03:27:00.000","Title":"How to pause or remove sounds in manim?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just started python tkinter today, and i am not able to differentiate between what the 'width' function does and what 'padx' does, could you please explain each of them to me.","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":903,"Q_Id":64291360,"Users Score":2,"Answer":"The padx is nothing but padding inside the layout, X indicates the x axis. The elements inside the layout tells that it needs more space inside the layout than what is allocated.\nwidth which you already know is distance from one side to another side.","Q_Score":3,"Tags":"python,tkinter","A_Id":64291387,"CreationDate":"2020-10-10T08:12:00.000","Title":"What is the difference between 'width' and 'padx' in tkinter in python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"normally when you make a window in tkinter using Tk(), the standard shape of the window would be a square. Is there any way we can make the shape anything else?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":609,"Q_Id":64294866,"Users Score":0,"Answer":"No, you cannot create windows of any shape other than a rectangle.","Q_Score":1,"Tags":"python,tkinter,tkinter-layout","A_Id":64295116,"CreationDate":"2020-10-10T15:04:00.000","Title":"Different shapes of windows in tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I used the function screensize() and it told me that my window was (400, 300). I need to get to the top left hand corner to draw some stuff, but when I put in (-400, 300), my turtle goes way off the window. Is there any other function I can use to get the size of my turtle window?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":382,"Q_Id":64361192,"Users Score":0,"Answer":"The point 0, 0 is in the center of the screen, so if you want to go to the top left corner, you need to use turtle.goto(200, 150). A problem also could be that if you used setup() to create the window, screensize() will return the default, which is (400, 300), even if you screen is bigger.","Q_Score":0,"Tags":"python,window,turtle-graphics,python-turtle","A_Id":64466835,"CreationDate":"2020-10-14T20:40:00.000","Title":"What is the size of the Python Turtle window in pixels?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"does anyone know how a program can find dead pixels on a phone screen?\nI found a lot of dead pixel finding tools and all of their implementations looks similar. It's showing a single-color screen, such as red, green, blue, white and black. Then, we need to check if there's any dots with different color (which is dead pixels) manually.\nIs it possible to find the dead pixels automatically?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":250,"Q_Id":64365986,"Users Score":2,"Answer":"No, it isn't. Rendering the pixels is a \"write-only\" process, much like sending a message to the console. There is no feedback from the physical pixels to indicate whether they turned on as expected. Think of it like a TV screen: the broadcast studio has no way to tell whether you got the program. They simply send out the signal; you pick it up or ignore it, depending on how you set your hardware state.","Q_Score":0,"Tags":"java,python,opencv,screen,pixel","A_Id":64366088,"CreationDate":"2020-10-15T06:28:00.000","Title":"Does anyone know how to find dead pixels on a phone screen automatically?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygame 2.0.0.dev15 to develop games with Python. Everything works great so far, but I'm surprised that pygame.font.SysFont() takes a lot of time to process.\nWhenever I use fonts in my game, the startup takes about 5 seconds more than without them. The number of fonts I use doesn't seem to slow it down - it's just that first pygame.font.SysFont() call doing that. Something is definitely wrong. I'm on macOS Catalina, using Python 3.8.6.\nThe problem is gone when I use pygame.font.Font() instead.\nWhy does pygame.font.SysFont() take so much time?","AnswerCount":1,"Available Count":1,"Score":-0.3799489623,"is_accepted":false,"ViewCount":261,"Q_Id":64394397,"Users Score":-2,"Answer":"It is because different operating systems have different speeds.","Q_Score":3,"Tags":"python,fonts,pygame,pygame2","A_Id":67665775,"CreationDate":"2020-10-16T18:16:00.000","Title":"pygame.font.SysFont() takes about 5 seconds on macOS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am still quite new to Python and I would like to create a program which would draw geometry objects of given size. For example how would I create the triangle with the sides of 7cm, 6 cm and 5 cm? Any hint would be very appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":52,"Q_Id":64400174,"Users Score":0,"Answer":"do you want the sizes to be user inputted?\nif you do, in my experience I created a loop with the colour and amount of rectangles they wanted by using x=int(number) then for i in range(x): this allowed the user to choose how many rectangles. Before hand I put in an input code to get the answer print(\"how many rectangles do you want?\") and number = input(\"I want this many rectangles:\")\nAlthough it isn't the exact same, if you know what numbers equals what distance you want, then you could redo the x=int(number) for each side and instead move the x from the code i mentioned before to the moving codes. eg,forward(x)\nI hope that helped, let me know if you don't understand","Q_Score":0,"Tags":"geometry,python-turtle","A_Id":64547502,"CreationDate":"2020-10-17T07:49:00.000","Title":"Triangle of particular size with Python turtle graphics","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I keep getting the below error when trying to import numpy in kivy on an android device.\nNo module named 'numpy.core._multiarray_umath'\nWhy am I getting this error if I already installed numpy where the main.py file is located and I also\nmade sure the file it is trying to import (_multiarray_umath) is located in the numpy library before building with buildozer, that is ->\n_multiarray_umath.cpython-36m-x86_64-linux-gnu.so located in numpy\/core?\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":236,"Q_Id":64408261,"Users Score":1,"Answer":"The file you talk about is a desktop linux binary, not compatible with your android device. That is why it didn't work on android and (per the comments) the fix was to put numpy in the requirements so that an android version was built and included by buildozer.\n\nListing numpy in the buildozer.spec file fixed the error, but I can't seem to get tensorflow to compile in kivy for android. Does tensorflow not work in kivy on android?\n\nTensorflow is not currently supported. Apparently tensorflow lite works, but you need to include it via gradle and write some java wrapper code to access it.","Q_Score":0,"Tags":"python,numpy,kivy","A_Id":64412950,"CreationDate":"2020-10-17T23:19:00.000","Title":"No module named 'numpy.core._multiarray_umath' in kivy","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to play a video using python-vlc. I have gotten everything to work, and the video plays without any technical issues. There is this one aesthetic issue, though. I only want to play part of the video. As in, I want to crop out a fair bit on the bottom and a good bit on the right. I know I can do this with a call to MediaPlayer.video_set_crop_geometry(), and I've done so semi-successfully. However, the actual window that opens is the one that is adjusted for the entire video, with the part that I want centered in the middle with black bars around it. (If I call MediaPlayer.video_set_scale(), then the cropped-out bit the same size as it would be if I didn't crop. If I don't call video_set_scale(), the cropped-out bit is stretched, maintaining aspect ratio, until it reaches the edge of the window. Regardless, there are black bars).\nCan I get the window to adjust to this new, smaller video? Preferably automatically, but if I have to pass in the size I want, that's fine too.\nI have tried shuffling around the order between the different calls to no avail. Clearly python-vlc has the capacity somewhere to adjust the window it's playing in, as it can open a window the correct size for the regular video to play, and it adjusts automaticallty after calling video_set_scale(), but only to fit the original video, not the cropped one.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":336,"Q_Id":64414324,"Users Score":1,"Answer":"You should probably share more details, such as your full code and platform used.\nThat being said, libvlc doesn't offer an API to resize the native Window it draws on, but you can easily do it yourself (with win32 APIs for HWND, on Windows, for example).","Q_Score":0,"Tags":"python,vlc,python-vlc","A_Id":64422579,"CreationDate":"2020-10-18T14:15:00.000","Title":"Is there a way to make the python-vlc window acknowledge cropping?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently using renpy and I want to access some features of the native NSWindow API (and eventually the win32 equivalent but I'm starting with the machine I'm using.) However PyObjC doesn't seem to be compatible, presumably because renpy's python implementation is not CPython, but I don't truly know. I asked in the discord and basically got a shrug so as a hail mary I'm gonna throw this question out to the people of stackoverflow:\nIs there a way to access native APIs, like cocoa and win32, from renpy?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":94,"Q_Id":64430926,"Users Score":1,"Answer":"Ren'Py is only compatible with libraries written in pure Python, so it's not possible at this point. PyObjC uses more than just Python.","Q_Score":0,"Tags":"python,pyobjc,renpy","A_Id":64797229,"CreationDate":"2020-10-19T15:54:00.000","Title":"Is there a way to access native APIs from renpy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am currently working on a GUI application using PyQt5 and QtDesigner. As I have to make it multi-platform (at least Ubuntu and W10) I will use the \"Fusion\" style to make it look similar on both platforms.\nI was wondering if one could simply set the QApplication style directly in QtDesigner ? I know that a simple <<.setStyle(\"Fusion\")>> will do the trick in the code, but does it exist within QtDesigner so the lines can be automatically generated ?\nI'm trying to learn QtDesigner and how much it can be pushed before going into the code.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":94,"Q_Id":64440849,"Users Score":0,"Answer":"No, it is not possible to set the style through Qt Designer.\nWhat Qt Designer does allow is to display the GUI with different styles if you select Form-> Preview -> ...","Q_Score":0,"Tags":"python,pyqt5","A_Id":64447518,"CreationDate":"2020-10-20T07:57:00.000","Title":"Is it possible to set QApplication style in QtDesigner?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is my first question on this site. Let's cut right to it:\nI'm trying to create Voronoi diagrams with scipy in Python 3.8 on Kubuntu 20.04, however the problem seems to be that I cannot access the Voronoi class in scipy.spatial because it does not contain a reference to qhull. Other classes like ConvexHull which are also dependent on qhull are inaccessible as well. Trying to open qhull produces Cannot find reference to qhull in __init__.py in PyCharm, and I cannot navigate to it. Looking at the SciPy-Documentation, it would seem as though qhull is expected to be delivered alongside scipy, as there is no further information on how to install it.\nSo far I have tried:\n\nUpgrading scipy to the latest version 1.5.3\nFresh install of scipy - I ran pip install with verbose, but no errors or warnings (which should be color-coded afaik) appeared\nInstalling qhull-bin via console\nBuilding qhull manually\n\nNone of these approaches seems to have changed anything, except I can run qhull in the console now, but that's not really what I'm looking for.\nI would appreciate any kind of advice you might have for me.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":282,"Q_Id":64464722,"Users Score":0,"Answer":"Guess I should have tried to actually run my code. Turns out it was installed all along, just that PyCharm didn't, and still doesn't, have access to any qhull files or references, meaning the error within PyCharm hasn't disappeard, but the code works.","Q_Score":2,"Tags":"python,scipy,voronoi,qhull","A_Id":64478891,"CreationDate":"2020-10-21T13:35:00.000","Title":"Scipy.spatial does not contain 'qhull'","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a question concerning the access of the shared memory within the Ray Framework.\nImagine the following setup on 1 machine:\n\nStart Ray cluster\nStart a process\/worker python script w1.py, which puts an object O1 into the shared memory via ray.put(O1)\nStart a process\/worker python script w2.py, which tries to get O1 from the shared memory via ray.get(...)\n\nIs there a way to access the object O1 (put into shared memory from w1.py process) from another worker process w2.py?\nWhen I execute ray.objects() from w2.py, I get the obejct reference string, but how could I retrieve the object from the shared memory then? I can not init a ObjectRef object in w2.py","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":577,"Q_Id":64499456,"Users Score":1,"Answer":"This is not natively supported. The reason is ray\u2019s objects have various metadata that is for various features (ex, perf optimization or automatic memory management using reference counting).\nIf you\u2019d like to achieve this, I think there are 2 solutions.\n\nUse a detached actor api. Detached actors are actors whose lifetime is not fare-sharing with drivers. Once you create a detached actor, you can obtain the actor handle using ray.get_actor API. This way, you can put an object inside a detached actor and access from multiple drivers.\n\nThere\u2019s another way which uses cloudpickle, but I am not so familiar with this solution, so I won\u2019t write about it. Please go to Ray\u2019s discussion page in its Github repo to ask more details about it.","Q_Score":1,"Tags":"python,redis,multiprocessing,shared-memory,ray","A_Id":64502561,"CreationDate":"2020-10-23T11:50:00.000","Title":"Python Ray shared memory access","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am fairly new to kivy and am currently writing a simple fitness app for my A-level computing project.\nI originally used simple instructions I found from different websites and this means I have now coded the majority of my app in only kivy language instead of having a .py file too (sorry if that makes little sense, I'm struggling to understand the concept of both the .py file and the .kv file)\nIs it okay to just code in a 'kv.' type of file where I am mostly just using kivy language? Or do I need to learn how to create a .py file too for my app to work completely (as I have run into some issues such as using the scrolling widget and am wondering if this is to do with me not having a .py file as most solutions seem to be using a .py file.\nThanks for any help","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":33,"Q_Id":64499657,"Users Score":0,"Answer":"There is no fundamental problem with using mostly or entirely kv files, if they do what you want.\nI suggest asking a separate question about the specific issues you're hitting.","Q_Score":0,"Tags":"python,kivy,kivy-language","A_Id":64505908,"CreationDate":"2020-10-23T12:04:00.000","Title":"what is the need for .py and .kv files with kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This will be more of an open question, but I'm hoping someone may know how to solve my problem.\nI have C++ library compiled with pybind11, allowing me to call some functions from python. The C++ library uses CUDA to perform some operations on the device.\nI need to allow the user (who only has access to python, and cannot go into the C++ or CUDA code) to define an operation (typically, a lambda) that will run in one of the CUDA kernels.\nIf you have any pointers as to where I could learn the proper way of doing this, I'd be very grateful!","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":191,"Q_Id":64530634,"Users Score":2,"Answer":"I can't think any way to do this. Barriers to making something like this work\n\nPyBind style bindings won't work with CUDA device functions\nWhile CUDA supports passing of C++ lambda functions to kernels, it is a static compiler generated support. There is no way I am aware of to get a lambda function into a kernel call without compiler invocation (and probably nvcc and not nvrtc, which would imply a lot of messing around with compilers at runtime, or hacking extensions to PyCUDA). All of that would violate your \"cannot go into the C++ or CUDA code\" criteria.\nSimilarly, you would require CUDA runtime linking support in your application. I'm also pretty certain that the linker can't link naked lambda functions, only device functions with a generic interface (nvstd::function), so you would need to emit kernels, wrappers, and CUDA C++ device lambdas, compile them, and link them. That requires the CUDA driver API which I am sure you are not using.\n\nThe best hope you have would be to try Numba, which allows runtime compiling of Python device functions. However it lacks any ability to deal with lambda functions and can't interact with C++ code statically or JIT compiled with the CUDA toolchain. You might be forced to reimplement a lot of your CUDA C++ code in Python to make that work, and the Numba kernel dialect lacks a lot of modern CUDA features, which might make that extremely difficult depending on how sophisticated your existing CUDA code is.","Q_Score":0,"Tags":"python,c++,lambda,cuda","A_Id":64530815,"CreationDate":"2020-10-26T02:03:00.000","Title":"Best way to pass a lambda to a CUDA kernel from python code","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a game written in Pygame and was trying to debug it. I am new to debuggers so I am not even sure which one to use but I downloaded Pycharm. Anyway, my game starts up and shows the game screen along with a \"Play\" button in the middle of the screen. When you click on the Play button, the Play button is supposed to disappear and three other buttons are supposed to appear so that you can choose your skill level: Easy, Medium and Hard. When you choose your skill level, the game is supposed to begin.\nThe game is beginning when I click the Play button. The other three buttons are not showing. I want to use a debugger to see what is happening in the code when the Play button is clicked.\nThe problem that I am having is that when I try and debug the code, the game starts and takes up the full screen. I cannot see the debugger. When I click the Play button, I get the same bug as already mentioned earlier but I am unable to see the debugger to know what is happening in the code.\nI need some advice. Which of the following paths should I head down?:\nPath A: Try and figure out how to get the game to open in a window different from and next to the debugger window.\nPath B: Try and figure out how to simulate clicking on the Play button, in the debugger, without actually running the game.\nPath C: Follow a different path that I have not even thought of but someone on Stack Overflow is about to explain to me. :)\nPS: I am not asking for help with the code. I can probably figure out the problem without a debugger. I am asking for help with how to use a debugger so that I can debug in the future and not have to ask so many questions.\nclipovich","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":56,"Q_Id":64540462,"Users Score":1,"Answer":"I think path A would be the best. On windows and some linux distros, you can try pressing flag+left or right arrow. Then click the debugger and press flag+left or right arrow (opposite of pygame window side). This will allow you to see both windows at once","Q_Score":1,"Tags":"python,debugging","A_Id":64540730,"CreationDate":"2020-10-26T15:46:00.000","Title":"How do I debug a video game that requires me to play the game in order to re-create the bug?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a app written in python\/kivy that i have signed and installed on my android phone. The filemanager , an instance of the MDFileManager opens the root dir (\/) and displays the file system. But i am not able to open any directory in internal or external storage, so that i can select a file. Most of the directories have a small lock icon on them and those dirs wont open. The directories without lock icon do not have any files or the type of files i want. I browsed the directory using a terminal app and found that the ls command on a locked directory returns a permission denied error. This happens only with this app. I am able to open directories and chose files with other 3rd party apps as well as my own app, written in react native. So not sure if this is an issue with MDFIleManager or something else. Any advise\/workaround is highly appreciated","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":90,"Q_Id":64618642,"Users Score":1,"Answer":"Viewing folders without accessing them is most likely due to not setting permissions. Add the following permissions in your manifest according to level of access:\n\nREAD_EXTERNAL_STORAGE\nWRITE_EXTERNAL_STORAGE\nMANAGE_EXTERNAL_STORAGE.","Q_Score":0,"Tags":"python,android,kivy,kivymd","A_Id":64625019,"CreationDate":"2020-10-31T05:12:00.000","Title":"My android app not able to open directories to read files","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I want to put a Label and an Entry widgets on the same line and center them.\nI saw on multiple posts that to center, pack() method was easier. But, to put on the same line, it's grid().\nWith grid(), I suppose I have to build all the layout, then center it. Is there a way to do it on the go? With pack(), I don't have any idea.\nBut, I want to do both at the same time. I didn't find any answer :\/\nIf someone can help me, I will be very grateful!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":223,"Q_Id":64677560,"Users Score":2,"Answer":"I have to put everything in a frame and pack() the frame.\nThanks to @acw1668","Q_Score":0,"Tags":"python-3.x,user-interface,tkinter,tkinter-layout","A_Id":64677656,"CreationDate":"2020-11-04T09:42:00.000","Title":"Center and put multiple items on the same line using Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed pygame using pip install pygame and when that didn't work I found a solution online and tried pip install pygame==2.0.0.dev14.\nStill the same problem: \"pygame\" shows up when I do pip list, and pygame folders are there in the file locations. However, when I run the code import pygame, the shell shows the error ModuleNotFoundError: No module named 'pygame'.\nHow can I fix this?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":367,"Q_Id":64680121,"Users Score":0,"Answer":"You should do pip3 install pygame sometimes this happens, when you are on a mac and have 2 versions of python in your computer, MAC OS takes the python 2.7 by default, if you want a newer version, you have to specify by saying python3 or pip3","Q_Score":0,"Tags":"python,pygame","A_Id":64680178,"CreationDate":"2020-11-04T12:29:00.000","Title":"I have a problem running pygame 2.0 with python 3.9","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed pygame using pip install pygame and when that didn't work I found a solution online and tried pip install pygame==2.0.0.dev14.\nStill the same problem: \"pygame\" shows up when I do pip list, and pygame folders are there in the file locations. However, when I run the code import pygame, the shell shows the error ModuleNotFoundError: No module named 'pygame'.\nHow can I fix this?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":367,"Q_Id":64680121,"Users Score":0,"Answer":"For python 3.9, you can use: python -m pip install pygame --pre --user. This happens because python 3.9 isn't fully adapted to pygame yet.","Q_Score":0,"Tags":"python,pygame","A_Id":64789467,"CreationDate":"2020-11-04T12:29:00.000","Title":"I have a problem running pygame 2.0 with python 3.9","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm building a mobile app using kivy and python, and I want to understand what parts in my code I could explain to someone else being my frontend and backend part. I have one kv file plus one py file where my code is. My question is now, is all the code I'm having in the kv file, for example a button with a text and an on_press function, my frontend? Can I call my entire py file for a backend file, even though it sometimes does such simple functions as changing a text on a button in my kv code?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":187,"Q_Id":64705260,"Users Score":0,"Answer":"Frontend is what the user see and the way he interacts with your application.\nThe backend is every logical part, work on database, mathematic processing...","Q_Score":1,"Tags":"python,kivy","A_Id":64705482,"CreationDate":"2020-11-05T21:04:00.000","Title":"What parts in my Kivy application corresponds to the backend and their frontend","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm building a mobile app using kivy and python, and I want to understand what parts in my code I could explain to someone else being my frontend and backend part. I have one kv file plus one py file where my code is. My question is now, is all the code I'm having in the kv file, for example a button with a text and an on_press function, my frontend? Can I call my entire py file for a backend file, even though it sometimes does such simple functions as changing a text on a button in my kv code?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":187,"Q_Id":64705260,"Users Score":0,"Answer":"I would say that all the code dealing with manipulating the gui is the frontend, and all the code that deals with other state is the backend. In general it is good architecture to separate these, but it's possible to mix in what could\/should be backend state so that it's strongly coupled to the gui, in which case there might not be a clear separation to point to.\nI don't think it's useful to present the .py\/.kv disinction into the definition of frontend vs backend - it's tempting since on the surface it's sort of right, but it doesn't really hold up to scrutiny. As you note, the .kv file isn't really different to parts of the .py file that directly manipulate the gui.","Q_Score":1,"Tags":"python,kivy","A_Id":64706583,"CreationDate":"2020-11-05T21:04:00.000","Title":"What parts in my Kivy application corresponds to the backend and their frontend","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have to submit a .apk file for a competition. I used tkinter module of python for the same. I am unable to convert my.py with tkinter code to .apk\nI have tried making setup files and exe to apk tools as I converter my file to .exe and I still have my.py\nPlease help!\nNote: Can i convert it into web app and then make .apk","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":4837,"Q_Id":64725435,"Users Score":1,"Answer":"Tkinter does not support mobile; it's only for desktop apps. I suggest you use kivy because it's the best for mobile development, and the same code can be used for all platforms.\nYou don't need to modify the code for desktop, mobile, etc. one piece of code is enough.","Q_Score":0,"Tags":"python,android,user-interface,tkinter,web-applications","A_Id":71282985,"CreationDate":"2020-11-07T07:27:00.000","Title":"Python Tkinter to .apk","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Problem\nWe have a FloatLayout that gets some widgets and loses some (using add_widget and remove_widget) inside a function.The problem is the window gets updated when the function reaches its end. Then Kivy updates the window and user only sees the last results.\nHow to update the window when we are inside a function so user can see results ???\nWhat i tried\nI tried do_layout and _trigger_layout (read that somewhere on SO). None of them did the job (no traceback, no warning, literally no change)\nAlso read Kivy documentation but nothing was helpful there","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":104,"Q_Id":64738133,"Users Score":0,"Answer":"Instead of making all your changes while blocking the gui, use Clock.schedule_interval or Clock.schedule_once to let Kivy go back to rendering in between each change.\nEdit: Also to be clear, your problem is not that you have failed to update the layout, but that you haven't given Kivy any opportunity to render the changes.","Q_Score":1,"Tags":"python,python-3.x,user-interface,kivy,user-experience","A_Id":64738234,"CreationDate":"2020-11-08T12:37:00.000","Title":"How to update the layout inside a function in kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Ive got some import problems in python. When I want to import the PyQt5 library I just get the error \"No module named 'PyQt5'\". The folder is in the path C:\\Python\\Python37\\Lib\\PyQt5. I can import tkinter and the folder is in the same path as PyQt5\nCode: from PyQt5 import QtCore, QtGui, QtWidgets\nError:ModuleNotFoundError: No module named 'PyQt5'","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":103,"Q_Id":64764086,"Users Score":0,"Answer":"if you are using a virtual environment, the modules available in a normal machine can't be imported unless you grant permission.\n\nif you are using pycharm, every project is a virtual wrapper. so do install again or change interpreter preference in pycharm (if you installed locally).\nDo install again through:\n1. terminal: Type\npip install PyQt5\n2. if you are using pycharm, install from the interpreter preferences.","Q_Score":0,"Tags":"python,pycharm","A_Id":64764271,"CreationDate":"2020-11-10T06:47:00.000","Title":"Import problems python\/pyqt","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I currently have a script that automates sending Whatsapp messages. It takes an excel file full of contacts, receives a message argument and then sends the message to each contact. It's purpose is to help automate sending the same message about different services being offered to a bunch of groups.\nI am making the program for a family member who is computer illiterate and am hoping to make some simple UI for them so they never have to interact with the code.\nI have already been playing around in tkinter, and have figured out how to open a dialog to select the Excel file that needs to be used. I am confused about how the rest of the program would functionally work and if this is feasible for someone who has never used Tkinter before and is on a short deadline.\nI was thinking it would look something like a button, to open up the dialog to choose the Excel file. A text box, to fill in the message. And, another button to open up a dialog to choose a photo to be sent along the message. Then once all that was done the program would run.\nIs this functionally possible, and is Tkinter the best option to pursue? Also is this feasible first project for a novice Tkinter user?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":64,"Q_Id":64792366,"Users Score":1,"Answer":"Python is best for backend\n\nHey, so I think Python isn't the best language for UI at all.\nIn my opinion it is quite difficult to make a real good looking program with tkinter, but as I said before, Python is more for backend programming. But tkinter is not a bad choice for a simple program - if not the best. Also, the advantage of a tkinter program is that you can write your code and the GUI code in one file, which makes the program a bit more compact\nBut if you want a simple GUI program tkinter is you first choice","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":64792441,"CreationDate":"2020-11-11T18:45:00.000","Title":"Making a python UI - is Tkinter the best option?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've done some project using PyQt library for my class assignmnet.\nAnd I need to check my application working before I submit it.\nToday, 3 hours ago I updated my Mac book OS to Big Sur.\nAnd I found out that PyQt library doesn't work. It doesn't show any GUI.\nAre there someone know how to fix it?","AnswerCount":4,"Available Count":2,"Score":1.0,"is_accepted":false,"ViewCount":4835,"Q_Id":64818879,"Users Score":6,"Answer":"Rolling back to PyQt5==5.13.0 fixed the issue for me!\nyou should uninstall PyQt5 and then install it using\npip install PyQt5==5.13.0","Q_Score":12,"Tags":"python,pyqt","A_Id":64832627,"CreationDate":"2020-11-13T09:59:00.000","Title":"Is there any solution regarding to PyQt library doesn't work in Mac OS Big Sur?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've done some project using PyQt library for my class assignmnet.\nAnd I need to check my application working before I submit it.\nToday, 3 hours ago I updated my Mac book OS to Big Sur.\nAnd I found out that PyQt library doesn't work. It doesn't show any GUI.\nAre there someone know how to fix it?","AnswerCount":4,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":4835,"Q_Id":64818879,"Users Score":0,"Answer":"Related to this, after upgrading to BigSur my app stopped launching its window...I am using the official Qt supported binding PySide2\/shiboken2\nUpgrading from PySide2 5.12 to 5.15 fixed the issue.\nSteps:\n\nRemove PySide2\/shiboken2\npip3 uninstall PySide2\npip3 uninstall shiboken2\n\nReinstall\npip3 install PySide2","Q_Score":12,"Tags":"python,pyqt","A_Id":65077512,"CreationDate":"2020-11-13T09:59:00.000","Title":"Is there any solution regarding to PyQt library doesn't work in Mac OS Big Sur?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a Pygame library to easily create UI elements and I want to implement multicolored text. I know that I can do this by having multiple text objects but that's pretty unoptimized and I want to know if there's a better way i can do this?\nEdit: To make it clearer, i mean something like [RED]this text has to be red[\/RED]","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":104,"Q_Id":64825207,"Users Score":0,"Answer":"For anyone looking this up:\nThere sadly is no way to have multi-colored text in pygame as stated by @Rabbid76. You'll have to make it yourself","Q_Score":2,"Tags":"python,python-3.x,user-interface,pygame","A_Id":64825519,"CreationDate":"2020-11-13T17:17:00.000","Title":"Multi-Colored text in pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"$ pip install pygame\nCollecting pygame\nWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)'))': \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl\nWARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)'))': \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl\nWARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)'))': \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl\nWARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)'))': \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl\nWARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)'))': \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl\nERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: \/packages\/00\/86\/63b1967d59c3424992f0f822b012bcf24d8d013f8d65b40db20fae01be70\/pygame-2.0.0-cp38-cp38-win_amd64.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)')))","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1775,"Q_Id":64833049,"Users Score":0,"Answer":"Just uninstall all stuff of python 1st. Then delete that file from pc. Then uninstall python interpreter and download python form its official page again and install it and also install python interpreter again then\nCheck it in your cmd or powershell is it running perfectly or not.\nIt will definitely run.\nI am getting the same problem but it was resolved now.","Q_Score":0,"Tags":"python-3.8","A_Id":68407302,"CreationDate":"2020-11-14T10:46:00.000","Title":"python 3.8 and pip gives this error[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1123)')))","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What it is the best way to make a chessboard for checkers using Kivy framework?\nI have board.png, white.png, black.png, white_q.png, black_q.png files already. I wonder how to assign to each black tile on my board.png its own coordinate. Should I create 32 transparent widgets placed on black tiles of board.png or it is impossible? And what widget to use for 24 checkers? Any ideas or it is too complicated using Kivy and I should use tkinter?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":87,"Q_Id":64843966,"Users Score":1,"Answer":"There are many ways you could do this. It isn't complicated, it's very easy. The best way depends more on how you want to structure your app than anything else.\n\nI wonder how to assign to each black tile on my board.png its own coordinate\n\nSet the pos attribute of a widget to control its position, or better in this case use a layout that does what you want. For instance, adding your squares to a GridLayout with the right number of columns will have the right effect without you needing to worry more about positioning them.\n\nShould I create 32 transparent widgets placed on black tiles of board.png or it is impossible?\n\nI don't understand what you're asking here. You can make transparent widgets if you want but I don't know why you'd want to.\n\nAnd what widget to use for 24 checkers?\n\nThe real question is, what do you want the widget to do? e.g. if you want it to display an image then inherit from Image.\nOverall this answer is very generic because your question is very generic. I suggest that if you're stuck, try to ask a more specific question about a task you're struggling with, and give a code example showing where you are now.","Q_Score":0,"Tags":"python,kivy","A_Id":64844090,"CreationDate":"2020-11-15T11:43:00.000","Title":"Checkers board in kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I created a Conda Environment on my Manjaro Linux system.\nAs I develop a Kivy App and run it, it runs fine.\nThen when I go to compile it into an APK to run on my Android Tablet that's when I run into a strange problem. I can successfully create an APK and install it on my Tablet.\nBut...\nPython-For-Android downloads packages, that I aleady have installed, when building my APK. Sometimes it downloads versions I'm not using. and Sometimes it can't find a package that I already have installed.\nMy Question is this: How can I override (maybe in my Buildozer Spec file) P4A downloading packages (I guess it's called recipes) and to JUST USE the packages I already have downloaded and installed in my Conda Environment. (this way my compiled APK will be exactly identical to the Kivy App I'm running on my Linux machine.)","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":473,"Q_Id":64881147,"Users Score":0,"Answer":"I run into a strange problem. I can successfully create an APK and install it on my Tablet. But... Python-For-Android downloads packages, that I aleady have installed, when building my APK. Sometimes it downloads versions I'm not using\n\nThis isn't a strange problem, it's just how python-for-android works. It needs to install packages for the android environment, which isn't necessarily possible using what you have locally, and even if it was it's still a simpler way for python-for-android to operate.\n\nMy Question is this: How can I override (maybe in my Buildozer Spec file) P4A downloading packages (I guess it's called recipes) and to JUST USE the packages I already have downloaded and installed in my Conda Environment\n\nYou can't. There are options in the buildozer.spec file to specify the source directory for a given recipe, but this needs to be pointed at the source directory of the project (i.e. for a python module the root directory with a setup.py), not the installed package in another python environment.\nDepending on how conda caches packages, you might be able to point it at what it's pulled, but this won't work for e.g. wheels.\n\nthis way my compiled APK will be exactly identical to the Kivy App I'm running on my Linux machine.\n\nIf this is your goal, you can specify versions for things using requirements=package==version, e.g. requirements=colorama==0.4.4. However, for packages installed using recipes not all versions may be supported, it's normally a good idea to use the defaults. For instance, only certain python3 minor versions are supported.","Q_Score":0,"Tags":"python,kivy,buildozer,p4a,python-for-android","A_Id":64882743,"CreationDate":"2020-11-17T18:27:00.000","Title":"Buildozer and Python-for-Android","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":1},{"Question":"Generally to create a Virtual Camera we need to create a C++ application and include DirectShow API to achieve this. But with the modules such as\nwin32 modules and other modules we can use win32 api which lets us use these apis in python.\nCan anyone Help sharing a good documentation or some Sample codes for doing this?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":194,"Q_Id":64898643,"Users Score":1,"Answer":"There is no reliable way to emulate a webcam on Windows otherwise than supplying a driver. Many applications take simpler path with DirectShow, and emulate a webcam for a subset of DirectShow based applications (in particular, modern apps will be excluded since they don't use DirectShow), but even in this case you have to develop C++ camera enumation code and connect your python code with it.","Q_Score":0,"Tags":"python,windows,directshow,pywin32,win32com","A_Id":64898755,"CreationDate":"2020-11-18T17:55:00.000","Title":"Using Python to access DirectShow to create and use Virtual Camera(Software Only Camera)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have Azure Kinect and I am currently using PyK4a wrapper for python and Azure Kinect SDK for C++ application. I want to use feed from my Kinect in two applications at the same time. Is it possible to do this in parallel?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":94,"Q_Id":64912248,"Users Score":1,"Answer":"One alternative is to create a new application that reads the feed from the Kinect. This new application would then forward the feed to your two applications.","Q_Score":0,"Tags":"python,c++,azure,kinect-sdk,azurekinect","A_Id":64919892,"CreationDate":"2020-11-19T13:02:00.000","Title":"How to use a feed from Azure Kinect in multiple applications?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to install PyQt5 on my Raspberry Pi 4. I work in a virtual env with Python 3.7 installed using source env\/bin\/activate\nI've updated my pip version to 20.2.4.\nIf I use the command:pip install pyqt5, the installation takes too long, it continues displaying for hours:\ncollecting pyqt5\nUsing cached PyQt5-5.15.1.tar.gz (3.3 MB)\ninstalling build dependencies ... done\nGetting requirements to build wheel ... done\nPreparing wheel metadata ...\/\nI've tried to write sudo apt-get install pyqt5 but I found out that the package is installed for Python 2.7 version which was installed as default version on my Raspberry.\nHow can I install PyQt5 correctly? I want to use it in Python3.7.\nI previosly installed pyqtgraph with the command pip and I did not get errors.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":1297,"Q_Id":64914367,"Users Score":0,"Answer":"You can use this command sudo apt-get install python3-pyqt5. There is only one question that the pyqt5 by that command doesn't work in the venv of PyCharm.\nFine I found that if the selected python interpreter is system interpreter, it also worked in PyCharm.","Q_Score":0,"Tags":"python-3.x,installation,pyqt5,raspberry-pi4","A_Id":66426572,"CreationDate":"2020-11-19T15:04:00.000","Title":"PyQt5 on Raspberry Pi 4","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a game which is written in Python\/Kivy and would like to implement a global leaderboard. Does anyone have any suggestions or more preferably a working example which I can use? I've stumbled across Redis but struggling to get my head around it for implementation and am not sure this is the right way to go. Any help would be appreciated. Thanks.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":83,"Q_Id":64923833,"Users Score":0,"Answer":"Okay, I am trying firebase realtime database. There is a YouTube video on how to do this.","Q_Score":0,"Tags":"python,kivy,leaderboard","A_Id":65320482,"CreationDate":"2020-11-20T04:36:00.000","Title":"How can I implement a global high score or leaderboard in Python\/Kivy for android?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Whenever I paste text into a QTextEdit widget, it pastes without changing the font or color. Is there a flag I can set to prevent this? Couldn't find anything on here.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":51,"Q_Id":64945204,"Users Score":0,"Answer":"Instead of using the normal Ctrl+v\/Cmd+v to paste text in, try holding shift while you paste it in.","Q_Score":1,"Tags":"python,pyqt,pyqt5,qtextedit","A_Id":64945248,"CreationDate":"2020-11-21T16:08:00.000","Title":"Paste without changing font","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im trying to get a good gui for python and tkinter is working fine but I cant put any custom fonts on it\nCan I import any custom fonts from either a ttf or maybe google font if not do you know any other guis that do, do that. (btw it needs to work with linux windows and osX)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":173,"Q_Id":64950357,"Users Score":1,"Answer":"Tkinter provides no cross-platform way to install custom fonts. The only support tkinter has built-in is to use the fonts provided by the OS.","Q_Score":0,"Tags":"python-3.x,macos,user-interface,tkinter,fonts","A_Id":64950405,"CreationDate":"2020-11-22T03:21:00.000","Title":"How to use custom fonts on TKINTER","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Looking to create a GUI based 25-key keyboard using PYQT5, which can support MIDI controller keyboards. However, I don\u2019t know where to start (What libraries should I use and how do I go about finding a universal method to supporting all MIDI controller keyboards). I plan to potentially use the Mido Library, or PyUSB but I am still confused as to how to make this all function. Any starting guides would be much appreciated.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":319,"Q_Id":65002198,"Users Score":2,"Answer":"MIDI is a universal standard shared by all manufacturers, so you don't have to worry about \"supporting all MIDI controller keyboards\", you just have to worry about supporting the MIDI studio of your system.\nYou'll have to scan your environment to get the existing MIDI ports. With the list of existing ports you can let the user choose to which port he wants to send the events generated by your keyboard and\/or from which port he wants to receive events that will animate the keyboard (for instance from a physical MIDI keyboard connected to your computer), possibly all available input ports.\nTo support input events, you'll need a kind of callback prepared to receive the incoming notes on and off (which are the main relevant messages for a keyboard) at any time. That also means that you have to filter the received events that are not of those types because, in MIDI, a stream of events is subject to contain many kinds of other events mixed with the notes (pitch bend, controllers, program change, and so on).\nFinally notice that MIDI doesn't produce any sound by itself. So if you plane to hear something when you play on your keyboard, the produced MIDI events should be send to a device subject to produce the sound (for instance a synthesizer or virtual instrument) via a port that this device receives.\nFor the library, Mido seems to be a pretty good choice : it has all the features needed for such a project.","Q_Score":0,"Tags":"python,pyqt5,midi,libusb,piano","A_Id":65004991,"CreationDate":"2020-11-25T09:51:00.000","Title":"How to implement a MIDI keyboard into python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm just wondering if there is a way to put a python Tkinter canvas onto a web page with HTML. It's OK if there isn't. If there is not, is there a way to run python code from IDLE with HTML?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":261,"Q_Id":65042076,"Users Score":0,"Answer":"Essentially 'no'. Tkinter is Python's interface to the tcl\/tk GUI framework. The 'tkinter canvas' is actually the tk Canvas. A web page could only have a tk Canvas if the browser were somehow running tcl\/tk.\nAs for running Python code in a browser, there are some browser add-ins that will allow that. I do not know how good they are not. You should search the web for 'run python in browser' or add a separate question here. It is irrelevant how you edit the python code, whether with IDLE or another editor.","Q_Score":0,"Tags":"python,html,tkinter-canvas","A_Id":65050433,"CreationDate":"2020-11-27T18:18:00.000","Title":"Is there a way to embed a tkinter canvas into an HTML web page?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I created a game and there is this part of the code I don't understand.tk.wm_attributes(\"-topmost\", 1)\nWhat does the number after \"-topmost\" mean? I changed the number to 0 and 255, yet there is no difference. Why is that?\n\nI also checked the tkinter documentation and I can't find the function.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":789,"Q_Id":65046290,"Users Score":0,"Answer":"Yeah, the function's quite well hidden and (I think) only works on Python.\ntk.wm_attributes() sets settings for tkinter to use for drawing the app. -topmost is an option to make the window always be on top of all the other windows, and zero is considered false while all other numbers are true.\nSo in other words, tk.wm_attributes('-topmost', 1) means \"Yes, do draw the window on top of all the others.\"","Q_Score":1,"Tags":"python,tkinter","A_Id":65046389,"CreationDate":"2020-11-28T04:01:00.000","Title":"What does the one in 'tk.wm_attributes(\"-topmost\", 1) mean?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I created a game and there is this part of the code I don't understand.tk.wm_attributes(\"-topmost\", 1)\nWhat does the number after \"-topmost\" mean? I changed the number to 0 and 255, yet there is no difference. Why is that?\n\nI also checked the tkinter documentation and I can't find the function.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":789,"Q_Id":65046290,"Users Score":0,"Answer":"The topmost attribute requires a value that can be converted to True or False in the tcl language. 1 or any other number greater than zero evaluates to True. 0 will evaluate to False.\nSo, tk.wm_attributes(\"-topmost\", 1) sets the topmost option on, and a value of 0 turns it off.","Q_Score":1,"Tags":"python,tkinter","A_Id":65046594,"CreationDate":"2020-11-28T04:01:00.000","Title":"What does the one in 'tk.wm_attributes(\"-topmost\", 1) mean?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to slowly draw a circle in pygame so the act of drawing is actually visible to the naked eye. I got a function on stackoverflow to draw a straight line by incrementing the end point and keeping the starting point same but couldn't figure out how to slowly draw a circle in the pygame screen.","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":371,"Q_Id":65049152,"Users Score":0,"Answer":"I recommend using the turtle library because it contains a circle function. For example circle(40) would draw a circle with a radius of 40 units. When you run the program the circle will be drawn in front of you","Q_Score":3,"Tags":"python,pygame,geometry","A_Id":65049240,"CreationDate":"2020-11-28T11:38:00.000","Title":"How to slowly draw a circle in Pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I know that python is interpreter language and that it means it converts script to machine code when you run it, but can someone clarify to me why can't it be pre converted to machine code (compiled).\nI'm asking this because I have been making these simple programs with GUI using tkinter and I am using pyInstaller to create executable file. The problem is that sometimes I get this simple program (only a few lines of code) as big as 10s of MBs.\nAs I understand, PyInstaller packs all libraries and interpreter with script in exe which results in these sizes, but is there a way I can get this to somewhat rational size? Because I know same programs made in C++ much smaller (less than MB).\nI don't know any of C or C++ so that isn't an option as I don't have time to learn it. Size really isn't that big to be much of a problem, but still, it's nice to have smaller file.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":218,"Q_Id":65055823,"Users Score":0,"Answer":"Check if the virtual environment that you are using does not have site-packages that you don't need. Usually it's these packages that are large. Create a new venv and only install the libraries you need and try.","Q_Score":2,"Tags":"python,compilation,size","A_Id":65055895,"CreationDate":"2020-11-29T00:29:00.000","Title":"Compiling python to a small exe file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a matching game where there are several cards faced upside down and the user has to match the right pairs. The cards faced upside down are all turtle objects.\nFor eg. if there are 8 faced down cards, there are 8 turtle objects.\nI'm having some trouble figuring out how to select the cards since I don't know which turtle is associated with the particular card selected by the user. I do have a nested list containing all turtles and those with similar images are grouped together. Is there any way to return the turtle object selected by the user?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":259,"Q_Id":65057381,"Users Score":0,"Answer":"If i got your question, one way to do so is that you should provide some id attribute to each turtle which will identify it. Then you can check easily which turtle was selected by the user.","Q_Score":1,"Tags":"python,python-3.x,return,turtle-graphics,python-turtle","A_Id":65057437,"CreationDate":"2020-11-29T05:47:00.000","Title":"Is there any way to return the turtle object that is clicked?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For, example If a button click turns the background blue, or changes the button's text, how do I make sure that change stays even after i go to other frames?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":34,"Q_Id":65110308,"Users Score":0,"Answer":"One way to go is to create a configuration file (e.g. conf.ini) where you store your changes or apply them to other dialogs. It will allow you to keep changes after an app restarted.","Q_Score":0,"Tags":"python,user-interface,interactive","A_Id":65110363,"CreationDate":"2020-12-02T14:42:00.000","Title":"How do I keep changes made within a python GUI?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made my app using python(PyQt5). I converted py to exe using pyinstaller but after converting it looped at splash screen(My app has splash screen and main screen.). So,I decided to stay it as py file but can I make it unreadable for user? I mean only my app can execute it and normal users couldn't able to see source code?\nNote:This program is only for Windows.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":138,"Q_Id":65131473,"Users Score":0,"Answer":"pyinstaller is the way to go. It does work with libraries you use. It seems you have some underlying problems though.\nAnother alternative is py2exe.\nDid you try some reasearch into pyinstaller options? Some suggest using --onefile option of pyinstaller.","Q_Score":1,"Tags":"python,python-3.x,windows","A_Id":65131625,"CreationDate":"2020-12-03T17:56:00.000","Title":"How to make code unreadable but executbale?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I tried to execute a try except command on the app to get log of the error but it still crash so I think it is a problem of PATH ? library ?\nWhy does it work with pyinstaller and not after I created an installer.nsi with HM NSIS edit ?\nI'm sorry but I have no idea of how to debug it !\nIt is a \"simple\" project. tkinter app, excel creation, 1 thread...\nI don't know from where it comes from (I'm not good in system and OS).\nPS: even stranger, when I install the app with Install.exe, if I decide to launch the app directly it works !!!\nBut it never work a second time when I use the shortcut or the .exe in C:\\Program Files (x86)\\MYDIRECTORY.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":138,"Q_Id":65141524,"Users Score":0,"Answer":"This a permission problem, I tried to write on a protected file.\nSolution to debug:\ndo not use --noconsole when you run pyinstaller, it will let you the console and with windows+G, you can keep track of the error even if the terminal stop immediatly after the crash of the programm.\n(I tried to register the error in a .json in a try except but that the thing that made my program crash !)","Q_Score":0,"Tags":"python,pyinstaller","A_Id":65157159,"CreationDate":"2020-12-04T10:03:00.000","Title":"Fatal error detected \"Failed to execute script main\".Works with pyinstaller, crash with HM NSIS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making turn based game in python using Pyglet. The game has a player-vs-AI mode in which the bot calculates a move to play against the player. However, the function which calculates the bot's move takes around 3-5 seconds to run, blocking the game's UI. In order to get around this, I am running the bot's calculation on a second process using multiprocessing.Process. I got it to work well without blocking the UI, however every time I open the second process to run the function a new Pyglet window opens, then closes again when the process is closed. Is there any way to open a second process in a Pyglet program without a second window opening? Let me know if examples of my code is required, and I will try to come up with similar code to share. Thanks in advance to anyone who can help.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":120,"Q_Id":65154811,"Users Score":0,"Answer":"You can fix the problem by moving the initialization of the window inside of the main block","Q_Score":1,"Tags":"python,multiprocessing,window,pyglet","A_Id":65164876,"CreationDate":"2020-12-05T07:37:00.000","Title":"Multiprocessing with Pyglet opens a new window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i have a 3d point clouds of my object by using Open3d reconstruction system ( makes point clouds by a sequence of RGBD frames) also I created a 3d bounding box on the object in point clouds\nmy question is how can I have 2d bounding box on all of the RGB frames at the same coordinates of 3d bounding box?\nmy idea Is to project 3d bb to 2d bb but as it is clear, the position of the object is different in each frame, so I do not know how can i use this approach?\ni appreciate any help or solution, thanks","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":472,"Q_Id":65160942,"Users Score":0,"Answer":"calculate points for the eight corners of your box\ntransform those points from the world frame into your chosen camera frame\nproject the points, apply lens distortion if needed.\n\nOpenCV has functions for some of these operations and supports you with matrix math for the rest.\nI would guess that Open3d gives you pose matrices for all the cameras. you use those to transform from the world coordinate frame to any camera's frame.","Q_Score":0,"Tags":"python,opencv,point-clouds,bounding-box,open3d","A_Id":65161287,"CreationDate":"2020-12-05T19:15:00.000","Title":"How can i have 2D bounding box on a sequence of RGBD frames from a 3D bounding box in point clouds?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Pycharm on Windows 10.\nPython version: 3.8.6\nI've checked using the CMD if I have tkinter install python -m tkinter. It says I have version 8.6\nTried:\n\nimport tkinter.\nI get \"No module named 'tkinter' \"\n\nfrom tkinter import *.\nI get \"Unresolved reference 'tkinter'\"\n\nInstalled future package but that didn't seem to change the errors.\n\n\nAny suggestions on how to fix this issue?\nThank you!","AnswerCount":2,"Available Count":2,"Score":-0.0996679946,"is_accepted":false,"ViewCount":252,"Q_Id":65190405,"Users Score":-1,"Answer":"You can try \"pip install tkinter\" in cmd","Q_Score":0,"Tags":"python,tkinter,python-3.8","A_Id":70811441,"CreationDate":"2020-12-07T22:29:00.000","Title":"tkinter in Pycharm (python version 3.8.6)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Pycharm on Windows 10.\nPython version: 3.8.6\nI've checked using the CMD if I have tkinter install python -m tkinter. It says I have version 8.6\nTried:\n\nimport tkinter.\nI get \"No module named 'tkinter' \"\n\nfrom tkinter import *.\nI get \"Unresolved reference 'tkinter'\"\n\nInstalled future package but that didn't seem to change the errors.\n\n\nAny suggestions on how to fix this issue?\nThank you!","AnswerCount":2,"Available Count":2,"Score":-0.0996679946,"is_accepted":false,"ViewCount":252,"Q_Id":65190405,"Users Score":-1,"Answer":"You just verify in the project settings, sometimes Pycharm doesn't use the same interpreter.","Q_Score":0,"Tags":"python,tkinter,python-3.8","A_Id":65190465,"CreationDate":"2020-12-07T22:29:00.000","Title":"tkinter in Pycharm (python version 3.8.6)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The wx.MenuBar class auto generates a Window dropdown that contains the entries: next, prev, close, and close all. How can I remove this option?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":29,"Q_Id":65222511,"Users Score":0,"Answer":"Figured it out.\nI was using wx.aui.AuiMDIParentFrame, and it appends a Window menu item by default unless you use wx.FRAME_NO_WINDOW_MENU style option in the constructor.","Q_Score":0,"Tags":"wxpython","A_Id":65251870,"CreationDate":"2020-12-09T18:09:00.000","Title":"How can I remove the Window dropdown in MenuBar?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I Am Getting This Error Using Pygame 64 bit Windows Python 3.9:\nFailed loading libmpg123.dll: The specified module could not be found.\nI have tried the following\n\nRestarting IDE\nRestarting Computer\n\nThis problem only happens with \".exe\" extension. It works fine if using the \".py\" extension. Any ideas on this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":409,"Q_Id":65237071,"Users Score":0,"Answer":"I have Downloaded That dll And Put It in the folder now it works like charm","Q_Score":0,"Tags":"python,dll,module,pygame","A_Id":65248328,"CreationDate":"2020-12-10T15:04:00.000","Title":"Failed loading libmpg123.dll: The specified module could not be found","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using Kivy Carousel to build an App.\nHowever I would like to maintain Manual control of the carousel and disable the swipe action (I will manually call carousel.load_next)\nI have looked through the Documentation but cannot see any way to disable the swipe action.\nIf anyone could help me I would appreciate it.\nMany thanks,\nSeotha.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":246,"Q_Id":65240081,"Users Score":0,"Answer":"Thanks Authur, I will mark as Answer.\nI also discovered I can subclass Carousel and override on_touch_move with nothing.\nclass MyCarousel(Carousel): def on_touch_move(self,touch): pass","Q_Score":1,"Tags":"python,kivy,carousel","A_Id":65241335,"CreationDate":"2020-12-10T18:16:00.000","Title":"Disable Swipe Actions on Kivy Carousel","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"So I have a class that I am working on and when I am finished with it, I want to import it into the game that I am working on. The main source code for my game has Tkinter imported, so my question is, do I need to import Tkinter into my seperate class file in order to use it in my game like normal or can I leave that out since Tkinter is already imported into the source code?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":38,"Q_Id":65284179,"Users Score":0,"Answer":"Yes, as a general rule you need to import tkinter in every file that uses tkinter.","Q_Score":0,"Tags":"python,class,tkinter,pygame","A_Id":65284228,"CreationDate":"2020-12-14T05:45:00.000","Title":"Importing Classes and working with Libraries","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to return all values of all widgets on a screen to their default values (ex. TextInputs text: '') or do I have to write a function to go through each one, one by one, to clear them?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":148,"Q_Id":65349266,"Users Score":0,"Answer":"What you can do is clear all widgets on a screen using .clear_widgets() function. I don't think there's any way to reset all values. Another way to change the values is like if you have a textfield then you can do textfield.text = '' but you have to go through each widget to reset it","Q_Score":0,"Tags":"python,kivy","A_Id":65357031,"CreationDate":"2020-12-17T22:31:00.000","Title":"Kivy: Reset\/Default values to all widgets on a screen?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to return all values of all widgets on a screen to their default values (ex. TextInputs text: '') or do I have to write a function to go through each one, one by one, to clear them?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":148,"Q_Id":65349266,"Users Score":0,"Answer":"I don't think Kivy properties retain any concept of a default value, so you'll have to handle this yourself.","Q_Score":0,"Tags":"python,kivy","A_Id":65349788,"CreationDate":"2020-12-17T22:31:00.000","Title":"Kivy: Reset\/Default values to all widgets on a screen?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a cool little project for my friend, basically a timer using tkinter, but I am confused on how to let them access this project without having vscode or pycharm. Is it possible for them to just see the Tkinter window or something like that? Is there an application for this? Sorry if this is a stupid question.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":108,"Q_Id":65352071,"Users Score":2,"Answer":"You can just built an .exe (Application) of your project. Then just share the application file and anyone can use the application through .exe. You can use pyinstaller to convert your python code to exe.\npip install pyinstaller\nthen cd to the project folder then run the following command\npyinstaller --onefile YourFileName.py\nif you want to make exe without console showing up then use this command\npyinstaller --onefile YourFileName.py --noconsole","Q_Score":1,"Tags":"python","A_Id":65352116,"CreationDate":"2020-12-18T05:07:00.000","Title":"How do you set up a python project to be able to send to others without them having to manually copy and paste the code into an editor","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using wkhtmltopdf 0.12.6 (qt patched) with python 3.6 and pdfkit as wrapper for wkhtmltopdf.\nI am getting this error \"wkhtmltopdf exited with non-zero code -9. error:\" and I am stuck not able to find any information what this error is related to. Can someone please guide me to fix this error.\nThanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":298,"Q_Id":65391353,"Users Score":0,"Answer":"This is due to your wkhtmltopdf process running out of memory.\nPlease increase the cpu and memory of the system where you are running this process.","Q_Score":0,"Tags":"python,python-3.x,wkhtmltopdf,pdfkit","A_Id":67334489,"CreationDate":"2020-12-21T10:45:00.000","Title":"wkhtmltopdf exited with non-zero code -9. error. How can I get rid of this error?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to build an app with buildozer, and it gets stuck when downloading hostpython3. The last message is:\n[INFO]: Downloading hostpython3 from https:\/\/www.python.org\/ftp\/python\/3.8.1\/Python-3.8.1.tgz\nand it never gets downloaded. I tried downloading it manually and placing it in ...\/Python\/kivy_sms\/.buildozer\/android\/platform\/build-armeabi-v7a\/packages, but it removes it and does the same thing. Is there a way to bypass this and download it manually?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":136,"Q_Id":65422740,"Users Score":0,"Answer":"check other DIRs under ...\/packages, those downloaded ones should have an empty file starts with \".make\" sth., besides the .tgz file. Mimic this should stop buildozer from downloading the file again.","Q_Score":0,"Tags":"python,kivy,buildozer","A_Id":66131137,"CreationDate":"2020-12-23T10:27:00.000","Title":"Buildozer doesn't install hostpython3","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In almost, if not every, programming language, pressing ctrl+c cancels your code. Why does it specifically have to be ctrl+c? So in other words, what made the developers of programming languages decide that ctrl+c has to be the combination to cancel the code and cause an error?","AnswerCount":3,"Available Count":2,"Score":0.1325487884,"is_accepted":false,"ViewCount":59,"Q_Id":65445877,"Users Score":2,"Answer":"Ctrl+C is not a programming language thing. It is an \"interrupt\" signal sent to the process executing.","Q_Score":3,"Tags":"python","A_Id":65445943,"CreationDate":"2020-12-25T06:46:00.000","Title":"Why does ctrl+c have to be the combination to cause an error (e.g. KeyboardInterrupt)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"In almost, if not every, programming language, pressing ctrl+c cancels your code. Why does it specifically have to be ctrl+c? So in other words, what made the developers of programming languages decide that ctrl+c has to be the combination to cancel the code and cause an error?","AnswerCount":3,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":59,"Q_Id":65445877,"Users Score":3,"Answer":"It doesn't \"have to be\" anything, it is a convention formed over a long history: Control-C, \"C\" for cancel, was I think first used in TOPS-10, a Digital Equipment Corporation (DEC) mainframe operating system used in the late 1960s. The control key itself goes back much further, used on telegraphs and teletypewriters to key in non-printing characters. The idea of non-printing characters controlling a machine without sending a message has an even longer history, including procedure signs in Morse code, \"NUL\" and \"DEL\" in Baudot code, and other late 19th-century teleprinter standards and their devices.","Q_Score":3,"Tags":"python","A_Id":65446215,"CreationDate":"2020-12-25T06:46:00.000","Title":"Why does ctrl+c have to be the combination to cause an error (e.g. KeyboardInterrupt)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I change the preset soundfonts for pygame or fluidsynth?\nIm using Python 3.7.3, pygame 2.0.1, fluidsynth 1.1.11 to play Midi files. When I call pygame.mixer.music.load(), I receive a few fluidsynth errors:\nfluidsynth: error: Unable to open file \"\/usr\/share\/sounds\/sf3\/FluidR3Mono_GM.sf3\" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont \"\/usr\/share\/sounds\/sf3\/FluidR3Mono_GM.sf3\" fluidsynth: error: Unable to open file \"\/usr\/share\/sounds\/sf2\/TimGM6mb.sf2\" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont \"\/usr\/share\/sounds\/sf2\/TimGM6mb.sf2\" \nThese soundfont files are not on my device. So I'd like to point fluidsynth to another soundfont. How do I change the preset soundfonts for fluidsynth inside PyGame?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":303,"Q_Id":65449321,"Users Score":0,"Answer":"I wasn't able to change the preset soundsfonts, but I was able to install the missing soundfonts.\napt-get install fluidr3mono-gm-soundfont for FluidR3Mono_GM.sf3\napt-get install timgm6mb-soundfont for TimGM6mb.sf2","Q_Score":0,"Tags":"python,pygame,midi,fluidsynth","A_Id":65450953,"CreationDate":"2020-12-25T15:14:00.000","Title":"PyGame change preset soundfont","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"sorry for potentially asking stupid questions but I am newbie, learning Python from YT videos.\nI need to use Ptwin32 extension, and use the libraries there.\n\nEDIT: using Windows 10\n\nDowloaded \"pywin32-300.win-amd64-py3.9\" from here \"https:\/\/github.com\/mhammond\/pywin32\/releases\"\n\nUsing python 3.9.1 and PyCharm 2020.3.1.\n\nOn the beginning of my program I write:\nimport win32gui \nimport win32con \n\n\nand then I get the message \"ModuleNotFoundError: No module named 'win32gui'\"\nTried to search for solutions but nothing worked so far.\nThx in advance for help.\nLoonak","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1354,"Q_Id":65451896,"Users Score":0,"Answer":"Go to your terminal and say either pip install win32gui or pip3 install win32gui(Try the other one if one of these 2 don't work)\nHappy Coding!","Q_Score":0,"Tags":"python","A_Id":65452198,"CreationDate":"2020-12-25T21:21:00.000","Title":"ModuleNotFoundError: No module named 'win32gui","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"sorry for potentially asking stupid questions but I am newbie, learning Python from YT videos.\nI need to use Ptwin32 extension, and use the libraries there.\n\nEDIT: using Windows 10\n\nDowloaded \"pywin32-300.win-amd64-py3.9\" from here \"https:\/\/github.com\/mhammond\/pywin32\/releases\"\n\nUsing python 3.9.1 and PyCharm 2020.3.1.\n\nOn the beginning of my program I write:\nimport win32gui \nimport win32con \n\n\nand then I get the message \"ModuleNotFoundError: No module named 'win32gui'\"\nTried to search for solutions but nothing worked so far.\nThx in advance for help.\nLoonak","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1354,"Q_Id":65451896,"Users Score":0,"Answer":"I had the same problem & py -m pip install win32gui didn't solve it,\nfinally it was fixed using py -m pip install pywin32 as @Kenny Ostrom advised","Q_Score":0,"Tags":"python","A_Id":71084859,"CreationDate":"2020-12-25T21:21:00.000","Title":"ModuleNotFoundError: No module named 'win32gui","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I normally starts the thread using the following command,\nthreading.Thread(target=function_name).start()\nIs there any way to pause it like\nthreading.Thread(target=name).wait()\nand resume is like\nthreading.Thread(target=name).set()","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":328,"Q_Id":65459138,"Users Score":1,"Answer":"The threading module has a Semaphore, which might help. If there isn't something already built-in to the threading module, you could try using a Tkinter semaphore variable specific to each thread, and have the thread check its semaphore while in some polling loop.","Q_Score":1,"Tags":"python,python-3.x,multithreading,tkinter","A_Id":65459242,"CreationDate":"2020-12-26T17:54:00.000","Title":"Is there any way to pause and resume thread in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am using Gtk to create an application and I need to use a stack page again and again with different data on each page. I designed a page with glade but now want to clone it and use it in different pages of the stack. Please help me.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":93,"Q_Id":65527314,"Users Score":1,"Answer":"I got what I wanted to do. Basically, I wanted to use multiple widgets arranged in order to give me a template to use dynamically in my app. Composite widgets are one I was looking for. Which can be made and used with pygi(gi_composite library in python)\n[https:\/\/github.com\/virtuald\/pygi-composite-templates][1]","Q_Score":1,"Tags":"python,c++,gtk,glade","A_Id":65563056,"CreationDate":"2021-01-01T04:42:00.000","Title":"Clone widgets and its all child in Gtk","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Iam trying to make a password manager with login system using python and tkinter. To store those passwords I'm using notepad. But, the problem is that, the passwords are easily accessible just by opening the .txt file(without logging into the app) that I'm using to store them.So, is there any way to make those text files only accessible through that app or any better way to store that information? Please dont mind any mistakes","AnswerCount":4,"Available Count":1,"Score":0.049958375,"is_accepted":false,"ViewCount":160,"Q_Id":65529075,"Users Score":1,"Answer":"There are some issues with the way you're going about doing this.\nFirst, you shouldn't be storing actual passwords. Instead, hash them and store the hashes, then when your users try to log in, you hash the passwords they give and check that it matches the hash you have stored for them.\nSecond, your app should be running under a service account and whatever secrets it needs should be accessible only to that account, which prevents any other user from being able to read its sensitive data. For added protection, you can disable ssh and shell access for that service account, and also disable sudo and root logins on your server to make it a bit harder for an attacker to become the service account (be aware it doesn't make it impossible, just harder).\nThird, you shouldn't be rolling your own secrets manager anyway. But assuming this is some sort of toy app or school project where you're doing it to learn how to do it, keep some basic rules of info sec in mind. You can also encrypt the file you keep the password hashes in, but don't think that necessarily buys more security as anyone who can get access to your service account to read the password file at all can also get the encryption key. This is the basic reason \/etc\/passwd and \/etc\/shadow aren't encrypted and are instead protected by restrictive file permissions.\nMind you, a user database in a flat text file isn't particularly scalable, so while it works fine for servers, apps with a lot of accounts tend to use real databases, and you can use the database manager's built-in access control and encryption functionality to restrict access to sensitive tables and encrypt sensitive columns.","Q_Score":1,"Tags":"python,python-3.x,tkinter,text,notepad++","A_Id":65530461,"CreationDate":"2021-01-01T10:57:00.000","Title":"Suggestions regarding accessiblity of files in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to build an iOS application using Kivy, is it possible to pack this application using Windows machine?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":886,"Q_Id":65600039,"Users Score":0,"Answer":"I'm afraid not. It might be possible using a macOS virtual machine under Windows, but of course Apple make this difficult and probably forbid it.\nIf there are web services providing app build infrastructure then it may be possible to use them.","Q_Score":2,"Tags":"python,ios,windows,kivy","A_Id":65601890,"CreationDate":"2021-01-06T16:58:00.000","Title":"Can I develop Kivy application for iOS on Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I\u2019m building a gui on python with tkinter, i\u2019ve made a login, register and change password screens, hosting the data on mysql, i want to make an option that if user already choose password \u201cx\u201d for example, he will be able to repeat the password only 1 more time, after that it will not give him an option to choose and repeat the same password on the change password screen, any clue how to do it?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":62,"Q_Id":65649344,"Users Score":0,"Answer":"Create a table with (user, passwords_used) as columns. Each time a user changes their password, check it against this table. If that (user, password) pair isn't in the table, add it to the table and change the password. Otherwise reject it as reused.","Q_Score":0,"Tags":"python,python-3.x,tkinter","A_Id":65649381,"CreationDate":"2021-01-10T01:30:00.000","Title":"Limit same password in password change","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Hello I am programming a program to automate mouse presses on a program for certain pixels but I don't want a second program to come in the way with that click, my program is going to look for a green pixel and click it on a certain part of the screen, but if there is another program\/image in the way that is green I don't want it to click on that\nI just want it to click on the process\/program I want it to click on, and not click on the screen\nIf anyone could give me some tips on this, that would be helpful","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":108,"Q_Id":65682858,"Users Score":0,"Answer":"Im sorry im not familiar with keys interacting with programs, but i made a little research and found a library called PyWin32 that should statisfy your need. You can search for its documentation or try your luck by finding videos on this particullar library on youtube.\nAnyways, hopefully this helped you getting set in the right direction, and feel free to ask any question","Q_Score":0,"Tags":"python,automation,process","A_Id":65682986,"CreationDate":"2021-01-12T11:16:00.000","Title":"Clicking on pixel for certain process with python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to maximize the pygame window when intializing the window with set_mode without making it completely fulsscreen. I tried to get the required window_size by printing event.size, when VIDEORESIZE is called, which is (1920, 1017). But if I use this value for my window_size when setting mode I just get a window at the same size of a maximized window. If I press maximize in the top right corner it just switches between a thicker and a thinner border.\nObviously i want the thinner border, is that possible from the start?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":43,"Q_Id":65689163,"Users Score":0,"Answer":"You should try to use the\nRESIZEABLE\nWhen using set_mode in pygame like\nDISPLAYSURF = pygame.display.set_mode((1920,1017), RESIZABLE)","Q_Score":0,"Tags":"python,pygame,window,maximize,maximize-window","A_Id":65689305,"CreationDate":"2021-01-12T17:43:00.000","Title":"Maximize the pygame window without making it fullscreen","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make an app with kivy, but am wondering if I can connect it to a Wordpress database, I want to show the wp posts within the kivy app, is there an easy way to do so?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":46,"Q_Id":65698094,"Users Score":0,"Answer":"Wordpress provides a REST API. You can use it to get posts in JSON format using an HTTP request and do whatever you want with the data.","Q_Score":0,"Tags":"python,wordpress,kivy,kivymd","A_Id":65698796,"CreationDate":"2021-01-13T08:25:00.000","Title":"Is there an easy way to show Wordpress posts in kivy\/python app?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Using tkinter we can use either widget.grid(row,col) or widget.pack() to place a widget.\nSince row,col corresponds to the row\/col-index in a given Frame\/Window - how do we know how many columns the Frame\/Window consists of? E.g if I want to place a widget in the midle or to the very right","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":411,"Q_Id":65701967,"Users Score":2,"Answer":"Rows and columns are just concepts, not actual things. There is effectively an infinite number of rows and columns, all with a width or height of zero until they contain a widget or are configured to have a minimum width or height. From a practical standpoint, there are as many rows and columns as there are pixels in the window.\nIn reality, the number of rows and columns is entirely up to you. A widget can have a single row and column or it can have several. It all depends on what you add to the window.\nA frame starts out with nothing in it, so there are no rows and columns, just empty space. When you add a widget to a row and column, it now has one row and one column plus maybe some empty space. Even if you place your first widget at row 50 and column 20, there is still just one row (50) and one column (20).\nThere are simple techniques to put something in the middle, or along the right size. For example, because you can define how many columns, you can configure the master to use three columns and the place your widget in the middle column. You can use columnconfigure to cause the last column to take up all extra space with the weight option. This will move any widgets in the last column to the right edge.","Q_Score":1,"Tags":"python-3.x,tkinter","A_Id":65704715,"CreationDate":"2021-01-13T12:26:00.000","Title":"How many rows\/columns are there in a tkinter Frame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a python GUI with tkinter that requires drawing lots of circles and lines. I want to limit some of the canvas drawings to a certain part of the window, e.g. the right half. For lines, I can just do the tedious calculation (and have done so) but there's no obvious way to do this for circles because they can be disconnected, so I'm wondering if there's just a simpler solution (possibly a specific keyword) that allows you to limit where canvas can draw? Thanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":83,"Q_Id":65709538,"Users Score":0,"Answer":"There are a couple of options that you could try.\n\nYou could make two separate canvas', one on the right side and one on the left side and only allow the user to draw in the one on the right.\n\nGiven a center point and a radius, it is possible to calculate if the circle will extend into the left half of the canvas, in which case, you can remove it from the canvas.","Q_Score":0,"Tags":"python,tkinter","A_Id":65709782,"CreationDate":"2021-01-13T20:47:00.000","Title":"Is it possible to limit a Tkinter canvas drawing to a specific frame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am building a Kivy into a Android app using buildozer and I am running into a error. When I type buildozer -v android debug I run into the following error.\n\n#sdkmanager path \"\/home\/...\/.buildozer\/android\/platform\/android-sdk\/tools\/bin\/sdkmanager\" does not exist, sdkmanager is notinstalled\n\nHow can solve this problem.\nNote: I am using the Windows virtual Linux terminal (Ubuntu)","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":484,"Q_Id":65724724,"Users Score":0,"Answer":"So what is basically happening is that buildozer is not finding the sdk manager. There are two ways to tackle this problem. First you can download the SDK tools and unzip it in the folder. Second is to start afresh. Delete all the folders created during the build via the terminal using this command rm -rf folder_name. Then build the app again. This will cause the packages to be downloaded again.","Q_Score":0,"Tags":"python,android,user-interface,kivy,buildozer","A_Id":65750377,"CreationDate":"2021-01-14T18:19:00.000","Title":"While building Kivy app 'sdkmanager not installed'","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a QTextTable and I want to insert a row in my current position.\nHow can I know in which row is the QTextCursor?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":46,"Q_Id":65741813,"Users Score":0,"Answer":"With help @musicamente\nthe solution for insert a row in a QTextTable in current position is:\ncursor.currentTable().insertRows(cursor.currentTable().cellAt(cursor).row()+1,1)","Q_Score":0,"Tags":"python,pyqt,pyqt5","A_Id":65742377,"CreationDate":"2021-01-15T18:38:00.000","Title":"QTextTable QTextCursor current row?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a database management program in Python and Tkinter that relies on user input for updating it. The script goes like this:\n\nUser searches for records.\nSelects an entry in treeview widget.\nSelection populates all of the Entry fields.\nUser changes one or more values in them.\nProgram updates the database with the new values\n\nMy problem is this: How do I compare the old value (that came from selecting in threeview) and the new value (that user changed)?\nI have an idea for a loop that 'scans' the new and old values and based on that executes UPDATE query on the changed column, but I can't get the value that is in the Entry widget.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":200,"Q_Id":65775759,"Users Score":0,"Answer":"You need to let the database do the work, i.e you let the database search for the record and update it based on a value. This value must be unique, an ID.\nSo what should happen:\n\nThe user chooses the record and the new value\nYou have the ID of the record and the new value\nCall your ORM's update function, which should accept the ID of the record and the new value","Q_Score":0,"Tags":"python,sql,firebird","A_Id":65776192,"CreationDate":"2021-01-18T13:48:00.000","Title":"Update database based on user input","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a database management program in Python and Tkinter that relies on user input for updating it. The script goes like this:\n\nUser searches for records.\nSelects an entry in treeview widget.\nSelection populates all of the Entry fields.\nUser changes one or more values in them.\nProgram updates the database with the new values\n\nMy problem is this: How do I compare the old value (that came from selecting in threeview) and the new value (that user changed)?\nI have an idea for a loop that 'scans' the new and old values and based on that executes UPDATE query on the changed column, but I can't get the value that is in the Entry widget.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":200,"Q_Id":65775759,"Users Score":0,"Answer":"Your widget should do it, not the database.\nWhat would be triggering the database writing anyway? would it be some \"save\" button in the window? Or should it be immediately done after the node of the tree was renamed (probably, user stroke ENTER key after keying in new name, but different tree wdgets can have different user interactions methods).\nSo, the latter option would be like this:\nWhen user starts renaming the node, when it enters the tree node editing mode, you tree widget notifies you about it, and then you read the value (before user changed it) and save it into variable. Then you wait for the user to stop editing the node.\nWhen the tree widget informs you that user completed the editing, you check what kind of completion it was. If it was CANCEL-like completion, then you do nothing.\nIf it was OK-like completion, then read the now changed name of the node to another variable.\nYou compare the two variables and if the values are different, you command database to UPDATE the row corresponding to the edited node and then to COMMIT the transaciton.\nAs @MehdiKhlifi said earlier, you would have to have ID column in your table (read about SQL sequence, in Firebird\/Interbase this was created as generator before SQL standardized it, it is the same thing). You would have to somehow store those IDs into the tree nodes (read your widget documentation how to do it), so you would know which table row corresponds to just edited node.\n\nAlternatively, you may consider the whole window as data frame, not one node.\nThen you would have to make two functions:\n\nreading the tree from some buffer (array, hashmap\/dictionary, object or something)\ncreating new empty buffer and writing the tree to it\n\nWhen form is opened you create one buffer and read it from the database, then toy read the tree from the buffer.\nWhen user preses SAVE button, you write the tree into the new buffer, then you compare those two buffers, and then for every changed item you do the SQL update like described above, then you do the SQL commit for all he updated rows.\n\nNotice that usually user can do more than renaming specific nodes: often user can add new tree nodes, delete nodes, or move nodes to different branch (prune-and-paste).","Q_Score":0,"Tags":"python,sql,firebird","A_Id":65798540,"CreationDate":"2021-01-18T13:48:00.000","Title":"Update database based on user input","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have Android application made in java and I need to call Python script and put there some parameters to its function. When I make apk. of this androdid app. how can I make Android device execute python script in it ?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":34,"Q_Id":65789961,"Users Score":0,"Answer":"You can make a server out of python as backend with flask or django, and then call the server whenever your app needs to run the python script.","Q_Score":1,"Tags":"java,python","A_Id":65792459,"CreationDate":"2021-01-19T10:47:00.000","Title":"Run python script in Android aplication","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I want to subclass QtCore.QSortFilterProxyModel, and I found that it has two class methods that are very similar in function.\nrowCount() and hasChildren()\nI can use rowCount()==0 to determine whether there are children. Why do I need a separate class method hasChildren()?\nHow are their roles different? Is hasChildren() necessary?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":50,"Q_Id":65796722,"Users Score":2,"Answer":"rowCount() is not similar to hasChildren() since the first indicates the number of rows and the second if there are children. As you pointed out just when you compare rowCount with zero it might seem that they are equivalent. For example, in the case that the model does not have columns(columnCount() == 0) but has rows (rowCount() > 0), then will it have children? Well no, that's why in various models the QModelIndex is verified to be valid and that the number of columns or rows is greater than zero.\nSo if you want to verify that a QModelIndex has children it is better to use hasChildren() as well as it is more readable.","Q_Score":0,"Tags":"python,qt,pyqt5,qt5,pyside2","A_Id":65796825,"CreationDate":"2021-01-19T17:43:00.000","Title":"What is the difference between rowCount() and hasChildren()?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to use a Tkinter scale to set the magnitude of an input. Therefore I want the ticks of the scale to be 1, 10, 100, 1000 etc.\nMy initial thoughts are that I will have the scale\nmagnitudescale = Scale(window1, from_ = 0, to = 3)\nWhen the scale is moved there would be some function that takes the scale position and alters the value by 10^x\nIs there a clean way to do this?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":94,"Q_Id":65813540,"Users Score":0,"Answer":"magnitudescale = Scale(window1, from_ = 0, to = 3)\nI found that there are some clever ways to do this but none that do exactly what the question asks. The way that I ended up implementing this is to have the scale position command a function that takes the position of the scale and calculates 10^(X)\nthis code looks like this\n10**(magnitudescale.get())\nUsing this calculation we can change the text in a label placed above the scale so that the slider position corresponds with the values \"1, 10, 100, 1000, etc.\"","Q_Score":0,"Tags":"python,tkinter,tkinter-scale","A_Id":66156051,"CreationDate":"2021-01-20T16:26:00.000","Title":"Is it possible to set Tkinter tickinterval as a magnitude?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have tried to retrieve text in a rectangle. This rectangle is retrieved from\nPage.getLinks(). when I try to get the text in the rectangle using getTextbox() and getText(\u201ctext\u201d, clip=rect). Both methods return Empty string","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":152,"Q_Id":65815905,"Users Score":1,"Answer":"Try expanding your rectangle's coordinates slightly. The default get_textbox parameter excludes anything intercepting the bounds of the rectangle.\nI was having the exact same issue and this solved it.","Q_Score":0,"Tags":"python,pdf,pymupdf","A_Id":70807995,"CreationDate":"2021-01-20T18:59:00.000","Title":"Pymupdf getTextbox returns empty","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I want to make a desktop app obiously im a begginer so\nif i built a gui in mac using python and tkinter that program will work on windows?\nAlso is tkinter the best framework?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":406,"Q_Id":65856854,"Users Score":1,"Answer":"Yes, but tkinter applications will look different on different platforms. This means that you may get different buttons on Windows 7 vs MacOS X -- Tkinter is just using whatever the OS gives it.\nAs for it being the best framework, I couldn't say if it is the best or not, but it is pretty simple and works well. I normally use tkinter.","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":65856917,"CreationDate":"2021-01-23T07:35:00.000","Title":"Python tkinter Mac and windows","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I made an app using python and kvlang, and I was trying to get all the files into a one standalone \"exe\" file. I needed to include the \".kv\" file and my main script. I was using pyinstaller and wrote this command:\npyinstaller --onefile -w --icon=download.ico --add-data filefinder.kv;. filefinder.py\nAnd it all went well - no errors or anything but when I launch the app I just get a quick flash of a white window and then it closes. I have determined that the error must be because of some issue with the \".kv\" file but I am not able to fix it cause there's no errors, Nothing! I checked and the app works with the \"onedir\" option but I need to make it smaller in size. I also tried the \"auto-py-to-exe\" but it gives the same result. I am happy to provide any more info should you need it to help me resolve this issue. Cheers!\nAdditional info:\nSystem: Windows 10 pro\nPython: 3.9.1\nkivy: 2.0.0\nPyinstaller: 4.2","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1358,"Q_Id":65874054,"Users Score":2,"Answer":"Not sure why it doesn't work, but run the exe in command prompt and then when it fails the error message will not disappear.\nAdd lots of logs to your application, these can be print statements, as those will always end up on stdout.\ni.e. on the first entrypoint, print(\"Running main\")\nWhen you call your first function:\nprint('calling function_name()')\nOnce that has finished\nprint('function_name() complete')\nAnd so on and so forth until you find where exactly the program stops functioning.\nStart -> cmd -> navigate to your file using cd -> type in the name of the exe to run it.","Q_Score":1,"Tags":"python,pyinstaller,kivy-language","A_Id":65874085,"CreationDate":"2021-01-24T17:53:00.000","Title":"Python app not working after using pyinstaller but doesn't give any errors","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to update the color of a GLMeshItem in a 3d pyqtgraph plot with some success. Using the setColor() member of the GLMeshItem class, I can set the color initially, and sometimes, the face color of the mesh will update, but not always.\nI've had this working in the past, so I know it is possible to do, but can't seem to figure it out this time. According to the documentation, setColor() will Set the default color to use when no vertex or face colors are specified. I'm a bit confused as to whether this means I can dynamically change colors, or only set the color initially.\nFor context, I have a 3d plot with a mesh in it. I read date from a file, then want to set the color of the mesh based on that data. I can post more code if needed, but my program is several hundred lines long and would be tricky to extract the necessary bits to make to problem reproducible. If it would help I can definitely do that however. For now here is the line I am using to set the color:\n_mesh_model is a GLMeshItem.\nColor is a tuple of the form (R, G, B, Alpha)\nself._mesh_model.setColor(color)","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":127,"Q_Id":65875040,"Users Score":0,"Answer":"Ok after some searching I figured it out.\nInstead of self._mesh_model.setColor(color), where color is a tuple in the form RGBA, I used this: QtGui.QColor(R, G, B) where R, G and B are values between 0 and 255.\nNow the mesh color updates as expected.","Q_Score":0,"Tags":"python,pyqtgraph","A_Id":65877351,"CreationDate":"2021-01-24T19:35:00.000","Title":"Updating the color of a GLMeshItem","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a uint8 image and a mask of it (float32).\nThe mask has ones where the object I want to keep is, and zeros for the background.\nI want to make a new image that shows the real colored object instead of the ones, and keep the background zeros.\nI tried to multiply both images but it says that the mask has 3 dimensions and the colored image 4 dimensions.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":59,"Q_Id":65875845,"Users Score":0,"Answer":"You seem to have an RGBA image, which may be converted to 3-channel rgb\/bgr via cv2.cvtColor() function. Also i believe that it would be more clear to do masking with cv2.bitwise_and().","Q_Score":0,"Tags":"python-3.x,opencv,image-processing","A_Id":65877748,"CreationDate":"2021-01-24T20:53:00.000","Title":"How can I take out an object from an image to remove the background?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i am trying to program a simple script and i would like to know if anyone has the answer to this question\nwhen i have a module for example WMI from 'pip install wmi' in the form as 'import wmi' in my code, how do i get the pyinstaller module to compile the wmi module with the exe file\ni have tried importing from the source code in a folder example 'from wmi import wmi' but i got no luck when launching the exe file only in the raw python file, also just to note when i compile the script i do the command 'pyinstaller vb.py --onefile'","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":75,"Q_Id":65878909,"Users Score":0,"Answer":"remove --onefile since wmi couns as a file (or multiple if its a package)","Q_Score":0,"Tags":"python,module,pyinstaller,exe","A_Id":65879149,"CreationDate":"2021-01-25T04:16:00.000","Title":"need help using pyinstaller","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been working with kivymd for awhile and I wanna create a screen in which it's contents will change depending on content that is clicked for example let's say I have a home screen with products and when each product is clicked another screen will open with the image and details of that specific product and that should be possible for each other product","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":88,"Q_Id":65898199,"Users Score":0,"Answer":"You can use 2 screens for this.\n\nMainScreen to show all the products\nProductscreen to show details of the product.\n\nYou can add the contents on the screen according to the product being clicked. This way, you do not need to create a separate screen for each product.\nNote: Since the contents on the productscreen will be added at runtime, you will need to write it in .py file and not .kv file.","Q_Score":0,"Tags":"python,dynamic,kivy,kivymd","A_Id":65913437,"CreationDate":"2021-01-26T08:43:00.000","Title":"Dynamic screens in kivymd","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"now. when i run it. the error conmes\nImportError: dlopen(\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so, 2): no suitable image found. Did find:\n\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so: mach-o, but wrong architecture\n\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so: mach-o, but wrong architecture","AnswerCount":8,"Available Count":2,"Score":0.0748596907,"is_accepted":false,"ViewCount":12971,"Q_Id":65901162,"Users Score":3,"Answer":"Try installing the pyqt under the ARM architecture as below\narch -arm64 brew install pyqt","Q_Score":15,"Tags":"python,macos,pyqt5,apple-silicon,apple-m1","A_Id":67355598,"CreationDate":"2021-01-26T12:12:00.000","Title":"How can i run pyqt5 on my mac with M1chip","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"now. when i run it. the error conmes\nImportError: dlopen(\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so, 2): no suitable image found. Did find:\n\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so: mach-o, but wrong architecture\n\/Users\/v\/Library\/Python\/3.8\/lib\/python\/site-packages\/PyQt5\/QtWidgets.abi3.so: mach-o, but wrong architecture","AnswerCount":8,"Available Count":2,"Score":0.024994793,"is_accepted":false,"ViewCount":12971,"Q_Id":65901162,"Users Score":1,"Answer":"In my case it's\u00a0work: arch -x86_64 brew install pyqt\nAnd all required pyqt start from arch -x86_64 or start from rosetta (through emulator).","Q_Score":15,"Tags":"python,macos,pyqt5,apple-silicon,apple-m1","A_Id":69896096,"CreationDate":"2021-01-26T12:12:00.000","Title":"How can i run pyqt5 on my mac with M1chip","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a pretty basic Heroku app made in Python with Jupyter and Voila. The app consists of a few ipywidgets that need to be filled in order to run a piece of code, which then goes to show a graph.\nThe app is working just fine for me, but is not working for a colleague of mine. The app does load for him, but the widgets (circled in red in the picture below) are not showing. He only sees the texts.\nAny idea what might cause this? Since the app is working fine for me, I was thinking there isn't something wrong with the app, but maybe it's something on his machine. But it's not working on both his computer and phone though...\nEDIT: Solved","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":161,"Q_Id":65923200,"Users Score":1,"Answer":"Disabling adblocker did the trick!","Q_Score":1,"Tags":"python,heroku,ipywidgets,voila","A_Id":65924762,"CreationDate":"2021-01-27T16:23:00.000","Title":"Ipywidgets not showing in Voila app deployed with Heroku for some (not all) users","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"For my frameless qml app i made close, minimise and maximize icons in ms paint (28\u00d728 pixel art) and then added transparent background with photoshop.\nI put them as icons on qml buttons.\nBut they are looking blurry.\nI tried disabling antialiasing, mipmaps, smoothing but still blurry.\nAny help ?\nI want them to look pixely like minecraft text.\nEdit : I appears that qml uses linear scaling for images.\nBut for pixely look i need \"nearest neighbour\" scaling.\nHow can i use nearest neighbour in qml ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":403,"Q_Id":65964638,"Users Score":0,"Answer":"NVM Solved It !\nIt turns out that for nearest neighbour upscaling, you need to set smooth: false (and for downscaling you need mipmaps as well) + remove sourceWidth & sourceHeight from your qml code. (Sometimes qt-creator turns it on by itself and this option is basically compresssing image resolution)\nBut in my case the Problem was that MS Paint in Windows 10 doesn't use solid colours. It uses solid colours in middle and increases transparency towards edges of strokes.\nAnd that creates the blurry effect when viewed on small icon.\nSimple Solution : Install Windows 7 and use its MS Paint. Or just use some other program.","Q_Score":0,"Tags":"python,qml,qt-creator,pyside2,blurry","A_Id":65977408,"CreationDate":"2021-01-30T04:29:00.000","Title":"QML icons and images looking Blurry","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a release apk using buildozer android release command. Then I sign and zipalign my apk using following commands.\ngenarate keystore file [before] - keytool -genkey -v -keystore myapp.keystore -alias myalias -keyalg RSA -keysize 2048 -validity 10000\ngenerate keystore file [after] - keytool -importkeystore -srckeystore myapp.keystore -destkeystore myapp.keystore -deststoretype pkcs12\nsign apk - jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myapp.keystore myapp-0.1-arm64-v8a-release-unsigned.apk myalias\nzipalign apk - zipalign -v 4 myapp-0.1-arm64-v8a-release-unsigned.apk playstore-release.apk\nAfter everything done play store gives this error - You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: ERROR: MIN_SIG_SCHEME_FOR_TARGET_SDK_NOT_MET: Target SDK version 30 requires a minimum of signature scheme v2; the APK is not signed with this or a later signature scheme\ntarget max api 30 and min api 21, sdk 30 used\nHow i upload my apk to playstore in 2021","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":187,"Q_Id":65988193,"Users Score":0,"Answer":"First, your project must be able to run on an android with .apk on debug and unsigned mode.\nIf it's the case you can read theses 2 steps.\nFirst you must signed your application to be sure that you are the only one that can update it (prevent from malicious algo insertion).\nChange this in your buildozer.spec file:\n#App store ask us to have this architecture and the latest api available (actually 29)\nandroid.arch = arm64-v8a\nandroid.api = 29\n#Each time you update your apk on the app store, you have to incremente this variable by 1. It's 8211 by default BUT BE AWARE, you have to change it from the start (I begin with 1):\nandroid.numeric_version = 1\n\nNow that your key is signed, go on the terminal and:\n---- FULFILL FOLLOWING VARIABLES ----\nproject_path=~\/MY\/PATH\nkey_filename=mykeyfilename\nkey_alias=mykeyaliasname\npassword=\"turlututu\"\n---- TO DO ONLY ONE TIME ----\nmkdir -p ~\/keystores\/\nkeytool -genkey -v -keystore ~\/keystores\/$key_filename.keystore -alias $key_alias -keyalg RSA -keysize 2048 -validity 10000\n---- a warning is printed and advice us to migrate to PKCS12 so we do it ----\nkeytool -importkeystore -srckeystore ~\/keystores\/$key_filename.keystore -destkeystore ~\/keystores\/$key_filename.keystore -deststoretype pkcs12\n---- ENDING OF THE PART TO DO ONLY ONE TIME ----\nexport P4A_RELEASE_KEYSTORE=~\/keystores\/$key_filename.keystore\nexport P4A_RELEASE_KEYSTORE_PASSWD=$password\nexport P4A_RELEASE_KEYALIAS_PASSWD=$password\nexport P4A_RELEASE_KEYALIAS=$key_alias\ncd $project_path\nbuildozer -v android release","Q_Score":0,"Tags":"python,android,kivy,kivymd","A_Id":65994765,"CreationDate":"2021-02-01T06:42:00.000","Title":"Error while signing an kivy app for the play store","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to make an app with kivy and kivymd but I can't figure out how I can make the setup screen show up only the first time. This is how the application is going to work: User launches the application after installation and is being shown the sign up\/log in screen, And once the user is done with the setup, the setup screens will never appear again unless the user reinstalls the application.\nHow can I make this happen?\nPlease help and thanks SO much in advance!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":63,"Q_Id":66005886,"Users Score":1,"Answer":"I fixed this problem by creating and reading a \"text\" file.My \"text\" file has '0' as a boolean variable .Once the user is done with signing up \/ logging in , I change that \"text\" file to '1' ,and in the __init__ func, I check if that file equals to '0' or '1'.\nI'm not sure if this is the correct way or not,but this worked for me.","Q_Score":0,"Tags":"python,kivy,kivy-language,python-3.8,kivymd","A_Id":66173541,"CreationDate":"2021-02-02T08:16:00.000","Title":"Showing the setup screen only on first launch in kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am experimenting building app with buildozer, and yesterday, I built my app to apk, and it installed well.\nBut today, I built same app except, I deleted Window.size in main.py code. And I installed app but then it says app not installed. Just that. Without any warning or error.\nUnless I typed some characters by mistake in buildozer.spec file, my spec file was same, too.\nWhy this happens? And this is about window size?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":267,"Q_Id":66007123,"Users Score":0,"Answer":"I solved this after some testing.\nI disabled Play Protect in Play store, and deleted previous version of app. Then it installed correctly.","Q_Score":0,"Tags":"python,kivy,python-3.8,buildozer,kivymd","A_Id":66008556,"CreationDate":"2021-02-02T09:43:00.000","Title":"Why my same kivymd app says app is not installed?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Let's imagine, I have a simple tkinter program: only tkinter.Entry(), where I can write down some text. The main goal I have set to this tkinter.Entry() is to make next: when I try to input there some symbol, it is immediately deleted from tkinter.Entry(). So the question is how to make tkinter.Entry() delete every symbol, when it have been just input there?\nI hope the problem is fully described. Thanks in advance for your help.\n\nI apologize, but it seems to me that this question has lost its former relevance for me. Sorry for letting you take all of your precious time. I took all the answers and tips into account. I will delete the question soon. Thank you for your attention to me","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":45,"Q_Id":66033049,"Users Score":1,"Answer":"From what I deduced, you're trying to delete the content from the entry widget.\ntkinter.Entry.delete('0',END)\nThis should do it.","Q_Score":0,"Tags":"python-3.x,tkinter,tkinter-entry","A_Id":66033184,"CreationDate":"2021-02-03T17:56:00.000","Title":"How to immediately delete just input symbol in tkinter.Entry()","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Tkinter app which I have converted to .app and .exe, but after giving this app to others if I have to update the app how should I do it(like in play store update)? And also if I package this app and distribute with an installer then how to send update to the app?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":44,"Q_Id":66033193,"Users Score":2,"Answer":"I don't think that it's possible to update the app like that. Android apps usually are made with Java, and iOS apps are made with Xcode, Swift, and Objective-C. I don't usually make apps with Python, unless they are for myself, because once they are made into apps, they cannot be updated (as far as I know). If I wanted to update my Python app, I would remove the first app, then use Pyinstaller to make the updated app.\nHope this helps, and have a good day. :)","Q_Score":1,"Tags":"python,python-3.x,windows,macos,tkinter","A_Id":66034171,"CreationDate":"2021-02-03T18:05:00.000","Title":"how can i create a tkinter app updater which is included with the app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I searched too much but can't find any salution over the internet.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":536,"Q_Id":66042048,"Users Score":2,"Answer":"label=QLabel(\"hello\",self)\nlabel.setStyleSheet(\"QLabel{font-size:50px;font-family:'Orbitron'}\")\n\nOR\n\nfrom PyQt5.QtGui import QFontDatabase label=QLabel(\"hello\",self)\nQFontDatabase.addApplicationFont('file_name.otf or .ttf')\nlabel.setStyleSheet(\"QLabel{font-size:50px;font-family:'Orbitron'}\")","Q_Score":1,"Tags":"python,python-3.x,user-interface,pyqt,pyqt5","A_Id":66042094,"CreationDate":"2021-02-04T08:41:00.000","Title":"How to import font family in pyqt5?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Our application process a large audio file into number of smaller segemnts and displays it on a table in the GUI. The user can listen, label and comment on each segment in the table. So is there a way to save the progress that can be resumed from where the user left off with the last accessed row in the table?\nFor example in the table has 700 rows and the user has worked with 100 and closes the application, the next time they open the application they must be able to start working with the 101st row and the previous work must be saved.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":118,"Q_Id":66059335,"Users Score":0,"Answer":"pickle (import pickle) allows you to write\/read python objects and therefore save a progress status from one session to another.","Q_Score":0,"Tags":"python-3.x,user-interface,pyqt5,progress-bar,desktop-application","A_Id":66060530,"CreationDate":"2021-02-05T07:38:00.000","Title":"Is there a way to save progress in a desktop application developed in python and pyqt5?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have built a snake game using Turtle graphics module of Python, and now I wish to convert it into an apk.\nI have tried kivy. It builds the apk, but the app crashes as soon as I open it in android. When using adb logact -s python, it says that the tkinter module is not available.\nOn further researching, I got to know that turtle graphics is based upon tkinter module and tkinter is not supported by python-for-android. The solutions suggest to rewrite my code in Kivy, but I don't know how to do so.\nAny suggestions on how can I run my turtle graphics game on android?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":277,"Q_Id":66080212,"Users Score":0,"Answer":"The solutions suggest to rewrite my code in Kivy, but I don't know how to do so.\n\n\nAny suggestions on how can I run my turtle graphics game on android?\n\nIt looks like you've already found the solution: rewrite your graphics in Kivy, or another python module that works on android. Recent pygame releases might.\nIf you don't know how to do so, you need to learn. If you try to do so but have problems with any specific question, that would be a better target for a stackoverflow question.","Q_Score":0,"Tags":"android,python-3.x,kivy,python-turtle,python-for-android","A_Id":66081362,"CreationDate":"2021-02-06T18:05:00.000","Title":"Turtle Graphics APK","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I\u2019m trying to make a bot to play a video game for me, but neither pyautogui or directinput can make the character move in another direction. What is going on? Is there any alternative?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":167,"Q_Id":66153533,"Users Score":0,"Answer":"Try running the python script as an administrator.","Q_Score":0,"Tags":"python,pyautogui,directinput","A_Id":66158637,"CreationDate":"2021-02-11T11:06:00.000","Title":"Why doesn\u2019t pyautogui and directinput work in video game?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python gui project which having a database. i want to convert my project into .exe\nHow the end user will get database or how can convert my entire project along with database(mysql).\nMy requirement is end user want to have all the things along with db in a single .exe file.\nNote: application is for windows and database will be located locally.\nThanks in advance for your response.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":155,"Q_Id":66203343,"Users Score":0,"Answer":"Use py2exe or pyinstaller.\n\n$ pip install pyinstaller\n\n\n$ pip install py2exe","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":67026187,"CreationDate":"2021-02-15T05:57:00.000","Title":"How to convert my Python Project (GUI With Tkinter) into .exe where it having database dependence?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to send DirectInput keys to an inactive window without interfering with my actual mouse. I tried using PostMessage, SendInput and SendMessage but pywin32 uses virtual keycodes while ctypes does work with DirectInput. I have no idea how I can make it send in an inactive window.","AnswerCount":1,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":552,"Q_Id":66222584,"Users Score":-1,"Answer":"Try using this, it manages to work for me send the keystrokes to the inactive window,\nUse (but add error checking) hwndMain = win32gui.FindWindow(\"notepad\", \"\u200bprueba.txt: log keys\") hwndEdit = win32gui.FindWindowEx","Q_Score":3,"Tags":"python,ctypes,pywin32","A_Id":66222675,"CreationDate":"2021-02-16T10:24:00.000","Title":"How to send DirectInput keys to an inactive window in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a beginner in python and I am trying to make a program using PyQt5 that detects mouse click events that are outside of the program window. I was unable to find anything online, is there any way of do this?\nThanks in advance!","AnswerCount":1,"Available Count":1,"Score":-0.3799489623,"is_accepted":false,"ViewCount":87,"Q_Id":66230647,"Users Score":-2,"Answer":"Easy: Make your program fullscreen.","Q_Score":0,"Tags":"python,pyqt5,mouseevent,mouse","A_Id":66230667,"CreationDate":"2021-02-16T19:06:00.000","Title":"PyQt5 - Detecting mouse clicks outside of window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Python has a class named \"pyautogui\" to perform some task automatically on system interfere(Control mouse and keyboard strokes by method of that class). Is there any similar class available in C++ and Java? Help me out dudes by writing down names of this class. Thanks in advance, \u2764.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":360,"Q_Id":66272066,"Users Score":2,"Answer":"Your question: Is there any similar class available in Java?\nAnswer: Yes.\nMore info: Read the java documentation of java.awt.Robot","Q_Score":0,"Tags":"java,c++,python-3.x,pyautogui","A_Id":66272171,"CreationDate":"2021-02-19T05:06:00.000","Title":"Is there any similar class available in C++ and Java as \"pyautogui\"?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have C++ app where it does many calculations, but the most of time it needs to execute simple scripts by PyRun_SimpleString() so I'm curious if is there something in Python\/C API, what would do faster following tasks:\n\ndo simple assignents like x = 0.1 (changing over time)?\nexecute script storaged in string (maybe something like compile once to run faster)?\n\nFor now I do all these tasks by executing PyRun_SimpleString(). In loop performance loss is significatn.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":83,"Q_Id":66332450,"Users Score":1,"Answer":"As you suspect, there's indeed two parts to running Python code: interpretation and execution. See Py_CompileString and PyEval_EvalCode. But for simple statements like x=0.1, you might even consider modifying locals yourself via PyLong_FromDouble(0.1)","Q_Score":0,"Tags":"c++,optimization,python-c-api","A_Id":66333553,"CreationDate":"2021-02-23T11:41:00.000","Title":"Is PyRun_SimpleString() function slow?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am looking for a solution to find the index(number) of the chousen OptionMenu option.\nPython 3.8\nValues can be the same.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":115,"Q_Id":66354502,"Users Score":0,"Answer":"I just threw tk.OptionMenu, using ttk.Combobox instead","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":66355531,"CreationDate":"2021-02-24T16:05:00.000","Title":"How to find index of Python tkinter's OptionMenu index?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to install PyQt5 on my Windows 10 python 3.7. I tried several things suggested by different users like:\n\nInstall using pip install on cmd.\npip not found error is showing.\n\nInstall PyQt5 from downloaded files.\nNot happening\n\nPip3 not working\n\nEven my cmd is not recognizing that my pc has a python program on it.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":189,"Q_Id":66385399,"Users Score":0,"Answer":"I suggest trying a few things, and then testing if you can use pip to install pyqt.\n\nTry using pip3 instead of pip or vice versa\nTry uninstalling and reinstalling python, making sure that you tick the box to add python to path\nRestart your computer\n\nIf this doesn't work, then I don't know what else to do.","Q_Score":0,"Tags":"python,windows,installation,pyqt5,spyder","A_Id":66386333,"CreationDate":"2021-02-26T11:54:00.000","Title":"How to install Pyqt5 on windows python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"If I were to use the Requests library in a python kivy app and compile the app for android and iOS, would it still be able to perform its requests, or will it just crash because it's on the wrong operating system or something?\nIf it would crash, how could I solve this problem or go about finding a solution?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":38,"Q_Id":66415044,"Users Score":0,"Answer":"Well, any python library that you use in kivy will work on both android and ios or any other platform (windows & mac). As all the python library are compiled and handled by kivy so you need not worry about the platform for that. If you are using any platform-specific thing then that might not work on other platforms, but python libraries like requests work fine on any platform you use.","Q_Score":0,"Tags":"python,android,ios,python-requests,kivy","A_Id":66422121,"CreationDate":"2021-02-28T23:49:00.000","Title":"Compiling the Requests library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I am trying to build a login dialog for my application using qt\/python.\nI got confused by QT's view\/model architecture. QT provides models and view for tables, lists etc., but how do I go about implementing a login dialog using this architecture?\nI use a ui file that I created with QtDesigner.\nShould I create a user model that interfaces with the DB and retrieves user data, handling the login process, and return this result to the view? (view and controller combined, as per QT's terminology)\nI would like to use the same architecture throughout the application, but I got confused with this one. Do I even need a model for this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":24,"Q_Id":66425819,"Users Score":0,"Answer":"Models are for binding data to view. You can create list model with user\/password fields and use QWidgetMapper to bind it to two QLineEdits but there's no much use in it since there's no much data and no complicated interactions.","Q_Score":0,"Tags":"python,pyqt","A_Id":66425984,"CreationDate":"2021-03-01T16:23:00.000","Title":"QT View\/Model Login dialog","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So im trying to simply just trying to make a directory with kivy and i simply cant get it to work. I a useing the os.mkdir() function.\nI have tried to just simply os.mkdir(\"a\"), but i couldnt find any directory named a (after doing a full phone search, with the phone plugged in to my pc).\nI have alos tried os.getcwd() as in os.mkdir(os.getcwd()+\"a\"), but to no avail.\nTo put it simply i am lost, can't find anything about it online either... So if you know how i would greatly appreciate to be enlightend on the subject, thx in advance.\nAnd i am importing os, also tried to run os.mkdir before importing kivy.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":354,"Q_Id":66429880,"Users Score":0,"Answer":"I have tried to just simply io.mkdir(\"a\")\n\nThere is no io.mkdir - do you mean os.mkdir?\nThe directory will be created inside the current directory of the script, which is a folder inside the app's private directory as defined by Android.\nThat means you should see your new directory in e.g. os.listdir(\".\").","Q_Score":0,"Tags":"python,android,kivy,buildozer","A_Id":66430097,"CreationDate":"2021-03-01T21:24:00.000","Title":"How would one go about making a directory (mkdir) in python with kivy on android(buildozer)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was on my computer and I was trying to code some tkinter code but when I put the starters in Pycharm, there was an error saying that Tkinter is not a module and then I tested it as tkinter and it was also not found. Can someone please help me get this sorted out as I really want to do some coding and this is slowing it down.\nThanks!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1523,"Q_Id":66441291,"Users Score":3,"Answer":"Is it installed on your OS? You can try sudo apt install python3-tk or sudo apt install python-tk.\nYou could also try installing it via pip: pip install python-tk","Q_Score":1,"Tags":"python,ubuntu,tkinter,pycharm,ubuntu-20.04","A_Id":66441620,"CreationDate":"2021-03-02T14:27:00.000","Title":"Tkinter is not a module in Ubuntu 20.04","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i need to halign text in kivymd button to the left and i found solutions for default kivy like text_size: self.size and halign='left', is button still a label in kivymd like in kivy? If no then how do you align text inside it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":213,"Q_Id":66447022,"Users Score":0,"Answer":"Try the following:\ntext_align:'center'","Q_Score":0,"Tags":"python,kivy,kivymd","A_Id":67648878,"CreationDate":"2021-03-02T20:56:00.000","Title":"how do i align text in kivymd button?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to plot the surface : W = (X*sin(Y)+Z)^2\nIs there a way to do it in Python?\nIn general tests I did on Google I did not find anything relevant.\nI would appreciate your help.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":128,"Q_Id":66491189,"Users Score":0,"Answer":"It depends on what you want to see. If you want to see samples of the function, you could go for a parallel coordinates plot. You could also fix x,y or z, so you get a 3-dimensional surface. You definitely need some interaction or constraint to plot this function, since it has 3 degrees-of-freedom.","Q_Score":0,"Tags":"python","A_Id":66491373,"CreationDate":"2021-03-05T10:50:00.000","Title":"How to plot 4-dimensional surface in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a 2d game in pygame, and I want it to be available on the web. In my head, a fun way to challenge myself is to use web assembly to make the game available on the web. So I'm wondering if there is any way to take executable binary (.exe) and somehow \"compile\" .wasm if that's still sayable at this point) to","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":732,"Q_Id":66511854,"Users Score":2,"Answer":"Running a .exe via WebAssembly (WASM) in the browser will be extremely slow and inefficient but is still possible with a Wasm PC emulator ( eg v86 ) + an OS ( eg ReactOS ).\nBut if you can gain access to game sourcecode then\nwhat you could do is using CPython 3.11 which supports WebAssembly target ( with the help of Emscripten a C\/C++ compiler targeting WASM ).\nAdd to that the latest development version of PyGame and minor changes to the game main loop source code.\nYou can now run directly the game if you pack both sourcecode and assets with the emscripten File Packager instead of a .exe you will have a .wasm (cpython) + one .data (assets+code) and some javascript glue to load them.\nPlease note that currently there is no straightforward tool to do that at once, but situation will most likely evolve very quickly after release of CPython 3.11.","Q_Score":1,"Tags":"python,google-chrome,web,pygame,webassembly","A_Id":71694919,"CreationDate":"2021-03-06T23:50:00.000","Title":"Is there any way to take executable binary (.exe) and somehow \"compile\" .wasm","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a plan for a mobile app which is in the very early stages of development. Background: The mobile app will be available on Apple and Android. It will allow the user to log in and see which local taxi companies will arrive the quickest, payment will be made through the app, a map will show the drivers location, in a nutshell.\nNow the tech part, i am currently studying Python, still consider myself a junior. Could anyone advise if Kivy with Python would be able to handle these kind of functionalities that the app will need?\nFurther more could anyone shine some light on what kind of back end technology and functionalities I will need to incorporate also.\nI have never created a Mobile app before so any advice or direction would be greatly appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":29,"Q_Id":66522422,"Users Score":0,"Answer":"You can technically achieve this with Kivy, but you'd be touching lots of features that are not well supported with existing helper modules - that includes payment processing, map display, to some extent login functionality (although this doesn't need anything special, it just adds to the pile).\nIf you aren't very experienced, I think you'll probably find it easier to use a more widely used framework with more examples.","Q_Score":0,"Tags":"python,mobile,kivy","A_Id":66522585,"CreationDate":"2021-03-07T23:04:00.000","Title":"Building Apps with Kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to use a scroll bar in a pyqt5 gui. I need it to increment by 0.01 (Total length should be around 390) for a single click on the arrow but it seems like the setSingleStep only takes integers. Is there a way to make a single step 0.01?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":63,"Q_Id":66541282,"Users Score":2,"Answer":"I think you must convert to integers these values 390x100 and 0.01x100 setRange(0,39000) and setSingleStep(1) and done :)","Q_Score":1,"Tags":"python,pyqt5,scrollbar,increment","A_Id":66543009,"CreationDate":"2021-03-09T05:27:00.000","Title":"Is there a way to set a float for the single step of a pyqt5 scrollbar?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to run the tkinter mainloop in the background because I\u00b4m following the MVC Pattern, so the Controller gets a Interfaceobject to handle all cares. So I tried to thread it. RuntimeError: Calling Tcl from different apartment occures. Saw no further answers on this topic.\nDoes anyone have a clue what to do?\nThanks, Max","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":290,"Q_Id":66550695,"Users Score":0,"Answer":"thanks @Tom\u00e1s Gomez Pizarro for one solution. I myself came up with a solution. My Controller etc are set up with a reference(Object) to my Gui. the Gui itself, so the mainloop function is not called until everything is ready. So in Runtime every GuiEvent is passed to the Controller via a thread so that the main loop is not interferred with.\nRegards, Max","Q_Score":0,"Tags":"python,tkinter,model-view-controller","A_Id":66581298,"CreationDate":"2021-03-09T16:17:00.000","Title":"Tkinter mainloop in background","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"My project deals with sharing screen of one computer on another, similar to TeamViewer.\nI use Python with Pygame to show the screen share, as my GUI.\nOne of my features is dragging a file\/directory on the screen share to send this file or the directory to the other computer. It's easier to be done as Pygame has the abillity to detect a DROP event and to get the dropped item's path.\nWhen I try to run this project on my computers, it works well. But when I'm trying to run it on the lab, as I'm trying to drop the file or directory on Pygame's screen, the cursor turns into a \"block\" sign and eventually what I dropped onto the screen is not detected, which also means that the DROP event is not triggered.\nI assume that the operation system could be the reason for this. Maybe a setting on the computers that causes a rejection of the \"drag and drop\". I use windows 10 on both computers. What should I do?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":77,"Q_Id":66595395,"Users Score":0,"Answer":"I tried to uninstall the old version I had of Pygame (1.9.6) and then to reinstall it to the most recent version (2.0.1 as of today). Now the Drag and Drop eventually works perfectly. I've come to a conclusion that this problem occured because of the old version of Pygame that actually didn't allow me to use this feature. Now it's fixed.","Q_Score":2,"Tags":"python,python-3.x,drag-and-drop,screensharing","A_Id":67810816,"CreationDate":"2021-03-12T06:43:00.000","Title":"Problem with dragging files on Pygame screen","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do I download QtDesigner for PyQt6? If there's no QtDesigner for PyQt6, I can also use QtDesigner of PyQt5, but how do I convert this .ui file to .py file which uses PyQt6 library instead of PyQt5?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":3695,"Q_Id":66613380,"Users Score":2,"Answer":"You can install QtCreator or use command line pyuic6 -o main.py main.ui","Q_Score":0,"Tags":"python,pyqt5,qt-designer,pyqt6","A_Id":66614227,"CreationDate":"2021-03-13T12:13:00.000","Title":"Downloading QtDesigner for PyQt6 and converting .ui file to .py file with pyuic6","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm looking to keep my mouse events in sync with my objects after resizing the screen.\nI'm told I need to create a data structure to keep track of:\n\nResizing events\n\nNew coordinates to match the resize\n\n\nHow can I accomplish this using simple algebraic equations and integrate it into a resize event for accurate updating?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":64,"Q_Id":66645103,"Users Score":1,"Answer":"Do it the other way around create a virtual game map, scale to the size of the window when drawing the scene and scale to the size of the virtual map when receiving an event.","Q_Score":2,"Tags":"python,python-3.x,pygame,pygame-surface,pygame2","A_Id":67031573,"CreationDate":"2021-03-15T20:19:00.000","Title":"In pygame how can i create a data struct that keeps track of resizing events and the coordinates of objects?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a Python Turtle Snake Program, and I want to make my Turtle longer.\nBy that, I mean that I increase the 1 Cube to 2 Cubes, then 3, etcetera, for my Snake Game.\nCan you please inform how I could do that with turtle?\nThanks.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":66647935,"Users Score":0,"Answer":"I once made a game like that. You can just create more turtles and use them as the body. Make the first turtle as the head of the snake. Then whenever it eats food,run a function that will create another turtle as a body component and put it in the previous position of head component. Repeat this everytime the snake eats a food.\nI am not so good in explaining,so sorry for any inconvenience : )","Q_Score":0,"Tags":"python-3.x,python-turtle","A_Id":69835659,"CreationDate":"2021-03-16T01:33:00.000","Title":"How to make a Turtle Longer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am very new to python and pygame and I'm currently making a very basic experiment with it. So far, I know how to draw an image on the screen, move it around, add a background, stuff like that. But what I have always been wondering is, how do I switch between screens in a game and how do I keep the code tidy when doing so?\nEvery time I try to add a new thing to my already unstable code, it takes only a few lines to break it and it becomes a confusing mess.\nIf for example, I want a start screen that shows the title and a \"press any key to continue\" kinda thing, how do I do it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":86,"Q_Id":66653278,"Users Score":0,"Answer":"A quick fix:\n\nMake the entire screen white and then draw the second screen onto the first one.\nThen when you need the other screen, just refill the screen with black and then continue.\nThis can be achieved by putting the screens in their own separate functions.\n\nLet me know if this helps out","Q_Score":0,"Tags":"python,pygame","A_Id":66653375,"CreationDate":"2021-03-16T10:24:00.000","Title":"How to make multiple screens in pygame? (As in, a \"menu\" screen, a \"main\" screen, a \"start\" screen, etc.)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm sorry for the vague wording in this question.\nI've created a login system with Tkinter but am not sure how to create a new window for the main menu of the app I want to make.\nI've tried opening a new window but that still leaves the login window open and if I attempt to delete it with the .destroy command it shuts down the whole thing.\nis there a way to completely refresh\/open a new window?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":98,"Q_Id":66662493,"Users Score":1,"Answer":"is there a way to completely refresh\/open a new window?\n\nThe simplest solution is to put all of your \"windows\" inside frames -- login window is all inside a single frame, the main window is all inside a single frame, etc.\nThen, when you're ready to switch from one to the other, just destroy the login frame and create the main window frame, all without having to destroy the main window.\nA similar solution is to simply delete all of the children in the root window and then add the new widgets. It's easiest if everything is in a single frame, but you can destroy all of the widgets one by one by calling winfo_children on the root window and iterating over the results.","Q_Score":0,"Tags":"python,tkinter","A_Id":66663155,"CreationDate":"2021-03-16T19:56:00.000","Title":"How to progress to next window in tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm sorry for the vague wording in this question.\nI've created a login system with Tkinter but am not sure how to create a new window for the main menu of the app I want to make.\nI've tried opening a new window but that still leaves the login window open and if I attempt to delete it with the .destroy command it shuts down the whole thing.\nis there a way to completely refresh\/open a new window?","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":98,"Q_Id":66662493,"Users Score":1,"Answer":"You can call old_root.destroy() and that will close the old window. It will also reset all of the global variables in tkinter so it will be as if you just imported tkinter for the first time. So you can create a new tkinter window using tk.Tk(). I find this approach more intuitive and easier to understand\/implement.\nEdit: You need to first pull the data out of your entries\/other widgets before you call old_root.destroy() otherwise the data will be deleted as well.","Q_Score":0,"Tags":"python,tkinter","A_Id":66663478,"CreationDate":"2021-03-16T19:56:00.000","Title":"How to progress to next window in tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to download the current 32bit version of WinPython. The 32bit version is needed for compatibility with pypyodbc and a 32bit MS Access database. I have had a 32bit version of 3.2.7 installed and running correctly for a while, but would like to upgrade to say 3.9 for a few reasons.\nBut on the usual download sites the WinPython 32 bit versions are all stripped back bundles, without the rich array of packages (pyQT,pyqtgraph, pyserial etc). What is the standard process to get a fully featured WinPython 32bit (v3.9.2)? Perhaps download an older version of the 32 bit version and then overwrite with the new version? Or download the current 64 bit version and install the minimal 32 bit version over the top? Download the minimum and install each needed package via pip?\nI know I am missing something, it can't be too hard... But have spent the day googling and not found the way forward.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":120,"Q_Id":66665417,"Users Score":0,"Answer":"Without having any better idea, I proceeded with just downloading the 'minimal 32 bit' installation, and then pip'ing the nine or ten packages I needed for my current suite of projects. Only took 15 minutes, and has resulted in a much smaller footprint on my hard disk.\nIf anyone has a different solution to my original question though, happy to hear it!\nMark","Q_Score":0,"Tags":"python-3.x,download,32-bit","A_Id":66729776,"CreationDate":"2021-03-17T00:33:00.000","Title":"WinPython 32bit download","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I installed WinPython64-3.9.2.0 on my Windows 10 laptop.\nI tried to make a GUI with Qt Designer, but when I click on Form and then on View Python Code... I get the following warning message:\n\nUnable to launch\nC:WPy64-3910\\python-3.9.1.amd64\\lib\\site-packages\\pyqt_tools\\Qt\\bin\\bin\\uic:\nProcess failed to start: The system cannot find the file specified.\n\nI click on OK and I don't get the Python code of the GUI.\nPlease, can you help me?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":465,"Q_Id":66676015,"Users Score":0,"Answer":"The solution is to open the Start menu and click Settings, type \"Edit environment variables for your account\" and click on it. You will get a new window called \"Environmental Variables\". Click \"New\" under \"User variables for username\" and you will get another window.\nNext to \"variable name:\" write \"Path\" and next to \"Variable value:\" write\n\nC:\\WPy64-3910\\python-3.9.1.amd64 ; C:\\WPy64-3910\\python-3.9.1.amd64\\Scripts\n\nNote that I used a semicolumn to separate the two paths.\nIn case you use LaTex editors like Texmaker remember to add also this after a semicolumn:\n\nC:\\Users\\ username \\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\\n\nOtherwise Texmaker won't work.","Q_Score":0,"Tags":"python,python-3.x,qt,pyqt5","A_Id":66706758,"CreationDate":"2021-03-17T15:17:00.000","Title":"When I try to view the Python code from Qt Designer, in WinPython, I get an error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing a GUI app that will be used supposedly by mutliple users. In my app, I use QAbstractTableModel to display a MS Access Database (stored on a local server, accessed by several PCs) in a QTableView. I developped everything I needed for unique user interaction. But now I'm moving to the step where I need to think about multi-user interaction.\nFor exemple, if user A changes a specific line, the instance of the app on user's B PC needs to update the changed line. Another example, if user A is modifying a specific line, and user B also wants to modify it, it needs to be notified as \"already being modified, wait please\", and once the modification from user A is done, the user B needs to see this modification updated before he has any interaction.\nToday, because of the local nature of the MS Access database, I have to update the table view a lot of time, based on user interaction, in order to not miss any database modification from other potential users. It is kinda greedy in terms of performance and resources.\nI was thinking about using Django in order make the different app instances communicate with each other, but maybe I'm overthingking it and may be there is other solutions.\nDunno if it's clear, I'm available for more informations !","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":193,"Q_Id":66688187,"Users Score":0,"Answer":"Perhaps you could simply store a \"lastUpdated\" timestamp on the row. With each update, you update that timestamp.\nNow, when you submit an update, you include that timestamp, and if the timestamps don't match, you let the user know, and handle the conflict on the frontend (Perhaps a simple \"overwrite local copy, or force update and overwrite server copy\" option).\nThat's a simple and robust solution, but if you don't want users wasting time writing updates for old rows, you could use WebSockets to communicate from a server to any clients with that row open for editing, and let them know that the row has been updated.\nIf you want to \"lock\" rows while the row is already being edited, you could simply store a \"inUse\" boolean and have users check the value before continuing.","Q_Score":0,"Tags":"python,database,ms-access,pyqt5,multi-user","A_Id":66688336,"CreationDate":"2021-03-18T09:26:00.000","Title":"How to handle multi-user database interaction with PyQt5","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am trying to create a bot for a game. Therefore I need to capture the screen however the Pyautogui's screenshot function is too slow for a game. How can I capture the screen directly without using the module. I tried looking for answer but the only thing I found were answers for mac or windows. Now I know there are many ways to capture a X window but which of them are actually fast enough for getting at least 30 FPS.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":119,"Q_Id":66713294,"Users Score":1,"Answer":"None of them. A full HD screen is about 8 MB. GPUs are optimized for getting data INTO memory, not getting data OUT of memory. The read path is always lower priority. When you add the overhead of Python, you are never going to get 30 FPS.","Q_Score":0,"Tags":"python,linux,opencv,pyautogui,xorg","A_Id":66713604,"CreationDate":"2021-03-19T17:53:00.000","Title":"How can I capture the screen fast using Pyautogui in Linux","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to create a python 3 program with tkinter that will listen to my keyboard input even while the window is not \"focused,\" as in I would have a separate window open, say a browser and press the tab key, which would then put the window into focus. Is there any way that I could go about doing this?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":78,"Q_Id":66717592,"Users Score":1,"Answer":"Tkinter has no support for this. Tkinter can only respond to events when it has focus.","Q_Score":0,"Tags":"python,python-3.x,tkinter","A_Id":66718224,"CreationDate":"2021-03-20T02:03:00.000","Title":"Python 3 Tkinter: How do you listen to user inputs when the window is not in focus?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Basically I need an event that will fire each time, when text in my custom TextInput is being edited.\nModifying insert_text works only when user type something, but not when he delete symbols.\nSo I might try to compare text before and while editing. Though not sure that it's best way.\nSoo.. is there a way to get not validated text from currently being edited TextInput?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":19,"Q_Id":66722155,"Users Score":1,"Answer":"Use the on_text method to get the text from the TextInput whenever it changes.","Q_Score":0,"Tags":"python,kivy","A_Id":66726887,"CreationDate":"2021-03-20T13:29:00.000","Title":"How to get not validated text from currently being edited TextInput in Kivy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I successfully drawn the rectangle by mouse but fail to resize that.\nI've tried multiple ways using event by calling function but fail.\nNew to python so struggling.\nThanks","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":251,"Q_Id":66736347,"Users Score":0,"Answer":"few errors self.current = self.create_rectangle(*self.start, *self.start, width=5) should be self.canvas.create_rectangle(*self.start, *self.start, width=5)\nsimilarly self.tag_bind should be self.canvas.tag_bind\nremove self.canvas.bind(\"\", self.on_click) and self.__init__(filename) from openFile method\nAlso, don't forget to import partial (from functools import partial)","Q_Score":1,"Tags":"python,tkinter,tkinter-canvas","A_Id":66739591,"CreationDate":"2021-03-21T18:58:00.000","Title":"Want to resize shapes(Rectangle) by cursor using Tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Am aware that QtGraphicalEffects are now in commercial qt version.\nBut according to docs I can access some components like \"ColorOverlay\" through Qt5Compat. With c++ I added QT += qt5compat\nIn project.pro file and it worked.\nHow can I do the same in python. I want to use QtGraphicalEffects with qml and qt for python.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":365,"Q_Id":66755963,"Users Score":0,"Answer":"I was able to fix this problem, by using PySide2. I think it is not ported in more resent versions yet.","Q_Score":0,"Tags":"python,qt,qml,pyside6","A_Id":66758696,"CreationDate":"2021-03-23T01:19:00.000","Title":"Unable to import Qt5Compat.QtGraphicalEffects in qt6 (qt for python)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In a pyqt5 app I want to untoggle a button when any other button is clicked.\nIs it possible to have a signal emitted when any button inside a layout or a widget is clicked?\nI can connect each button click to an untoggle function but that would be hard to maintain if the buttons ever change. Is there a clean way to achieve the same functionality without having to connect the buttons one by one?","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":290,"Q_Id":66790247,"Users Score":2,"Answer":"What you want is added functionality for an existing type. This suggests that you want to write an extension of the Button class. Write a class that inherits from Button. Write your own function to handle button clicks: this function will call your toggle function and then call the parent's button click handler.","Q_Score":1,"Tags":"python,pyqt5","A_Id":66790293,"CreationDate":"2021-03-24T22:20:00.000","Title":"Emit a signal when any button is pressed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need some help badly. I got all my mouse movement simulation in % so it can work for other resolutions like this:\nwin32api.mouse_event(win32con.MOUSEEVENTF_MOVE, int((300\/1920)*width), int((-50\/1080)*height))\nWhich is meant to make it move 300 pixels to the right and 50 pixels up and it works perfectly on my computer, however, people are trying to use my program, the mouse moves way too far away for some reason and it isn't going to the proper spot.\nWhat could be the issue and what do I need to do to fix.\nEDIT: Found the issue. I don't have \"enhance mouse precision\" in windows while they do, it essentially gives mouse acceleration.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":43,"Q_Id":66870099,"Users Score":0,"Answer":"Found the issue. I don't have \"enhance mouse precision\" in windows while they do, it essentially gives mouse acceleration.","Q_Score":0,"Tags":"python,python-3.x,mouseevent,mouse,pyautogui","A_Id":66871306,"CreationDate":"2021-03-30T11:25:00.000","Title":"Mouse movement % based but mouse still goes flying where it's not supposed to?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to create an app in kivymd with a toolbar at the top of every screen. When I change screens, is there a way to keep the same toolbar at the top of the new screen without copying and pasting all the code for the toolbar again?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":121,"Q_Id":66907257,"Users Score":0,"Answer":"u will have to create a main class that all classes will inherit that bar from it.","Q_Score":1,"Tags":"python,kivy,kivy-language,kivymd","A_Id":66947782,"CreationDate":"2021-04-01T15:19:00.000","Title":"How do I keep a kivymd toolbar on every screen?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Whenever I open my application (on android) made using KivyMD, it show it's own splash screen. How to remove it or add our own?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":522,"Q_Id":66907396,"Users Score":1,"Answer":"In the buildozer.spec file there will be an option for Presplash of the application. I guess it will be commented so just uncomment it and enter the path of your splash image.","Q_Score":0,"Tags":"python-3.x,kivy,kivymd","A_Id":66940039,"CreationDate":"2021-04-01T15:28:00.000","Title":"How to add a Splash Screen in KivyMD","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to display a list of the widgets or the items inside a list view? the items were also added by buttons, then next thing that i want to do is to display a list of the added items in another screen? how would i do this?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":93,"Q_Id":66926981,"Users Score":0,"Answer":"You can provide an id to your ListView and later on access it in your code where you want it. After accessing ListView you can just call lstvw.children (assuming you accessed it as lstvw). It will provide you list of all the children.","Q_Score":0,"Tags":"python,python-3.x,kivy,kivy-language,kivymd","A_Id":66940104,"CreationDate":"2021-04-03T01:29:00.000","Title":"Displaying a list of all the items\/widgets inside a ListView Kivy\/KivyMD","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"how can I save the app's every widget, list item added and changed by the user while using the app so that when he\/she opens it it's still back to how he\/she left it? I'm new to Kivy ,I would really appreciate help, thanks!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":135,"Q_Id":66937401,"Users Score":0,"Answer":"When the app is paused or closed (in the on_pause and on_stop methods of your App class), write code to save whatever app state you want. You will need to serialise it somehow, e.g. as json.\nWhen the app is opened (in the build method of your App class), write code to read that file and reconstruct whatever gui state you wanted from it.","Q_Score":0,"Tags":"python,python-3.x,kivy,kivy-language,kivymd","A_Id":66940699,"CreationDate":"2021-04-04T01:59:00.000","Title":"How do i save the state of my app? kivy\/kivyMD","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a rather large python script that I would like to convert to .exe. I use PyInstaller and I managed to import every library needed so now I don't get any error message. My problem is that at some point, the .exe is stuck, so the conversion with PyInstaller didn't really worked. I suspect the issue is related to the PyAutoGui library, but I had to import it to convert my python script (I used pip install).\nDoes anyone else got the same issue? Is there something I can do to remove this issue?\nI have python 3.9.2 and pyinstaller 4.2 and I am working with windows 10.\nThe libraries I had to import are : pyautogui, pandas, bs4, pygame, PyQt5, pywin32, winshell, pymysql, sqlalchemy, sqlalchemy.sql.default_comparator, wmi, Pillow, psutil and lxml.\nThanks for your suggestions!","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":180,"Q_Id":66970212,"Users Score":0,"Answer":"We think we found the issue: pyautogui needs an other package called open-cv to work. Hope it'll help someone someday ;-)","Q_Score":0,"Tags":"python-3.x,pyinstaller,exe,pyautogui","A_Id":67192652,"CreationDate":"2021-04-06T14:05:00.000","Title":"Issue making .exe with Pyinstaller : compilation is done but the .exe fails","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using Pygame.midi and you can select from 127 instruments.\nI want to know how I can change\/add midi instruments to this list.\nIs there a list of pygame.midi instruments anywhere and if not what libraries is pygame using to actually do midi?\nI've seen something called PortMidi and I'm wondering if this is what Pygame is using.\nI just want to know how I can access pygame.midi and add instruments.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":108,"Q_Id":66975443,"Users Score":1,"Answer":"Pygame is not providing the instruments. It's just sending MIDI commands to your system's built-in synthesizer, usually part of your sound card. MIDI allows for 127 instruments at a time. There is a standard called \"General MIDI\" that tries to define a baseline of 127 instruments, and that's probably what your system is using.\nYou use \"sysex\" (system exclusive) messages to tell the synthesizer to change the instrument-to-channel assignments. pygame supports that with the write_sys_ex command, but you have to know the internals of your synthesizer to know which commands to send.","Q_Score":1,"Tags":"python,pygame,midi,pyportmidi","A_Id":66975564,"CreationDate":"2021-04-06T19:39:00.000","Title":"How to access and change Pygame.midi?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have image processing application written in python consists of CRNN model, and I want to take an image from my android application and send it to the image processing and receive back a response from it.\nwhat should I use to make it done.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":70,"Q_Id":67024211,"Users Score":1,"Answer":"I would create a server that deals with the logic (in python) and make the app communicate with it over HTTP requests.\nThe app would send the image to the server, the server would process it, and then send the output to the app.","Q_Score":0,"Tags":"java,python,android,django,image-processing","A_Id":67024417,"CreationDate":"2021-04-09T15:43:00.000","Title":"how can I connect my image processing application in my android application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I've written a program for a class and I am getting a syntax error that makes no sense on this portion:\n\"\"\"Output Area\"\"\"\n#self.outputArea\nself.outputArea = self.addTextArea(\"\", row = 3, column = 0)\nThe syntax error is on the \"\"\"Output Area\"\"\" line, but when I delete that portion, the syntax moves to the \"#self.outputArea\" line. Then if I delete that line, the syntax error will move down to the \"self.outputArea = self.addTextArea\". Then down to the function below this line. This is the only error in the entire code and it just seems to keep jumping around.\nI'm incredibly confused as I am new to programming. Am I just overlooking something?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":32,"Q_Id":67030389,"Users Score":0,"Answer":"This is a common siutation. The issue most likely lies in the block before \"\"\"Output Area\"\"\".\nThe exact issue is difficult to guess. Some of the common ones off the top of my head are:\n\nIncorrect indentation (correct setup of an editor is important here.)\nTrailing comma\nIncorrect implementation of exception handling.\n\nThe list goes on. As I said, it's difficult to surmise.","Q_Score":0,"Tags":"python-3.x,syntax-error","A_Id":67030431,"CreationDate":"2021-04-10T02:51:00.000","Title":"What do I need to change to get rid of this syntax error that seems to jump from line to line?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to create application with taskbar\/system-tray icon. Crossplatform. OSX, Windows, Linux (Ubuntu\/Centos\/Mint\/Manjaro and other popular distros).\nThis app should detect keyboard input and react to it. Basically do some actions on specific keys. Example: user wants to play some music, presses shift+ctrl+p. Music starts playing.\nI know that Kivy capable of detecting","AnswerCount":3,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":362,"Q_Id":67036963,"Users Score":0,"Answer":"For the \"cross-platform system-tray\" thingy - I don't think this is entirely possible without some truly cross-platform framework like Elektron or something, which can give ability to use system-tray\/taskbar feature.\nFor the detecting mouse even when window is not focused - use pynput with asyncio (example for kivy + asyncio in their official repository). Basically: you can detect keyboard events even when app is not focused with background working code with asyncio. Then it will detect every keystroke.","Q_Score":0,"Tags":"python,kivy,background-service","A_Id":67072414,"CreationDate":"2021-04-10T16:54:00.000","Title":"How can I make cross-platform Kivy app with system-tray\/taskbar icon which would detect keyboard input even when app is not focused\/in taskbar mode","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a sample app that just says hello world with kivy and I am trying to put it on an android tablet I bought.\nI used a virtual machine (Virtual box) and use bulldozer to loaded to the tablet. However when I run it the terminal just prints in a loop\n#waiting for the application to start\nany idea on what could be the problem, or how can I start the application","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1169,"Q_Id":67081236,"Users Score":0,"Answer":"I had trouble with this too. But if it runs that far then it should've successfully compiled the .apk. It should be in the same folder that you ran the buildozer command. You can even run an HTTP server with buildozer serve and access it via localhost:THE_PORT_NUMBER_HERE. Then you can just transfer or download the .apk to your device. And then install and run it after accepting the correct permissions.","Q_Score":1,"Tags":"python,kivy,kivy-language,buildozer,kivymd","A_Id":71406743,"CreationDate":"2021-04-13T19:27:00.000","Title":"kivy app in adroid with buildozer, terminal loops on \"#waiting for application to start\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a sample app that just says hello world with kivy and I am trying to put it on an android tablet I bought.\nI used a virtual machine (Virtual box) and use bulldozer to loaded to the tablet. However when I run it the terminal just prints in a loop\n#waiting for the application to start\nany idea on what could be the problem, or how can I start the application","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":1169,"Q_Id":67081236,"Users Score":0,"Answer":"Make sure you have enabled developer mode on the phone, the phone must be plugged in to the VM (In VirtualBox: Devices -> USB -> {phone}) and that the screen is unlocked.\nOn the phone you should see a \"USB debugging connected\" notification when it's plugged in.\nIf the phone is properly connected, you'll see it in Android Studio in a number of places, including the LogCat and right at the top of the screen in a little dropdown to the left of the run button.\nLastly, you can run the app manually and then connect the debugger if you want. Just run the app on the phone, then click the little icon in the top right with the green bug with an arrow over it.","Q_Score":1,"Tags":"python,kivy,kivy-language,buildozer,kivymd","A_Id":67081320,"CreationDate":"2021-04-13T19:27:00.000","Title":"kivy app in adroid with buildozer, terminal loops on \"#waiting for application to start\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been using the 'ttkthemes' module to add some additional user-selectable themes to my application via an OptionMenu, and all my Text widgets stand out a bit in their standard style.\nI would like to know if it is at all possible to style a Tkinter Text widget with ttk themes.\nI know you can't actually style the standard Tkinter widget (you instead must use the respective ttk version).\nMy issue is that there is no ttk.Text only the entry and I need multiple lines for a text editor.\nOne possibility would be to change background colour based on the selected theme, but this could be very long since there many themes to choose from.\nWould anyone know of any possible way to get a stylable version of the Tkinter Text widget, so that it doesn't stand out as much?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":112,"Q_Id":67094570,"Users Score":1,"Answer":"Would anyone know of any possible way to get a stylable version of the Tkinter Text widget, so that it doesn't stand out as much?\n\nYou can create your own custom Text widget that listens to the <> event, and then reconfigures itself based on the settings from the current theme or other widgets. For example, you could query the current theme to get the background color of an Entry widget and use that to set the background of the Text widget.","Q_Score":0,"Tags":"python,python-3.x,tkinter,ttk,tkinter-text","A_Id":67095424,"CreationDate":"2021-04-14T15:23:00.000","Title":"Is it possible to style a tkinter Text widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a GUI on a touchscreen (Pi). I'm using FigureCanvasTkAgg and NavigationToolbar2Tk. The GUI seems to work but I cannot figure out how the Zoom Out function works on the touchscreen. On the PC, rectange windows drawn with left click seem to zoom in, and those drawn with right click seem to zoom out. On the Pi, I can zoom in, but not zoom out. Any assistance\/pointers would be appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":34,"Q_Id":67103276,"Users Score":0,"Answer":"Apparently, there was a conflict between the event handlers. I had a event handler attached to the canvas using canvas.get_tk_widget().bind('Button-1>',self.canvas_button1_handler). When I replaced this with canvas.mpl_connect(\"button_press_event\",fig_button_handler) the strange behaviour of zoom stopped.","Q_Score":0,"Tags":"python,python-3.x,matplotlib,tkinter,pi","A_Id":67123752,"CreationDate":"2021-04-15T06:25:00.000","Title":"matplotlib on Pi touchscreen","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am, a total newbie to this, trying my first addon that has a properties panel with three Int variables that I can modify.\nChanging these values crashes blender almost all the time.\nI suppose that it would not be cool to upload here the 516 lines of the addon so that somebody could look at it!\nIs there a way to save the latest messages from the console when blender crashes?\nI am totally clueless as to what I can do to debug that one!\nAny ideas anyone?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":33,"Q_Id":67114115,"Users Score":0,"Answer":"You can start Blender from console. When it crashes the error will be in this console.","Q_Score":0,"Tags":"python,blender","A_Id":67121407,"CreationDate":"2021-04-15T18:27:00.000","Title":"Blender 2.92 Python Use of IntProperties crashes addon","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I try to use vtkCollisionDetectionFilter to detect collision between two tubes that created with vtkTubeFilter, but vtkCollisionDetectionFilter can not detect it.\nwhen i write and read one tube as STL file, it works properly.\nhow can i solve this problem without writing as STL file.\nIn first condition i give the vtktubefilter outputs to the collisiondetection, in this case it doesn\u2019t work.\nin second condition i write and read vtk tube output as a STL file and give the STL file output to the collisiondetection, in this case it works properly.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":75,"Q_Id":67183933,"Users Score":3,"Answer":"type of vtkTubeFilter cells is TriangleStrip while collision required Triangle cell.\nvtkTriangleFilter can convert cell type to Triangle cell.","Q_Score":0,"Tags":"python-3.x,vtk","A_Id":67184965,"CreationDate":"2021-04-20T17:50:00.000","Title":"collision detection between two tubes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"The problem seems quite simple, I have two similar images on the screen, using pyautogui.LocateOnScreen() it can normally locate the first image, using moveTo() makes me able to move to the image in question. The problem is that I have more than one image, and I want it to detect the first, then move to it, then detect the other and finally move to it. Can anyone help me with this question? Thanks.\nPS: Both images are equal","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":1068,"Q_Id":67187921,"Users Score":-1,"Answer":"Giving some text examples of the code is great. So, I wouldn't have to ask this silly question. Have you tried the \"while\" loop?","Q_Score":1,"Tags":"python,pyautogui","A_Id":67188394,"CreationDate":"2021-04-21T00:40:00.000","Title":"Locate second location of a similar image using pyautogui","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create something and I don't know if it's possible or \"clean\" :\n\nFrom python, call function A of my C++ code to compute something complicated\nThe C++ code returns just the pointer to the python\nDo other things in python...\nFrom python, call function B of my C++ code, it takes the pointer and other things as arguments.\n\nI really don't need to use my complicated C++ class in my Python algorithm, that's why I just want to save the pointer in python.\nAnyone has any advice on how to do that ?\nEdit : In the end I wrapped the c++ class in python, thank you everyone.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":66,"Q_Id":67227334,"Users Score":1,"Answer":"A pointer is just data that can be marshaled and sent to anything. It is however a very bad idea because when doing that, you have to assure that that pointer remains valid as long as the python part has the pointer. There is no possibility to check whether the pointer is still valid, so dereferencing a pointer that you receive from an external party could crash your program.\nA better idea in a lot of situations is to send a key to a table. When that key is sent back, it can be used to get the needed information from that table and it can be handled when the table doesn't have the key anymore. It is easiest to use std::map for the table. Of course, you could store the pointer in a container and check for that, but a string or number is easier to debug.","Q_Score":1,"Tags":"python,c++,cython","A_Id":67227563,"CreationDate":"2021-04-23T09:22:00.000","Title":"How save a C++ pointer in python to pass it again later?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to create something and I don't know if it's possible or \"clean\" :\n\nFrom python, call function A of my C++ code to compute something complicated\nThe C++ code returns just the pointer to the python\nDo other things in python...\nFrom python, call function B of my C++ code, it takes the pointer and other things as arguments.\n\nI really don't need to use my complicated C++ class in my Python algorithm, that's why I just want to save the pointer in python.\nAnyone has any advice on how to do that ?\nEdit : In the end I wrapped the c++ class in python, thank you everyone.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":66,"Q_Id":67227334,"Users Score":0,"Answer":"It would be better to create a class in C++ and store that pointer in the class itself as private. Then create function calls to access those pointers.\nOnce the class is implemented generate the .so file of your lib and import it in python. This way you can simply use your C++ code in python and also will not have to save the pointer.","Q_Score":1,"Tags":"python,c++,cython","A_Id":67227731,"CreationDate":"2021-04-23T09:22:00.000","Title":"How save a C++ pointer in python to pass it again later?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I am trying to change the text in a entry to be bigger. So far I could only make the actual text box bigger, but not the user inputted text inside. How would I change the user-inputted text in an entry to be bigger and is there a way to change it's font as well? Thanks in advance","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":57,"Q_Id":67253603,"Users Score":0,"Answer":"I have found out how to, I tried to do font= but it said that there wasn't such a thing as font. However this was because I added that in the .pack line...","Q_Score":0,"Tags":"python,python-3.x,tkinter,text","A_Id":67253690,"CreationDate":"2021-04-25T12:50:00.000","Title":"How to change entry text size? (Tkinter)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using kivy to develop a small project. Currently, I use the animation utility to animate Widgets (change position, cycle through a sprite atlas, etc.). Everything works great so far, but I have no idea how I am supposed to pause animations and continue them at a later point. I know that I could use the Clock schedule mechanism and clock.cancel, but that would make the whole \u00e0nimation` class pointless.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":96,"Q_Id":67357827,"Users Score":0,"Answer":"The Animation class has start, stop and cancel methods you can use to manipulate it how you like. Perhaps we should have a pause too, but you can achieve the same effect with those.","Q_Score":2,"Tags":"python,animation,kivy","A_Id":67357852,"CreationDate":"2021-05-02T15:02:00.000","Title":"How to pause animations with kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to implement a application using pyqt5 where I wish to show protein structure using nglview in the application window, is it possible to do so. If yes, can anybody suggest how to embedd the nglview in pyqt5 or any similar package like nglview without using jupyter to show protein structure","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":79,"Q_Id":67358257,"Users Score":0,"Answer":"nglview is IPython\/Jupyter widget. Jupyter is web application, frontend runs inside browser. You can use QProcess to start jupyter notebook and open notebook url in QWebEngineView.","Q_Score":1,"Tags":"python,pyqt,pyqt5,protein-database","A_Id":67360115,"CreationDate":"2021-05-02T15:45:00.000","Title":"how to embedd nglview in pyqt5 window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I display a numeric keyboard using Kivy==2.0.0 and kivyMD? I set input_type:'number', input_filter:'int' and multiline:False in textfield but when I run apk on android device app display only full character keyboard.\nBetter mention that buildozer couldn't download sdl2 files and I manually replaced sdl2 files.\npython version = 3.8.5\nbuildozer = Latest version\nsdl2 version = 2.0.9","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":168,"Q_Id":67366898,"Users Score":0,"Answer":"After much effort I realized that numeric keyboard works only with kivy==master and p4a==develop.\nSo I changed buildozer.spec requirements from kivy==2.0.0 to kivy==master,also p4a.branch from master to develop.Now numeric keyboard works fine.","Q_Score":0,"Tags":"python,android,kivy,kivy-language,kivymd","A_Id":68873598,"CreationDate":"2021-05-03T09:55:00.000","Title":"How can I generate the Numeric Keyboard using kivy and kivyMD?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Here's was appears to be an odd question at least from what I've been able to turn up in Google. I'm not trying to determine IF there's a UAC prompt (I've got a couple of reliably ways to do that, win32gui,GetForegroundWindow() returns a 0, or win32gui.screenshot returns exception OSError at least in my case)\nI'm also not looking to BYPASS the UAC, at least from python, I have an update process that's kicking off automatically that I need to get through the UAC. I don't have control of the update process so I don't think it's a good candidate for disabling the UAC with Python. I could just disable the UAC in Win10, but I'd prefer not to if possible. I do have a couple of methods for bypassing the UAC, in one instance where I'm running this in vitualbox I believe I can use VBoxManage guestcontrol to sent keystrokes to the guest system, for a stand alone system I have a microcontroller connected as a USB HID Keyboard, with a basic deadman switch (using the scroll lock to pass data between the python and the microcontroller acting as the HID keyboard) if it doesn't get the signal it sends left arrow enter to bypass the UAC.\nWhat I'm trying to do, and getting stymied with, is verifying that the UAC popup is actually from the update process that I want to accept the UAC prompt for, and not some other random, possibly nefarious application trying to elevate privileges. I can use the tasklist to verify the UAC is up, but I'm not seeing any way to see WHAT caused the UAC prompt. The update process is kicked off from an application that's always running, so I can't check to see if the process itself it running, because it's running under normal operation, I just want to accept the UAC when it's attempting to elevate privileges to update. I've been using a combination of using win32gui.GetWindowText and win32gui.EnumWindows to look for specific window titles, and for differentiating between windows with the same title, taking a screenshot and using OpenCV to match different object that appear in the windows. Both of those methods fail though when UAC is up, which is why I can use them to detect UAC as I mentioned before.\nI suppose I could use a USB camera to take a screenshot of the system, but I'd like to be able to run this headless.\nAnybody have an idea on a way to accomplish this, as the tree said to the lumberjack, I'm stumped.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":91,"Q_Id":67415047,"Users Score":0,"Answer":"If you run a process as administrator, no user account control prompt will appear.\nYou could manually run your process as administrator.\nYou need system privileges to interact with a user account control prompt.","Q_Score":0,"Tags":"python,windows,uac","A_Id":67415235,"CreationDate":"2021-05-06T09:07:00.000","Title":"How can I determine what what is in the Win10 UAC prompt in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"Hello wxWidgets and wxPython people, I want to build wxWidgets and wxPython on cygwin, but use windows widgets ( --with-msw ) so as to not require X. This seems possible and appears to be done previously by others, but perhaps not for some time. I have successfully build wxWidgets, but the build scripts\nfor wxPython do not seem to support this out-of-the box. I have hacked on this with 2.8 and 3.0.2 verions. Phoenix versions would be fine, too if that would be better. thx. tnordland7","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":31,"Q_Id":67478418,"Users Score":0,"Answer":"The best way to build under Cygwin is by using MinGW-w64 cross-compiler. If you do this, i.e. specify --host=i686-w64-mingw32 or --host=x86_64-w64-mingw32 to configure, wxMSW should already be selected automatically and you shouldn't have much to do.\nIf you really want to create a Cygwin, as opposed to native, application (but why?), you may need to use --with-msw explicitly because Cygwin is considered to be a Unix environment and there may indeed be problems because, to be frank, this is a build variant that nobody uses any more. If you're interested in making it work, please check 3.1.5 and\/or latest Git and let us know, or ideally fix, about any problems you encounter.\nBut if you just want to make things work in the Cygwin environment, using MinGW cross-compiler (available in Cygwin) is by far the simplest and IMO better option.","Q_Score":0,"Tags":"wxpython,wxwidgets","A_Id":67502349,"CreationDate":"2021-05-10T22:36:00.000","Title":"want to build wxPython on cygwin --with-msw","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I was wondering there is a way to directly change the x and y coordinate of a canvas object after you created it. I know .move function but it only changes the coordinate but not directly setting it.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":1381,"Q_Id":67516876,"Users Score":1,"Answer":"You can use .moveto(item_id, x, y) to move the canvas item to absolute position (x, y).","Q_Score":0,"Tags":"python,tkinter","A_Id":67517153,"CreationDate":"2021-05-13T09:25:00.000","Title":"how to change the position of a canvas object after you created it in Python Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What I'm trying to do is? automate a game using coordinates and pywin32.\nExpected result: \ngetting R of RGB colors value of using pyautogui.pixel(489, 209)[0] and check the R value is corresponded to what I am looking for, if it meets requirement perform a mouse click.\nDrawback result: \nOnce the code is run while loop start to work and click event performs until the if statement run into else statement. that resulted unwanted and unnecessary time consuming. is there anyway I can perform the click() method only once inside of this while loop.\n\nimport keyboard\nimport pyautogui\nimport time\nimport win32api, win32con\n\n\ndef click(x, y):\n\n win32api.SetCursorPos((x, y))\n win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)\n time.sleep(0.1)\n win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)\n\nwhile not keyboard.is_pressed('q'):\n\n if pyautogui.pixel(686, 172)[0] != 255:\n print(\"he is not looking at you, click the mouse\")\n click(680, 694)\n else:\n print(\"he is looking at you, click again\")\n click(680, 694)","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":66,"Q_Id":67533990,"Users Score":1,"Answer":"You can add a bool variable before the loop set as True and put click() into if, where condition is that bool variable. After one usage of click() set variable to False so the condition is False and click() will not be performed","Q_Score":1,"Tags":"python,pywin32,pyautogui","A_Id":67534131,"CreationDate":"2021-05-14T12:01:00.000","Title":"How to prevent a function from being called more than one time in a while loop - PYTHON","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been setting up a game which is meant to have a \"song speed\" variable. I've set up the actual movement speed, and multiplied it by what is essentially Unity's Time.deltaTime, but the movement itself is very slow. Is there a way to keep a surface moving to the same position, in the same amount of time, but visually move faster.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":84,"Q_Id":67541863,"Users Score":0,"Answer":"According to the laws of physics, there are two possible ways of approaching this:\nThe first option is reducing the distance that the object is moving and increasing the speed, but according to your question that is not what you want (you said it needs to move to the same position, so I'm guessing the distance must be fixed).\nIf that doesn't work, then you should consider the second option - adding acceleration.\nWith fixed velocity movement, you only have three variables - distance, velocity, and time. That means that if you want two of them to be fixed but for the third to be changeable, it would be impossible. You could instead use movement that has a fixed acceleration, since that makes it speed up over time, making it seem like it's going faster.\nNote that it doesn't have a constant speed so the speed itself would be getting higher with each frame.","Q_Score":0,"Tags":"python,pygame","A_Id":67545155,"CreationDate":"2021-05-14T23:02:00.000","Title":"Is there a way to have a Pygame object reach its destination at one speed, in the same amount of time, but visually move at another speed?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Title pretty much sums it up. I don't think it's because I'm loading too much so it takes time to render since I only create a screen manager and a screen initially. so I have no idea what the cause of this is. Please help","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":97,"Q_Id":67564674,"Users Score":0,"Answer":"I was able to fix it by having only a please wait screen in screen manager initially, and loaded some of the module and data I loaded initially after the screen had been rendered by having a clock.schedule_once inside the on_enter method for a few seconds. the schedule was so that the screen is visible as right after the module and data are loaded, it moves to the next screen.","Q_Score":0,"Tags":"python,kivy,buildozer","A_Id":67585609,"CreationDate":"2021-05-17T06:04:00.000","Title":"Kivy presplash in apk ends too early leaving blank screen for a few seconds","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm use 2 python IDE's in my system one is spyder and another one is python IDLE whenever I import a module in spyder it works the same code doesn't works in python IDLE it shows error.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":4812,"Q_Id":67566732,"Users Score":0,"Answer":"I also had the same problem but this fixed it pip3 install flask","Q_Score":0,"Tags":"python,ide,spyder,modulenotfounderror","A_Id":71359089,"CreationDate":"2021-05-17T08:57:00.000","Title":"ModuleNotFoundError: No module named 'pywhatkit'","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to save each slide of PowerPoint presentation as image and also save each slide as separate PowerPoint file using python. Can anyone help me with that","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":96,"Q_Id":67617263,"Users Score":0,"Answer":"Unfortunately python-pptx can't do any of that. You're going to have use either VBA or AppleScript, depending on your platform.","Q_Score":0,"Tags":"python-pptx","A_Id":67649822,"CreationDate":"2021-05-20T09:03:00.000","Title":"Save each slide of powerpoint as image(png) using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm making a login system, and I called mainloop in the first window that will be opened upon starting the program. This window is the window which asks whether the user would like to login or register. Obviously, this means I can't close this window at all, which is impractical and I was hoping to be able to use mainloop instead in the main window that will open once the user has logged in, which will be a window where they will be able to play my game. Will this cause any issues in the program, or will everything run as usual?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":48,"Q_Id":67652668,"Users Score":0,"Answer":"call the mainloop for every window you make\nfor example if you make a window as\nroot=Tk()\nthen after writing all the code for the window\nwrite root.mainloop() \nin the end","Q_Score":0,"Tags":"python,authentication,tkinter,mainloop","A_Id":67652986,"CreationDate":"2021-05-22T18:00:00.000","Title":"When you call mainloop in tkinter, do you need to call it in the first window that will be opened?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am building a Python application bundled with PyInstaller which is available for Windows, Linux (as AppImage) and MacOS.\nI need shortcut icons for those. I have a logo, but I am struggling to bring it to the right format. It seems to me that all three platforms use different icon sizes and formats.\nIs there any online\/offline generator that allows me to create icons for all three platforms from a jpg file?","AnswerCount":4,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":634,"Q_Id":67689014,"Users Score":0,"Answer":"It's easier if you just use auto-py-to-exe, it uses pyinstaller, but it auto-generates the command, and so you can just upload the image to a GUI","Q_Score":4,"Tags":"python,icons,pyinstaller","A_Id":67825779,"CreationDate":"2021-05-25T13:29:00.000","Title":"How to create shortcut icons for Windows, MacOS and Linux applications bundled with PyInstaller","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":1,"Web Development":0},{"Question":"I want to extract any file like libraries(so files) and images(app icon, background image, ETC) using the Androguard.\nI know The a.get_app_icon() and a.get_files_information() method returns paths, but how can I extract them as real file using the Androguard?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":157,"Q_Id":67698995,"Users Score":0,"Answer":"Use a.zip.extract(filename) to extract that file.","Q_Score":0,"Tags":"python,android,apk,androguard","A_Id":69568859,"CreationDate":"2021-05-26T05:27:00.000","Title":"How to extract any resource file from APK using the Androguard?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to Create an Application that is build using python language with native . But I am not getting anything","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":224,"Q_Id":67724608,"Users Score":1,"Answer":"Native Android applications can only be written in Java or Kotlin languages. Kotlin is currently the official language for coding Android Apps due to its many advantages over Java e.g Reduces boilerplate codes. It also introduces functional features to support Java interoperability.\nYou can also code android applications using C and C++ languages by Installing the NDK and CMake.","Q_Score":0,"Tags":"java,python,android,native","A_Id":67726799,"CreationDate":"2021-05-27T14:47:00.000","Title":"Can we create a Native android application using python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to Create an Application that is build using python language with native . But I am not getting anything","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":224,"Q_Id":67724608,"Users Score":1,"Answer":"As far as I know, native applications are written in a language that the platform you want to develop the application for supports. For example, native android solutions would be applications written in Java or Kotlin, for iOS apps written in Swift. To the best of my knowledge, Android does not support Python for the development of an application.","Q_Score":0,"Tags":"java,python,android,native","A_Id":67724707,"CreationDate":"2021-05-27T14:47:00.000","Title":"Can we create a Native android application using python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm just learning to code. I use Pydroid on my tablet running Android 11.\nWhen I try to save a graphic drawn with plot() method, this IDE proposes to save a file to that directory:\n\/data\/user\/0\/ru.iiec.pydroid3\/app_HOME.\nBut I'm not able to find such a directory on my tablet. How can I find it or am I obliged to save files with savefig() method?\nThank you\nP.S. Where does savefig() method save figures if I don't precise the path? (it doesn't appear in the same dossier where is my .py file)","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":200,"Q_Id":67726603,"Users Score":0,"Answer":"The simple fix would be to save the code in a folder inside internal storage. The complicated fix : You need superuser privilege to access \/data partition.","Q_Score":1,"Tags":"android,python-3.x,pydroid","A_Id":67726982,"CreationDate":"2021-05-27T16:49:00.000","Title":"Matplotlib on Android (Pydroid)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to code my Pygame game so the player falls anytime it's not touching the floor. The problem is that the way to code it to test if the player y coordinate is lower that 0, and then stop the falling process, but cuadratic function is not always going to get to the exact y = 0, since it travels more pixel each frame, maybe the first value that is lower than 0 is -10. And then the player ends up under the screen.\nI thought about testing if the player's y coordinate is lower that 0, and then teleporting him to y = 0 but that feels like a really non elegant solution and it also makes the player teleport for a frame.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":37,"Q_Id":67761738,"Users Score":0,"Answer":"\"I thought about testing if the player's y coordinate is lower that 0, and then teleporting him to y = 0, but that feels like a really non elegant solution\"\n\nThis is the usual way. The collision stops the player from falling.\n\n\"it also makes the player teleport for a frame.\"\n\nNo it doesn't. You have to \"teleport\" the player plyer after the collision detection and before you draw it.\nYou do the collision detection once in every frame. Once a collision is detected, you know that the player has hit an object at some point while moving since the last frame. Instead of calculating the exact time when the player hits the object and stopping movement, you limit the player's position by the object.","Q_Score":1,"Tags":"python,function,math,pygame","A_Id":67762020,"CreationDate":"2021-05-30T13:30:00.000","Title":"How to overcome the problem of sprite trespassing floor due to acceleration in Pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to link CPLEX or Gurobi with the windows installer .exe of the scip optimization suite (Version 7.0.2)?\nOr do i have to build scip with cmake\/make to configure an other LP solver? Is there any step-by-step installation guide i could follow for installation?\nThanks!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":95,"Q_Id":67783724,"Users Score":1,"Answer":"As far as I know you have to build SCIP yourself (I recommend using cmake since it is much more platform-independent).\nI suggest you look at the INSTALL.md file in the scip folder (after you download the scip sources) for an installation guide.","Q_Score":0,"Tags":"python,optimization,cplex,gurobi,scip","A_Id":67783923,"CreationDate":"2021-06-01T06:32:00.000","Title":"Linking Scip with CPLEX or Gurobi","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Before running buildozer I put a java file in ga\/chatme\/web\/WebHandler.java.\nThen, I set the android.add_src to ga\/chatme\/web but, I cant seem to import it with autoclass('ga.chatme.web.WebHandler')","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":51,"Q_Id":67795515,"Users Score":0,"Answer":"I fixed it by putting everything in an src folder then pointing android.src to it","Q_Score":1,"Tags":"python-3.x,pyjnius","A_Id":67796207,"CreationDate":"2021-06-01T20:17:00.000","Title":"how do I compile java files and import them with pyjnius with kivy","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I'm creating a drawing app as one of my first kivy projects as a learning experience, and one of the core features on it is a save_as method where you get to save the image you drew on canvas at a specified filepath as a png. I'm using the FileChooserListView built in kivy to get the specified path the user desires, and there is a button that should save the drawing as a png.\nI've been having a really hard issue trying to figure this out and wondering if anyone has an idea how this would be possible. I know there is a export_to_png method built in, but that saves to the current directory of where the coding folder is located.\nAny sort of ideas would be awesome, thank you","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":72,"Q_Id":67828126,"Users Score":0,"Answer":"I know there is a export_to_png method built in, but that saves to the current directory of where the coding folder is located.\n\nIt saves to whatever path you give it. If you want to save to a path from the filechooserview, pass that pass as the argument to export_to_png.","Q_Score":0,"Tags":"python,kivy,kivy-language","A_Id":67828475,"CreationDate":"2021-06-03T20:14:00.000","Title":"Saving a canvas as an image in kivy to a certain file path specified in filechooserview","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"As in title, i have recently picked up Kivy for Python GUI development. I do not enjoy using the kv files, as i prefer to do binding myself, and not rely on some background \"magic\". Is it acceptable to write apps in Kivy without using the kv files?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":133,"Q_Id":67855207,"Users Score":3,"Answer":"It is not required to use the kv language in app development. You can do everything you need to without using a kv file. However, I have found the kv language to be very helpful in making apps. I would recommend getting comfortable with using it, but it ultimately comes down to your preference.","Q_Score":4,"Tags":"python,user-interface,kivy,kivy-language","A_Id":67855399,"CreationDate":"2021-06-06T01:48:00.000","Title":"Is it required to use kv language in kivy app development?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm doing a snake game in a way of attaching turtles together and move each of them individually each time. Let's say we have a white snake on a black screen which consists of multiple adjacent 'square' turtles. If the snake move and hit the wall, it should be removed. So what's the best way to do it? Loop through all segments and use hideturtle() to hide each turtle element? Or simply move every segment out of the screen.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":51,"Q_Id":67856647,"Users Score":0,"Answer":"The simplest way would be when the brick moves and hits the wall it has each segment be set to invisible. These can all be cleaned up or removed at an intermediary screen like a play again\/etc","Q_Score":1,"Tags":"python,turtle-graphics,python-turtle","A_Id":67856788,"CreationDate":"2021-06-06T07:14:00.000","Title":"How to remove turtle list in an effective way","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am Building a app using Kivy , KivyMD in Python and I face a problem , the size of the text that I set for a Label is much bigger to a small devices and very small for a bigger devices like Tablet is that possible to set the size of a text dynamically ?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":67857619,"Users Score":0,"Answer":"is that possible to set the size of a text dynamically ?\n\nYes, just set the font_size property of the Label to what you want, when you want.\nIt sounds like you actually want to know if you can you set it to be constant between different devices. The way to do this is to use device-independent pixels - instead of font_size: 12 use font_size: dp(12) in kv (12 is just an example), or in Python code do the same thing but you'll need to import dp from kivy.metrics.","Q_Score":0,"Tags":"python,kivy,kivy-language,kivymd","A_Id":67860564,"CreationDate":"2021-06-06T09:29:00.000","Title":"Is that possible to set the size of a text dynamically in Python Kivy App?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Recently, I've been tinkering around with pygame. I noticed that even if I've imported pygame, I can still import pygame.local and pygame.sprite (from... import... to reduce the words I need to type in later). What are the relationships between pygame and pygame.SOMETHING? I thought it was just one pygame module, and now I'm a bit confused. Please give me an explanation or direct me to some articles.\nAny help would be appreciated!","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":69,"Q_Id":67872410,"Users Score":0,"Answer":"Think of pygame like a library or archive on how to make GUIs in python. You can get a specific book, such as one on how to make sprites, from the library. It is still part of the library, and whether you read it while sitting in the library or after checking it out, it will have the same content.\nYou can do from pygame import sprite to use sprite() as a shorthand for pygame.sprite() in your code and it will function the same overall.","Q_Score":0,"Tags":"python,python-3.x,macos,import,pygame","A_Id":67872464,"CreationDate":"2021-06-07T13:19:00.000","Title":"difference between pygame and pygame.SOMETHING","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was finally able to get python 3.9.0 installed(was using 3.4.2) on my raspberry pi, however I cannot use pygame now stating \"ModuleNotFoundError: no module named 'pygame'. I know where pygame is located, but I have no idea how to get python 3.9.0 to see where it is to read it.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":62,"Q_Id":67879601,"Users Score":1,"Answer":"You have to re-install all of your packages when you upgrade to a new major version of Python. You'll need to pip3 install xxxx again.","Q_Score":0,"Tags":"python,pygame,raspberry-pi","A_Id":67879645,"CreationDate":"2021-06-07T23:05:00.000","Title":"Newer version of python cannot find module pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So here is my first question here. I am preparing a dataset for object detection. I have done the following things so far:\n\nI have an original picture (size w4000 x h3000).\nI used the annotation platform Roboflow to annotate it in COCO format, with close to 250 objects in the picture.\nRoboflow returned a downscaled picture (2048x1536) with a respective json file with the annotations in COCO format.\nThen, to obtain a dataset from my original picture (as I have a lot of objects and the picture is big enough), I decided to tile the original picture in patches of 224x224. For this purpose, I upscaled a bit (4032x3136) to be able to slice it properly, obtaining 252 pictures.\n\nQUESTIONS\n\nHow can I resize the bounding boxes of the Roboflow 2048x1536 picture to my original picture (4032x3136)?\n\nOnce the b.boxes are resized to my original size picture, how can I resize them again, adapting the size to each of my patches (224x224) created by slicing the original picture?\n\n\nThank you!!","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":775,"Q_Id":67900731,"Users Score":1,"Answer":"It sounds like the ultimate goal is to have tiled 224x224 images from the source 4032x3136 images with bounding boxes correctly updated.\nIn Roboflow, at least, you can add tiling as a preprocessing step to your original 4032x3136 images. The images will be broken into the number of tiles you select (2x2, 3x3, NxY). The bounding boxes will be correctly updated to cover the objects across each individual tile as well.\nTo reimplement in code from what you've described, you would need to:\n\nUpscale your 2048x1536 images to 4032x3136\nScale the bounding boxes accordingly\nBreak the images into 224x224 tiles using something like Pil\nUpdate the annotations to be broken into the coordinates on the respective tiles; one annotation per tile","Q_Score":0,"Tags":"python,object-detection,bounding-box,coco,roboflow","A_Id":67903682,"CreationDate":"2021-06-09T08:52:00.000","Title":"Resize COCO bounding boxes for object detection","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i'm on Ubuntu 20, and I use Python 3.9.\nI can't put the list of pygame.midi.Input.read to a string, because else, my programm is closed with the output:\npygame 1.9.6\nHello from the pygame community. https:\/\/www.pygame.org\/contribute.html\n[[[248, 0, 0, 0], 1]]\nException: b\"PortMidi: Bad pointer'\"\nException ignored in: 'pypm.Input.__dealloc__'\nException: b\"PortMidi: Bad pointer'\"\nso, here, it work:\ndef truc(myinput):\n while True:\n if myinput.poll():\n event = str(myinput.read(3))\n print(event)\npygame.midi.init()\nmy_input = pygame.midi.Input(3)\ntruc(my_input)\nbut if I add this after the print(event), he won't work\n if '1' in event:\n print('ok')\n else:\n return\nCan you help me please?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":35,"Q_Id":67903225,"Users Score":0,"Answer":"PROBLEM FOUNDED:\nIf you got this problem, you just have to don't put any return\nSee ya","Q_Score":0,"Tags":"python,python-3.x,ubuntu,pygame,midi","A_Id":67903471,"CreationDate":"2021-06-09T11:27:00.000","Title":"pygame.midi.Input.read can't being a string","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I\u2019m working on this face recognition app, so I am using android studio as front-end and python as a back-end.Upon designing my UI in android studio, I want to make a button in a way when i press it , my python script runs. If someone can help me I\u2019d be very grateful.\nThanks in advance","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":70,"Q_Id":67995030,"Users Score":1,"Answer":"What I think you need to do is run your python script on a server,\nThen make a GET request from your app, on click or whatever, then out the response (generally in JSON) from your script.py","Q_Score":1,"Tags":"python,android,frontend,backend","A_Id":67995130,"CreationDate":"2021-06-16T00:48:00.000","Title":"Is there a way to integrate a python script to a button in android studio?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to use kivy as the graphical system and yet i dont know how to put inside a button and a label at the same time where label shows text and button closes popup also there is one import ant thing here it must be a function that can have editable title and contents and buttob(text) and can be launched like: self.popup(text1, text1, text3) Does anyone know how do it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":68001485,"Users Score":0,"Answer":"Kivy popup contents: What do you want ? Nobody can answer this !!! Give a precise question (here are some propositions for your next SO post).\nI am trying to use kivy as the graphical system: How to use kivy app as a graphical system ?\nand yet i dont know how to put inside a button and a label at the same time where label shows text and button closes popup\n\nKivy: how to add a widget (Label\/Button) to an app ?\nKivy: how to change Label text ?\nKivy: how to bind a function on a button click ?\nKivy: How to close a popup ?\n\nalso there is one import ant thing here: .\nit must be a function that can have editable title and contents and buttob(text):\n\nI think you should check out what theses terms are: POO, Inheritance, attribute, method.","Q_Score":0,"Tags":"python,python-3.x,kivy","A_Id":68016110,"CreationDate":"2021-06-16T11:07:00.000","Title":"Kivy popup contents","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have my rows and columns of a Tkinter GUI changing size when I resize my main window but I need to manually resize a matplotlib figure to fit the new grid size.\nI am using the grid geometry manager.\nHow can I get the size of the row\/column in pixels that the Figure is in so I can resize the figure?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":105,"Q_Id":68012607,"Users Score":0,"Answer":"\"The answer is in the standard documentation. Search for grid_bbox\" \u2013 Bryan Oakley","Q_Score":0,"Tags":"python,tkinter","A_Id":68270724,"CreationDate":"2021-06-17T03:40:00.000","Title":"Get row and column size in pixels from grid manager of tkinter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a calculator program where you click on 'digit' rectangles to enter numbers. When I go into a debugger, mouse clicking doesn't register\/ doesn't change any variables. I must be doing something obviously wrong. I've tried the idle debugger, the thonny debugger and the pycharm debugger.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":25,"Q_Id":68028428,"Users Score":0,"Answer":"It is better to attach some images or code, so we can evaluate your problem better. But, as far as I know, you need to update the Pygame display\/frame each time you perform an action.\npygame.display.update()\nThis is a line to update Pygame display\/frame. If you don't place this, the program will freeze.","Q_Score":0,"Tags":"python-3.x,pygame","A_Id":68028482,"CreationDate":"2021-06-18T01:59:00.000","Title":"When I try to debug a pygame script I can't mouse click anything","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to get live video from my server side by clicking a button of the gui of client side. How it can be done? I am not getting any idea. Can anybody help me with the concept or by giving me some webpage address where I can get related code? Thanks in advance.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":45,"Q_Id":68032676,"Users Score":0,"Answer":"If you got a website or you have hosted it on your LAN:\nyou can pass the command argument\nbtn.config(command=myfunc)","Q_Score":0,"Tags":"python,sockets,tkinter","A_Id":68032782,"CreationDate":"2021-06-18T09:28:00.000","Title":"How to trigger a server side function by pressing a button in the client side gui using tkinter python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I made an app, and it uses Tkinter for the UI. I am trying to make the app more user-friendly by allowing dynamic color modes. But I couldn't find a solution anywhere else. The plan is to fetch the current color mode and use it to decide window.configure(bg=light\/dark) while window=Tk(). Any suggestions? :D","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":77,"Q_Id":68036709,"Users Score":0,"Answer":"There is a module called darkdetect which can do this for you, darkdetect.theme() will return what theme your pc is using, hope this helps!","Q_Score":0,"Tags":"python,tkinter,colors","A_Id":68036880,"CreationDate":"2021-06-18T14:12:00.000","Title":"Is it possible to use Python to detect the system dynamic color mode (light or dark mode) for Windows?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently working on a program with Kivy and Python that solves quadratic equations. Because the user has to enter his quadratic function or the values \u200b\u200bof the variables, I wanted to ask how exactly this works with Kivy and Python.\nIn Python it works with a = float(input(print(\"Your a: \"))).\nBut how do I save an input as a variable in the form \"float\" so that I can calculate with it?\nThank you!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":31,"Q_Id":68057174,"Users Score":0,"Answer":"I don't know exactly what you are asking for. To save an input as a float in a variable, just do a = float(input(\"Your a: \")), and then to calculate with that you can do x = a + 89, or print(a**2). Hope I solved your question.","Q_Score":1,"Tags":"python,kivy","A_Id":68057419,"CreationDate":"2021-06-20T15:07:00.000","Title":"How can I calculate with Inputs from Kivy (Python)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"def browse_base(self):\noption=QFileDialog.Options()\nfile=QFileDialog.getOpenFileName(widget,\"Open Single File\",\"CC\",\"All Files(*)\",options=option)\nself.base_addr.lineEdit.setText(file[0])\n\nI have a problem here: 'QLineEdit' object has no attribute 'LineEdit'\nAnd i don`t know what i need to do","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":138,"Q_Id":68103952,"Users Score":1,"Answer":"It looks like you're assuming that self.base_addr has a lineEdit attribute that is a QLineEdit, but it seems that self.base_addr itself is already a QLineEdit (which has no lineEdit attribute), so that using just self.base_addr.setText(file[0]) should probably work.\nHowever, this may just be the tip of the iceberg, but it is very hard to tell from the code in your question.","Q_Score":0,"Tags":"python,qlineedit","A_Id":68104204,"CreationDate":"2021-06-23T16:41:00.000","Title":"'QLineEdit' object has no attribute 'LineEdit'","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a question: Can I click on android os with python (like windows that we can change mouse position, clicking or etc.)\nlike clicking in emulators as gameloop or physical smartphone.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":114,"Q_Id":68109691,"Users Score":0,"Answer":"Don't know if I get your question clearly, but nowadays, you can use a mouse on a phone. If your talking about operating your phone with python, it might be possible, however, why to complicated, when you've got an assistant on your phone","Q_Score":0,"Tags":"python,android,android-emulator","A_Id":68109756,"CreationDate":"2021-06-24T04:34:00.000","Title":"click on android screen using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to modify some python code which use traitsui & wxphthon, written several years ago.\nI want to update these traitsui & wxpython, but there are some problems..\n(Environment: windows 10, python 3.7.6 32bit, traits==5.2.0 -> to the latest one)\nIn the first place, this code used traitsui 6.1.3 and I want to update it to the latest version 7.2.1, because I need to install visual studio>14.0 to use 6.1.3\nHowever, if I use traitsui 7.2.1, it shows me an error message as below:\nModuleNotFoundError: No module named 'traitsui.wx.basic_editor_factory'\nI found any clue and came here to ask about this error. Probably this basic_editor_factory is deprecated, but there is no info about it..\nPlease let me know if you have any idea or further information.\nThank you in advance.\n-JESuh","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":75,"Q_Id":68157529,"Users Score":0,"Answer":"Well, it's not a correct answer but anyway I solved this problem.\nI just copied a part of basic editor factory to my code. (What a stupid solution)\nPlease let me know if somebody knows more elegant way to solve this problem. :)\nThank you in advance.\n-JESuh","Q_Score":0,"Tags":"python-3.x,wxpython,traits,traitsui","A_Id":68158738,"CreationDate":"2021-06-28T04:20:00.000","Title":"Use traitsui & wxpython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can i open and close any programm on my raspberry pi using python?\nI want to open florence.desktop (Virtual Keyboard) and close it.\nI have tried it with:\nP = subprocess.Popen([\"\/usr\/share\/applications\/florence.desktop\"]\nbut the error message is:\nTraceback (most recent call last):\nFile \"\/usr\/lib\/python3.7\/tkinter\/init.py\", line 1705, in call\nreturn self.func(*args)\nFile \"\/home\/pi\/Desktop\/Software_1.0.2\/Software\/Software\/Hautpprogramm\/Start_Seite.py\", line 588, in \nWartungs_Button = Button(root, text=\"Wartungsfunktion\", font=bigFont, fg =\"black\", bg=\"#D3d3d3\", command=lambda: newWindow_Wartung_PW())\nFile \"\/home\/pi\/Desktop\/Software_1.0.2\/Software\/Software\/Hautpprogramm\/Start_Seite.py\", line 165, in newWindow_Wartung_PW\nP = subprocess.Popen([\"\/usr\/share\/applications\/florence.desktop\"])\nFile \"\/usr\/lib\/python3.7\/subprocess.py\", line 775, in init\nrestore_signals, start_new_session)\nFile \"\/usr\/lib\/python3.7\/subprocess.py\", line 1522, in _execute_child\nraise child_exception_type(errno_num, err_msg, err_filename)\nPermissionError: [Errno 13] Permission denied: '\/usr\/share\/applications\/florence.desktop'","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":80,"Q_Id":68190036,"Users Score":0,"Answer":"normally you should try to execute your script with sudo, but that wouldn't help here, because you're trying to run a .desktop file, that's not really a program. Try this: subprocess.Popen([\"florence\"])","Q_Score":1,"Tags":"python,raspberry-pi,raspberry-pi-zero","A_Id":68190124,"CreationDate":"2021-06-30T07:14:00.000","Title":"Open Programms on Raspberry Pi using Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a small application built using python and tkinter, and I want that application to run on startup.\nHere I have few questions\n\nMy question is how do I actually set the app to run at startup.\nMy application needs to login, but I don't understand how I can connect, application with database without placing database credentials in user's downloaded application.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":49,"Q_Id":68205660,"Users Score":0,"Answer":"There are 2 points here:\n\nhow to set-up an application to run at start-up?\nIf what you call startup if the machine startup before any user logs in, then the answer will depend on the OS. You will have rc scripts on Unix (and Unix-like) systems, or services on Windows.\n\nhow can an unattented application connect to the database?\nA common way is to have the application run under a dedicated login (user name). Then you configure the database to accept passwordless connections from that specific login on that specific machine (ideally the same one). Of course that login should have the less possible privileges...","Q_Score":0,"Tags":"python,postgresql,authentication,exe,app-startup","A_Id":68205893,"CreationDate":"2021-07-01T07:00:00.000","Title":"How do I set a program to run on startup and how desktop application's login check done","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am currently working on BLE in raspberry pi cm4 using Pygatt library, I am able to subscribe and able to call back the notify handler in which i am reading the data but i want a continous stream of data instead i am getting data for only 2 to 3 seconds and it automatically stops here. Please help me out","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":57,"Q_Id":68212740,"Users Score":0,"Answer":"I meet the same question. Adding \"auto_reconnect=True\" in function \"adapter.connect()\" can solve the question. It can continously receive data when reconnect is done.","Q_Score":0,"Tags":"python,bluetooth-lowenergy,gatt,bluetooth-gatt","A_Id":71291839,"CreationDate":"2021-07-01T15:11:00.000","Title":"Unable to read data continously using BLE pygatt call back function","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to be able to deploy a project that I made with pyqt5 using pyqtdeploy, I read the whole documentation, which sucks (sorry for the language), I even read the 1.3.2 version, and I still don't know how to make it work. I installed all the packages (using pip and the downloadable files for the demo) and run the setup, but I don't see the executable pyqtdeploy mentinned in the documentation, and the build-demo.py does not work.\nI'm on Windows by the way,","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":134,"Q_Id":68231530,"Users Score":0,"Answer":"This is not an answer but can sort of one since it \"solve\" the problem\nOK I took a look at the whole code and to add to the fact that there are not the executable in it (the one mentioned in the documentation), all the imports are incorrect, and we have to either rename all the files or modify the import, I think that I'm just going to change and stick with pyinstaller, even if we can only do .exe.\nHowever if someone have figured out how to make it work, I would like to know","Q_Score":0,"Tags":"python,qt,pyqt,pyqt5,pyqtdeploy","A_Id":68232378,"CreationDate":"2021-07-02T21:47:00.000","Title":"pyqtdeploy issue with how to proceed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"i have a QTableWidget created with Qt Designer and would like to know if it is possible to\nmake certain columns editable and other not in Qt designer. I have seen solutions in python\nor c++ but i would like to know if it is possible in qt designer.","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":187,"Q_Id":68243427,"Users Score":1,"Answer":"For a whole column, I don't think so. No flags are provided in the properties for the columns. If your table isn't too big, you could edit the items individually like so:\nIn the Designer, right-click the QTAbleWidget and click on Edit Items.... Then, switch over to the Items tab.\nFrom there, click on any item and then open up the Properties << tab. In there you should find a checkbox for whether that specific item is editable or not.","Q_Score":0,"Tags":"python,pyqt,pyqt5,qt-designer,qtablewidget","A_Id":68243623,"CreationDate":"2021-07-04T09:44:00.000","Title":"qt designer certain columns of a QTableWidget editable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was using python then I had to uninstall it and after Uninstall I reinstalled it and now I cant open any py file and it comes with choose a default app. I dont know why this happened. Please help me and this can be off topic or so but please help me before you flag this post or whatever. I tried repairing but it didnt help","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":17,"Q_Id":68258921,"Users Score":0,"Answer":"What OS are you using? Sounds like you don\u2019t have an IDE. You could install PyCharm for example to edit and run your scripts.","Q_Score":0,"Tags":"python","A_Id":68259165,"CreationDate":"2021-07-05T15:52:00.000","Title":"Can you help me open py.file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"as from title, I am setting up a QLabel in QT designer.\nI know I can set it up in the designer and then populate it via code.\nI still would like to exploit the ease of managing the text via the designer and import a variable value in it.\nFor instance:\nIn the designer, I set a QLabel that will be: \"Hello, [long text with formatting], this session will last\" + $variable_from_Python_code \"minutes [long text with formatting]\".\nIs it possible?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":278,"Q_Id":68268579,"Users Score":1,"Answer":"No, that's not what Designer is intended for, and Qt doesn't directly provide such support.\nAll properties are intended as \"static\", with the exception of properties directly linked with signals and slot created in the GUI.\nA possible solution would be to use a promoted widget (which wouldn't provide a visual result while designing) or a custom widget plugin (which is a pretty complex procedure that would be rather pointless if you just need to update a string).","Q_Score":0,"Tags":"python,python-3.x,pyqt5,qt-designer","A_Id":68269901,"CreationDate":"2021-07-06T10:09:00.000","Title":"In QT designer, can I set a text label that is text + a variable from my python script?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am learning how to use PyQt5 and there are quite a few points that elude me.\nI have started implementing QThreads to replace the threads I have been using in my UI as I realised that mixing threads and QThreads could possibly lead to issues later and have started using pyqtSignal simultaneously\nSo far I have seen that the pyqtSygnal needs to be implemented on a class level to be able to work ( putting it in a class constructor does not work )\nIn the architecture I use currently, I have a pyqtSignal that is instantiated in the main thread and is then used by all of the child threads. This is due to having one class that is responsible for my logs of all the program.\nI am unsure if this is a good implementation or not.\nHere are my questions :\n\nare pyqtSignals thread safe ?I know that they use a queue system to be thread safe but is the emit() method itself thread safe ? My understanding of them is a bit limited\nDo I need to protect my pyqtSignals with locks ?\nCan I have multiple different signals emitting to the same slot without having any issues ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":173,"Q_Id":68287979,"Users Score":1,"Answer":"The signals are one of the few elements of the QObjects that are thread-safe so it is not necessary to protect the data. So you can have different types of signals connected to the same slot.\nSince the signals are thread-safe then Qt recommended to communicate QObjects that live in different threads.","Q_Score":0,"Tags":"python-3.x,pyqt5,signals-slots","A_Id":68289910,"CreationDate":"2021-07-07T14:30:00.000","Title":"PyQt5 : are pyqtSignals thread safe?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way to insert a picture inside a cell using pptx python?\nI'm also thinking of finding the coordinate of the cell and adjust the numbers for inserting the picture, but can not find anything.\nThank you.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":117,"Q_Id":68289163,"Users Score":1,"Answer":"No, unfortunately not. Note that this is not a limitation of python-pptx, it is a limitation of PowerPoint in general. Only text can be placed in a table cell.\nThere is nothing stopping you from placing a picture shape above (in z-order) a table cell, which will look like the picture is inside. This is a common approach but unfortunately is somewhat brittle. In particular, the row height is not automatically adjusted to \"fit\" the picture and changes in the content of cells in prior rows can cause lower rows to \"move down\" and no longer be aligned with the picture. So this approach has some drawbacks.\nAnother possible approach is to use a picture as the background for a cell (like you might use colored shading or a texture). There is no API support for this in python-pptx and it's not without its own problems, but might be an approach worth considering.","Q_Score":0,"Tags":"python,python-pptx","A_Id":68291203,"CreationDate":"2021-07-07T15:46:00.000","Title":"Python pptx insert a picture in a table cell","Data Science and Machine Learning":0,"Database and SQL":1,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Python, while I was testing a bruteforce script I saw that not printing something like Trying Password: *password* with every attempt significantly decreases the time it takes in order to find the password. I just let it run on a blank screen but if I put something as simple as a loading animation (Running . . .)in the beginning to let me know it's working fine, would that slow down my program too?\n(Excuse me if any of what I said was hard to understand. I'm confused as well)","AnswerCount":2,"Available Count":2,"Score":0.2913126125,"is_accepted":false,"ViewCount":43,"Q_Id":68330033,"Users Score":3,"Answer":"When attempting a bruteforce, it's best to have as much processing power available. A constant call from Python to update the screen (with a loading status, in this case) takes up some processing power and would indeed slow down the bruteforce.\nBy how much it slows down depends on how your script is written and the hardware it's running on. Better hardware - faster. Better threading for the script - faster. You might be able to avoid a noticeable impact if you offload the \"animation\" to a thread which isn't fully utilized (if your script leaves any such threads in the first place).\nThough unless you are on a very slow PC, the main slow down probably doesn't come from the CPU, but from the data bus. Sending information between components at a very rapid pace could cause a bottleneck. So if your script waits for that bottleneck to pass before it continues cycling passwords - it gets slowed down. Try to separate the \"loading\" status from the rest of the logic, so that the CPU can keep cycling passwords without waiting for each screen refresh to pass.\nI hope this helped.","Q_Score":1,"Tags":"python","A_Id":68330119,"CreationDate":"2021-07-10T17:17:00.000","Title":"Would adding an animation slow down my program in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"In Python, while I was testing a bruteforce script I saw that not printing something like Trying Password: *password* with every attempt significantly decreases the time it takes in order to find the password. I just let it run on a blank screen but if I put something as simple as a loading animation (Running . . .)in the beginning to let me know it's working fine, would that slow down my program too?\n(Excuse me if any of what I said was hard to understand. I'm confused as well)","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":43,"Q_Id":68330033,"Users Score":1,"Answer":"I\/O bound operations like printing are very slow compared to CPU bound ops like calculations.\nSo, everytime you printed, trying password, your program could have tried 1000 more combinations.\nBut if you want to print once in the beginning, it wont slow down, printing repetitively will.","Q_Score":1,"Tags":"python","A_Id":68330089,"CreationDate":"2021-07-10T17:17:00.000","Title":"Would adding an animation slow down my program in Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Ok, I know there are other posts but couldn\u00b4t relate to none, so, bare with me here\nWhy I'm not posting code: happened in multiple codes\nI have all my imports on buildozer.spec file requirements as usual.\nSimple applications I am able to run NP.\nbut I am actually developing a bigger app that connects to googlesheets to download data. (I don't think the problem is related to google though - other project that doesn't rely on that also crashes).\nSo I started to get really odd crashes like:\n\"ModuleNotFoundError: no module named imageio\"\nOk, I have never asked to import imageio. But when I put imageio in the requirements (on buildozer.spec) suddenly other module is not found and this is going on forever.\nThinks worth notice: It is working on local OS (Ubuntu 20)\nI am using a virtual environment.\nBuildozer is able to build and install apk.\nIs there anything I am missing? It has been going for months now and I was very reluctant to post as this is odd, but couldn't find anything searching for an answer. So, any help would be great!\nI've tried using Python3.8 and 3.9","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":98,"Q_Id":68420233,"Users Score":1,"Answer":"This Is Common Problem For Beginners Who Are Using Other Third Party Modules And Getting Module Not Found Error And The App Crashes\nThis Occurs Because :\n--> Even Though You Used Only One Third Party Module - The Third Party Module Itself Has Other Third Party Modules in Them\nSo Basically When You Add : Say for example : torch, it maybe using other third party modules like : numpy\nSo Even Though When You Add torch to .spec file , The app may crash by throwing a Module Not Found Error [numpy].\nThe Solution To This Example Problem Is That : You Have To Add numpy in the requirements in the .spec file.\nSo, A Basic And Most Common Solution To This Kind Of Problem Is\n--> Run The App Everytime And Note Down Which Modules Are Not Found And Add that module in the .spec file\nWhen All The Third Party Modules Are Satisfied Your App Will Run As Butter :)","Q_Score":0,"Tags":"kivy,python-3.8,buildozer,kivymd,modulenotfounderror","A_Id":68426739,"CreationDate":"2021-07-17T11:47:00.000","Title":"Buildozer keep crashing for different ModuleNotFoundError reasons","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Recently, I learned that C++ codes runs faster than Python. We have post-processing Python script which takes huge time to run. So, I'm thinking of replacing them with C++ code. I know that C++ code can only be used for Post-processing, and that is fine for me.\nI am not sure how to run the C++ code in Abaqus. I know that I need a compiler to compile the C++ code, like Visual Studio. But I don't know about integrating it with Abaqus and overall flow to compile and run the script.\nAny help will be much appreciated!","AnswerCount":1,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":126,"Q_Id":68449638,"Users Score":-1,"Answer":"Recently, I have the same problem with you,if you want to use C++ you must use the script in command: abaqus make job=filename.cpp.Then abaqus will give you a file:filename.exe,I think that C++ is same as fortran,I couldn't link it to abaqus ,so I couldn't run the .exe file,if you can solve my problem I would appreciate that you could answer me.","Q_Score":0,"Tags":"python,c++,visual-studio,abaqus","A_Id":68647599,"CreationDate":"2021-07-20T04:42:00.000","Title":"Integrating compiler to compile C++ code and running it in Abaqus","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I see people complaining about how Pygame is so slow, having a backend with C and SDL and Godot seems to have a great performance even using a Python-like language.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":1140,"Q_Id":68461622,"Users Score":1,"Answer":"Godot is a game engine while Pygame is a cross-platform set of Python modules.\nGame engines handle a lot of stuff related to game loop under the hood using a low level compiled language like C\/C++. This means that developers can write scripts with higher level languages like C# or GDScript that contain methods that get invoked by the engine at certain points of the execution. The engine itself handles rendering, updating physics, polling for inputs and whatnot.\nWith Pygame you're likely writing the game loop yourself and calling bunch of libraries to poll for inputs, draw\/render graphics, update physics etc. This means that a bigger chunk of the execution time gets spent executing python scripts than say GDScripts in Godot.","Q_Score":0,"Tags":"python,performance,pygame,godot","A_Id":68498192,"CreationDate":"2021-07-20T21:34:00.000","Title":"How does Godot manage to be fast with GDScript while Pygame is so slow with Python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I try to distribute a tkinter GUI while using ttkbootstrap.\nThe isse I have is, that it seems that the default path to the ttkbootstrap_themes.json file is in C:\/User\/Documents folder.\nWhen I copy the file into my project folder I get an error that the file is missing.\nAnyone knows a workaround for that so I can later on also compile it to exe and send it to other users?\nI cant find any information about that in the documentation.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":99,"Q_Id":68481409,"Users Score":1,"Answer":"Got it:\nstyle = Style(theme='custom_name', themes_file='C:\/example\/my_themes.json')","Q_Score":0,"Tags":"python,user-interface,tkinter,bootstrap-4,ttk","A_Id":68481468,"CreationDate":"2021-07-22T08:16:00.000","Title":"change path to ttkbootstrap json file","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"While building kivy app for android using buildozer, I found an error saying pdfminer module was not found. Then I included the requirements of pdfplumber in the buildozer.spec file. Then I got the error that chardet was not found. Now should I keep finding and adding the requirements of the other modules as well? That is a very difficult process. Is there any easy solution for this? Please help. Any suggestions are welcomed.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":81,"Q_Id":68509187,"Users Score":1,"Answer":"Now should I keep finding and adding the requirements of the other modules as well?\n\nYes, you should.\n\nIs there any easy solution for this?\n\nYou could make a virtualenv, install what you need letting pip resolve dependencies, then export the installed packages list and use that in buildozer.","Q_Score":1,"Tags":"python,kivy,kivy-language,buildozer,python-for-android","A_Id":68509203,"CreationDate":"2021-07-24T10:38:00.000","Title":"Kivy app crashes saying no module name \"chardet\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to hold down the right mouse button for a script I'm working on. Any help would be appreciated","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":295,"Q_Id":68526812,"Users Score":0,"Answer":"try this:\npyautogui.drag(10, 0, 0, button='right')\nI am on mobile and i cant convert it to code sorry.","Q_Score":0,"Tags":"python","A_Id":68526914,"CreationDate":"2021-07-26T08:39:00.000","Title":"Hold down right mouse click with Pyautogui","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am confused about pygame.init() which needs to be run manually to start working in pygame. However, since it is crucial to run anything, why would this not be run by default?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":102,"Q_Id":68527294,"Users Score":1,"Answer":"The best way to think about why pygame.init() is relevant is how pygame works: Pygame relies on a library called SDL2 (Simple DirectMedia Layer 2) to display images. Hence, whenever you start pygame it needs to start up quite a few things in the background. Since this can be unnecessary at times pygame gives you control over it.\nFor a beginner, this might not be terribly obvious but you don't necessarily have to call pygame.init() and you could instead initiate the modules you want individually. For example, if you wanted to only initialise the font module you would replace pygame.init() with pygame.font.init(). You don't see this often in tutorials because most pygame ones are for beginners and pygame.init() is used to keep things simple.\nI guess 2 examples to illustrate why this can be useful:\nExample 1 - You want to display data with pygame and don't need text or sound\nExample 2 - You have pygame code over multiple files, let's say a file with the main code and another file with the sprite of the main character. You would only need to call pygame.init() on the main file and not on the sprite file, thus reducing the processing time.","Q_Score":0,"Tags":"python,pygame","A_Id":68531100,"CreationDate":"2021-07-26T09:14:00.000","Title":"why does pygame not run pygame.init() by default?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a function that checks if UI window is still opened.\nI would like to end a process if the UI is closed. Maybe something similar to isActiveWindow().","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":310,"Q_Id":68532440,"Users Score":0,"Answer":"you can check the isHidden() method","Q_Score":0,"Tags":"python,pyqt5","A_Id":68532524,"CreationDate":"2021-07-26T15:18:00.000","Title":"PyQt5 - how to check if UI window is opened","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do you insert text into a TextInput. I cant figure this one out and have not found anything in the docs. I want text to appear in the text field","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":114,"Q_Id":68657187,"Users Score":0,"Answer":"Not the proper answer but here is a first idea:\nprint(\"Press Enter to continue\")\nenter_btn = input(\" \")\nif enter_btn in '':\nyour code goes here\n(I'm not working with Kivy, but I guess there is something similar there)","Q_Score":0,"Tags":"python,kivy,kivy-language,kivymd","A_Id":68657331,"CreationDate":"2021-08-04T19:41:00.000","Title":"How to insert text into a textinput in kivy\/KivyMD?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I would like to warp one fisheye image:\nLeft:\nInto this target image:\nThe target image is actually a part of the synthetic panorama:\nI know a method called mesh warping, like:\nBut how am I able to find or define a irregular mesh like this? Very grateful if someone can give me some suggestions. I would like to have this mesh, so that I can use this mesh for every frame of a video and warp every frame into this target image.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":224,"Q_Id":68669766,"Users Score":0,"Answer":"Is this a one-off project, or are you trying to write an automatic procedure?\nIf the former, you can just hand-tag corresponding points in the two images till you have enough coverage, particularly in the more \"curvy\" areas, then warp using (for example) a thin-plate spline defined by the point correspondences. This works iteratively: match some points, warp, figure out where the error is largest, add more point matches there. Doing all this in, say, Matlab or Python+OpenCv is quite easy.\nYou can then try to automate it using feature extraction and matching. The trouble is you'll need to use both point and line correspondences...","Q_Score":0,"Tags":"python,opencv,image-processing,graphics,warp","A_Id":68674621,"CreationDate":"2021-08-05T15:49:00.000","Title":"Image warping using mesh","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For example I have an empty data table (with only column data) and a button. I want to dynamically add row data when button is pressed. Is it even possible?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":771,"Q_Id":68694061,"Users Score":0,"Answer":"AttributeError: 'MDDataTable' object has no attribute 'open'","Q_Score":1,"Tags":"python,python-3.x,kivy,kivymd","A_Id":72024091,"CreationDate":"2021-08-07T16:07:00.000","Title":"Dynamically adding a row in data table Kivy\/KivyMD","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made an online connect 4 game that uses the following logic:\n\nPlayer1 sends their move to the server\n\nServer sends the move to Player2\n\nPlayer2 receives the move, makes their own move and sends it to the server\n\nServer sends the move to Player1\n\nPlayer1 receives the move, makes their own move and sends it to the server\n\n(until someone wins or it's a draw)\n\n\nIt works but there is a problem: when player1 takes a while to choose their move and player2 is waiting to receive, player2's pygame window becomes unresponsive since it is stuck in a .recv() call. How can I fix this?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":51,"Q_Id":68749722,"Users Score":2,"Answer":"You need to use threading and events. This way, the pygame window can refresh while another thread waits for any updates from the server.\nAs soon as the thread receives the update, an event should handle it to the main thread.\nI don't remember much about implementation details (i'm a C# developer), but i used this while waiting for a AI to complete in Python.","Q_Score":0,"Tags":"python,sockets,pygame","A_Id":68749797,"CreationDate":"2021-08-11T22:44:00.000","Title":"pygame window Not responding error (using sockets)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wrote a program in Python using TKINTER GUI and I`m using a special font i have downloaded.\nI gave all elements the font family definition - something like this :\nlabel000.config(font=('Retro Team', 74), fg='black')\nThis application is being used by several users and they don`t have this font installed on their PC.\nis there any way not asking them to install it manually before execution?\nThanks !","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":162,"Q_Id":68750075,"Users Score":0,"Answer":"Thanks guys !\npyglet.font.add_file did the trick.\ni have located the font file in our network and mapped Pyglet to it.\nThanks","Q_Score":0,"Tags":"python,tkinter","A_Id":68754995,"CreationDate":"2021-08-11T23:46:00.000","Title":"Python Tkinter - How to use a font which is not installed on a different pc while running the EXE program on it?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am on a Mac with MacOS Bug Sur\/11.4 installed. \nwhen I open files using Pygame the files appear in the \"recently used\" folder, is there any way to prevent that?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":37,"Q_Id":68755501,"Users Score":0,"Answer":"I'm pretty sure there is no solution via code. You could check your computer settings to disable the recently used folder or simply remove the files from the folder. Hope this helped mate.","Q_Score":0,"Tags":"python,macos,pygame","A_Id":68756708,"CreationDate":"2021-08-12T10:15:00.000","Title":"Image files used in Pygame appear in the \"recently used\" folder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have used tkinter to make a complex GUI, with the mainwindow as a class, so I can put function defs anywhere, and the other perks of doing it that way. Currently the simpler subwindows are just defined as normal functions within this class, called like a normal function (and using Tk.Toplevel()).\nMy questions is - does it make sense to also write these subwindows as classes like the main window (or is it even possible?), or does this just end up making a whole mess? So far I can't figure out an elegant way to do it versus just making the subwindows traditional functions rather than classes... but I know in the long run the \"class\" way of doing it is better for the main window, so if the subwindows get more and more complex, should I somehow do the same approach?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":94,"Q_Id":68811567,"Users Score":0,"Answer":"Thanks all - it wasn't so much an opinion question, rather is it possible in the first place. Turns out it's quite simple and I was over-complicating it. I was trying to create instances of the sub-window class, which in turn was inheriting the entire main window class, trying to call it's own mainloop(), etc etc. Very messy.\nFor people in the same boat - code the subwindow as if it were a stand-alone main window, but use tk.Toplevel() rather than tk.Tk() to 'start' it within init(), then to call (i.e. open) it you don't need to create an instance, just call it as though it were a function (it will call the class constructor and Toplevel() handles most of the rest).","Q_Score":0,"Tags":"python,class,tkinter,subclass,toplevel","A_Id":68826422,"CreationDate":"2021-08-17T04:07:00.000","Title":"Tkinter subwindows as classes","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"this code that i wrote runs fine in my ide and the exe version. but the problem arises when i try to close the program. it shows me this error(and yes, i've imported sys and used sys.exit() instead of quit().):\n\nFile \"source.py\", line 77, in \nFile \"source.py\", line 41, in main\nfor event in pygame.event.get():\nNameError: name 'quit' is not defined\n\nmy game is almost done, and this is the only thing that bothers me. any help would be appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":32,"Q_Id":68815702,"Users Score":0,"Answer":"You need to write pygame.QUIT instead of quit","Q_Score":0,"Tags":"python,pygame","A_Id":68820246,"CreationDate":"2021-08-17T10:28:00.000","Title":"exe version of code shows error message when i try to close it","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Im trying to find a way send inputs to XINPUT buttons for a controller that is already plugged in. So the one python repo (vjoy\/pygame) wouldn't work since it \"adds\" a controller.\nDoes anyone know if this exist?\nFor a similar comparison I am able to have python trigger buttons on my keyboard by using Direct X scancodes and Sendkeys but I could not find scan codes for Xinput or controllers.\nThanks again!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":97,"Q_Id":68839640,"Users Score":0,"Answer":"I think what you want is a virtual xinput controller. If so, you should check out the relatively new but excellent vgamepad library. It's a wrapper around vigem, so you can send your keys to a virtual Xbox controller.\nI hope that answers your question.","Q_Score":1,"Tags":"python,sendkeys,xinput,scancodes","A_Id":70103831,"CreationDate":"2021-08-18T21:39:00.000","Title":"Is there a method to use Sendkeys with Xinput?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to import pygame for my game but its saying there's no such module I've tried making new folders(and other things) but its still saying it not a module(I'm a beginner)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":68913229,"Users Score":0,"Answer":"are you on windows? have you created a virtual environment?","Q_Score":0,"Tags":"python,macos","A_Id":68913494,"CreationDate":"2021-08-24T19:39:00.000","Title":"Pygame import problem VSC(visual studio code)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to import pygame for my game but its saying there's no such module I've tried making new folders(and other things) but its still saying it not a module(I'm a beginner)","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":68913229,"Users Score":0,"Answer":"I had a similar issue with VS Code, if you are on windows you can try this: (if not you're going to have to read the docs for creating a virtual environment on your system with VS code.)\nThis is what I did and it worked.\n\nOpen windows powershell as administrator.\n\nTurn off Execution Policy\n\n\n\nSet-ExecutionPolicy Unrestricted\n\nOnce that is done, if you haven't done this already:\n\ncreate a virtual environment in the terminal in VS Code.\n\n\npython -m venv [env_name] #usally name of project + env\n\n\nNow you have to:\n\n\nActivate virtual environment:\n\n\npath\\to\\env\\Scripts\\activate\n\nyou may have to use activat.ps1 or Activate.bat depending on your system. Just go into the environment folder that is created in your project folder and click Scripts. Once you do that you can scroll down and you will see a few files that start with activate. You can read each one to see which one you would need. But activate should work\nOnce that is activated you will see something like this:\n\n(env_name) C:path\\to\\project\\folder> \n\n\nNow you can install packages into your venv and use them in your VS Code Script","Q_Score":0,"Tags":"python,macos","A_Id":68913537,"CreationDate":"2021-08-24T19:39:00.000","Title":"Pygame import problem VSC(visual studio code)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I made a Tkinter GUI, added text-widget to it, and added a save button but when I click the save button it save as a text (.txt file) and I want it to save the text as a picture which would be read-only(.png) can anybody help?\nin simple words\nwhats happening=user save the file - it is saved as a txt file\nwhat I want=user save the file - it is saved as a png Image\nIt is a text widget not a canvas\n(Actually, first i wanted it to Do like because I was having an option that can change the color of the text according to the user's choice and save it as a pdf but that didn't work if you can do that would also work) :)","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":164,"Q_Id":69054251,"Users Score":1,"Answer":"Write your cods in txt file and go to file menu and click on (save as) and save file with .png format\nlike (cod.png)","Q_Score":0,"Tags":"python,tkinter","A_Id":69055122,"CreationDate":"2021-09-04T09:56:00.000","Title":"How to save your tkinter text file as a image(.png)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm building a script to automate some stuff on my Android emulator I'm currently using pyautogui to do it tho it would be nice if there was some sort of way I can directly interact with the emulator without it relying on my mouse\nI know there's an option using ADB but that requires the android to be rooted\na lot of android emulators like Nox, Bluestacks, LDplayer have built-in macros that don't require the device to be rooted.\nHow do these emulators send commands to the emulator is that something I can tap into and send commands through that instead?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":327,"Q_Id":69068138,"Users Score":0,"Answer":"Answer: These emulator run on virtual machines their macro is sending input command from the virtual machine input API","Q_Score":0,"Tags":"python,android,android-emulator,adb","A_Id":69123025,"CreationDate":"2021-09-06T00:36:00.000","Title":"How do built in macros on Emulators work?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've set my TextInput's color to a diffrent one, even though - if you don't click on the TextInput you see a weird shadowed look on the TextInput. Blackish-grey at the top and white on the bottom. How do you get rid of this? I've tried foreground_color it doesn't work, even background_color - it doesn't work. How?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":39,"Q_Id":69075727,"Users Score":0,"Answer":"Just add background_normal: '' to the TextInput in your kv.","Q_Score":0,"Tags":"kivy,python-3.8,textinput","A_Id":69078945,"CreationDate":"2021-09-06T13:54:00.000","Title":"Kivy: how to get rid of the weird shadow look in TextInput?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm writing code in python to help me accomplish something in a Roblox game. I won't go into too much detail, but basically, the objective is to automatically click at certain points in the screen. To try to accomplish this, I am using pyautogui.click(). So for instance if the point I needed to click at was (300, 500), I'd do pyautogui.click(300, 500)\nOutside of Roblox, pyautogui works just fine. However, whenever I have Roblox open and I use the commands, it doesn't work properly. So, let's say the mouse starts out at (0, 0), and I activate a click at (300, 500). When that happens, the mouse cursor doesn't move, and the click happens at (0, 0) where the mouse originally was. However, as soon as I move my actual mouse even slightly, the mouse cursor teleports back to (300, 500) where it was supposed to be.\nThis makes it impossible to do what I want because I want the program to click at certain spots without me having to move my actual, physical mouse. Does anyone know how I can use python to actually move the mouse properly?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":541,"Q_Id":69080495,"Users Score":0,"Answer":"you have to use pyautoit to make it work inside of roblox, i used autoit.mouse_click(\"left\",x, y) to make the mouse go to an x and y position in your screen and click the left or right click.","Q_Score":0,"Tags":"python,mouse,roblox","A_Id":71898899,"CreationDate":"2021-09-06T21:39:00.000","Title":"Pyautogui not properly moving the mouse in Roblox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there anyway to bind certain coordinates of window or frame like when mouse enter these coordinates call this function etc. The reason is that i want to bind these coordinates for scrollbar, So I can hide scrollbar if user leaves that position.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":47,"Q_Id":69117664,"Users Score":0,"Answer":"No, you cannot bind to specific pixels. However, you can simulate that by binding to all mouse movement (eg: ). In the bound function, you can then determine if the mouse is over whatever region you want to have active.","Q_Score":0,"Tags":"python,tkinter","A_Id":69120146,"CreationDate":"2021-09-09T11:50:00.000","Title":"How can we bind certain pixels of tkinter window or frame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Everytime I deploy my app, I delete all the stuff in the folder and I load my Github app project (with the .spec) before running buildozer -v android release.\nNow I encounter this error: toolchain.py: error: the following arguments are required: --package\nbut I only changed my python code. How is it possible that changing python stuff makes my .apk creation crash ? What could I try to debug this ?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":97,"Q_Id":69130360,"Users Score":0,"Answer":"Found it, you can begin a line with # to make a commentary but you can't do put it following a useful line.","Q_Score":0,"Tags":"python,kivy,buildozer","A_Id":69136356,"CreationDate":"2021-09-10T09:45:00.000","Title":"Kivy buildozer: toolchain.py: error: the following arguments are required: --package","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to have an image as a background to a Listbox, but I am am only able to find out how to change background color of one.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":152,"Q_Id":69144983,"Users Score":0,"Answer":"No, it is not possible to add an image as a background for the listbox.","Q_Score":0,"Tags":"python,tkinter,background,listbox,background-image","A_Id":69145358,"CreationDate":"2021-09-11T16:50:00.000","Title":"Is it possible to add image as a background to Listbox in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have successfully compiled a few android packages with buildozer (e.g 'openweather' works just fine with an API key).\nMy Kivy file works fine.\nWhen I include geopy, buildozer successfully compiles the kivy file, but the app crashes when I ask for the Lat\/Lon position.\nI have an API key from Nominatim\/MapQuest:\nin the 'main.py file': user_agent='API_key' or 'app_name' or my email address\nin the buildozer'spec file':\nrequirements: pytyhon3, kivy, geopy\nandroid.permissions= INTERNET\nMy question, what am I doing wrong?\nRegards\nSybe","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":70,"Q_Id":69189538,"Users Score":0,"Answer":"The permissions should be android.permissions = INTERNET, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, if you need access to the devices gps.\nTry to rebuilding your app with those permissions included and post the logcat output if it still crashes","Q_Score":0,"Tags":"python,kivy,buildozer,geopy","A_Id":69205247,"CreationDate":"2021-09-15T08:24:00.000","Title":"python, kivy, geopy, buildozer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using the latest version (to date) of pywinauto; and also using PyInspect (uia) to identify controls.\nI'm automating controls on an application, and part of the process is to check a few boxes on a window that pops up after triggering the window to appear from a menu selection (like Edit->Settings).\nThe problem is, pywinauto doesn't seem to be able to detect the new window. I see successfully opens; and can see the window and elements as a sub (child?) window of the application in PyInspect.\nI've tried wait methods, thinking the automation is occurring too fast- but to no avail. something like:\nmysettings = app['app-name'].child_window(title_re=\"my target settings window\", class_name=\"#32770\").wait('exists', timeout=10)\nthis will just timeout. And if I print control identifiers, \"my target settings window\" is never included.\napp['app-name'].print_control_identifiers()\nI also tried set_focus on top_window.. that didn't work either. My conclusion is that pywinauto is having trouble detect that it is there. Any thoughts on this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":718,"Q_Id":69215801,"Users Score":1,"Answer":"I was able to resolve this issue of pywinauto detecting the child window, and the issue that immediately followed: accessing the child window.\nFirst, I was able to get pywinauto to detect the new window by defining backend='uia' in the application definition, like this:\napp = application.Application(backend='uia')\nI previously just had:\napp = application.Application()\nMy next issue was accessing elements on the child window. I could not access the window directly, as I may have anticipated:\napp['my app']['child window']['textbox'].set_edit_text(\"hello world\")\nInstead, this code worked:\napp['my app'].child_window(title='child window name').Edit1.set_edit_text(\"hello world\")\nWhile I have resolved my issue, I have noticed that after defining backend='uia', the process now executes much slower than before. If anyone who stumbles across this has any feedback in that regard (or optimizing my efforts above), please contribute.\nThanks","Q_Score":1,"Tags":"python,automation,pywinauto","A_Id":69226258,"CreationDate":"2021-09-16T22:20:00.000","Title":"pywinauto does not detect child window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wrote some script with tkinter as a GUI and pyinstaller to convert it to an exe.\n\nHowever gmail doesn\u2019t allow me to share the file\nif I share the file with google drive then windows security gets triggered\n\nWhat\u2019s a good safe and easy way for people who don\u2019t know how to install python to use the code I write in python.\nThank you","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":39,"Q_Id":69238534,"Users Score":1,"Answer":"You could use Discord. I believe you can upload an exe to Discord.","Q_Score":1,"Tags":"python,user-interface,tkinter,pyinstaller,exe","A_Id":69240032,"CreationDate":"2021-09-18T21:21:00.000","Title":"Share script with non coders","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I'm having 3 days education seminar which isn't of much use for me, so I'm writing my program on a paper and I'm wondering something since I can't test it at-the-moment.\nI'm basically scanning my screen for image, and screen is divided into 8 segments. I don't need to scan all 8 segments, but for instance now, let's say I only need to scan 5 out of those 8 where image can pop out.\nIs it faster to just make pyautogui to scan whole screen and write down coordinates where image was seen, and I'll then know by coordinated on which screen it popped, or is it faster to make multiple pyautogui searches with defined regions? So is it faster if pyautogui searches whole screen once or if pyautogui makes multiple searches with defined regions, searching only 20-70% of screen?\nIf it depends on how much screen in the end I search, what would be aproximate percentage where one becomes faster than other? For instance: searching 4 times 50% of screen is faster than searching once 100% screen, but searching 6 times 75% of screen is slower than searching once 100%.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":89,"Q_Id":69269376,"Users Score":0,"Answer":"I think that the faster and more efficient\/accurate process here would be searching the whole screen through pyautogui and write down the coordinates where the image was seen, and you then knowing by the coordinated on which screen it popped...\nSo I would reccomend using this method as the second methos would be more slower and not as efficient as this","Q_Score":0,"Tags":"python,python-3.x,pyautogui","A_Id":69269872,"CreationDate":"2021-09-21T13:02:00.000","Title":"Pyautogui - which approach is faster?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've just installed py2app 0.26 since I need the new SSL recipe, however, it appears to be displaying only a black Tkinter window upon launch.\nJust seeing if anyone else is encountering this issue and if there have been any workarounds since py2app 0.26 has been released.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":64,"Q_Id":69313214,"Users Score":0,"Answer":"This is caused by a bug in py2app 0.26 in combination with the \"Intel\" variant of the Python.org installer for macOS. The bug is fixed in py2app 0.26.1.","Q_Score":0,"Tags":"python,tkinter,tk,py2app","A_Id":69349854,"CreationDate":"2021-09-24T10:06:00.000","Title":"py2app 0.26 Black Tkinter window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need my win.flip() call as much close to being real-time as possible. Meanwhile, while waiting for the trigger to occur, which flips the buffer, I also want some keyboard keypresses to be listened for. So, which one is faster:\n\nassigning event.globalKeys.add() and relying on pyglet's thread to poll it\nor manually checking for len(event.getKeys()) in my trigger callback?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":40,"Q_Id":69354415,"Users Score":1,"Answer":"You should be using the new Keyboard class which can plug into either the ioHub event polling system or the Psychtoolbox engine for event polling. Both of those poll the keyboard on a separate process independent of the rendering loop and timestamp the keypresses at source. Calls to event.getKeys() use pyglet and then polling occurs only once per screen refresh, at least during dynamic updating.\nWe would typically recommend, however, that you simply create studies in the Builder which will automatically use the current best practice and methods so you don't have to keep abreast of what the latest recommendations are.","Q_Score":0,"Tags":"python,real-time,polling,psychopy,low-latency","A_Id":69375109,"CreationDate":"2021-09-28T00:12:00.000","Title":"How do I minimize latency caused by event polling in Psychopy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a python project written with PySide2 and now I want to migrate to PySide6. I used Qt Linguist to translate UI and created .ts files with help of this command:\npylupdate5 utility from PyQt5 package (but it worked fine for my project with PySide2). Now I plan to get rid of PySide2 and PyQt5 packages.\nSo, I need to replace pylupdate5 with something from PySide6 package. I assumed lupdate should to the job but it seems it works only with C++ code. It gives me errors like Unterminated C++ character or Unbalanced opening parenthesis in C++ code. An with lupdate -help I don't see how I may switch it to python mode (similar to uic -g python).\nDoes anyone know how to create .ts files for Qt Linguist from python source files?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":349,"Q_Id":69409367,"Users Score":3,"Answer":"lupdate of Qt 6.1 does not support Python but in Qt 6.2 that problem no longer exists so you have 2 options:\n\nInstall Qt 6.2 and use its lupdate.\nWait for PySide6 6.2.0 to be released (at this moment it is only available for windows) and use lupdate.","Q_Score":0,"Tags":"python,qt,pyside6","A_Id":69409916,"CreationDate":"2021-10-01T16:42:00.000","Title":"How to create .ts files for Qt Linguist with PySide6?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to fix leaks in a ctypes-based Python binding over a C library. I'm confused as to the behavior of memory management of strings and other pointers when working with ctypes.\nThere are, to my knowledge, 3 cases I need to solve, basically:\nA) Creating memory in C and returning a c_char_p as the result of the function to the Python.\nB) Creating a string in the Python, and passing it as a char const* parameter of a C function, and not freeing it in the C: this is the only one I've solved confidently: I can just do my_str.encode(\"utf-8\") into a c_char_p, and the Python Alloc\/GC handles both the allocation and deallocation.\nC) Creating memory in Python, and storing it in the C (for example as a char* field within a struct), to be deallocated later (with a function from the C library).\nMy questions:\nA)\n\nis the c_char_p thus created a second pointer ? If so, what happens to the pointer allocated by the C ?\nhow do we free the pointer returned from the C ?\nis there a difference of behavior between how c_void_p and c_char_p are handled as restype by the GC ?\n\nC)\n\nWhat is the correct way to \"give ownership\" of a memory pointer allocated in Python to the C ? .encode() clearly makes a Python object that's GC'ed.\nis a string created by create_string_buffer also Python-GC'ed ?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":205,"Q_Id":69419126,"Users Score":0,"Answer":"This is an adaptation of the exchange I had on the Python discord server with someone who answered the questions:\n\nis the c_char_p thus created a second pointer ? If so, what happens to the pointer allocated by the C ?\n\nYes, it is. The c_char_p is a PyObject* pointer that lives on the heap, and it stores the original C char* pointer inside it.\n\nhow do we free the pointer returned from the C ?\n\nPass the c_char_p to free() using ctypes\n\nis there a difference of behavior between how c_void_p and c_char_p are handled as restype by the GC ?\n\nNo, in both cases, when the c_void_p or c_char_p is garbage collected, it does nothing, ie, it does not free the original C object that was pointed to.\n\nWhat is the correct way to \"give ownership\" of a memory pointer allocated in Python to the C ?\n\nThat's not normally something you'd do - memory created by Python is usually freed by Python, memory created by C is usually freed by C. If you need to pass something from one domain to the other, it's best to copy it. It's possible to make the C side keep a Python reference to the Python object by using the Python C API, but that's probably not the best idea.\n\nis a string created by create_string_buffer also Python-GC'ed ?\n\nIn this case, when the Python object is GC'd, it also frees the C memory. A c_char_p knows whether it owns the memory that it points to or doesn't, and when it's GC'd it frees the C memory if it owns it.\n========\nSince my (I = asker) goal is to have as few (no) reference to ctypes types for the Python end-user, given the answers above, I would do the following:\n\nwhen I malloc a char* in the C in a function char* do_c_func(), I return it as a c_char_p restype in Python. In my Python, I have a wrapper function do_py_func() that calls do_c_func(), receives this c_char_p called my_c_char_p, and stores its contents in a Python string, through some sort of s = str(my_c_char_p). I then call ctypes.free(my_c_char_p): this frees the malloced char*, and the end of the function decrementing the last reference counter, this eventually garbage collects my_c_char_p.\n\nI create a conversion function python_str_to_c_str(py_str) which takes a normal python string, and returns stdc.strdup(py_str.encode('utf-8')) (with stdc.strdup.restype = c_char_p), thereby providing a new char* to the C (which Python will recognize as having been created in the C). I use this conversion function anywhere I need to pass a string from the Python to the C. This makes it so the buffer created by my_string.encode('utf-8')), and the c_char_p returned by stdc.strdup, are both garbage-collected by the Python, but the char* itself is not.","Q_Score":0,"Tags":"python,c,memory-management,memory-leaks,ctypes","A_Id":69419127,"CreationDate":"2021-10-02T18:25:00.000","Title":"Memory management and removal of leaks, in C and Python with ctypes, using the example of strings","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do you hide the turtle while drawing in Python 3. It is covering my work and I need to see exact corners and other things. Is it also possible to draw with it hidden? Thank you.\nI have tried this command and it did nothing.\nt = turtle.Turtle()\ns = t.getscreen()","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":127,"Q_Id":69468093,"Users Score":0,"Answer":"Try using hideturtle() function. The syntax would be . hideturtle()","Q_Score":3,"Tags":"python,turtle-graphics","A_Id":69468956,"CreationDate":"2021-10-06T14:58:00.000","Title":"How to hide the turtle in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I got the error given below ,While launching the sysmon in Linux :\n\"Traceback (most recent call last):\nFile \"\/usr\/local\/bin\/sysmon\", line 5, in \nfrom sysmon.sysmon import main\nFile \"\/usr\/local\/lib\/python3.6\/site-packages\/sysmon\/sysmon.py\", line 1, in \nfrom PyQt5 import QtWidgets, uic\nImportError: libGL.so.1: cannot open shared object file: No such file or directo ry\"\nI have installed the following packages with the command \"pip3 install sysmon --force\"\nnumpy -version 1.19.5,\n,pip -version 21.2.4\n,PyQt5 -version 5.15.4\nPyQt5-Qt5 -version 5.15.2\n,PyQt5-sip -version 12.9.0\n,pyqtgraph -versin 0.11.1\nsysmon -version 1.0.1\nPlease anyone can help me to resolve the issue.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":977,"Q_Id":69480301,"Users Score":0,"Answer":"i think you don't have ffmpeg installed because libGL.so.1 is part of ffmpeg\nfor install ffmpeg you can use:\nUbuntu: sudo apt install ffmpeg\nArch Linux: sudo pacman -S ffmpeg\nand for other distros search in package manager of that distro you can find ffmpeg","Q_Score":0,"Tags":"python","A_Id":69480728,"CreationDate":"2021-10-07T11:26:00.000","Title":"ImportError: libGL.so.1: cannot open shared object file: No such file or directo ry while launching sysmon","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I had this problem since I started using the code runner extension. a file called tempCodeRunnerFile.py get created and runs when I click on the run button it really annoying, I tried deleting the tempCodeRunnerFile.py file but it keeps coming back.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":308,"Q_Id":69530044,"Users Score":1,"Answer":"It indicates that you have selected part of the code snippet and run it.\nYou can add \"code-runner.ignoreSelection\": true in the settings.json file to avoid it.","Q_Score":0,"Tags":"python,visual-studio-code,vscode-code-runner","A_Id":69535714,"CreationDate":"2021-10-11T17:07:00.000","Title":"tempCodeRunnerFile.py problem in visual sudio","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I actually made an executable with some ui in tkinter for automating some tasks in my Windows 10 computer. But since Windows 11 started rolling out, I was wondering if my app can still run in Windows 11.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":124,"Q_Id":69552507,"Users Score":0,"Answer":"Yes it will indeed work, if your app doesn't use features that were deprecated in Windows 11. You can also run it in compatibility mode if there is some unexpected behavior.","Q_Score":1,"Tags":"python,windows,tkinter,exe","A_Id":70262048,"CreationDate":"2021-10-13T08:54:00.000","Title":"Can windows 10 standalone executables (in Python) run on Windows 11?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The Tkinter app works good after deployment with Pyinstaller,\nbut it opens 2 windows: .exe and app (tkinter container).\nAny ideas? how to fix it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":32,"Q_Id":69560083,"Users Score":0,"Answer":"I'm not sure I understand completely but you may want to try saving the file as .pyw vs .py before making it an executable. you may be seeing the console running.","Q_Score":1,"Tags":"python,pyinstaller","A_Id":69561124,"CreationDate":"2021-10-13T17:47:00.000","Title":"Pyinstaller: It works, but .exe window and App Window is separated. Any ideas?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I\u2019d like to make a simple application which shows one element from a list on screen at a time (using curses). The user navigates left and right with keys. They can close the application with q.\nThe application should remember where they were when they reopen the application. This is a simple question, but is the most standard application architecture to store application-state related information in a single file called \u201capplication.data\u201d?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":30,"Q_Id":69702114,"Users Score":1,"Answer":"You should serialize the application data and store it in a file. you can try using xml or json. the file extension should be \"application.dat\" not \"application.data\"","Q_Score":3,"Tags":"python,inspect","A_Id":69702137,"CreationDate":"2021-10-25T01:53:00.000","Title":"What is a standard way to save a location in a list between application runs?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I take a screenshot of a GLTF model in python?\nThe idea is to load and position a 3D model and save the screenshot as an image. I want to run this on a server, where I will host the models. I found some javascript frontend solutions, but I need it server side.\nUnfortunately I haven't found anything yet which worked...","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":137,"Q_Id":69756643,"Users Score":0,"Answer":"I ended up using Puppeteer, a nodeJS library, where I push the result to my python API then.","Q_Score":0,"Tags":"python,node.js,3d,gltf,3d-rendering","A_Id":70065160,"CreationDate":"2021-10-28T15:11:00.000","Title":"How to take a screenshot of a GLTF 3D model server side (Python or NodeJS)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I've been trying to write a script that sends specific key presses to the game, however they just get \"ignored\", while the script can send the exact same key presses to any other window without a problem. I'm using WIN 10 x64, python 3.9 and pyautogui and pywinatuo.\nIs there an easy way around this? Please consider my inexperience with coding when answering.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":109,"Q_Id":69777789,"Users Score":0,"Answer":"For normal GUI apps there is no easy way to distinguish real clicks vs pywinauto's ones. If you set monitoring keyboard\/mouse hooks, there is no such info in HOOK structures. So the answer is no.","Q_Score":1,"Tags":"python,windows-10,pyautogui,pywinauto","A_Id":69789193,"CreationDate":"2021-10-30T07:58:00.000","Title":"How does a program distinguish between real key presses and those sent by pyautogui, pywinauto etc.?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to write a script that sends specific key presses to the game, however they just get \"ignored\", while the script can send the exact same key presses to any other window without a problem. I'm using WIN 10 x64, python 3.9 and pyautogui and pywinatuo.\nIs there an easy way around this? Please consider my inexperience with coding when answering.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":109,"Q_Id":69777789,"Users Score":1,"Answer":"I had a similar problem and ended up sending the desired keystroke out to a serial port, using the 'serial' module the writing some code on a 'pro micro' using an arduino ide which would accept any character coming in on the serial port and would then output said character or string to a the usb. The neat thing about the pro micro is the serial port and the usb can be same physical connection. While I had to make exceptions for some special characters like \\r and \\n it works quite well. Where my application that would not recognize keyboard or mouse inputs from pyautogui or pywinauto, it now does recognize them when coming from the usb as it looks like any other piece of hardware. If you are interested I will send\/post the code for the pro micro and some examples of how I used it.","Q_Score":1,"Tags":"python,windows-10,pyautogui,pywinauto","A_Id":70467871,"CreationDate":"2021-10-30T07:58:00.000","Title":"How does a program distinguish between real key presses and those sent by pyautogui, pywinauto etc.?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can we provide PaddleOCR\/Pytessearct with bounding box values from which it should read data?\nThanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":46,"Q_Id":69777852,"Users Score":0,"Answer":"No, you can't. You just have to crop your text using the points you have then pass the output to any of them. You may use \"warping\" in OpenCV to crop it.","Q_Score":0,"Tags":"ocr,python-tesseract","A_Id":71417534,"CreationDate":"2021-10-30T08:08:00.000","Title":"Reading data from a particluar bbox","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"So far I have been able to convert pygame into apk with buildozer and everything works fine including the animation. But when I add images like jpeg and png it will not work anymore. The app will crash after the loading screen. And when I remove the image and deploy it again the app will work perfectly fine again.\nI have googled for days now but nothing helps. In the spec file I have included png ang jpeg but still does not work.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":355,"Q_Id":69797994,"Users Score":0,"Answer":"You can get the error message using adb logcat. Just download and install adb in any directory and open cmd in that directory. After that, connect your mobile to pc using a usb cable. Then type the following command:\nadb logcat | to python\nMake sure that USB Debugging is enabled in your android device developer options. Now a pop-up will ask you to allow usb debug by this PC. Click OK.\nThis will give you all the errors or messages you generally see in the Python console once you run the app on your phone.\nYou can then solve that issue easily and rebuild your app with buildozer.","Q_Score":0,"Tags":"python,android,pygame,apk,buildozer","A_Id":69940200,"CreationDate":"2021-11-01T13:59:00.000","Title":"How can I convert pygame that can display image to apk with buildozer","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way I can limit the lines a user can enter in a TextInput in kivy?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":68,"Q_Id":69800352,"Users Score":0,"Answer":"You can control whether the TextInput supports multiple lines with the multiline option. You can set multiline=True and then check the contents of the widget after an input event for a line count, optionally discarding a new line when necessary. You'll have to do the housekeeping yourself, but it's doable.\nI don't see an easier way at this time to config the widget to not exceed a certain max number of lines. You'll have to limit the line count via your code.","Q_Score":0,"Tags":"python,kivy","A_Id":69815013,"CreationDate":"2021-11-01T17:12:00.000","Title":"Limiting lines in kivy TextInput?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is there a way I can limit the lines a user can enter in a TextInput in kivy?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":68,"Q_Id":69800352,"Users Score":0,"Answer":"Do you want to eliminate the ability to have multi-lines?\nIf so use,\nmultiline=False in the python file, or:\nmultiline: False in the kv file.","Q_Score":0,"Tags":"python,kivy","A_Id":69806576,"CreationDate":"2021-11-01T17:12:00.000","Title":"Limiting lines in kivy TextInput?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just finish writing my script and for the first time I make a graphical interface with tkinter. When I run the script by double clicking on the file (I'm on W10) the graphical interface run, but I also got a terminal that open in background and I don't know why? Is there a way to remove it?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":32,"Q_Id":69949291,"Users Score":2,"Answer":"Just change the file ending to .pyw","Q_Score":0,"Tags":"python,python-3.x,windows","A_Id":69949332,"CreationDate":"2021-11-12T21:32:00.000","Title":"Why does running a python script with double click, also launches a terminal in background?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need to do the following: suppose I have a widget opening on a window (as QWidget). That widget includes some plot. I also have a second window (as QMainWindow) where I do stuff to that plot interactively: move it around and resize it. What I want is to create a third window that displays the exact same thing as the first window (the one with the plot) in real time. How could I go on doing this?\nWhy do I want this? The first window is going to be hidden and I want the third window so as to inspect that the correct thing is happening on the first one.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":84,"Q_Id":69959185,"Users Score":2,"Answer":"Cannot duplicate widgets. The closest thing is to create 2 widgets and in one of them you have to track the changes and apply them to the second (and vice versa). This task is not easy so I would recommend you only track some characteristics.","Q_Score":0,"Tags":"python,pyqt,pyqt5","A_Id":69959231,"CreationDate":"2021-11-13T23:49:00.000","Title":"How to duplicate a widget in second window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have created an .exe file by pyinstaller. And I want it to run on background even if I close it and I want to be able to access it taskbar's arrow at the bottom-right corner. For example; when I close Discord, it disappears but I can access it from the taskbar's arrow at the bottom-right corner. I want to exact same thing to happen with my app, how can I do it?","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":191,"Q_Id":69981444,"Users Score":2,"Answer":"try this\npyinstaller -w --onefile \"yourfile\"\nyou should be good","Q_Score":0,"Tags":"python,windows,exe","A_Id":71540289,"CreationDate":"2021-11-15T22:03:00.000","Title":"How to keep my app running on background?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"While trying to migrate pyqt5 code to pyqt6, i have occured a problem with setWindowFlags:\nself.setWindowFlags(Qt.WindowStaysOnTopHint) returns an error:\nAttributeError: type object 'Qt' has no attribute 'WindowStaysOnTopHint'. So wat is the similar in PyQt6?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":276,"Q_Id":70045339,"Users Score":2,"Answer":"QtCore.Qt.WindowType.WindowStaysOnTopHint","Q_Score":2,"Tags":"python,pyqt6","A_Id":70045381,"CreationDate":"2021-11-20T11:10:00.000","Title":"What is analog of setWindowFlags in PyQt6?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Is it possible to change the brightness on the fly for Adafruit_CircuitPython_NeoPixel ?\nIt seems to be possible in a C library but no in python.\nThanks,\nmcb","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":83,"Q_Id":70072396,"Users Score":0,"Answer":"neopixel derives from Pypixelbuf, and inherits a brightness property from that module. Did you try it?","Q_Score":0,"Tags":"python,adafruit,adafruit-circuitpython,neopixel,adafruit-circuitpython-neopixel","A_Id":70072493,"CreationDate":"2021-11-22T21:09:00.000","Title":"Is it possible to change the brighness on the fly for Adafruit_CircuitPython_NeoPixel","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm quite new to Python so the answer to my question might be simple or impossible.\nIn below shown example I would like to substitute the object name \"myBox\" with a variable boxName.\nboxName = \"myBox\"\nFreeCAD.ActiveDocument.addObject(\"Part::Box\", boxName)*\nThis works:\nFreeCAD.ActiveDocument.myBox.Length = 150\nThis doesn't:\nFreeCAD.ActiveDocument. + boxName + .Length = 150\nI get a syntax error:\n'App.Document' object has no attribute 'boxName' or when I try other variations I get this error:\n(1): ('invalid syntax', ('###\/AppData\/Roaming\/FreeCAD\/Macro\/nyMacro.FCMacro', 5, 24, 'FreeCAD.ActiveDocument.+(boxName)+.Length = 150\\n'))\nIf it's possible to substitute with a variable, I will be gratefull if someone will show me the syntax.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":98,"Q_Id":70077823,"Users Score":0,"Answer":"You have to use meta programming. Do a little study about this concept. It's interesting. In Python you can execute dynamic code by eval function:\neval('FreeCAD.ActiveDocument. + boxName + .Length = 150')\nDo seaech about eval and exec function if I'm not wrong.","Q_Score":0,"Tags":"python,syntax,syntax-error","A_Id":70078171,"CreationDate":"2021-11-23T08:47:00.000","Title":"Python FreeCad ActiveDocument with variable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"So I have this font .\/files\/resources\/COMIC.TTF\nAnd I reference the font like this: font = pygame.font.Font('.\/files\/resources\/COMIC.TTF', 12)\nSo I ran this on cmd python files\/opencv_ball_tracker.py and sure enough it works.\nBut when I cd files then run python opencv_ball_tracker.py it fails with FileNotFoundError: [Errno 2] No such file or directory: '.\/files\/resources\/COMIC.TTF'.\nHow do I make it so that it works no matter where I run the file?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":74,"Q_Id":70117116,"Users Score":1,"Answer":"you could use the absolute pathing, so if your using windows use \"C:\/XXX\/XXX\/files\/resources\/COMIC.TTF\".\nfor linux\/MAC it would be same but change the C:\/ to the respective one for UNIX machines (I know for Mac it would be \/Users\/XXX\/files\/resources\/COMIC.TTF)\nEdit: If you wanted to use relative pathing I think you would need to copy the files folder with the python script and run it with the folder in there OR add it to your python pathing","Q_Score":0,"Tags":"python,python-3.x,relative-path","A_Id":70117139,"CreationDate":"2021-11-25T20:53:00.000","Title":"Relative paths depend on where I run the python script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i have LogisticRegressionCv model it's .pkl file and import data as images but i don't know how to get it on flutter please help me If you know how or if I must to convert my model to other file formats.\nplease help me.\nThank you for your help.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":49,"Q_Id":70144848,"Users Score":0,"Answer":"as you've trained your model in python and stored it in pkl file. One method is in your flutter background, call python3 predict_yourmodel.py your_model_params and after the run, it will give your the model result.\nAnother way is implement a logisticRegressionCv in Flutter as it is a simple model, and easily be implemented. you can store all your params and l1 or l2 etc super-params in a txt instead of pkl file for readility.","Q_Score":0,"Tags":"python,flutter,classification","A_Id":70144960,"CreationDate":"2021-11-28T15:28:00.000","Title":"How to implement LogisticRegressionCv on flutter","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"First things first, I'm very new to devloping android applications and games, so please bare with my poor knowledge of things. Thanks!\nSo I'm developing a game in kivy, where the data such as money, items, level are started in a seperate py file. Essentially, there is a main.py and a data.py. Now if\/when I update my game on play store, will it lose the data.py, causing it to reset everything? If yes, how should I overcome it? Thanks a ton in advance!","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":28,"Q_Id":70186265,"Users Score":0,"Answer":"If I understand correctly you are storing the data in a python file? I would recommend against this, and would instead suggest you store the data in something like a json or CSV. The python file will be overwritten if you update the app, however if you use a file saved externally on the device it will not.","Q_Score":1,"Tags":"python,android,kivy","A_Id":70190492,"CreationDate":"2021-12-01T14:46:00.000","Title":"Will the data files be lost when I update my game apk in play store?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a potentially long-running task (serialise a document) which I don't want to run in the Gui thread. At the end of that task I want to update various visual aspects of the UI (menu enablement, etc.).\nI had assumed that QTimer.singleShot() was the way to go, and that the method it runs would always execute in the Gui thread. But this turns out not to be so: if you call it in a non-Gui thread, its invoked method runs in a non-Gui thread (the same one).\nI have double-checked this on my OS (W10). If you find that this is not the case on yours I'd be interested to hear about it.\nI've actually created a decorator to check that every method in my app runs in the right thread (Gui or non-Gui). There are one or two where the parameter is None (= can be either) but these are very few. The method which updates the UI elements MUST be called in the Gui thread.\nI can of course do this by creating a new signal and firing that. Is there not a simpler way of doing it?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":40,"Q_Id":70205169,"Users Score":0,"Answer":"The answer to this appears to be No (see Musicamante's comments).\nI'm not sure whether to delete this question. I think it clarifies things for me.","Q_Score":0,"Tags":"python,pyqt5,qthread,qtimer","A_Id":70211105,"CreationDate":"2021-12-02T19:06:00.000","Title":"How to call method in gui (application) thread from method in non-gui thread?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a codebase that uses PyQt5 and QML for its GUI. I want to use the Qt3D module, but when I attempt to import it in my QML file, I am told the module is not installed. pip installing the PyQt3D library did not change that, though I expect that QML libraries won't be installed by pip. I didn't have Qt Creator, so I installed that and one of the addons I could have was Qt3D. I installed it and I see the library folder, but I don't know where to put it to let my QML code access the library. Is there a default path for QML libraries? How would I find out where the libraries are for my code?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":58,"Q_Id":70214156,"Users Score":0,"Answer":"Found out that the linux end of the system I'm using actually has the library installed already. Go figure. I'm going to use that as a workaround for now. Not really an answer, unfortunately, but this is the solution for me.","Q_Score":0,"Tags":"python,qt,qml","A_Id":70266032,"CreationDate":"2021-12-03T12:14:00.000","Title":"How to install Qt modules for a python application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using PySimpleGUI to generate a window with a few hundred inputtext fields pre-filled by a pandas dataframe. I'd like to be able to allow the user to add a an empty set of inputtext fields so they might fill in another row manually. Is there a way to append new inputtext fields to my existing window after creation?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":216,"Q_Id":70217847,"Users Score":0,"Answer":"Per Jason and Mike's comments, utilizing extend_layout allowed me to edit the existing window layout without calling the window again or getting a layout re-use error.","Q_Score":0,"Tags":"python,pysimplegui","A_Id":70238964,"CreationDate":"2021-12-03T16:42:00.000","Title":"Is there a way to append new elements to an existing PySimpleGUI window?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have just updated my Macbook to Monterey and installed XCode 13. I'm now seeing errors when trying to link my code - for example one library needs to link to the system python2.7, but gives the error:\n\nKeiths-MacBook-Pro:libcdb keith$ make rm -f libcdb.1.0.0.dylib\nlibcdb.dylib libcdb.1.dylib libcdb.1.0.dylib\n\/Applications\/Xcode.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/clang++\n-stdlib=libc++ -headerpad_max_install_names -arch x86_64 -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX12.0.sdk\n-mmacosx-version-min=10.13 -Wl,-rpath,@executable_path\/..\/Frameworks -Wl,-rpath,\/usr\/local\/Qt-5.15.7\/lib -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcdb.1.dylib -o libcdb.1.0.0.dylib release\/db.o release\/KDTree.o release\/db_Wlist.o release\/db_VSeg.o\nrelease\/db_View.o release\/db_ViaInst.o release\/db_ViaGen.o\nrelease\/db_Via.o release\/db_Vertex.o release\/db_Vector.o\nrelease\/db_Utils.o release\/db_Trapezoid.o release\/db_Transform64.o\nrelease\/db_Transform.o release\/db_Techfile.o release\/db_Style.o\nrelease\/db_Signal.o release\/db_Shape.o release\/db_SegParam.o\nrelease\/db_Segment.o release\/db_Rectangle.o release\/db_Rect.o\nrelease\/db_QTree.o release\/db_Property.o release\/db_Polygon.o\nrelease\/db_PointList.o release\/db_Point.o release\/db_Pin.o\nrelease\/db_Path.o release\/db_ObjList.o release\/db_Obj.o\nrelease\/db_Net.o release\/db_Mst.o release\/db_Mpp.o release\/db_Lpp.o\nrelease\/db_Line.o release\/db_Library.o release\/db_Layer.o\nrelease\/db_Label.o release\/db_InstPin.o release\/db_Inst.o\nrelease\/db_HVTree.o release\/db_HSeg.o release\/db_HierObj.o\nrelease\/db_Group.o release\/db_Ellipse.o release\/db_Edge.o\nrelease\/db_CellView.o release\/db_Cell.o release\/db_Array.o\nrelease\/db_Arc.o -F\/usr\/local\/Qt-5.15.7\/lib -L..\/libcpp\/release -lcpp\n-L\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/lib\/python2.7\/config\n-lpython2.7 -framework QtWidgets -framework QtGui -framework AppKit -framework Metal -framework QtNetwork -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL\nld: cannot link directly with dylib\/framework, your binary is not an\nallowed client of\n\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX12.0.sdk\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/lib\/python2.7\/config\/libpython2.7.tbd\nfor architecture x86_64 clang: error: linker command failed with exit\ncode 1 (use -v to see invocation) make: ***\n[release\/libcdb.1.0.0.dylib] Error 1\n\nGiven that I have recompiled (successfully) the Qt libs and the code for this library, why is it giving me this 'your binary is not an allowed client' error?\nAs far as I can see the python2.7 paths have not changed, so the error is baffling.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":491,"Q_Id":70278110,"Users Score":0,"Answer":"So the quick and diirty fix is to edit the Python.tdb file that is located at:\n\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX12.0.sdk\/System\/Library\/Frameworks\/Python.framework\/Versions\/Current\/Python.tdb\nAnd add your library\/executable targets to the clients list.\nOf course, there is a reason Apple are doing this - python2 is deprecated and sooner or later they will drop it. But until they do, this works.","Q_Score":1,"Tags":"python,xcode,macos-monterey","A_Id":70286243,"CreationDate":"2021-12-08T16:06:00.000","Title":"Linking to system python gives 'binary is not an allowed client' error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have just updated my Macbook to Monterey and installed XCode 13. I'm now seeing errors when trying to link my code - for example one library needs to link to the system python2.7, but gives the error:\n\nKeiths-MacBook-Pro:libcdb keith$ make rm -f libcdb.1.0.0.dylib\nlibcdb.dylib libcdb.1.dylib libcdb.1.0.dylib\n\/Applications\/Xcode.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/clang++\n-stdlib=libc++ -headerpad_max_install_names -arch x86_64 -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX12.0.sdk\n-mmacosx-version-min=10.13 -Wl,-rpath,@executable_path\/..\/Frameworks -Wl,-rpath,\/usr\/local\/Qt-5.15.7\/lib -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcdb.1.dylib -o libcdb.1.0.0.dylib release\/db.o release\/KDTree.o release\/db_Wlist.o release\/db_VSeg.o\nrelease\/db_View.o release\/db_ViaInst.o release\/db_ViaGen.o\nrelease\/db_Via.o release\/db_Vertex.o release\/db_Vector.o\nrelease\/db_Utils.o release\/db_Trapezoid.o release\/db_Transform64.o\nrelease\/db_Transform.o release\/db_Techfile.o release\/db_Style.o\nrelease\/db_Signal.o release\/db_Shape.o release\/db_SegParam.o\nrelease\/db_Segment.o release\/db_Rectangle.o release\/db_Rect.o\nrelease\/db_QTree.o release\/db_Property.o release\/db_Polygon.o\nrelease\/db_PointList.o release\/db_Point.o release\/db_Pin.o\nrelease\/db_Path.o release\/db_ObjList.o release\/db_Obj.o\nrelease\/db_Net.o release\/db_Mst.o release\/db_Mpp.o release\/db_Lpp.o\nrelease\/db_Line.o release\/db_Library.o release\/db_Layer.o\nrelease\/db_Label.o release\/db_InstPin.o release\/db_Inst.o\nrelease\/db_HVTree.o release\/db_HSeg.o release\/db_HierObj.o\nrelease\/db_Group.o release\/db_Ellipse.o release\/db_Edge.o\nrelease\/db_CellView.o release\/db_Cell.o release\/db_Array.o\nrelease\/db_Arc.o -F\/usr\/local\/Qt-5.15.7\/lib -L..\/libcpp\/release -lcpp\n-L\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/lib\/python2.7\/config\n-lpython2.7 -framework QtWidgets -framework QtGui -framework AppKit -framework Metal -framework QtNetwork -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL\nld: cannot link directly with dylib\/framework, your binary is not an\nallowed client of\n\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX12.0.sdk\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/lib\/python2.7\/config\/libpython2.7.tbd\nfor architecture x86_64 clang: error: linker command failed with exit\ncode 1 (use -v to see invocation) make: ***\n[release\/libcdb.1.0.0.dylib] Error 1\n\nGiven that I have recompiled (successfully) the Qt libs and the code for this library, why is it giving me this 'your binary is not an allowed client' error?\nAs far as I can see the python2.7 paths have not changed, so the error is baffling.","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":491,"Q_Id":70278110,"Users Score":0,"Answer":"What fixed it for me was to drop the Python2 framework and link with the framework provided by my version of Python3 installed via Brew.\nLocate your installation of Python3 by using this command in Terminal: ls -la $(which python3).\nThe framework is in the \"Frameworks\" folder located one level above \"bin\", for example: \/usr\/local\/Cellar\/python@3.9\/3.9.7_1\/Frameworks\nOnce your have the location of the Python3 framework, add it as a framework in your XCode project.\nIn the Build Settings, don't forget to add:\n\nthe Frameworks folder location in Framework Search Path (e.g. \"\/usr\/local\/Cellar\/python@3.9\/3.9.7_1\/Frameworks\")\nthe framework's Headers folder in Header Search Path (e.g. \"\/usr\/local\/Cellar\/python@3.9\/3.9.7_1\/Frameworks\/Python.framework\/Headers\")\n\nSome functions changed in version 3 so you'll need to update some of your Python function calls.","Q_Score":1,"Tags":"python,xcode,macos-monterey","A_Id":70520378,"CreationDate":"2021-12-08T16:06:00.000","Title":"Linking to system python gives 'binary is not an allowed client' error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I want to make a program taking a cropped screenshot (like Windows+Shift+s) and save it as variable, not as a file.\n\nHow do I Programmatically open this win+shift+s window?\n\nHow to directly get the output without saving this as a picture?\n\n\nI'm using python","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":71,"Q_Id":70317870,"Users Score":1,"Answer":"you will need to:\n\ntrigger the Print screen key (any keyboard library should allow it)\nretrieve the data from the clipboard (you will maybe forced to save it as a temporary file and then read from it)\nthen parse the data it will be it will png format.","Q_Score":0,"Tags":"python,python-3.x,image,python-imaging-library,screenshot","A_Id":70317946,"CreationDate":"2021-12-11T18:20:00.000","Title":"Take a screen shot of a specif area and save as variable","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I just started learning Pyglet but hit a roadblock. I am using the i3 window manager, and when I open a window with Pyglet, it floats. My guess is that i3 treats it like a dialog and positions it in the center of my screen. I tried setting the style attribute of the Window object to to all possible values, but it had no effect. How can I set the type attribute of the window to DEFAULT so that the window is part of the i3 grid and not floating in the center?\nI read on StackOverflow how to make a floating window with Tkinter and Cairo GTK(thinking that doing the opposite will give me a non-floating window), but I can't find a way to set the window type attribute in Pyglet the way it can be done with other libraries.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":22,"Q_Id":70376535,"Users Score":0,"Answer":"I figured it out by looking for the same issue with SDL. Apparently, the type hint is not needed if the window is specified as a resizable. By adding resizable=True to the window constructor arguments, the window is included as a part of the grid.\nIf the intended behavior is to have a floating window(ex. a game or dialog) set resizable=False. Else resizable=True.","Q_Score":0,"Tags":"python,python-3.x,pyglet,i3","A_Id":70396060,"CreationDate":"2021-12-16T09:19:00.000","Title":"How to set type attribute for window in Pyglet?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been trying to use Pygame on Sublime Text 4 for the longest. But every time I try to import it into Sublime Text it says that there's no module named Pygame. Which is weird seeing how I downloaded it already. I watched multiple videos about this, but nothing I try isn't working.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":315,"Q_Id":70385987,"Users Score":0,"Answer":"Open cmd and type : pip install pygame confirm by click enter and it will install.","Q_Score":0,"Tags":"python,windows,pygame","A_Id":70437630,"CreationDate":"2021-12-16T21:45:00.000","Title":"How do you import Pygame in Sublime Text 4 on Windows 10?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"This is code that waits for an event coming from button A.\ncontrol.waitForEvent(Button.A, EventBusValue.MICROBIT_EVT_ANY)\nI want to wait for either button A OR button B to be pressed.\nIs this possible?\nEDIT\nI know that in Scratch this is possible with something like button.any, also the above code is written in microjavascript, but it is written similarly in micropython, so maybe someone from this field can also help. Thank you.","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":149,"Q_Id":70424520,"Users Score":0,"Answer":"In scratch, placing a [Wait for ], will do the trick, you can just slot a key pressed (a) and a key pressed (b) into the same or statement, and place the new blocks into a \"Wait until\" block, place this where you want the code to stop and continue on the keypress update and you're golden.","Q_Score":1,"Tags":"micropython,mit-scratch,bbc-microbit","A_Id":71082562,"CreationDate":"2021-12-20T15:57:00.000","Title":"Is it possible to wait for either button A or button B?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have so far discovered four discovered width (or height) related methods and properties of widget (some for them also can be used to get other widget properties). What are the differences between all of them?\n\nwidget[\"width\"]\nwidget.cget(\"width\")\nwidget.winfo_width()\nwidget.winfo_reqwidth()\n\n(There are also equivalent methods and properties for height).","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":46,"Q_Id":70469187,"Users Score":2,"Answer":"-the first one(widget[\"width\"]) is just a wrapping of some of the other commands, I can't tell you which one without decompiling the function.\n-the second one(widget. cget(\"width\")) is a method to access to variable width using the access to widget object through the getters methods of the object\n-the third one(widget.winfo_width()) can be used to know the current width asking to TK's windows manager\n-the fourth one (widget.winfo_reqwidth()) can tell you how much the width of the widget was originally when it was opened, or anyway before the widget.update_idletasks () method.\nin general, we can say that they all do the same thing but, as you can guess, there are subtle differences that allow you to access the information you are looking for differently, in this case width","Q_Score":0,"Tags":"python,tkinter,widget","A_Id":70469550,"CreationDate":"2021-12-24T03:02:00.000","Title":"Python Tkinter: Why are there so many ways to get the width of a widget and what are the differences?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Tkinter key binding using Tf.bind('', function) will trigger a function with the (Enter) key from the entry widget. Is there a parameter that will trigger the function based on the number of characters entered within the entry widget?\nThanks for your thoughts.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":36,"Q_Id":70474602,"Users Score":0,"Answer":"Is there a parameter that will trigger the function based on the number of characters entered within the entry widget?\n\nNo, there is not. Your bound function can easily check how many characters are in the widget and simply not do anything until the limit has been reached.","Q_Score":0,"Tags":"python,tkinter,key-bindings,tkinter-entry","A_Id":70474669,"CreationDate":"2021-12-24T15:54:00.000","Title":"tkinter entry command based on number of characters entered?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm currently working on an assignment where I had to complete a few functions and import pygame so I could run a runner program.\nWhen I try to import pygame by running the command pip3 install -r requirements.txt (there is a requirements text file that just says pygame in it), it says that it successfully installed it but it also gives a warning that I am not using the latest version of pip.\nWhen I run the runner program, it however gives a moduleNotFoundError.\nIs there something wrong with the way I am importing pygame or is there something else I am doing wrong?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":95,"Q_Id":70487831,"Users Score":1,"Answer":"I had this happen to me once with pyautogui so basically what was happening is that I was using the wrong version of python\nIn cmd it was using pip install for python version 3.9 while on VSCode I was using python 3.10 so if you wanna check what version of python you are installing to in cmd just type python in cmd and it will show the version and compare it with VSCode if they are the same it will work\nAnd for the pip install version alert don't worry even if you are running an old version it will still do the job and install everything and this won't affect the installation","Q_Score":0,"Tags":"python,installation,pygame,modulenotfounderror","A_Id":70487955,"CreationDate":"2021-12-26T15:55:00.000","Title":"Unable to use pygame in VSCode","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The error message was ( cannot be loaded because the execution of scripts is disabled on this system. Please see\n\"get-help about_signing\" for more details )\nCan you help me","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":22,"Q_Id":70523583,"Users Score":0,"Answer":"This seems to be an error of Powershell.\nIt should work if you just use the CMD instead.\nIf you want to stick with Powershell, then you can try to disable the restriction with Set-ExecutionPolicy RemoteSigned (Powershell has to be run as Administrator)","Q_Score":0,"Tags":"python,virtual-environment","A_Id":70612003,"CreationDate":"2021-12-29T18:36:00.000","Title":"I created a virtual environment in my editor but when I wanted to activate it by this code (kivy_venv\/Scripts\/activate) editor gave me error message","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing an app for Android and i have this issue - after i have taken a picture with the camera, i need to crop it. But the coordinates for the rectangle i have dragged over the capturing area start from the screen's 0,0 coordinates aka touch coordinates do not match actual picture's - if i try to crop the image with these using PIL, i get a partial result.\nOne possible solution would be to take a partial screenshot with these coordinates and get the cropped picture that way.\nI tried to use pyscreenshot, but then i found out that it does not work on Android.\nAny ideas how to capture a partial screenshot on Kivy?\nThank you","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":27,"Q_Id":70524180,"Users Score":0,"Answer":"For possible anyone with the same issue - i did not find any good way to grab a screenshot and crop selected portion out of it. I did, however, solve it this way - i move to a new screen, resize picture to device's screen resolution and from then i can crop it with touch without no issues - i did not have to find a clever way to map screen coordinates with image's. After cropping and saving i resize the image back to a fixed resolution. This is not a elegant solution, but still will serve my purpose.\nThank you anyone who thought along with me.","Q_Score":0,"Tags":"python,kivy","A_Id":70548823,"CreationDate":"2021-12-29T19:36:00.000","Title":"Any way to capture partial screenshot with Kivy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am working on a C++ project which will be compiled to a shared object file. It needs to have access to the python interpreter, which is where I reach my hurdle: upon linking, I receive \/usr\/bin\/ld: \/usr\/lib\/gcc\/x86_64-linux-gnu\/9\/crtbeginT.o: relocation R_X86_64_32 against hidden symbol '__TMC_END__' can not be used when making a shared object\n(The opening quotation on __TMC_END__ was a backtick, but this ruined the formatting so I changed it, if this is useful information).\nThe obvious solution is to download the Python source and compile it along with my code, but I would rather not complicate my development workflow to this point, thus, my question is: how do I embed the Python interpreter in my shared object file?\nI am on Ubuntu 20.04 with a full Python 3.9 install, and access to all development files.\n(My apologies if this is the wrong site)","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":44,"Q_Id":70546102,"Users Score":0,"Answer":"It appears that my problem was solved by adding the python lib to the g++ shared-object-builder command. I previously only added it to the first phase of compilation (convert into an object file).","Q_Score":0,"Tags":"python,c++,shared-libraries","A_Id":70546120,"CreationDate":"2021-12-31T22:58:00.000","Title":"How to link library into shared object with G++\/LD","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How do you take a screenshot of a particular widget? I keep on getting \"how to take screenshot of whole screen\" or \"how to take screenshot of the window\" when searching, but I want to know how to take screenshot of a widget, a Frame, to be exact. I'm afraid that this forum would require me to give them a code snippet, when in reality I don't know what to do. So I'm just asking if this is possible, and how to do it.\nPS: I would really appreciate if it is possible to just give a function the widget variable, and then it would go searching for that widget and then take a precise screenshot of it. I know that there is pyautogui which searches for images, I just don't know what I need to do exactly, since this frame isn't an image and it always changes from now and then, so the automation might get confused.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":44,"Q_Id":70576249,"Users Score":0,"Answer":"Maybe you can get the coords of that frame and then make a screenshot from that coords. This should work","Q_Score":2,"Tags":"tkinter,widget,screenshot,python-3.9","A_Id":70576277,"CreationDate":"2022-01-04T08:55:00.000","Title":"How do you take a screenshot of a particular widget in Tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Ummmm so I'm trying to make this pong game but it keeps giving me this error and idk why. The ide is saying everything is fine but I get the error when running it. help pls.\nError:\nModuleNotFoundError: No module named 'turtle'\nThe code is a bit long so I can't really paste it here but I am using pycharm for IDE","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":41,"Q_Id":70600493,"Users Score":1,"Answer":"Maybe you forgot to install it with pip or deleted it.\n\nwindows + R\ntype cmd\nEnter\ntype pip install turtle\nEnter","Q_Score":1,"Tags":"python,python-3.x,pycharm","A_Id":70600549,"CreationDate":"2022-01-05T22:47:00.000","Title":"i dont know why but i am getting a turtle import error and i need assistance","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"About 5 years ago this question was asked:\n\"On a web page in my web browser (preferably, but not necessarily Firefox), I can search (byctrl+f) for a given text \"abc\" within the body text of the page. From there then I must move the mouse cursor to another (relative) position (height plus x pixels), and there I must do a mouse click.\nI cannot do this otherwise since the needed info is not contained in the source code but is fetched by mouse click from the web server. The problem for me is to identify the position of the found text \"abc\", in order to move the mouse cursor there; from there it's easy.\nI currently try to solve my problem by searching for the background color which changes for the text \"abc\" when found, but the same color is found in lots of other positions on the screen, so this is unreliable, and finding the text \"abc\" as a graphic is unreliable, too. So I'm looking for an alternative, programmatic way to identify the position of found text, if there is any.\"\n==> I'm currently facing the same problem and so far haven't really found a solution! I'm using Python, but libraries such as pyautogui do not include any way (as far as I can tell) of obtaining the position of text located via Ctrl-F. I'm hoping for some solution that works under Windows and Linux, if possible. Any solutions\/workarounds\/suggestions would be greatly appreciated! Wayne","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":390,"Q_Id":70607418,"Users Score":1,"Answer":"My final approach to this problem only requires pyautogui. The first step is to use the \"find\" option (Ctrl-f) in Chrome to locate the text in question. The found text is then highlighted, generally in Orange (RGB=255,150,50) but sometimes in Yellow (RGB=255,255,0). I then take a screenshot using im = pyautogui.screenshot(). Finally, I search that image ('im') to look for pixels of the appropriate background color in order to identify the upper-left and lower-right corners of the highlighted rectangle. Using those two locations it is easy to compute the center of the highlighted text.\nI'm sure this is not the most efficient way of searching for the location of text on the screen, but this method certainly seems fast enough for many applications.\nThis method should be platform-independent, assuming that pyautogui is available. Also, no other special libraries such as Selenium are needed.\nNOTE: This approach will locate the FIRST occurrence of the text being sought, so care should be taken when defining that text.\nHoping that other folks may find this approach useful, Wayne","Q_Score":0,"Tags":"python,pyautogui,text-cursor","A_Id":70623648,"CreationDate":"2022-01-06T12:54:00.000","Title":"How to find screen coordinates of found text?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am creating a game in pygame which has some buttons and on every button pressed a text is displayed on screen on same position (co-ordinates) but the text is overlapping each other.\nHow can I solve this problem?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":62,"Q_Id":70620500,"Users Score":0,"Answer":"You need to fill in the screen with for example a background image or just white color to erase the old text before writing the new one.","Q_Score":1,"Tags":"python,pygame","A_Id":70620545,"CreationDate":"2022-01-07T11:22:00.000","Title":"How to remove a text in pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"there is a task: you need to write a registration menu program. it is necessary to do this necessarily on pygame. no other way. how can this be implemented at all? as I know, pygame does not support multi-window. how to do it then?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":25,"Q_Id":70634829,"Users Score":0,"Answer":"Instead of making multiple windows, you could make a single window and then create 2 functions, 1 for the game and the other for registration. Then at start, you could call the registration function and then, the game function. You have not given any code or anything, so we can't help you a lot...","Q_Score":0,"Tags":"python,pygame,menu,registration","A_Id":70676214,"CreationDate":"2022-01-08T17:36:00.000","Title":"menu registration in pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"train_data = object_detector.DataLoader.from_pascal_voc(\n'images_jpg_splitted\/train\/img',\n'images_jpg_splitted\/train\/xml',\n['bat']\n)\nval_data = object_detector.DataLoader.from_pascal_voc(\n'images_jpg_splitted\/test\/img',\n'images_jpg_splitted\/test\/xml',\n['bat']\n)\nI am trying to detect bat from images. I have labeled the data using labelImg.\nWhile trying to load the data from tflite_model_maker, object_detector.DataLoader.from_pascal_voc returns empty data. I have tried not splitting the image and XML file and it still did not work.","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":377,"Q_Id":70682884,"Users Score":-1,"Answer":"could you please write the code in below style?\ndataloader = object_detector.DataLoader.from_pascal_voc(image_dir, annotations_dir, label_map={1: \"person\", 2: \"notperson\"})\nIt may be a syntax issue.","Q_Score":2,"Tags":"python,tensorflow,object-detection","A_Id":70683027,"CreationDate":"2022-01-12T14:00:00.000","Title":"object_detector.DataLoader.from_pascal_voc returning empty data","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a scientist with a lot of python background, and I enjoy developping UI for little projects I develop, for fun. I have already built an android app with kivy, and I'm now studying dart and flutter. I find building the UI with flutter much easier than with kivy, but all the logic I had built for the app was in python, and it uses lots of packages (for magnetism calculations).\nIs there a (easy\/friendly) way to reuse the python scripts for the logic and\/or matplotlib for outputting plots using flutter to design the UI?\nThanks in advance.","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":75,"Q_Id":70714072,"Users Score":1,"Answer":"You can use Flask as a wrapper for the Python functions and return the data in JSON format.\nYou can then consume the JSON data in Flutter by invoking the Flask endpoints (that in turn invoke Python functions) and present the data in the Flutter UI.\nThere are many articles on how to invoke HTTP services through Flutter and how to consume JSON data returned from said services into a Flutter Object.\nNote:\nThis will require a bit of set-up work and will require many more elements for production quality code, e.g., API Gateway, but for testing\/learning purposes you can skip that and talk directly to the services you set-up in Flask.","Q_Score":0,"Tags":"python,flutter,dart,matplotlib,user-interface","A_Id":70759676,"CreationDate":"2022-01-14T17:00:00.000","Title":"Is there a way to easily (and officialy?) integrate python, and more specifically matplotlib, with flutter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm a scientist with a lot of python background, and I enjoy developping UI for little projects I develop, for fun. I have already built an android app with kivy, and I'm now studying dart and flutter. I find building the UI with flutter much easier than with kivy, but all the logic I had built for the app was in python, and it uses lots of packages (for magnetism calculations).\nIs there a (easy\/friendly) way to reuse the python scripts for the logic and\/or matplotlib for outputting plots using flutter to design the UI?\nThanks in advance.","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":75,"Q_Id":70714072,"Users Score":1,"Answer":"As answered you can use Flask as a local webserver and retrieve data from python application.\nBut, if you need better speed and also need to send multiple responses(like progress) from python application to flutter. I would prefer using WebSocket.\nYou can create a local WebSocket server, and connect flutter and python in a faster way.\nNOTE: WebSocket are not recommended when you only need responses for specific requests.","Q_Score":0,"Tags":"python,flutter,dart,matplotlib,user-interface","A_Id":70893833,"CreationDate":"2022-01-14T17:00:00.000","Title":"Is there a way to easily (and officialy?) integrate python, and more specifically matplotlib, with flutter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In c++, QVTKOpenGLNativeWidget can be included.\nFor python vtk, I also want to import QVTKOpenGLNativeWidget, is it possible? How can I import QVTKOpenGLNativeWidget?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":29,"Q_Id":70735705,"Users Score":1,"Answer":"No, you cannot import QVTKOpenGLNativeWidget in Python because the Python bindings for VTK doesn't have that class (as of VTK 8.2.0). A quick grep doesn't find it anywhere in the VTK python package. I grepped \/usr\/lib64\/python3.6\/site-packages\/vtk* (which is where I have python3-vtk installed) recursively for QVTKOpenGLNativeWidget and grep didn't find anything.","Q_Score":0,"Tags":"python,vtk","A_Id":70748540,"CreationDate":"2022-01-17T01:48:00.000","Title":"python vtk: how to import QVTKOpenGLNativeWidget","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When making a drawing in pygame, for example the rectangle, how do I make my other sprites show up ontop of the rectangle? Currently they are underneath it","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":24,"Q_Id":70778113,"Users Score":0,"Answer":"when you draw all the objects, sprites should be last drawn on screen.\nSo first rectangles will be draw and sprites on top","Q_Score":0,"Tags":"python,pygame,sprite","A_Id":70780649,"CreationDate":"2022-01-19T21:41:00.000","Title":"How do I get sprites to appear overtop of drawings?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I downloaded the QT-Designer with 'pip install pyqt5-tools' and no error message came up. However, in the folder 'C:\\ANACONDA\\Lib\\site-packages\\pyqt5_tools' where I saved my python and the 'pyqt5-tools' object is stored I cannot find the 'designer.exe'. In all the YouTube toturials I have watched the 'designer.exe' should be found. I have installed the Python version 'Python 3.9.7' with ANACONDA.\nPython 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":204,"Q_Id":71006603,"Users Score":1,"Answer":"I guess I can solve your problem since you said\n\n'C:\\ANACONDA\\Lib\\site-packages\\pyqt5_tools' where I saved my python and the 'pyqt5-tools' object is stored\n\nI installed pyqt5-tools via Conda environment named Python3.10. here is the path where I can find designer.exe file:\nC:\\Users\\Shayan\\Anaconda3\\envs\\Python3.10\\Library\\bin\nSo if you installed pyqt5-tools via a Conda environment, you can find designer.exe in a path like this:\nC:\\Users\\\\Anaconda3\\envs\\\\Library\\bin\nOr you can search for designer.exe via the search option of windows!","Q_Score":1,"Tags":"python,pyqt5,oserror","A_Id":71154264,"CreationDate":"2022-02-06T11:18:00.000","Title":"I can't find the QT Designer even though it is installed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"This question is about listbox.I'm not sure what's the difference between activated element and selected element.What is the point?When I select an item (with an arrow key or mouse) in a listbox,the item is both selected and activated,Which make me also question what's the point with the two seperated methods: active(index) method and selection_set(index) method?\nOne more question:When is active without selected,and the opposite?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":29,"Q_Id":71057863,"Users Score":1,"Answer":"Several elements in a listbox can be selected, but only one of them can be active. The active element can deal with inputs, whether they are selected just says something about their internal state.","Q_Score":2,"Tags":"python,tkinter","A_Id":71057924,"CreationDate":"2022-02-09T22:58:00.000","Title":"What is the difference between activated element and selected element?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I recently made a small desktop app with Tkinter and created a .exe file with pyinstaller (pyinstaller --onefile -w ) and had to change some things I was doing in the underlying code to make the .exe file smaller.\nAt the beginning I was using OpenCV to get some frame information from videos (an overkill, I know), which made the .exe file 400 MB in size, mostly because of the use of pandas. So I changed that to python-ffmpeg. This changed a lot and made the file 16MB. But this is still too big compared to other big program exe files, and takes a couple of seconds to start. I'm working with a conda environment that I created only with Python, and other packages\/modules I installed in it are XlsxWriter and docx.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":370,"Q_Id":71102062,"Users Score":0,"Answer":"You can reduce the file size for pyinstaller by creating the build in a separate virtual environment.\nExecute python -m venv demo_env in your cmd to create a new virtual environment.\nAfter that, install all the packages you need for your script, including pyinstaller.\nOnce you installed everything again, build the exe as before.","Q_Score":3,"Tags":"python,pyinstaller","A_Id":71103837,"CreationDate":"2022-02-13T15:21:00.000","Title":"How to make .exe file smaller and faster with pyinstaller (or any other tool)?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Whenever I try to add a picture from a folder in pygame it says no such file or directory even though the same code and folder worked with others\ni work with vscode","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":44,"Q_Id":71169222,"Users Score":0,"Answer":"Are the other files you are talking about in the same folder as the new file ? If the same code worked with the path img\/some_picture.jpg but you moved the new file to a different folder, then it will not see the old path: img\/some_picture.jpg\nIn this case, copy the folder with pictures to a new folder with nesting.\ncheck if the path is correct and if the code is spelled correctly. If anything, throw off examples and screenshots of the location of the folders","Q_Score":0,"Tags":"python,image,pygame,load","A_Id":71169595,"CreationDate":"2022-02-18T06:27:00.000","Title":"Pygame download image from a folder","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Edit - I eventually figured out the answer and have posted it below.\n\nUsing .audio_set_volume() on a media_player_new() object works fine with values 0-100, but it's much quieter than the corresponding value in normal VLC is, by a factor of around 2-3. This can be remedied by using values greater than 100, but this introduces the problem of severe delays while changing the volume (not delays in the video or audio, just ~half-second delays before the volume updates).\nNo issues with my volume mixing from what I can tell. The player is being embedded in PyQt5. I can't find anyone else with this issue so I imagine there's an easy workaround I'm missing.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":48,"Q_Id":71256165,"Users Score":0,"Answer":"I never got a response, but I eventually figured it out on my own: Firstly, running it through a command prompt\/natively through Python causes the volume to be lower than normal (no idea why). This goes away when compiling or using your script as a default program.\nSecondly, there's a VLC command-line argument called --gain you can set that seems to default to a lower value when using libvlc directly versus what VLC actually uses. When defining your instance, specify the argument like so (it takes a float value from 0-8):\ninstance = vlc.Instance(['--gain=8.0']) # make sure the arguments are in a list!\nA gain of 8.0 is definitely higher than what VLC natively uses, but it's not ear-shatteringly loud. From what I can tell, the quality is not degraded at all and there's no delay while adjusting the volume with --gain set.\nDon't forget to include any other arguments in the list if desired, such as ones from sys.argv.","Q_Score":0,"Tags":"python,vlc,audio-player,libvlc,python-vlc","A_Id":71376088,"CreationDate":"2022-02-24T17:48:00.000","Title":"Python-VLC unusually quiet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am new to buildozer, but I have what should be a simple question:\nWhen I add \"freetype-py\" to my requirements, it installs with a libfreetype.so for x86-64 for some reason (this may be pip default behavior). After installing my APK, the program fails to run because of the wrong libfreetype.so architecture. Going into adb shell and simply removing the offending file causes my program to work completely (libfreetype.so is correctly installed by another freetype requirement).\nHow do I either tell buildozer to not package this file that comes with freetype-py, or update the freetype-py recipe to pass the --no-binary flag to \"pip install freetype-py\" to avoid downloading a problematic file?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":32,"Q_Id":71275083,"Users Score":0,"Answer":"So the conclusion is that we had to build a recipe for freetype-py. We've done it and they've accepted it upstream, so this shouldn't be a problem moving forward.","Q_Score":0,"Tags":"python,buildozer","A_Id":71527397,"CreationDate":"2022-02-26T08:17:00.000","Title":"How to Package APK without wrong architecture libfreetype.so","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to change the titlebar color of my pygame window. Because I need to have the background white, but the titlebar is also white. Everyone says to just hide the titlebar.\nThat's not possible because\n\nI need to be able to close the program with the x button,\nI want to be able to move the window,\nI want to see the tite and the logo,\nIts just much prettier.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":43,"Q_Id":71276554,"Users Score":0,"Answer":"Unfortunately, it is not possible to change the titlebar a pygame window; that area is beyond the control of pygame. As you already know, you can hide it and draw your own, but then you lose the quit button and the drag functionality and would have to implement them yourself. And yes, both functionalities are possible to implement if you really want to.","Q_Score":0,"Tags":"python,pygame","A_Id":71311376,"CreationDate":"2022-02-26T12:14:00.000","Title":"How to change the titlebar in pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am coding kivy app on PC. At the end, I will convert it to .apk on my android phone (redmi note 9 pro). Which window size should I choose? It will be easier to code with this specific window size (add buttons and text on specific place).\nAnd how to do it. Because I heard that using window.size is not good\/not working.\nThanks","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":48,"Q_Id":71284215,"Users Score":0,"Answer":"It's usually a better idea not to code for a specific window size, but to code the gui in such a way that regardless of the window size it tries to do something sensible. For instance, your app might have a navigation bar at the top that is always 40dp high, then the rest of the app is taken up by something else that grows to fill all the available space.\nYou can code the whole gui to a fixed size if you want of course, but it probably isn't the best solution.","Q_Score":0,"Tags":"python,android,kivy","A_Id":71287391,"CreationDate":"2022-02-27T11:06:00.000","Title":"Kivy window size for mobile","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I had created with tkinter an application.\nthis application (python.py) contains a button, by clicking on the button it calls scripts (scripts that I have already created before) and executes them.\nI was able to convert python.py to python.exe with pyinstaller (pyinstaller --onefile python.py)\nafter this step I put my python.exe and pycache and all the scripts (with extensions py) that I should use on my application in a single folder and open the folder in NSIS \u2026 so you can send it to another user who doesn't have python\nOn other pc : the application opens but as soon as I click on the button to have the execution of the scripts I have an error\n\n\n\npython was not found; run without arguments to install from the Microsoft store, or disable this shortcut from settings > Manage App Execution Aliases.\n\n\n\nI fix it with disable app python on manage app execution aliases. (I don\u2019t know if it correct), but I tried to run it again and I have this error\n\npython\u2019 is not recognized as an internal or external command, operable program or batch file.\n\nyet everything works fine on my pc\nknowing that I work on windows\nmaybe i forgot a step?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":110,"Q_Id":71295574,"Users Score":0,"Answer":"Python interpreter is not installed on the target PC. Bundle your executable with all dependency libraries necessary to run your application on any windows PC. Also note that your windows version matters too.","Q_Score":0,"Tags":"python,pyinstaller,exe","A_Id":71295632,"CreationDate":"2022-02-28T13:14:00.000","Title":"Why I can\u2019t run exe file on other pc","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"From the docs :\n\ncppyy is an automatic, run-time, Python-C++ bindings generator, for\ncalling C++ from Python and Python from C++.\n\n(Emphasis mine)\nI don't see any instructions for doing the same, however, so is it possible to call Python via C++ using cppyy?","AnswerCount":3,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":114,"Q_Id":71303671,"Users Score":0,"Answer":"I'm pretty sure cppyy only allows you to call C++ via Python, not vice versa. You could use Python.h, or use C++ to execute a python file as you would an .exe file, but that would require that the computer can run python files.","Q_Score":1,"Tags":"c++,python-3.x,interop,cppyy","A_Id":71303949,"CreationDate":"2022-03-01T04:16:00.000","Title":"How to call Python from C++?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"pip install pygame==2.0.0.dev10 this package not installed in python 3.8.2 version.so when I run the gaming project so that time this error showing.instead of this I am install pip install pygame==2.0.0.dev12,this package is install but same error is showing.\nso can anyone give me a solution","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":114,"Q_Id":71391688,"Users Score":0,"Answer":"You could try uninstalling pygame2.0.0.dev12\nby pip uninstall pygame2.0.0.dev12\nAnd then install pygame by pip install pygame\nSee if it works","Q_Score":0,"Tags":"python","A_Id":71392254,"CreationDate":"2022-03-08T07:58:00.000","Title":"pip install pygame==2.0.0.dev10 not supported in python 3.8.2 version","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have two questions:\n\nIs it possible to increase somehow size of the icon in tkinter? Because the icon choosen by me is not clear visible when I use root.iconbitmap(..).\nI also have another icon, but it's black and is not visible on black taskbar. What can I do?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":117,"Q_Id":71449956,"Users Score":0,"Answer":"I don't believe it's possible to change the size of the icon, unfortunately. However, make sure that the icon your using is a .ico file not some other format. .ico files show up bigger and clearer than other formats.\nAs for the black icon problem, the color of the taskbar is determined by your Windows color settings. There isn't much you can do other than to make an icon that works for both dark and light colors. Although you could get rid of the default taskbar and make your own taskbar in tkinter with whatever colors you would like, if that's something you would like to undertake.","Q_Score":0,"Tags":"python,tkinter","A_Id":71451702,"CreationDate":"2022-03-12T13:07:00.000","Title":"Tkinter - how to change icon size or make black icon visible","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"The Python Tkinter color chooser does not work in Python Version 3.8.5 on Mac.\nWhenever I type in colorchooser.askcolor(), It always outputs Traceback (most recent call last): File \"\", line 1, in colorchooser.askcolor() NameError: name 'colorchooser' is not defined.\nI did this all in the shell and I didn't forget to add from tkinter import *. Could you please help me?","AnswerCount":2,"Available Count":1,"Score":0.0996679946,"is_accepted":false,"ViewCount":52,"Q_Id":71460489,"Users Score":1,"Answer":"Some modules reqiure you to do from tkinter import x, and do not get imported with from tkinter import *. Add from tkinter import colorchooser into your code.","Q_Score":0,"Tags":"python,macos,tkinter,colors","A_Id":71460568,"CreationDate":"2022-03-13T20:14:00.000","Title":"Tkinter: Color Chooser om MacOS","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have created an desktop app with Python and PyQt5 and sqlite database then create an .exe with Pyinstaller.\nThe app work completly fine and the database tables updates succefuly, but when closing the app and reopen the .exe file looks like the database tables empty.\nany answers please.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":38,"Q_Id":71480254,"Users Score":0,"Answer":"Yes. thanks musicamante\nI was binding my sqlite database like the other resources (src files)\n--add-data=\"database\\db.db;database\"\nbut when i added it like an external resource to the executable file, it work perfectlly.","Q_Score":0,"Tags":"python,sqlite,pyqt5,pyinstaller,executable","A_Id":71483867,"CreationDate":"2022-03-15T10:01:00.000","Title":"Python PyQt5 executable app wont update the sqlite db when closing the app","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to kotlin and i am used to python. In python if i run dir(class) i get all names of attributes and methods of that class or object of class.\nIs there a way of doing the same in kotlin?\nThank you in advance","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":38,"Q_Id":71498986,"Users Score":2,"Answer":"You can use YourClass::class.members for a list of attributes and YourClass::class.java.methods for the methods.","Q_Score":1,"Tags":"python,class,kotlin,object,oop","A_Id":71499146,"CreationDate":"2022-03-16T14:36:00.000","Title":"How to acess attributtes and methods of a class in kotlin?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to create a python form with a textfiled and a button where a user will enter his\/her link and it will create a webview flutter apk for that url. I want advice from the community if it is possible or not. If it is possible, please let me know how can I achieve it.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":22,"Q_Id":71503709,"Users Score":0,"Answer":"Maybe you can achieve this via using a remote server. You can create a connection between your python program and the server, and you can create the apk file in server and send it to your python program.","Q_Score":0,"Tags":"python,flutter,dart,webview,automation","A_Id":71509534,"CreationDate":"2022-03-16T20:14:00.000","Title":"Make a WebView flutter app with different urls everytime using python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I have written a guizero code that creates a new window with different amounts of information on it depending on what is selected. I was just wondering if there is a function to resize the window to fit all of the information. I am currently just making the window big enough to fit the largest amount of information but I would rather have it so it resizes it automatically.\nAnd also is there a simple function so that if the window size is changed all of the widgets inside of it change size as well?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":53,"Q_Id":71542280,"Users Score":0,"Answer":"I think is not possible to automaticly resize the window but you can count the number of lines and resize the window.\nnumLines*defaultHeightByLine + height of the other elements","Q_Score":1,"Tags":"python,guizero","A_Id":72394769,"CreationDate":"2022-03-19T21:35:00.000","Title":"Automatically resizing a guizero window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to embed a Python interpreter within my C++ application, and make them call each other.\nI followed the sample in the official doc of pybind11, and now I can call a python sub-program and create a object of python's class in the main program of c++, But my python class need to derive from a c++ base class.\nAlthough there is a official sample about deriving a c++ base class within python, but it is extending python with a c++ module(in form of *.so file), not embedding a python interpreter into a c++ application.\nThere will NOT a shared library(*.so) file in my projects, if I import myCppModule in python, where would it find the module? How should I offer the module in C++?\nIf I blindly make a *.so file as a module for python, may I encounter a linking conflict?\nBecause there will be two binary code copies of my base class, one copy resides in main executable, and the other reside in the shared library.\nSorry for my ugly English.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":79,"Q_Id":71618852,"Users Score":0,"Answer":"According to @unddoch 's directive, I found that if we use PYBIND11_EMBEDDED_MODULE macro instead of using PYBIND11_MODULE, we can directly export a module for python in our c++ main executable without exporting a shared library file.\nMaybe this can help others so I write it down here.","Q_Score":0,"Tags":"python,c++,pybind11,cross-language,pythoninterpreter","A_Id":71655257,"CreationDate":"2022-03-25T14:46:00.000","Title":"How to embed Python within C++ and call each other with PyBind11","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to use pyglet in a framework I am working on but I keep running into an error when I run it and cant tell if im a idiot or not.\nTraceback (most recent call last:\nFile \"C:\\Users\\Admin3\\Desktop\\custom framework\\main.py\", line 6, in \nimport pyglet\nModuleNotFoundError: No module named 'pyglet'\nI dont know if I have imported or installed it incorrectly but every time I run the code it comes back with this error, even though I have pyglet installed and have used it before. Does anyone know how to fix this?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":32,"Q_Id":71634886,"Users Score":0,"Answer":"Double check that you have python pyglet specifically installed. sometimes you need to have a version thats specific to python. if that doesn't work, try making sure everything is spelled correctly. looks fine to me, but idk.","Q_Score":1,"Tags":"python,pyglet","A_Id":71684594,"CreationDate":"2022-03-27T08:45:00.000","Title":"trying to use pyglet in python but i keep running into an error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"How can I manipulate the volume of the audio loaded via pyglet.media.load?\nThe reason is that I have to repeat a sound repeatedly (eg bullets), but if I use the Player, the sound is queued to be able to play it and plays it only once using .play() (eg bullet = pyglet.media.load(\"bullet.wav\", streaming=False) audioPlayer = pyglet.media.Player() audioPlayer.queue(bullet) if the audioPlayer.play() command is used several times, for example from a key, it is executed only once and that's it)\nIf I don't use the Player, I can use the sound constantly, but at that point I can no longer manipulate the volume of the audio. (eg bullet = pyglet.media.load(\"bullet.wav\", streaming=False) bullet.play())\nSo how can I go about solving the problem? I don't have much experience using Pyglet audio, so I'm probably ignoring something I'm not aware of.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":23,"Q_Id":71697895,"Users Score":0,"Answer":"The audio player is the correct approach as you can set volume on the player.\naudioPlayer.volume = 0.5\nUnder the hood all the media.play() command does is create a Player instance, queue and play it. If you want to replay something, simply queue the source and play the player again. If you need audio overlaps, then you would create separate Player instances every time, like media.play() would.","Q_Score":0,"Tags":"python,pyglet,python-3.10","A_Id":71711638,"CreationDate":"2022-03-31T19:06:00.000","Title":"Manipulate the volume of a constantly repeating audio in Pyglet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"In my application I have two push button, namely \"draw\" and \"stop\".When the push button (\"draw\") is push by the user,he\/she can draw or addItems in my QGraphicScene.I am using mousePressEvent to draw same position to my mouse.My addLine and addEllipse are inside my mousePressEvent. Is there a way where I can disable or enable the mousePressEvent with the push button so that If the user will push the \"draw\" button the mousePressEvent is enable while if the \"stop\" push button is press, the mousePressEvent is disable. If this is not possible, can you share any idea how can I implement and solve this problem? Thanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":31,"Q_Id":71702153,"Users Score":0,"Answer":"Yes, you can use variable to store state of your system, for example called doDraw, assign True in draw.clicked handler and assign False in stop.clicked handler, check value of that variable in mousePressEvent and draw only if it's true.","Q_Score":0,"Tags":"python,pyqt5,qgraphicsview,qgraphicsscene,qgraphicsitem","A_Id":71705889,"CreationDate":"2022-04-01T05:22:00.000","Title":"Is it possible to disable\/enable mouseEvent using a push button?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a beginner and I want to work with the pygame module. I have already used pip install to install pygame and it says so on my command prompt. On my command prompt it says:\nRequirement already satisfied: pygame in c:\\users\\35192\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\\localcache\\local-packages\\python310\\site-packages (2.1.2)\nHowever, when I try to import pygame in vscode, the module won't import and it says: \"ModuleNotFoundError: No module named 'pygame'\"\nDoes anyone know how to fix this?","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":66,"Q_Id":71742916,"Users Score":1,"Answer":"I solved the problem. I basically just used Ctrl+Shift+P to open up the command palette. From there, I opened \"Python: Select interpreter\" and then I just changed the python interpreter to be the global one (which I assume is the one used by the command prompt)","Q_Score":1,"Tags":"python,pip,pygame,modulenotfounderror","A_Id":71749937,"CreationDate":"2022-04-04T19:40:00.000","Title":"No module named \"pygame\" after using pip","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have disabled an option in an OptionMenu to fix something in the code where if I click on it just duplicates it, so I thought by disabling the option is an easy work around, but when the user may want to change to another option both the options are now disabled making the first one not usable again. I now need to return the option to normal. I thought of getting all the options which are disabled but couldn't figure out on how to do that. Sorry for the long para.\nAny suggestions are useful.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":26,"Q_Id":71749795,"Users Score":0,"Answer":"You might want to consider an object-oriented approach, defining for your object either a dict, list or some other array of settings, from which you can yourself easily fetch the status of any single control. Even if you don't want to do OOP, you should probably yourself save the current settings to an array.","Q_Score":0,"Tags":"python,python-3.x,tkinter,tkinter.optionmenu","A_Id":71750492,"CreationDate":"2022-04-05T10:01:00.000","Title":"How to know all the disabled options in an Options Menu Tkinter Closed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"When making my tkinter app project, sometimes I need to quickly know the current values of the variables I made, for debugging purposes, so I make a line like this:\n\nroot.bind(\"< F1>\", lambda e: print(f\"var1: {var1} \\n var2: {var2} \\n [etc]\"))\n\nwhich basically prints out the values of the variables I specifically list in, when I press F1.\nThe problem with this is that manually typing each variable is a pain when you have a lot, so surely there is a smarter and automatic way of doing this. I'm guessing maybe there is a dictionary like \"globals()\" excluding the built-ins (meaning only the variables made by the user)? If there isn't such a thing, can someone give me an alternative?\nThanks","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":26,"Q_Id":71806008,"Users Score":0,"Answer":"Ekrem's answer is good enough for most cases, but it will also conflict with any imported modules, etc. There is simply no way of knowing what is user-made and what is imported, but you can filter globals to remove functions, classes, modules, and other items that are clearly not user-defined variables. However, if you have any lines like from module import some_constant, then it's nearly impossible to clearly categorize it as user-defined without explicitly marking a variable as user-defined (by adding it to a list or dictionary).","Q_Score":0,"Tags":"python-3.9","A_Id":71808369,"CreationDate":"2022-04-09T07:17:00.000","Title":"Is there a built-in dictionary like globals() but only for user-made variables?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to understand how memory is managed when python is embedded in C# using python.net. Python is executed in C# using the py.GIL (global interpreter lock), essentially C# calls the python interpreter and executes the python code. What I don't understand is how is memory allocated and deallocated for python objects.\nI couldn't find anything online and any type of help will be appreciated.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":48,"Q_Id":71892964,"Users Score":2,"Answer":"C# PyObject is holding a Python object handle (which are pointers into C heap). Internally Python objects count references to themselves.\nIn C# you can either force releasing the handle by calling PyObject.Dispose, in which case Python object refcount is decreased immediately, and if at this point it reaches 0, Python object will be destroyed and deallocated (from C heap).\nAlternatively, wait until PyObject instance is collected by .NET garbage collector. When that happens, the Python object handle is added to an internal queue, which is periodically emptied when you create new PyObjects (e.g. PyObject constructor will go check that queue, and release all handles in it).\nThis applies to Python.NET 2.5 and the upcoming 3.0.","Q_Score":1,"Tags":"python.net,python-embedding","A_Id":71897349,"CreationDate":"2022-04-16T10:14:00.000","Title":"Memory Management while embedding python in C# using python.net","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to print unicode characters like \u250c\u250c\u251d\u251c from QPython 3.6 (under Android on a Chromebook with Chrome OS 100) but print(u\"\u250c\u250c\u251d\u251c\") prints nothing, and using \\u doesn't work since \\ is the line continuation character in QPython. Perhaps the sandwiching of Android-over-Chrome OS-over-Linux makes this impossible - it's certainly beyond my diagnostic abilities - but I was hoping that a high-level language like Python might be able to bridge that gap...","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":18,"Q_Id":71919583,"Users Score":0,"Answer":"OK, have answer, both simple and humiliatingly ridiculous. After wasting hours reading docs and forums, I was running my Unicode test program when I noticed the 'preferences' button, at top-right corner of QPython console screen (but not of editor screen) greyed-out so as to be almost illegible. Among those preferences is a tick box 'Default to UTF-8' and ticking it instantly cured my problems. I do love QPython very much, but its documentation, help and UI design are simply appalling - it's taken me two years to find this box, and no-one has ever mentioned it.","Q_Score":0,"Tags":"unicode,printing,qpython","A_Id":72031080,"CreationDate":"2022-04-19T04:11:00.000","Title":"I'm trying to print unicode characters from QPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Trying to print unicode characters like \u250c\u250c\u251d\u251c from QPython 3.6 (under Android on a Chromebook with Chrome OS 100) but print(u\"\u250c\u250c\u251d\u251c\") prints nothing, and using \\u doesn't work since \\ is the line continuation character in QPython. Perhaps the sandwiching of Android-over-Chrome OS-over-Linux makes this impossible - it's certainly beyond my diagnostic abilities - but I was hoping that a high-level language like Python might be able to bridge that gap...","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":18,"Q_Id":71919583,"Users Score":0,"Answer":"After a little more research it looks as though QPython 3.6's chr() function doesn't accept u\"whatever\" containing characters outside the ASCII set, ie. it isn't doing unicode at all","Q_Score":0,"Tags":"unicode,printing,qpython","A_Id":71925067,"CreationDate":"2022-04-19T04:11:00.000","Title":"I'm trying to print unicode characters from QPython","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"i want to control every pixel of my tkinter program but when i search how, i just found out that the only solution is to use 'canvas' and even if it allows us to draw lines, i think i didnt find out how to change for exemple the color of the pixel (x=200, y=478)\nand i m also afraid that when i use my code on a really big size of pixels, the program becomes slow with tkinter.. i m still a beginner for those who havent noticed it yet.. so i m curious to know if there is no tool in tinker that actually is used like it takes the x, y of the pixel and the color you wanna apply! i guess it should be possible bcs how either tkinter is supposed to be programmed.. (i m still a beginner ^^) anyways if this tool exists pls tell me about it and if it is supposed to be as slow as canvas i can actually just try a better code..","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":29,"Q_Id":71957089,"Users Score":0,"Answer":"so i m curious to know if there is no tool in tinker that actually is used like it takes the x, y of the pixel and the color you wanna apply!\n\nThere is no such tool. Tkinter simply isn't designed to do this. If you need to control individual pixels in a GUI, tkinter is the wrong tool to use.","Q_Score":0,"Tags":"python,tkinter,canvas,pixel","A_Id":71957512,"CreationDate":"2022-04-21T15:30:00.000","Title":"how to change the color of our pixels using tkinder?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to make a 3D game but right now just jumping, I have got the jumping working, but I want to do a thing that (for example if speed=10) but if space is pressed 2x within (for example 0.5 seconds) the speed will go up by (for example 2) and if the player doesn't jump 2x times within the 0.5 seconds the speed stays\/resets to normal.\nSo to simplify character speed becomes faster if you press space in certain time and if you don't for it stays 10, for example if I press space\/jump and after 1 second do the same, the speed won't go up, but if I press space\/jump within seconds <= 0.5 seconds the speed will go up, until I don't press it within the time, so if I stop pressing it within seconds <= 0.5 seconds the jump resets to 10 and if I jump --> 0.6 seconds =< seconds the speed stays the same.\nAnd to people who don't know ursina, its a python based game engine and you modify the player using this type\n----> player=FirstPersonController(gravity = (1), speed=10)\n(Not sure but I think the engine is fully based on Python. Just so you know.\nThe engine I'm learning in is \"Ursina Engine\"","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":43,"Q_Id":71962182,"Users Score":0,"Answer":"Sounds like you need to save the timestamp whenever the space is pressed. Then, every time it is pressed, before updating the timestamp, compare now against the previous timestamp... if it is less than 500ms, then speed up!\nReacting to the user doing nothing is harder. I have not used ursula, and a quick look at the documentation, I do not see much in the Ursina Engine to help you.\nBut I have an idea you could try? When the character is sped up, create an invisible wall to hit. Set the wall up exactly where the character will be in 500ms time, if the user does nothing, they will \"collide\" with the wall and it will trigger your routine to reduce the speed. If the user does do something, remove the wall. Just an idea. Not sure if that will work. Enjoy!","Q_Score":0,"Tags":"python,time,ursina","A_Id":71962573,"CreationDate":"2022-04-22T00:26:00.000","Title":"How to do a thing if user does something with a certain time limit?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"skeleton for the code\nThe functions you need to write are as follows:\ndef create grid(grid):\n\"\"\"create a 4x4 array of zeroes within grid\"\"\"\ndef print grid (grid):\n\"\"\"print out a 4x4 grid in 5-width columns within a box\"\"\"\ndef check lost (grid):\n\"\"\"return True if there are no 0 values and there are no\nadjacent values that are equal; otherwise False\"\"\"\ndef check won (grid):\n\"\"\"return True if a value>=32 is found in the grid; otherwise\nFalse\"\"\"\ndef copy grid (grid):\n\"\"\"return a copy of the given grid\"\"\"\ndef grid equal (grid1, grid2):\n\"\"\"check if 2 grids are equal - return boolean value\"\"\"","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":46,"Q_Id":71983693,"Users Score":0,"Answer":"If your util.py is just responsible for editing grid you can write code as you mentioned. But if your util.py has more functionalities, for instance opening dataset, multi dimension grid and ... you can use classes. Put your function which related each other to the classes and import classes from util.py wherever you want. You can read single responsibility design pattern.","Q_Score":0,"Tags":"python,arrays,unit-testing","A_Id":71984872,"CreationDate":"2022-04-23T21:19:00.000","Title":"how do i code a module of utility functions called util.py for manipulating 2-dimensional arrays of size 4x4?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to do auto mouse move and auto click, but it will be invisible, it will run in the background. It will keep clicking on a fixed location in the background game while I do other things on the computer. is it possible? will someone help me?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":48,"Q_Id":72070854,"Users Score":0,"Answer":"What you are trying is impossible, at least in Python. While you can create a synthetic second mouse and click a fixed location with it from Python as @Sinr Ego explained, this click will always happen in the window that is currently on top - so, you can't work in one window and have the synthetic mouse clicking in another.\nWhat you could try however, is to write an extension for your browser - there you have the possibility of accessing any element of a website in any tab (a button, for example) and on that element, you can automatically emit a click event. For Firefox (and probably most other browsers), this would be in JavaScript, mainly.","Q_Score":0,"Tags":"python","A_Id":72071151,"CreationDate":"2022-04-30T17:53:00.000","Title":"python mouse click and mousemove","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I finished my python application and I converted it to .exe\nbut when I open the .exe file, I found that the cmd window is also open with the application window.\nI used python3.10 and tkinter\nalso used auto-py-to-exe to convert","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":19,"Q_Id":72072190,"Users Score":0,"Answer":"You can add the --noconsole tag to the command when creating the .exe\npyinstaller \"other tags\" --noconsole app.py","Q_Score":0,"Tags":"python,cmd,auto-py-to-exe","A_Id":72072372,"CreationDate":"2022-04-30T21:07:00.000","Title":"cmd window always open when I open my .exe application","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"context: I have a python program which relies on multiple libraries implemented in C++, exposed via pybinder.\nMy impression is: when python import xxx, it loads shared libraries (.so) into virtual memory. This is something I remember I read from book or webpage but cannot find it now.\nI want to know how I can verify it in Linux? I tried to strace with event open, the only shared libraries opened are something like py\/__init__.so (all python internal libraries), which doesn't look correct to me.\nIn the code base, I have multiple libcurl with multiple versions, all of them are introduced by 3-rd parties libraries. I want to know if I have a way to enforce when running python applications, they don't intervene?\nFor example: python program A relies on C++ shared library B and C.\nB relies on libcurl (V1), statically linked.\nC also relies on libcurl (V2), also statically linked.\nBad things could happen if B invokes libcurl (V2), since there might be conflict.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":52,"Q_Id":72122320,"Users Score":0,"Answer":"On Linux systems, you can see which dynamic libraries are loaded into a process by running cat \/proc\/pid\/maps where pid is the relevant process ID.\nAbout your second question: If the libraries are statically linked to libcurl then they cannot use the wrong library version: the linking is static.\nIf the linking is dynamic then only one libcurl can be loaded. However libcurl seems to be relatively API\/ABI stable so this usually wouldn't be a problem.","Q_Score":1,"Tags":"python,c++,pybind11","A_Id":72129431,"CreationDate":"2022-05-05T05:28:00.000","Title":"How python loads C++ shared library","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Question regarding pygame's \"draw\" method. If I had a sprite group named \"spritegroup\" and had a display surface named \"screen\" I could use spritegroup.draw(screen) to draw the spritegroup onto the screen. Additionally, assume the sprite has an update method which makes the current x position of the sprite change by 5 units. This update method will be called in the main game loop upon the user hitting a specific key.\nTo explain further, we would call the update method in the game loop every time the key was hit. Then, we would draw the spritegroup(which now has an altered position) to the screen. Then, we can use the flip method to update these changes to the user's monitor.\nHowever, considering the process described above is within a loop, the next time the user hits the key, the update method will be called and once again the sprite group will once again be drawn onto the screen. My confusion is at this point: in the previous iteration we have already drawn the sprite group onto the screen. Yet, we are doing so again(albeit in an altered position), in this iteration. Why wouldn't this result in two sprite groups being displayed to the user when the pygame.display.flip() method is called?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":25,"Q_Id":72165282,"Users Score":1,"Answer":"The answer is, in the example above it does end up drawing the spritegroup to the screen at every iteration. Basically, the screen is like a canvas with multiple layers on it I guess: the previous layers never get cleared. As a result, if you draw a spritegroup at pos x and then in the next iteration draw it at pos x + 10, the spritegroup will be shown at both positions.\nTo get around this, reblit the background to the screen every iteration. This, essentially takes the screen(which I analogize as being like a canvas) and plasters the background on top of everything that was on the screen before. Esentially, you are giving yourself a clean slate by covering up the previous drawings with your background image. Upon doing this, you may then draw the updated spritegroup ontop of the new background.","Q_Score":0,"Tags":"python,pygame","A_Id":72165576,"CreationDate":"2022-05-08T21:42:00.000","Title":"Pygame Query Regarding Drawing Sprite Groups","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"In my code I was messing around and created code that looked something like this\ndef checkformouseclick():\neventlist = pygame.event.get()\nfor i in eventlist:\nif i.type == pygame.MOUSEBUTTONDOWN:\nprint(\"Mousebuttondown\")\nelse:\nprint(\"Mousebutton not down\")\nMain Loop:\ncheckformouseclick()\nsecond_event_list = pygame.event.get():\nfor j in second_event_list:\nif j.type == pygame.QUIT:\nbreak mainloop\nI then decided to print out each \"index\" of each individual list(i.e. print(i.type), print(j.type)) and found that unexpected things were happening. For example, I would create events by clicking on the screen and smashing my keyboard but these events would show up in one of the event lists but not the other. Why is that the case?\nThanks for any answers, sorry if I'm being an idiot.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":18,"Q_Id":72236852,"Users Score":0,"Answer":"Alright guys, after running a few experimental lines of code and reading up on documentation, here's the answer for future beginners like me.Disclaimer: I'm a business major not a computer scientist.\nAssume you create a variable eventlist and set it equal to pygame.event.get(). To dumb down whats happening, pygame is going to take a look at the event queue and check to see if there are any events within this queue. It is then going to take any events from the queue, put them into a list, and now the variable is referencing that list. However, the queue is emptied once this process is complete.\nThus, if in this same loop lower down in the program I say neweventlist = pygame.event.get(), pygame is going to look through the queue and only any events that have occured since I last read through the queue are going to be added to the list.","Q_Score":0,"Tags":"python,pygame","A_Id":72237022,"CreationDate":"2022-05-14T02:18:00.000","Title":"Setting var1 = Pygame.event.get() and var2 = Pygame.event.get() later in the code seems to lead to wonky results. Why?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to detect a long mouse click using tkinter.\nHow can I do that?\nThe doesn't help at all.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":29,"Q_Id":72243484,"Users Score":1,"Answer":"You can create a binding for both the button press () and button release (). Save the time that the press happened and then compute the delay when the release happened.\nOr, depending on what you mean by \"detect\", you can schedule a job to run when the button is clicked, and then cancel the job if the button is released before the timeout.","Q_Score":0,"Tags":"python,tkinter","A_Id":72243617,"CreationDate":"2022-05-14T20:00:00.000","Title":"How can I detect long mouse clicks with tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Looking for a way to be able to find the color data of a pixel(s) on a Canvas. I'm sort of a beginner to coding, just gauging if this is possible\/how to go about this. This is for a project I've been working on, and for part of it, it's necessary to compare the color data of a Canvas to an Image. I know how to find the per pixel color data of an Image, but I haven't found anything for a canvas. I'm using a Tkinter Canvas at the moment, but if it's not possible on that library, I'm open to switching to another library. Any ideas? Thanks guys!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":30,"Q_Id":72266604,"Users Score":0,"Answer":"Looking for a way to be able to find the color data of a pixel(s) on a Canvas.\n\nTkinter doesn't provide the ability to do this.","Q_Score":0,"Tags":"python,tkinter,canvas,colors","A_Id":72266773,"CreationDate":"2022-05-16T23:22:00.000","Title":"How to get color of pixel on Tkinter Canvas in Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using win32com in JupyterLab to draw in MS Visio and am struggling with a VBA to Python translation.\nThe problem is the property RowType of a shape.\nIn VBA you read and write it via: shp.RowType(sec_num, row_num)\n(shp is a shape instance, sec_num = section number and similar for the row)\nIn Python the reading works as expected, writing however throws the error message \"cannot assign to function call\". Which is logical since VBA is ambiguous with setters and getters.\nI tried creating an object that references this property. But it obviously doesn't work neither.\n(temp = shp.RowType(sec_num, row_num). temp becomes the value.\nI think the core problem is located in win32com.\nPython is probably powerful enough to let one differentiate between setter and getter, but this is beyond my level.\nAny ideas?\nThe worst option would be to call a VBA routine in a stencil, or even worse the document.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":61,"Q_Id":72272390,"Users Score":0,"Answer":"Answered by @Tim Roberts in the comments.","Q_Score":1,"Tags":"python,vba,jupyter-lab,win32com,visio","A_Id":72368452,"CreationDate":"2022-05-17T10:29:00.000","Title":"win32com - cannot assign to function call","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"When you run a function using .after() in Tkinter, does it stop all the current tasks and run that function or does it run it as a background task?\nSo, if I want to run a function as a background task (meaning it won't make the process to stuck while it is running), what should I do?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":23,"Q_Id":72369367,"Users Score":1,"Answer":"Tkinter is single-threaded. It is an event-based architecture that maintains a queue of events to be processed. These events are processed in order.\nThe use of after does nothing more than putting an event on the queue with a timestamp. During normal processing of the queue, tkinter will invoke a function once the interval has passed. Tkinter will not be able to do anything while that function is running.\nThese functions do not run in the background. A better way of looking at it is that they run in the gaps between doing other things.\nIf you need something to run in the background you'll need to use threading or multiprocessing.","Q_Score":0,"Tags":"python,tkinter","A_Id":72369517,"CreationDate":"2022-05-24T20:55:00.000","Title":"Is .after function in Tkinter makes you run the function on background?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need my dialog box to close when the ok button is clicked. How do I do that ?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":24,"Q_Id":72405761,"Users Score":0,"Answer":"Assuming you created the button you should be able to just set the button click event as follows:\nbutton.clicked.connect(self.close) where button is the button name.\nAlthough since you did not provide any code with your question it's hard to know if this is what you're asking for...","Q_Score":0,"Tags":"python,pyqt5","A_Id":72405839,"CreationDate":"2022-05-27T12:53:00.000","Title":"Closing an .ui file on a click of a button (pyqt5)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"What is the difference between a Frame and Canvas in tkinter? I'm a beginner in tkinter, and I don't really see any difference between the two... I've been using them interchangeably. Are they the same or is there some sort of internal or external difference?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":46,"Q_Id":72454562,"Users Score":2,"Answer":"A Frame is designed to be a container for other widgets. It really doesn't do anything but provide a border and color, and to collect a set of widgets into a logical group.\nA Canvas is something that can act as a container for other widgets (as can just about any widget), but it also has features that let you draw circles, lines, rectangles, and other objects on it.\nA Canvas can also be scrolled, whereas a frame cannot.","Q_Score":0,"Tags":"python,tkinter,tkinter-canvas","A_Id":72455183,"CreationDate":"2022-05-31T22:08:00.000","Title":"Difference between Frame and Canvas tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I wrote a Python script that generates a QR Code containing the user's contact information, and now I can't find a solid way to deliver it to the users. This is made for a group of people with no programming knowledge, so I need to make it very simple. I used tkinter to make a window in which the user can input their data, and then the QR code is generated in their Downloads folder.\nMy first thought was to make a .exe file using auto-py-to-exe, which worked on my machine, but didn't work on someone else's for some strange reason (they simply couldn't open it, not even a dialogue box appeared giving a reason why).\nI'm running out of ideas here, open to any and all suggestions.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":99,"Q_Id":72543751,"Users Score":0,"Answer":"You could do a simple streamlit app.\nIf your code can be public, you can push it to github and deploy it from there. It's free and should be straight forward.","Q_Score":0,"Tags":"python,windows,user-interface,exe,qr-code","A_Id":72543788,"CreationDate":"2022-06-08T10:02:00.000","Title":"Making a Python script into a file that's easy to open for other users","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Thank you for reading this.\nSo e.g I start csgo, minecraft, or whatever game. When I'm in game I want to open the chat by pressing the key \"y\", nevertheless, I've tried using pyautogui, keyboard, win32api and win32con, they only simulate virtual key presses and I guess that's the problem since the games don't accept it as real key presses.\nIs there any way I could simulate it as actual key presses?\nI appreciate any answer!\nHave a good day :)","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":261,"Q_Id":72577007,"Users Score":0,"Answer":"I don't think Python is the right tool for this, try looking for key mappers (like KeyMapper), they simulate keypresses better afaik and you can easily bound 'y' to press whatever button opens chat in the game you want.","Q_Score":0,"Tags":"python,keyboard,key,keypress,pyautogui","A_Id":72577064,"CreationDate":"2022-06-10T15:54:00.000","Title":"Simulating key presses in a game using Python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a tkinter form on which I have 2 comboboxes. The options in the second combobox depend on what has been selected in the first one. When I use a pair of ttk.Combobox widgets, everything works OK, but if I change these to ttkwidgets.AutocompleteCombobox widgets, the second list does not populate and, strangely, I get a \"TypeError: config() takes 1 positional argument but 2 were given\".\nIs it possible to dynamically set the entries list for an AutocompleteCombobox and, if so, how?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":61,"Q_Id":72620321,"Users Score":0,"Answer":"Looking at the documentation for the ttkwidgets.AutocompleteCombobox, it looks like you're supposed to call the set_completion_list method if you want to change the list of completions.","Q_Score":0,"Tags":"python-3.x,tkinter,ttkwidgets","A_Id":72622440,"CreationDate":"2022-06-14T16:21:00.000","Title":"Python ttkwidgets - Dynamically update AutocompleteCombobox completevalues list","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Tkinter app that uses images included in the same folder as the .py file. pyinstaller script.py produces an executable that runs but does not open any windows. This is because it is looking for images that don't exist in the same subdirectory. When I copy the important images to the dist folder Pyinstaller creates, the application runs correctly.\nHowever, I would like to have a single executable that I can share with other users that doesn't also require them to have the images stored. The images should be bundled with the software somehow, like how commercial software (usually) doesn't require you to download assets separately from the program itself.\nIs there a way to bundle Python programs and the assets they use into single-click applications?\nNote that I am using Python 3 on Linux Mint. I am also something of a novice, so don't be surprised if I'm missing something obvious here.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":71,"Q_Id":72652281,"Users Score":0,"Answer":"It appears I've solved my own problem.\nInstead of having the images included in the same folder as main.py and using the resulting short relative filepath to reach them, install the images in an appropriate space in the system directory tree (I used \/home\/$USER$\/.$PROGRAMNAME$\/) and have the program access the files using the absolute path to that directory. This will allow you to copy the program anywhere on your computer you want and have it run without a problem.\nHowever, if you want to share it with someone else, you'll need to also include an installation script that places the assets in the correct directory on their computer.","Q_Score":0,"Tags":"python,bundle","A_Id":72680683,"CreationDate":"2022-06-16T21:54:00.000","Title":"How to bundle Python apps with asset dependencies for end users?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to use win32gui from pywin32 but I keep getting this error:\nModuleNotFoundError: No module named 'win32gui'\nI am on windows 10, python 3.9\nI have been researching the top results on stack over flow and google for a while now and the solutions i found don't work for me.\nthings I have tried:\n\ninstalled pywin32 via a whl file (this shows in site packages along with win32 ect)\ndouble checked both 64bit versions of python and pywin32 are installed\nAdded pywin32 to Path (worth a try)\ntried \"from win32 import win32gui\"\n\nAny help would be appreciated!\nRequested commands with output:\nimporting win32api and win32com results in the same out of\n\nModuleNotFoundError: No module named 'win32api'\nModuleNotFoundError: No module named 'win32com'\n\npython -m pip install pywin32\nRequirement already satisfied: pywin32 in c:\\users\\user\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (304.0)\npython -c \"import win32gui\" -- nothing happens when i run this line in a cmd (maybe i have done something wrong here?)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":352,"Q_Id":72658434,"Users Score":0,"Answer":"Solution unknown however it was fixed by simply recreating the virtual environment and installing the pywin32.","Q_Score":0,"Tags":"python,pywin32,win32gui","A_Id":72770886,"CreationDate":"2022-06-17T11:05:00.000","Title":"Issues with importing win32gui python 3.9","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to get the input from a tkinter text widget, but it is coming up with the error:\n_tkinter.TclError: invalid command name \".!text\"\nHere is where I define the textbox: textbox = tkinter.Text(main_root)\nAnd this is how I call the get() function: textbox.get(\"1.0\", \"end-1c\")\nAnyone got any ideas what is going on? Usually this works fine.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":62,"Q_Id":72662220,"Users Score":0,"Answer":"I was calling textbox.destroy() before calling the get() function. This is what caused the error to be raised.","Q_Score":0,"Tags":"python,tkinter,tkinter-text","A_Id":72663264,"CreationDate":"2022-06-17T16:22:00.000","Title":"Why am I receiving a tkinter.TclError when trying to get the content of a text widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Recently, I have tried to compile a hikari discord bot to an exe (because many computers may not have a python interpreter installed), I tried pyinstaller, py2exe and autopytoexe though none of them worked. When I ran the exe they all returned the same error message of: \"FileNotFoundError: D:\\MyDir\\dist\\library.aip\/hikari\/banner.txt\" or something like that. They all had an issue with a hikari file not begin found. So I am wondering if there is anything I could do with my code or with settings so that I can compile this hikari bot to an exe. Or should I rewrite the program in a different","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":49,"Q_Id":72665715,"Users Score":0,"Answer":"To solve this problem I avoided using to exe compilers and instead just included a python interpreter with hikari installed to run the python source code.","Q_Score":0,"Tags":"python,discord,bots,filenotfounderror","A_Id":74284742,"CreationDate":"2022-06-17T23:52:00.000","Title":"Problem with compiling a hikari discord bot to an exe","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using module pywhatkit but without any reason, today py display an error.\nI tried to reinstall module and the system displays:\nRequirement already satisfied\nbut when I try to import module, py reply:\nModuleNotFoundError: No module named 'pywhatkit'\nAny ideas?\nThank you\nAngelo","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":33,"Q_Id":72675337,"Users Score":0,"Answer":"make sure you are using the correct env, if you are using an IDE like pycharm there is a good chance that you \"choose\" the wrong python. also if you are using pycharm you can go to FILE>SETTINGS>PROJECT>INTERPRETER to see packages that are available on the current project\/add directly","Q_Score":0,"Tags":"python,module,modulenotfounderror","A_Id":72675372,"CreationDate":"2022-06-19T08:23:00.000","Title":"module installed with pip not found in pyhton -windows 10","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Even though self is not a reserved keyword and just a strong convention it is written in red in my sublime text code. But if I change it to 'this' for example it will get white. Why is that so?","AnswerCount":1,"Available Count":1,"Score":-0.1973753202,"is_accepted":false,"ViewCount":68,"Q_Id":72700855,"Users Score":-1,"Answer":"In Python nearly everything is an object that can be referenced by self.\nTo display this there seems to be a common agreement upon IDE manufacturers to treat this keyword as special.\nOn the other hand \"This\" in python is basicly replaced by self because of the object-inherited self-attribute. Therefore \"This\" in python interpreter is recognized as simple word-\/name-tag (like in variable names). But i would strongly advice you not to use it to not confuse yourself and other code readers.","Q_Score":1,"Tags":"python,self","A_Id":72700934,"CreationDate":"2022-06-21T12:33:00.000","Title":"My sublime text shows 'self' in python methods in a different color even though it is not a reserved keyword. Why?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm working on a simple racing project where 4 turtles race on a track and at the finish line when it starts lap 2, it goes forward 1 to exit the point where it counts the lap. For some reason, the turtle's orientation is ever so slightly off 0 degrees, therefore the int() function rounds it to 0 and re-counts the lap. If I use the reset() function, it resets the colour.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":91,"Q_Id":72700950,"Users Score":1,"Answer":"You can use turtle.setheading(0) to reset the turtle to the original orientation.","Q_Score":1,"Tags":"python,python-turtle","A_Id":72700977,"CreationDate":"2022-06-21T12:40:00.000","Title":"How do I reset the turtle's orientation without resetting the colour?(python turtle)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to buil a c++ application with embedded python using pybind11 on Windows.\nI've installed python 3.7, 3.8, and 3.9 none of them is PATH\nnow no matter what pyhon version I want to use in cmake (by setting pybind11_DIR to pybind11 folder in the python folder, it always links to python3.9.dll)\nWhen I rename the folder where 3.9 is installed I get following error:\nFindPythonLibsNew.cmake:133: error: Python config failure:\n....\n\/Python37\/Lib\/site-packages\/pybind11\/share\/cmake\/pybind11\/pybind11Config.cmake:250 (include)\nCMakeLists.txt:131 (find_package)\nAdding \"-DPYBIND11_PYTHON_VERSION=3.7\" or \"-DPY_PYTHON_VERSION=3.7\"\nDoes not help. So where can I tell cmake to use 3.7 and not 3.9","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":222,"Q_Id":72718123,"Users Score":0,"Answer":"Got the solution myself. The python3.9 was somewhere in the cache from an earlier build. So after deleting the whole build folder and starting everything from scratch it directly worked with python3.7","Q_Score":0,"Tags":"python,pybind11","A_Id":72718576,"CreationDate":"2022-06-22T15:21:00.000","Title":"pybind11 embedded python: multiple python versions, cmake cannot find correct version","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am trying to run pyinstaller on a Windows 10 machine and I am getting the error below. Could somebody tell me that is the problem? I cannot understand which file is not finding.\nPython is version 3.10.5 and pyinstaller is version 5.1.\nError here:\nC:\\Users\\username\\Desktop\\CROWGUI>pyinstaller --onefile --noconfirm --console --clean --log-level=WARN --key=MySuperSecretPassword --strip --add-data=\u201ccommander.py;.\u201d crow_gui.py\n5983 WARNING: Ignoring \/System\/Library\/Frameworks\/IOKit.framework\/IOKit imported from C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\serial\\tools\\list_ports_osx.py - only basenames are supported with ctypes imports!\n5983 WARNING: Ignoring \/System\/Library\/Frameworks\/CoreFoundation.framework\/CoreFoundation imported from C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\serial\\tools\\list_ports_osx.py - only basenames are supported with ctypes imports!\nTraceback (most recent call last):\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\runpy.py\u201d, line 196, in run_module_as_main\nreturn run_code(code, main_globals, None,\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\runpy.py\u201d, line 86, in run_code\nexec(code, run_globals)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts\\pyinstaller.exe_main.py\u201d, line 7, in \nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller_main.py\u201d, line 178, in run\nrun_build(pyi_config, spec_file, **vars(args))\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller_main.py\u201d, line 59, in run_build\nPyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\build_main.py\u201d, line 842, in main\nbuild(specfile, distpath, workpath, clean_build)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\build_main.py\u201d, line 764, in build\nexec(code, spec_namespace)\nFile \u201cC:\\Users\\username\\Desktop\\CROWGUI\\crow_gui.spec\u201d, line 24, in \nexe = EXE(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 506, in init\nself.pkg = PKG(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 206, in init\nself.postinit()\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\datastruct.py\u201d, line 173, in postinit\nself.assemble()\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 269, in assemble\nfnm = checkCache(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\utils.py\u201d, line 367, in checkCache\nsubprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 501, in run\nwith Popen(*popenargs, **kwargs) as process:\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 969, in init\nself._execute_child(args, executable, preexec_fn, close_fds,\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 1438, in _execute_child\nhp, ht, pid, tid = _winapi.CreateProcess(executable, args,\nFileNotFoundError: [WinError 2] The system cannot find the file specified","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":310,"Q_Id":72742323,"Users Score":1,"Answer":"Its hard to judge just by the log. Where are your files located? Which file is your main file and which ones do you need to be included? What is your folder structure?","Q_Score":0,"Tags":"python,pyinstaller","A_Id":72742463,"CreationDate":"2022-06-24T10:02:00.000","Title":"Problems running pyinstaller on Windows for first time","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to run pyinstaller on a Windows 10 machine and I am getting the error below. Could somebody tell me that is the problem? I cannot understand which file is not finding.\nPython is version 3.10.5 and pyinstaller is version 5.1.\nError here:\nC:\\Users\\username\\Desktop\\CROWGUI>pyinstaller --onefile --noconfirm --console --clean --log-level=WARN --key=MySuperSecretPassword --strip --add-data=\u201ccommander.py;.\u201d crow_gui.py\n5983 WARNING: Ignoring \/System\/Library\/Frameworks\/IOKit.framework\/IOKit imported from C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\serial\\tools\\list_ports_osx.py - only basenames are supported with ctypes imports!\n5983 WARNING: Ignoring \/System\/Library\/Frameworks\/CoreFoundation.framework\/CoreFoundation imported from C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\serial\\tools\\list_ports_osx.py - only basenames are supported with ctypes imports!\nTraceback (most recent call last):\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\runpy.py\u201d, line 196, in run_module_as_main\nreturn run_code(code, main_globals, None,\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\runpy.py\u201d, line 86, in run_code\nexec(code, run_globals)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts\\pyinstaller.exe_main.py\u201d, line 7, in \nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller_main.py\u201d, line 178, in run\nrun_build(pyi_config, spec_file, **vars(args))\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller_main.py\u201d, line 59, in run_build\nPyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\build_main.py\u201d, line 842, in main\nbuild(specfile, distpath, workpath, clean_build)\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\build_main.py\u201d, line 764, in build\nexec(code, spec_namespace)\nFile \u201cC:\\Users\\username\\Desktop\\CROWGUI\\crow_gui.spec\u201d, line 24, in \nexe = EXE(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 506, in init\nself.pkg = PKG(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 206, in init\nself.postinit()\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\datastruct.py\u201d, line 173, in postinit\nself.assemble()\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\api.py\u201d, line 269, in assemble\nfnm = checkCache(\nFile \u201cC:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\PyInstaller\\building\\utils.py\u201d, line 367, in checkCache\nsubprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 501, in run\nwith Popen(*popenargs, **kwargs) as process:\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 969, in init\nself._execute_child(args, executable, preexec_fn, close_fds,\nFile \u201cC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\\lib\\subprocess.py\u201d, line 1438, in _execute_child\nhp, ht, pid, tid = _winapi.CreateProcess(executable, args,\nFileNotFoundError: [WinError 2] The system cannot find the file specified","AnswerCount":2,"Available Count":2,"Score":0.0996679946,"is_accepted":false,"ViewCount":310,"Q_Id":72742323,"Users Score":1,"Answer":"After trying installing several versions of PyInstaller and looking into the official script of PyInstaller, I found out that the issue is related to the --strip option. After removing that option all worked find.","Q_Score":0,"Tags":"python,pyinstaller","A_Id":72744080,"CreationDate":"2022-06-24T10:02:00.000","Title":"Problems running pyinstaller on Windows for first time","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Can I work with Virtual Cables in Ubantu using sounddevice library of Python? I am trying to play an audio file on a Virtual Cable. I have done this using pygame library. Now, I need to do it using sounddevice library. Is there a way?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":128,"Q_Id":72786656,"Users Score":0,"Answer":"ALSA Virtual cables on linux are easily accessible via sounddevice library and we can play audio on them using sounddevice library. Virtual cables made by PulseAudio are not accessible in linux via sounddevice library. If you want to use virtual cables with sonddevice lib on a linux machine then don't create them using PulseAudio :)","Q_Score":0,"Tags":"linux,audio,pygame,virtualization,python-sounddevice","A_Id":72824657,"CreationDate":"2022-06-28T12:42:00.000","Title":"Can we use sounddevice library in Python to play an audio file (.wav or .mp3) on a virtual cable instead of pygame library in Ubantu?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm fairly new to python and tkinter and I was wondering if it's possible to populate a ttk combobox with two values. i.e. an ID value and its corresponding text value. All the documentation I have read so far say it can only take single list values. I have managed to populate the combobox with values from an SQL Server table and would like to insert the combobox data into another SQL Server table, but would rather insert the ID value and not the string value. Is this possible?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":70,"Q_Id":72793274,"Users Score":0,"Answer":"It can only take a list of strings. However, the strings can be keys to a dictionary. You can easily look up the value based on the string. You can create your own class that handles these details for you.","Q_Score":0,"Tags":"python,tkinter","A_Id":72793621,"CreationDate":"2022-06-28T21:20:00.000","Title":"Inserting ID values from tkinter combobox values","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a GUI that I've made in tkinter using a canvas that has a bar along the left side and a bar along the top containing information. In the remaining area various rectangles are drawn corresponding to the information in those bars I described. The issue is, when you scroll away on the canvas, those events will leave as well.\nBasically, I want to create a visual effect like position: fixed is in CSS where these bars on the side and the top stay in place relative to the rest of the canvas so that they don't move from their relative position while scrolling.\nI tried making use of the scrollbar commands, but have had trouble making my own function there. I also tried to see if there was an event I could bind to the canvas to track the movement so that I could move the bars myself but I could not find anything.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":94,"Q_Id":72806751,"Users Score":0,"Answer":"There is no way to do this directly in the canvas unless you write the code to move the items in the top and left whenever the user scrolls. It would probably require a fair amount of work.\nHowever, it's trivial to have separate canvases for the side and top that do not scroll, and a third canvas that has all of the scrolled data.","Q_Score":0,"Tags":"python,tkinter,tkinter-canvas","A_Id":72807616,"CreationDate":"2022-06-29T19:19:00.000","Title":"How to move canvas drawn shapes to have a fixed position on screen?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"While I have been writing programs since high school (that's really old school to some of you) I am still quite new to [Micro]Python.\nI understand this question may have been answered elsewhere, but no suitable MicroPython solutions have shown up in my searches (solutions are usually Arduino or full Python).\nCurrent device and firmware:\nThonny IDE\nESP32 Lilygo TTGO T-Display\nThis model has a display and battery charger\/monitor circuit onboard (reading it is another matter) - from Aliexpress.\nLilygo's documentation for MicroPython is non-existant.\nMicroPython v1.18-128-g2ea21abae-dirty on 2022-02-12\nTTGO T-Display driver included, russhughes version from github\nBesides a salvaged flat lithium battery and using USB connection, no other devices added.\nNo datetime module in firmware (so no datetime.datetime.now() options)\nutime seems to use the time from the COMPUTER(!!) to report time values (8 element tuple) when I use it in Thonny and not from the ESP32 (the tuple should all start at 0).\nAnd forget using help('[object name]'), it treats the term as a string and reports all the stringy things you can do (help('modules') is the only one that works otherwise \"object [term] is of type str\") <- I've tried with and without the quotes.\nI am wanting to get the standalone uptime since the ESP32 started running the MicroPython program (I.E. 0 seconds starting point) so I can time how long the battery will last - I can't seem to find a reliable coding to read the battery charge (no two seem to fully agree on a method, appears to be great discussion on accuracy, and mostly in Arduino\/C code). Lilygo's Arduino\/C battery code is hidden in their demo firmware - both shipped and flashable from github, so no translation from that (at least by me).\nI want to display the uptime on the tft display, serial monitor, and save it to a file every minute so I can retrieve it on next boot. The main program is a webserver (modified codemee github ESPWebServer). Once I have a decent average time, I can use that for a safe shutdown time.\nIf there is a transferable version of datetime.py (udatetime.py?) that I could put on the local file system and import, I think that this would be the best option but any option that lets me time the uptime is welcomed.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":393,"Q_Id":72894861,"Users Score":0,"Answer":"@nekomatic: When I used utime while Thonny was running, the tuple that was reported was based on the time from my computer (that day's information as of the time of processing)\nAs I stated earlier, I am quite new to [Micro]Python. I didn't know about machine.RTC.\nhelp() is quite useless on the several firmwares I have tried ('offical' MicroPython and the variants that include various drivers). help('modules') lists the modules but help('[module name]') is treated as asking about a string, so no information is given about the modules. Without the quotes, it generates an error.\nThanks to your link, I added\nimport machine\nrtc = machine.RTC()\nprint(rtc.datetime())\nand it works (reports the ESP32's time relative to January 1st 2000), but rtc.now() generates an error\nprint(rtc.now())\nAttributeError: 'RTC' object has no attribute 'now'\nThis is a start and thank you.\nNote: after repetitive reruns\/restarts, the information returned flip flops between the ESP32 and the PC (sometimes starts with (2000, 1, 1), others (2022, 7, 8) as of today). So as a standalone it should be only the ESP32's datetime info as it can't access the computer's data.)\nAlso appears time.time() is available.\nNow to figure out how to call a write to file function every minute without sched, threading, and other useful full Python modules.","Q_Score":0,"Tags":"timer,micropython","A_Id":72916625,"CreationDate":"2022-07-07T08:49:00.000","Title":"Micropython: Get time since bootup\/program start","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm already pretty sure this isn't possible, but maybe someone here is really clever and knows a way. When you use create_image in a tk.Text, tkdocs states it is treated as any other character. This is barely true, though. It moves along with it's surrounding characters and you can use BackSpace on it, but other than that it is not a character, at all. It has zero length and nothing that it can be identified with in a regular expression. That is, I believe it can't be identified in a re, and that is the entire point of my actual question.\nIs it possible to give the results of create_image some kind of an identifier that can be caught in a regular expression? Something like [^every legitimate possibility] is not going to work. I say this because you can catch the image with ., so you probably could catch it, by it not being \"everything else\". Unfortunately, clunky methods like that are really not going to work for my needs.\nIf it helps to understand the specific problem. I have multiple faux-carets in my widget during certain behaviors. I am also using idlelib to do syntax-highlighting. idlelib does not like my faux-carets. I have semi-solved this problem without any regex. I believe I could completely solve it if I could describe the faux-caret in regex some kind of semi-sane way.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":32,"Q_Id":72923551,"Users Score":0,"Answer":"It actually is possible. You have to apply the image as fgstipple in a tag instead of using image_create. Then you can apply the tag to any imaginable character that regex recognizes. Instead of inserting images, you insert the desired dummy character (presumably some never-used whitespace character (U+200A)?), and tag it.\nAlternately, since you are dealing with carets, you could just tag the character before the caret, create no new characters, and skip the regex.","Q_Score":0,"Tags":"python-3.x,tkinter","A_Id":72923776,"CreationDate":"2022-07-09T17:53:00.000","Title":"tk.Text: Making image_create() images searchable by RegEx","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I use jpg file for image but when I run my app in phone it won't open but it works for PNG file.\nAnd also for audio file I use mp3, OGG file my app won't open but when I use wav file my app works but the sound doesn't come.\nAnd for font file, both TTF and OTF extension won't work i.e. my app won't work","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":62,"Q_Id":72980383,"Users Score":0,"Answer":"I solve my problem a bit, now the wav file is working correctly because I add the extension of wav file in the google colab file which created after the compilation of my files (Buildozer.spec) but the problem with jpg is still there and for mp3 also","Q_Score":0,"Tags":"python,android,kivy,google-colaboratory,extension-methods","A_Id":72989784,"CreationDate":"2022-07-14T12:19:00.000","Title":"I am converting a python\/kivy project to apk in google colab and some extension are not working so what extension I should use for audio\/font file?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"I am new to python and trying to figure out a problem that gui doesn't launch when clicking on the .pyw file.\nOn my windows 10 machine, I have installed python 3.5, and environment path is set.\nI was given a set of python files (.py) and some looks like shortcut file (.pyw). And I was told to double click the file then a gui will launch.\nSome .pyw works well, gui launch.\nHowever there are some failed. After double click, there was a quick cmd terminal open and closed automatically. Then no gui pop out.\nI want to know what is the cause and how do I debug it.\nFrom the properties of .pyw file, is is pointing to one of the .py file.\nLet me know if posting the .py file helps. I will then post here.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":78,"Q_Id":72982425,"Users Score":0,"Answer":"Managed to resolve it by selecting the correct pylauncher to open the file.","Q_Score":0,"Tags":"python,python-3.x,pytest","A_Id":72989877,"CreationDate":"2022-07-14T14:45:00.000","Title":"Pythonw gui does not run - how to debug","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want the user to enter something in the TextBox, and if he exits the program and returns to open the program again at any time, he finds that the words he entered are still there.\n(Python programmers - Save Dialog- tkinter )","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":72983088,"Users Score":0,"Answer":"If you want to save the state of the program, you could save it in file, in a database, or put your data in one place and use pickle. And at least reload the state on program start.","Q_Score":0,"Tags":"python,tkinter,dialog,save","A_Id":72983110,"CreationDate":"2022-07-14T15:30:00.000","Title":"How to save tkinter dialog data?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I used OpenCV's connectedComponentsWithStats function to do connected component labeling on an image. I would now like to be able to access all the pixels that have a certain label, or check the label that is assigned to a particular pixel while iterating through the image. How can I do this? I plan on iterating through the image using a nested for loop.","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":126,"Q_Id":72988695,"Users Score":1,"Answer":"connectedComponents* literally gives you a \"labels map\". You look up the pixel's position in there and you get the label for that pixel.\nIf you need a mask for one specific label, you calculate mask = (labels_map == specific_label)\nDo not \"iterate\" through images. Python loops are slow. Whatever you do, consider how to express that with library functions (numpy, OpenCV, ...). There are ways to speed up python loops but that's advanced and likely not the right solution for your problem.","Q_Score":0,"Tags":"python,numpy,opencv,pixel,connected-components","A_Id":72993128,"CreationDate":"2022-07-15T03:15:00.000","Title":"How do you access a pixel's label ID that is given to each pixel after connected component labeling?","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a GUI for a network of nodes. There are time-based data logs that I read from to make changes to the nodes. In the GUI I plot the nodes as QGraphicsItems. Based on the logs, the nodes change for example their colors and positions over time. I want to add a QSlider that works like a video progress bar, i.e. it moves automatically when reading data from the logs. How can this be implemented?\nThanks in advance.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":31,"Q_Id":72995591,"Users Score":0,"Answer":"I think you can read the data in a QThread and update the QSlider every line you read, or every x ammount of logs.\nYou can use slot and signal to communicate between the QThread and the UI main thread (or Application thread or whatever).","Q_Score":0,"Tags":"python,qt,pyqt,progress-bar,qslider","A_Id":72995624,"CreationDate":"2022-07-15T14:30:00.000","Title":"PyQt: How to set QSlider moves automatically over time?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For example if I have a main.py file which has a root = tk.Tk() line for main window of GUI. And another file menu.py which I want to use to add menu bar to the root window in main.py.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":71,"Q_Id":73003656,"Users Score":0,"Answer":"This is actually really easy so don't worry.\nFirst ensure that main.py and menu.py are in the same folder,\nthen at the beginning of main.py add from menu import *.\nThis should import all the data and python code from the other file so you can work in that file as if you were working in the main one.","Q_Score":0,"Tags":"python,tkinter","A_Id":73005630,"CreationDate":"2022-07-16T11:07:00.000","Title":"How to work on same tkinter window from different python file?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Check application requirements \nCompile platform \nRun '\/usr\/bin\/python3 -m pythonforandroid.toolchain create --dist_name=demo3 --bootstrap=sdl2 --requirements=python3,kivy,pillow,kivymd,asyncio,bleak --arch armeabi-v7a --copy-libs --color=always --storage-dir=\"\/content\/.buildozer\/android\/platform\/build-armeabi-v7a\" --ndk-api=21 --ignore-setup-py --debug' \nCwd \/content\/.buildozer\/android\/platform\/python-for-android \n\n[INFO]: Will compile for the following archs: armeabi-v7a \n[INFO]: Found Android API target in $ANDROIDAPI: 27 \n[INFO]: Available Android APIs are (27) \n[INFO]: Requested API target 27 is available, continuing.\n[INFO]: Found NDK dir in $ANDROIDNDK: \/root\/.buildozer\/android\/platform\/android-ndk-r19c \n[INFO]: Found NDK version 19c \n[INFO]: Getting NDK API version (i.e. minimum supported API) from user argument \nTraceback (most recent call last): \nFile \"\/usr\/lib\/python3.7\/runpy.py\", line 193, in _run_module_as_main\n\"main\", mod_spec) \nFile \"\/usr\/lib\/python3.7\/runpy.py\", line 85, in _run_code\nexec(code, run_globals) \nFile \"\/content\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/toolchain.py\", line 1294, in \nmain() \nFile \"\/content\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/entrypoints.py\", line 18, in main\nToolchainCL() \nFile \"\/content\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/toolchain.py\", line 728, in init\ngetattr(self, command)(args) \nFile \"\/content\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/toolchain.py\", line 144, in wrapper_func\nuser_ndk_api=self.ndk_api) \nFile \"\/content\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/build.py\", line 423, in prepare_build_environment\nself.ccache = sh.which(\"ccache\") \nFile \"\/usr\/local\/lib\/python3.7\/dist-packages\/sh-1.14.3-py3.7.egg\/sh.py\", line 1524, in call\nreturn RunningCommand(cmd, call_args, stdin, stdout, stderr) \nFile \"\/usr\/local\/lib\/python3.7\/dist-packages\/sh-1.14.3-py3.7.egg\/sh.py\", line 788, in init\nself.wait() \nFile \"\/usr\/local\/lib\/python3.7\/dist-packages\/sh-1.14.3-py3.7.egg\/sh.py\", line 845, in wait\nself.handle_command_exit_code(exit_code) \nFile \"\/usr\/local\/lib\/python3.7\/dist-packages\/sh-1.14.3-py3.7.egg\/sh.py\", line 869, in handle_command_exit_code \nraise exc \nsh.ErrorReturnCode_1:\nRAN: \/usr\/bin\/which ccache\nSTDOUT:\nSTDERR:\n\nCommand failed: \/usr\/bin\/python3 -m pythonforandroid.toolchain create --dist_name=demo3 --bootstrap=sdl2 --requirements=python3,kivy,pillow,kivymd,asyncio,bleak --arch armeabi-v7a --copy-libs --color=always --storage-dir=\"\/content\/.buildozer\/android\/platform\/build-armeabi-v7a\" --ndk-api=21 --ignore-setup-py --debug\n\nENVIRONMENT: \nCUDNN_VERSION = '8.0.5.39' \nPYDEVD_USE_FRAME_EVAL = 'NO' \nLD_LIBRARY_PATH = '\/usr\/local\/nvidia\/lib:\/usr\/local\/nvidia\/lib64' \nCLOUDSDK_PYTHON = 'python3' \nLANG = 'en_US.UTF-8' \nENABLE_DIRECTORYPREFETCHER = '1' \nHOSTNAME = 'ca63256296ed' \nOLDPWD = '\/' \nCLOUDSDK_CONFIG = '\/content\/.config' \nUSE_AUTH_EPHEM = '1' \nNVIDIA_VISIBLE_DEVICES = 'all' \nDATALAB_SETTINGS_OVERRIDES = '{\"kernelManagerProxyPort\":6000,\"kernelManagerProxyHost\":\"172.28.0.3\",\"jupyterArgs\":[\"--ip=172.28.0.2\"],\"debugAdapterMultiplexerPath\":\"\/usr\/local\/bin\/dap_multiplexer\",\"enableLsp\":true}' \nENV = '\/root\/.bashrc' \nPAGER = 'cat' \nNCCL_VERSION = '2.7.8' \nTF_FORCE_GPU_ALLOW_GROWTH = 'true' \nJPY_PARENT_PID = '41' \nNO_GCE_CHECK = 'False' \nPWD = '\/content' \nHOME = '\/root' \nLAST_FORCED_REBUILD = '20220712' \nCLICOLOR = '1' \nDEBIAN_FRONTEND = 'noninteractive' \nLIBRARY_PATH = '\/usr\/local\/cuda\/lib64\/stubs' \nGCE_METADATA_TIMEOUT = '3' \nGLIBCPP_FORCE_NEW = '1' \nTBE_CREDS_ADDR = '172.28.0.1:8008' \nTERM = 'xterm-color' \nSHELL = '\/bin\/bash' \nGCS_READ_CACHE_BLOCK_SIZE_MB = '16' \nPYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command' \nMPLBACKEND = 'module:\/\/ipykernel.pylab.backend_inline' \nCUDA_VERSION = '11.1.1' \nNVIDIA_DRIVER_CAPABILITIES = 'compute,utility' \nSHLVL = '1' \nPYTHONPATH = '\/env\/python' \nNVIDIA_REQUIRE_CUDA = ('cuda>=11.1 brand=tesla,driver>=418,driver<419 '\n'brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451') \nTBE_EPHEM_CREDS_ADDR = '172.28.0.1:8009' \nCOLAB_GPU = '0' \nGLIBCXX_FORCE_NEW = '1' \nPATH = '\/root\/.buildozer\/android\/platform\/apache-ant-1.9.4\/bin:\/opt\/bin:\/usr\/local\/nvidia\/bin:\/usr\/local\/cuda\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/tools\/node\/bin:\/tools\/google-cloud-sdk\/bin' \nLD_PRELOAD = '\/usr\/lib\/x86_64-linux-gnu\/libtcmalloc.so.4' \nGIT_PAGER = 'cat' \n_ = '\/usr\/local\/bin\/buildozer' \nPACKAGES_PATH = '\/root\/.buildozer\/android\/packages' \nANDROIDSDK = '\/root\/.buildozer\/android\/platform\/android-sdk' \nANDROIDNDK = '\/root\/.buildozer\/android\/platform\/android-ndk-r19c' \nANDROIDAPI = '27' \nANDROIDMINAPI = '21' \n\nBuildozer failed to execute the last command\nThe error might be hidden in the log above this error\nPlease read the full log, and search for it before\nraising an issue with buildozer itself.\nIn case of a bug report, please add a full log with log_level = 2","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":344,"Q_Id":73029750,"Users Score":0,"Answer":"There is a problem with the python-for-android build.py file which they currently fixing(something related to sh, and shoudl be fixed soon)\nmeanwhile as a workaround it is suggested to uncomment p4a.branch = master in the buildozer spec file and change the \"master\" to \"develop\"","Q_Score":1,"Tags":"python,android,buildozer","A_Id":73044331,"CreationDate":"2022-07-18T23:58:00.000","Title":"Buildozer stopped working all of a sudden despite always uploading the same files to Colab","Data Science and Machine Learning":1,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have lots of rects and each one has its own function when clicking on it.\nSome of these rects are overlap sometimes. When I click somewhere, I want to execute just the above rect function (not all rects in that position).\nThanks","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":29,"Q_Id":73034212,"Users Score":0,"Answer":"Give a name\/var to each rectangle, then use a for loop and break once the rect is the desired one.","Q_Score":0,"Tags":"python,pygame,overlap,rect","A_Id":73034398,"CreationDate":"2022-07-19T09:10:00.000","Title":"How click affects just on above rect in pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm designing a program in python tkinter that displays information that's currently in an excel spreadsheet. Ideally, I'd like to be able to share this program without needing to share the excel book as well. Is it possible to import the excel book into the program to make the program independent of that excel file? Let me know if I can provide any more clarification. Thank you!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":37,"Q_Id":73054813,"Users Score":0,"Answer":"You would need to assign the Excel file's content to a variable in your program to do so. I hope it isn't very large, but to make it easier I recommend:\n\nsaving your Excel file to .csv format\nread it from Pytho\nconvert it to the data type you want (ex: string, list, ...)\nsave it back to a .txt file.\n\nNow just copy the content of your .txt and assign that to a variable somewhere in your code.\nEdit: what Alphy13 said is also a solution","Q_Score":0,"Tags":"python,excel,pandas,tkinter","A_Id":73054894,"CreationDate":"2022-07-20T16:02:00.000","Title":"How do I make my program independent of an excel sheet it currently relies on?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm designing a program in python tkinter that displays information that's currently in an excel spreadsheet. Ideally, I'd like to be able to share this program without needing to share the excel book as well. Is it possible to import the excel book into the program to make the program independent of that excel file? Let me know if I can provide any more clarification. Thank you!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":37,"Q_Id":73054813,"Users Score":0,"Answer":"Typically its best to create an example workbook that you can share. Give it all of the right parameters and leave out the sensitive data, or fill it in with fake data.\nYou could also set all of the variables that come from the excel file to have a default value that only changes when the workbook is present. This can be the first step toward creating proper error handling for your program.","Q_Score":0,"Tags":"python,excel,pandas,tkinter","A_Id":73054896,"CreationDate":"2022-07-20T16:02:00.000","Title":"How do I make my program independent of an excel sheet it currently relies on?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"My hello message is not visible...\nI'm writing a 3D video game using Python (3.10) language with Panda3d (1.10) as 3D game engine.\nSome graphical parts of the game are not 3D, there are just 2D elements:\n\nspell bar,\nplayer resume\nquest panel\nskill tree\netc\nspells\/attacks book\nand others\n\nI see on the web that pictures are used to styling Panda3D Direct* components.\nHowever, in my opinion, I think use statics pictures (.png for exemple) is not efficient when game design must be evolved. That's why I prefer use HTML\/CSS to render 2D elements, especially since CSS is very powerful if you know how to use it. I prefere to use SVG into the scene but I don't understand how create SVG file.\nSo, my question is:\nCan I use HTML\/CSS inside a Panda3d application?\nThank to all!\nHave a nice day!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":59,"Q_Id":73078086,"Users Score":0,"Answer":"I think I've found a workaround (temporary).\n\nI create HTML\/CSS file that styling my 2D component that must be injected inside the Panda3D scene\nI create a Python script that convert an HTML part as PNG picture using RGBA for transparency\nI use the generated PNG picture inside my Panda3D scene on the target component.\n\nIt's not pure HTML\/CSS, but it can works.","Q_Score":0,"Tags":"python,html,css,panda3d","A_Id":73078393,"CreationDate":"2022-07-22T09:26:00.000","Title":"Python - Panda3D - Display HTML\/CSS elements into Panda3D scene","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":1},{"Question":"How can I get root access on android phone without having to use the SDK tools..is it possible to try it with python and Ubuntu terminal...I have searched online it only suggests other tools like Fastboot which also comes with SDk , ADB...\nCan anyone give me some guidelines where to start?\nand what python packages will be helpful? Kivy framework how helpful it will be..as it is cross platform...PS:I want to learn about Mobile Forensics","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":71,"Q_Id":73114025,"Users Score":0,"Answer":"I am now working with emulator from android Studio it is safer and convenient this way as using a emulator by default root access is given. ADB comes with lots of features and it is also easy to connect python scripts with the virtual device. My host machine is Windows OS I don't even need to use VM.","Q_Score":0,"Tags":"android,python-3.x,ubuntu,bootloader","A_Id":73770590,"CreationDate":"2022-07-25T18:51:00.000","Title":"To get root access using on android phone and unlocking the bootloader","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm using pygame inside Blender to get multitouch support.\nUnfortunately pygame catches all keyboard input which makes it impossible to use shortcuts in Blender.\nCan someone help me to unsubscribe from all keyboard events?\nThank you","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":93,"Q_Id":73130054,"Users Score":0,"Answer":"You can block specific events. According to the pygame wiki, this will stop pygame from queuing those events, but I can't test if it stops pygame from requesting keyboard input.\npygame.event.set_blocked([pygame.KEYDOWN, pygame.KEYUP])","Q_Score":0,"Tags":"python,input,pygame,keyboard","A_Id":73140966,"CreationDate":"2022-07-26T21:43:00.000","Title":"How to disable keyboard events in Pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to define a tk.Scale widget and assing the command function LATER ON. I'm think of something similar to scale.set() but for the command option. Is there a way to do this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":42,"Q_Id":73153172,"Users Score":0,"Answer":"Nearly all options of all widgets can be configured at any time via the configure and config methods (one is a synonym for the other).\nscale = tk.Scale(...)\n...\nscale.configure(command=the_command)","Q_Score":0,"Tags":"python,tkinter,widget","A_Id":73154000,"CreationDate":"2022-07-28T12:45:00.000","Title":"Can I set the command function for a tkinter scale later on in the code?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"On a machine with Ubuntu20.04 (description Ubuntu 20.04.4 LTS, Codename: focal) and python3.8.11 I've installed pyautogui, and it works well. But on a machine with Ubuntu22.04 (description Ubuntu 22.04 LTS, Codename: jammy) and python3.10.4 pyautogui does not work, because pyautogui.position() does not show the correct coordinate of the current mouse position. How can I solve this problem? Any suggestion is welcome. Thanks in advance!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":243,"Q_Id":73171220,"Users Score":0,"Answer":"Use ubuntu with XORG,It will work","Q_Score":0,"Tags":"python,ubuntu-20.04,pyautogui","A_Id":74974618,"CreationDate":"2022-07-29T21:37:00.000","Title":"pyautogui does not work with python3.10, but works well with python3.8 on ubuntu20.04","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"On a machine with Ubuntu20.04 (description Ubuntu 20.04.4 LTS, Codename: focal) and python3.8.11 I've installed pyautogui, and it works well. But on a machine with Ubuntu22.04 (description Ubuntu 22.04 LTS, Codename: jammy) and python3.10.4 pyautogui does not work, because pyautogui.position() does not show the correct coordinate of the current mouse position. How can I solve this problem? Any suggestion is welcome. Thanks in advance!","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":243,"Q_Id":73171220,"Users Score":0,"Answer":"I am also searching for a solution to this issue and this is what I have found.\n\nTry restarting your system after installing pyautogui.\nTry using just one monitor.\n\nThanks,\nRahul","Q_Score":0,"Tags":"python,ubuntu-20.04,pyautogui","A_Id":74380160,"CreationDate":"2022-07-29T21:37:00.000","Title":"pyautogui does not work with python3.10, but works well with python3.8 on ubuntu20.04","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"MOST OF US PROBABLY KNOW BUT MOBIZEN IS AN MOBILE SCREEN RECORDING APP\nThe part that i want to know is how,\nmobizen logo stays on screen and,\ntoolbar appears whenever you click\nthe logo stays on screen even while phone is on another app,\nwhere i should research to make something like this.\n\n(I'm using 'kivy' library in PYTHON)\n\n-PurpleLime\nREGARDS","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":28,"Q_Id":73227143,"Users Score":0,"Answer":"i've found, its named \"Floating Application\" guys check documentation of it","Q_Score":0,"Tags":"python,android","A_Id":73327238,"CreationDate":"2022-08-03T19:59:00.000","Title":"How do i make something like mobizen logo pop ups on screen in kivi python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"can we add Data frame in flutter python framework and show them in tables format Or how can we take another python script data into our flutter python framework.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":75,"Q_Id":73239763,"Users Score":0,"Answer":"Running python directly in flutter isn't possible (yet). However there are few things that you could try:\n\nScreenshot the data frame\nHost a Webserver and create a WebView to point to that\n\nIf you need it to be interactive, use the WebView.","Q_Score":0,"Tags":"python,flutter","A_Id":73240130,"CreationDate":"2022-08-04T17:01:00.000","Title":"Add Data frame in flutter python framework Or how to connect python code with flutter","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I got an error on st=Tk()\nAnd the error is tkinter.TclError","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":120,"Q_Id":73343557,"Users Score":1,"Answer":"it should be root.geometry(\"500x500\")(root is the hypothetical window name)\nbut not root.geometry(\"500*500\")","Q_Score":0,"Tags":"python,tkinter","A_Id":73348928,"CreationDate":"2022-08-13T10:40:00.000","Title":"Tkinter error(tkinter.TclError: bad geometry specifier \"500*500)","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have installed Pyqt5 and pyqt5 designer on gitbash and have tried to run the command designer.exe however nothing happens. What is supposed to happen is that designer pops up on to your screen ready for you to use but for me nothing happens. There isn't even a sign of something running. I have installed everything in my virtual environment and ran everything in my virtual environment. In general pyqt5 works as in the fact that I can run pieces of code that I have written without any problem but I cant open designer with the command designer.exe","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":92,"Q_Id":73345902,"Users Score":0,"Answer":"I solved my problem I needed to install qt from the qt website.","Q_Score":0,"Tags":"python,pyqt5,qt-designer","A_Id":73350411,"CreationDate":"2022-08-13T16:19:00.000","Title":"after installing pyqt5designer, designer.exe command not working","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I read that a common mistake in game development regards the volume option. It showed how a derease from 100% to 50% volume is decreasing by half, but then 10% to 0% is a decrease by 100%. In essence, the volume decreases more quickly at lower volumes, and faster at higher volumes. I'm not aware of the math, but the solution was to raise the volume decimal to the power of euler's number. In pygame, you input a value from 0-1 as the volume for pygame.mixer.set_volume(), I am wondering if it would be best to ignore the exponentiation, or to calculate it?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":54,"Q_Id":73404388,"Users Score":0,"Answer":"Pygame volume is very linear so it creates a strange effect when changing volume at various ranges. Raise the volume in the range of 0-1 to the power of your choosing, e seems to work well.","Q_Score":2,"Tags":"python,pygame","A_Id":73408026,"CreationDate":"2022-08-18T13:59:00.000","Title":"Is pygame volume linear or exponential?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I recently made a few games with Pygame but I found out that it is quite slow and laggy also there isn't any bug in my game. I tried everything apart from creating multiple threads in my game but I am wondering if creating them could lead to some glitches or trouble in my game.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":91,"Q_Id":73424868,"Users Score":0,"Answer":"In theory, it could be used very sparsely and if you really know what you are doing. Threading is really not a beginner concept and threading + pygame is most likely a bad idea, will cause more problems than it solves.\nSo short answer is \"no\", don't use threading. If your games are laggy that probably comes from your programming skills. Perhaps you could create a new post with a more specific example, sharing some code of yours, I'm sure the community would give you tons of advise to improve your coding.\nYou can check out \"DaFluffyPotato\" on youtube. He is one of the best content creator when it comes to making complexe\/advance games with pygame and pygame optimization.","Q_Score":0,"Tags":"python,pygame,python-multithreading","A_Id":73555571,"CreationDate":"2022-08-20T07:31:00.000","Title":"Is using Threading in Pygame good Idea to make the game faster?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm just trying to do some of my 100 days of code homework, but since my OS upgraded last night, whenever I try to run a turtle screen (the same code that worked yesterday), the window freezes and I have to shut it down.\nEverything ( to my knowledge ) is upgraded and updated in the virtual environment and my computer. ( I use homebrew ). Same freezing screen when code is ran in Idle,pycharm, visual studio code, etc.\nGoogling around it seems to me an OS issue, has anyone found a workaround? I've tried everything I can find to fix it, but nothing is working. I can't even get an error code because the window freezes and I have to force it to close.\nShould I just go back to the last update when everything was working fine?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":102,"Q_Id":73451093,"Users Score":0,"Answer":"I use a Mac with Monterey, working on the 100 days challenge and have the same problem.\nI did not try to use Turtle with other OS.\nI solved half of the problem, by going into Python-Preferences-iPhython Console-Graphics and changing graphics backend to Tkinter.\nNow the page does not freeze anymore at the beginning, it opens the screen, executes the code and then when I close the screen I find another frozen screen behind which I can exit only by Force Quit.","Q_Score":0,"Tags":"python,turtle-graphics,python-turtle,macos-monterey","A_Id":73485137,"CreationDate":"2022-08-22T21:18:00.000","Title":"Python turtle screen freezing after updating to Monterey 12.5.1","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a beginner in python , I want to download a module named pygame , I was told to type pip install pygame in the command prompt , I did it , now when I went back to vscode , and run \"import pygame\" , It says No module named 'pygame'","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":101,"Q_Id":73468496,"Users Score":0,"Answer":"Things you should check :\n\nIn terminal (cmd), type pip list and check if pygame appears in the list\n\nIn terminal (cmd), if you type python, which version of python shows up ?\n\nCheck your system path to see where your default python is store on your computer\n\nOn vscode check if you are using the right python interpreter. Go to vscode do ctrl + shift + p. A search window will appear, type python interpreter. You should see an option name Python: Select Interpreter, click on it and if you see multiple python interpreter here you can just try them and see if it solve the problem.\n\nYou can try to replace pip with pip3 in all your pip commands and see if it works but sooner or later you will need to take a deeper look on how everything is set up on your computer, this will prevent you some headache along your developer journey\n\nIf you are lost and nothing works, I would simply suggest uninstalling python all together, make sure you've uninstall every instance of python on your computer and reinstall it from scratch. Make sure you check \"Add to PATH\" while installing\n\nYou can also look at virtual environement but if you are just starting out with coding and everything related to that, it might be a little too advance especially on windows (if you happen to be on linux this might be a solution it's really easy to set up on linux)","Q_Score":0,"Tags":"python,module","A_Id":73468865,"CreationDate":"2022-08-24T06:39:00.000","Title":"unable to download pygame module in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm new to QT and Windows environment programming and tried to integrate some stuffs I developed in Python with another guy in QT. My python code deals with .ods and .xls files by using linux packages gnumeric and libreoffice. I found that WSL may be a convenient way to run my original Python code and it went well after I installed WSL2 Ubuntu.\nThen I installed QT5.15.2 with MinGW and try to run my Python code after click a button. I tested in QT Creator and found this line works: QProcess::execute(\"cmd \/c mkdir C:\\\\Test\"); that creates a folder in C. However, this line won't work: QProcess::execute(\"cmd \/c wsl -h >> res.txt\"); It can't recognize what wsl is. But I also test the QT MinGW terminal and it recognized wsl. Why it can't recognize in exe? Do I need to select different compiler or debugger? Or any other suggestion such as Docker for this kind of integration? Thank you~","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":239,"Q_Id":73491051,"Users Score":1,"Answer":"This works with C\nsystem(QString(\"wsl.exe\").toStdString().c_str());","Q_Score":0,"Tags":"python,qt,windows-subsystem-for-linux","A_Id":73542582,"CreationDate":"2022-08-25T16:41:00.000","Title":"How to use Windows QT to call WSL cmd?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I have a star power-up in my game, and when it collides with the player I want an 'invincibility timer' that starts up. This timer would basically turn off all collisions for 5 seconds, and after the 5 seconds are over, they would turn on again. Is there a better way to accomplish this, and if not, how can I write this in pygame?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":43,"Q_Id":73502860,"Users Score":0,"Answer":"Use a boolean => invisibility = false\nSet the boolean to true once the player collides with the star power-up.\nThen in your if-else statements or loops, state that if invisibility == true, no collisions will take place.","Q_Score":3,"Tags":"python,pygame","A_Id":73502923,"CreationDate":"2022-08-26T14:49:00.000","Title":"How can I make a invincibility timer in pygame?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a folder of 75 black and white images that all contain a number either 1-75. What I'm looking to do is when one of those numbers shows up on my screen, I want to print what number it is within a fraction of a second. I thought that each number may have a different amount of black pixels in the image so I tried linking the number to the specific amout of pixels it has, however for some reason the amount of black pixels changes slightly every time the number shows up on the screen again. If this worked it would be perfect but I just don't know why its changing each time. Do you know of any other way I could identify the number on the screen in less than half a second? Thank you!","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":172,"Q_Id":73515699,"Users Score":0,"Answer":"Thankfully I think I figured it out. When I origionally tried using OCR it wouldn't find the text within the image. I tried making the white space around the image larger so the text isn't too close to the edges (too zoomed in). When I made the background of the text larger by taking a larger screenshot of the screen, it was able to find the number in the text in the image in about 0.3 seconds every time. I think this could be perfect for my project. Always good to bounce ideas off of people to push me in the right direction. Thanks Tim Roberts for suggesting OCR again!","Q_Score":0,"Tags":"python,image,numbers,ocr","A_Id":73520496,"CreationDate":"2022-08-28T03:00:00.000","Title":"Python Find Number On Screen Instantly","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I was wondering if there was a way to make a pushbutton invisible while still being functional?","AnswerCount":2,"Available Count":1,"Score":-0.0996679946,"is_accepted":false,"ViewCount":92,"Q_Id":73602856,"Users Score":-1,"Answer":"simply use self.pushButton.hide(). If you need to hide it. When needed you can show it again.","Q_Score":1,"Tags":"python,pyqt5","A_Id":73607555,"CreationDate":"2022-09-04T21:13:00.000","Title":"Make a pushbutton invisible in PyQt5","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've been successfully using Thonny with Pygame and Pygame Zero for a while. Work upgraded the PCs to 4.0.0 (Python 3.10.4) and now I get the following error:\nimport pgzrun\nModuleNotFoundError: No module named 'pgzrun'\nI upgraded Thonny on my own Mac and had exactly the same issue.\nThonny's plug-ins manager shows both Pygame and Pygame Zero to be installed.\nOn my Mac, I used pip3 to install both plug-ins and the same code successfully executed from IDLE and the Terminal.\nBack in Thonny, I have tried changing the Python Executable to each of the available options but this does not help. I have also tried using Thonny's Pygame Zero mode, but this also reports that the module is missing.\nAny help and advice to overcome the problem, but on Mac and Windows, would be very much appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":227,"Q_Id":73613401,"Users Score":0,"Answer":"try using the previous version of python that was installed: Run => Select interpreter => Alternative Python 3 ...\nDifferent versions of python installed would also mean different sets of installed libraries.","Q_Score":0,"Tags":"python,python-3.10,thonny,pgzero","A_Id":73613501,"CreationDate":"2022-09-05T18:24:00.000","Title":"Thonny: No module named 'pgzrun'","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I've created a widget and I've applied several form layouts to tabs within the widget. I would like to make some tabs available based on some boolean flags.\nI've tried tab_my_tab.setEnabled(False) which disables the content of the tab, but it doesn't hide the tab. I'd like it if the tab is completely hidden.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":34,"Q_Id":73625426,"Users Score":0,"Answer":"I've found the solution to my question. I was able to hide one or more tabs by using the setTabVisible(index, bool) method on the QTabWidget().\nTo hide multiple tabs you have to start hiding the highest index number tab first before hiding the lower index number tabs.","Q_Score":1,"Tags":"python,python-3.x,pyqt,pyqt5","A_Id":73625755,"CreationDate":"2022-09-06T16:52:00.000","Title":"In pyQT5 how do you conditionally hide a tab in a widget?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making a game, a simple 2d RPG in python, using pygame. I'm now adding zooming in and out using the scrollwheel. I have a file called stuff.py along with my main.py file and a bunch of other files (player.py, enemy1.py, enemySpawner.py, chest.py etc.). In the stuff.py file, I have an int called sizeofEverything, and everything is scaled ( square shape) to sizeofEverything. Main.py is the only file that is executed, so In main.py, I detect if the scrollWheel has been interacted with, and if it has been, I want to change sizeofEverything. The problem is, that would just change the local copy of sizeofEverything that I imported into main.py .I need some way to change it, from the main.py file, so that it also updates in all the other files (enemy1.py, player.py etc. ) How would this be done?","AnswerCount":2,"Available Count":2,"Score":0.0,"is_accepted":false,"ViewCount":28,"Q_Id":73637945,"Users Score":0,"Answer":"Create a config module specifically which defines your global variables e.g. config.py\nImport this module into each of the files which need access to the global.","Q_Score":0,"Tags":"python,global-variables","A_Id":73638014,"CreationDate":"2022-09-07T15:17:00.000","Title":"Globals between files in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making a game, a simple 2d RPG in python, using pygame. I'm now adding zooming in and out using the scrollwheel. I have a file called stuff.py along with my main.py file and a bunch of other files (player.py, enemy1.py, enemySpawner.py, chest.py etc.). In the stuff.py file, I have an int called sizeofEverything, and everything is scaled ( square shape) to sizeofEverything. Main.py is the only file that is executed, so In main.py, I detect if the scrollWheel has been interacted with, and if it has been, I want to change sizeofEverything. The problem is, that would just change the local copy of sizeofEverything that I imported into main.py .I need some way to change it, from the main.py file, so that it also updates in all the other files (enemy1.py, player.py etc. ) How would this be done?","AnswerCount":2,"Available Count":2,"Score":1.2,"is_accepted":true,"ViewCount":28,"Q_Id":73637945,"Users Score":0,"Answer":"I'd recommend rethinking how the variables are defined and how you change them. For example, instead of trying to change a variable in another file, perhaps you can pass a variable to a function in another file, and store all the variables in the main script. Global variables tend to be frowned upon, but only because they make things pretty messy overall.","Q_Score":0,"Tags":"python,global-variables","A_Id":73638069,"CreationDate":"2022-09-07T15:17:00.000","Title":"Globals between files in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am trying to append an image to a frame I have. However, I have many frames within each other so I don't know what the dimensions of this frame are.\nIs there any function or anything that will output the dimensions of the frame like \"100x500\", for example?\nThanks","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":36,"Q_Id":73645147,"Users Score":0,"Answer":"Every widget has the methods winfo_width and winfo_height which return the current dimensions of the widget. You can also use winfo_reqwidth and winfo_reqheight to get the requested width and height. The two can be different if the size of the widget changes due to how it is managed (eg: when using sticky with grid, or fill with pack.\nIf the window has not yet actually been rendered, the width and height returned by winfo_width and winfo_height will be 1.","Q_Score":0,"Tags":"python,user-interface,tkinter","A_Id":73650765,"CreationDate":"2022-09-08T07:22:00.000","Title":"Is there a way to find dimensions of a frame in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I\u2019m working in program that need to save my settings data in drives, so I put my data\u2019s file in C drive next to the my program files. But My program can\u2019t change them , windows needs permission to let program change files, what can I do that my program can change the data file !?\nThanks everyone","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":51,"Q_Id":73647819,"Users Score":0,"Answer":"Just launch your program with administrators rights. It should probably solve the write\/change permissions.","Q_Score":0,"Tags":"python,windows,tkinter","A_Id":73649508,"CreationDate":"2022-09-08T10:45:00.000","Title":"How change files in :C drive on windows with python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I would like to know if 3ds max supports Unity's animation file .anim? I am trying to create like a program that makes it easier to animate and then you can get that animation file and import it to 3ds max. I have an idea to make a unity WRITE the python script of an animation but there should be an easier way of doing that.\nIs there any way of importing animation from unity3d to 3ds max? Maybe we could convert .anim to some other extensions that 3ds max supports.\nLooking forward to hear your ideas. Thank you.","AnswerCount":2,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":180,"Q_Id":73650928,"Users Score":2,"Answer":"yes, you can export unity animations to 3ds max. You can even do multiple at once using a so-called FBX file.","Q_Score":1,"Tags":"python,c#,unity3d,animation,3dsmax","A_Id":73651363,"CreationDate":"2022-09-08T14:40:00.000","Title":"Unity animation (.anim) to 3ds max","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have an interface in PyQt5 that crashes when moving a handle too fast (if done slowly, everything is fine), with no error message. My debug capacities reach their limits as the various functions tested separately work, manually and automatically. It may be caused by a memory leak.\nIs there a way to debug such an issue?\nThanks in advance!\nsettings :\n\nWindows 10\npython 3.8.6\nPyQt 5.12.3","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":29,"Q_Id":73700046,"Users Score":0,"Answer":"You can probably use any decent IDE (ex: pycharm) to check where you connect your event \"handle moved\" and see why it crashes.","Q_Score":0,"Tags":"python,windows,pyqt,pyqt5","A_Id":73701209,"CreationDate":"2022-09-13T08:48:00.000","Title":"Tools to debug a pyqt5 interface that crashes after specific event","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to create a background for my game with autocad, but I don't know to set the dwg project as background in my python (using ursina) app. Thanks","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":53,"Q_Id":73815406,"Users Score":1,"Answer":".dwg files are not supported by ursina. You'll have to first export it to a supported one like .obj, .glb or .gltf and then import that.","Q_Score":0,"Tags":"python,3d,autocad,ursina","A_Id":73817514,"CreationDate":"2022-09-22T13:20:00.000","Title":"how can I import dwg file in ursina python?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am learnining pygame and I got error \"module 'pygame' has no attribute 'get_ticks'\". What do i have to do?\nMy code was: start_ticks = p.get_ticks()","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":119,"Q_Id":73918095,"Users Score":0,"Answer":"There is no such thing as pygame.get_ticks but as Rabbid76 said pygame.time had get_ticks() so your code should be pygame.time.get_ticks() that should work.","Q_Score":0,"Tags":"python,pygame,attributes,python-module,pygame-clock","A_Id":73926430,"CreationDate":"2022-10-01T11:54:00.000","Title":"Pygame error: \"module 'pygame' has no attribute 'get_ticks'\"","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing a Kivy app that requires to fetch some data from an API. I want to show a MDSpinner spinning while the data is being fetched. The problem is, when the data begins to be fetched, the spinner stops spinning. It's kind of like the app is frozen. What is the correct way to use a MDSpinner? I will appreciate some basic example.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":80,"Q_Id":73923655,"Users Score":0,"Answer":"As @JohnAnderson mentioned in the comments, the solution for kivy is to use threading. Just create the table, fetch the data in another thread and set the row_data attribute to the fetched data.","Q_Score":0,"Tags":"python,kivy","A_Id":73955546,"CreationDate":"2022-10-02T05:51:00.000","Title":"How to keep the MDSpinner spinning while fetching data in Kivy?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a GUI application written in python, that uses GTK and runs on Ubuntu, and it has been working well for many months.\nThe GTK application uses gtk.Builder() and a Glade input file (a user interface designer for GTK+ and GNOME).\nWhen launching the application from the console, the following error is printed:\n(evms.py:14241): Pango-CRITICAL **: 08:17:31.288: pango_attr_gravity_new: assertion 'gravity != PANGO_GRAVITY_AUTO' failed\n(evms.py:14241): Pango-CRITICAL **: 08:17:31.288: pango_attr_gravity_new: assertion 'gravity != PANGO_GRAVITY_AUTO' failed\nThen the app proceeds to run (and print output to the console) however the GUI window itself isn't ever displayed.\nI posted about this in a separate question yesterday but it hasn't received a response, so I'm trying a different description of the issue.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":63,"Q_Id":73950350,"Users Score":0,"Answer":"This issue has been resolved.\nThe PANGO critical error still occurs and I'm not sure what that issue is about. However, that error wasn't responsible for GTK not launching the GUI window. The GUI launching issue was due to a thread that wasn't functioning properly, due to a naming mistake.","Q_Score":0,"Tags":"python,gtk,glade,pango","A_Id":73952207,"CreationDate":"2022-10-04T15:39:00.000","Title":"GTK app written in python with glade fails to launch its GUI","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a moveslist.py file with function movesSelection and a main.py file. Within my main.py, I've made sure that my variables are set to global and I had another function makeNewChar. Within makeNewChar, I'm trying to call movesSelection but I get \"NameError: name 'movesSelection' is not defined.\nSince my moveslist.py uses some global variables from main, I imported main into the file.\nFor my main.py, I did from moveslist import *. I also tried import movesList and from moveslist import movesSelection. All of those threw back errors.\nHow can I use movesSelection within my main.py?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":104,"Q_Id":73980137,"Users Score":0,"Answer":"Add \"from moveslist import movesSelection\" into makeNewChar.\nYou do not have to add the .py suffix when you import.","Q_Score":0,"Tags":"python,function,python-import,importerror","A_Id":73980272,"CreationDate":"2022-10-06T21:20:00.000","Title":"Python function from imported file shows as undefined","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm developing an app which fetches some numeric data from an api and manifests it in a MDDataTable(I'm using Kivymd). I need to give each row different color based on its numeric values. Is it doable in Kivymd and this specific class(MDDataTable)?If yes, how?\nI appreciate your answers. thanks.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":77,"Q_Id":73990144,"Users Score":0,"Answer":"I just found a way to do that. But it may causes serious problems to your app. Each MDDataTable object has a data_table attribute. This attribute has a sub-attribute named data, which contains all cells of data in your table. Each cell is saved as a dictionary containing multiple items as its properties, which among them, \"background_color_cell\" is the one I was looking for. So all I had to do was to iterate over the data dictionary and change the background color.","Q_Score":1,"Tags":"python,kivy,kivymd","A_Id":73993374,"CreationDate":"2022-10-07T16:33:00.000","Title":"How to give each row of a MDDataTable a specific color working with kivymd?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a QTableView in a PyQt application with custom horizontal & vertical headers.\nI'd like to find a way to filter the vertical header labels: the showed rows of the table would only be the one with a vertical header label matching the typed pattern.\nIt seems QSortFilterProxyModel only applies to QTableView content.\nWhat would be the optimal way to perform this operation?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":41,"Q_Id":74011861,"Users Score":0,"Answer":"I close this topic since I worked it around, hiding vertical labels, setting first column as not editable with my former labels and then applying QSortFilterProxyModel to my QTableView.","Q_Score":0,"Tags":"python,pyqt,qtableview","A_Id":74025649,"CreationDate":"2022-10-10T08:08:00.000","Title":"QTableView: filtering vertical header labels","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"after several hours of reasearing I havent found a helpful answer to this question on the Internet. I have just seen several solutions about how to convert a single python-file into a .exe-file using pyinstaller.\nAbout my programm: Its i a window application in python, therefore i have used the tkinter-library. The whole program is about restoring and documenting my income an spendings over a year, so that I have an overview over my finances. For that I have separated the program in two big folders[enter image description here][1]. One is called data for handeling all the numbers and other significant information and one is called gui for storing the files about the window and its different frames. In data i have different classes, e.g. a class that represents a year, one that represents a month, etc. As already mentiond, in gui you can find the main window and the different frames where the data is shown and can be manipulated. On top of that i have placed the file where i am storing the data in gui. The whole program is started from the main.py which is in none of the named folders.\nI have already tried just converting the main.py which failed instantly. Next I tried the option in auto-py-to-exe where you can add additional files. There i have added the gui and the data folders but it wasnt successful either.\nOn top information: I have programed in PyCharm, so thats why there are extra folders like .idea etc.\nI hope I have explained my problem good enough and out there is somebody that can help me.If you still have question feel free to ask.\nThanks in advance\nwotex","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":24,"Q_Id":74026588,"Users Score":0,"Answer":"ok, i have found a solution by myself. First you have to add the folders gui and data in the auto py to exe program, then you have to add all the different files that are in these folders(e.g. all the files with the classes or the text file).\nBut take care to import all libraries you use in your program in in main.py(the file you want to convert). Otherwise auto-py-to-exe wont convert these libraries and the program doesnt work. Maybe there is also another solution, but this is the only one that works with me.\nGreetings\nwotex","Q_Score":0,"Tags":"python,tkinter,exe","A_Id":74028004,"CreationDate":"2022-10-11T10:25:00.000","Title":"How can I create a .exe-File of a python programm consisting out of several classes located in different files?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I ran into a problem using pyautogui with one program. I've used it successfully in the past and this had me stumped for a while. The mouse would not click on a button, or anywhere over the running programs window. I searched but could not find a solution. PyDirectInput would not work either.\nI considered using Autohotkey as a workaround but it had the same problem.\nThe Fix:\nI found the solution when searching why Autohotkey would not work. It turned out that the program I was trying to control was running in elevated mode and I needed to run my Python program as Administrator in order to interact with it.","AnswerCount":1,"Available Count":1,"Score":0.3799489623,"is_accepted":false,"ViewCount":85,"Q_Id":74044310,"Users Score":2,"Answer":"The answer was to run my program as Administrator when trying to interact with a program running in elevated mode (also running as Administrator).","Q_Score":0,"Tags":"python,autohotkey,pyautogui","A_Id":74044331,"CreationDate":"2022-10-12T15:19:00.000","Title":"Having a problem with pyautogui and some programs","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Python registration and login code using Tkinter.\nBut, how and where can I save this recorded data so that a person who created the account on one computer can log on to another?\nOn google, I only find people saving the data in a local database (.db file on the computer) or in a .txt\nThanks in advance!","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":64,"Q_Id":74084466,"Users Score":0,"Answer":"You can use a sqlite3 database, but that would not solve your problem.\nThe database or any other form of data source must be stored on a server that you can access. This can be on the internet or on the local network. (You didn't specify your environment)\nyou could access this data source by https (don't use http as it is clear text and not a good idea for password requests), connect to an online database or write some kind of socket server that you can connect to and get the needed information.","Q_Score":0,"Tags":"python,tkinter","A_Id":74084507,"CreationDate":"2022-10-16T03:45:00.000","Title":"Where to save Python Tkinter login data","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am developing a code using pyautogui where i detect an event in the window \"A\" and them, with alt+tab, execute an action in the window \"B\". I would like to know if it is possible to do this, but with the window \"A\" minimized, so it doesnt have to alt+tab all the time (the solution doesnt necessary has to be with pyautogui).","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":108,"Q_Id":74114378,"Users Score":0,"Answer":"If you intended to use the locate function with pyautogui, whether or not it's LocateAll or just locate, it has to see that same matching image on screen first then you can adjust the confident to your needs. What you're asking is really hard to answer without knowing what you wanted to do, for example if you wanna do that on browser then you can replace it by selenium for example, for normal window can just make a script to let it switch tab for you then let pyautogui detect and do it job","Q_Score":0,"Tags":"python,windows,automation,screenshot,pyautogui","A_Id":74121700,"CreationDate":"2022-10-18T16:27:00.000","Title":"Pyautogui locate functions in a minimized window","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a coded an AI Python program and now I want to implement it in a mobile application. How can I add the python program in the mobile application, and which programming language should I use for the application to implement the python program?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":23,"Q_Id":74137889,"Users Score":1,"Answer":"since python has no built-in mobile app development capability. But you can use other packages to create some sort of mobile application for this you can use packages like Kivy, PyQt, or even Beeware's Toga library.","Q_Score":1,"Tags":"python,mobile,artificial-intelligence","A_Id":74867763,"CreationDate":"2022-10-20T09:53:00.000","Title":"how can we add a python program to a mobile application?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"For the past few days, i've been trying to set up a FastAPI & Uvicorn server on my Windows machine (although the main idea is to set it up on an old Android device that i dont use anymore.)\nThe server (in both my android and my pc) can be reached by any machine in my local network. The problem comes when I try to access it through my public IP. So far I have done everything i can think of to try solv it:\n\nPort forwarding TCP port 8000 (and others) to my PC's and Android's IP.\nAllow incoming and outgoing connections in Windows's Firewall (not sure how to do this in Android though)\n\nSome things to have in mind:\n\nI don't want to host the server in the cloud as it needs to interact with local devices. For example, to send WOL packages to my laptop.\nI have tried to use reverse proxy services like Ngrok, but the link changes every X amount of time, so it's not reliable enough.\nMy android device,which is a Sony E2053, currently runs rooted 4.4.4 kitkat, without the possibility to install a custom ROM (locked bootloader).\n\nI barely have knowledge about networking so I'm really messed up with this. Any help is aprecciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":161,"Q_Id":74148281,"Users Score":0,"Answer":"This question is way to broad for StackOverflow, and is highly dependent on the specifics of your situation. However, to get you going here is a highlevel overview of how it would normally work.\nSituation: you have a house, in which there is a internet connection to which your computer is connected. There are two networks at play: your internal network (LAN) and your internet (WAN). Your modem\/router connects these two networks together. Your computer has a internal IP (10.x.x.x or 192.x.x.x typically), so has your modem\/router. Your modem\/router also has a public IP address. You can find that public IP when going to websites as whatismyip.com.\nIn order for your local computer to be reachable via the internet, you need to forward the traffic meant for you computer to your computer on your modemrouter. Typically this is done by portforwarding on the modemrouter. On your modemrouter there would be a setting that let you forward all incoming traffic on port 8000 to :8000.\nThen, when you ar eon the internet and browse to :8000, the request is forwarded to your computer and returned to you over the internet.\nHowever, since you are very novice at this stuff, I would HIGHLY advise against such setup. The internet is a scary place and opening yourself up to attack is never a good idea.","Q_Score":0,"Tags":"python,android,windows,fastapi,uvicorn","A_Id":74150816,"CreationDate":"2022-10-21T02:52:00.000","Title":"FastAPI Server is not accessible from the internet","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":1,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am doing notification window and I want to do when massage pop up is shows for some time and then it clears it self.\nI know how to do that it waits with time.sleep() but I dont know how to clear screen.blip().","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":6,"Q_Id":74163750,"Users Score":0,"Answer":"I think the best thing for you to do is to draw the whole window again, removing the pop up. So when the condition to send the message is met, redraw the window with the message, and then after a few seconds, redraw it again without that pop up. The window is redrawn all the time when your screen refreshes anyway, so you're not doing anything drastic.","Q_Score":0,"Tags":"python,python-3.x,notifications,screen,blit","A_Id":74163799,"CreationDate":"2022-10-22T12:56:00.000","Title":"How to clear screan.blit()","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Whenever i try to install pygame, it says it has error: subprocess-exited-with-error\npython setup.py egg_info did not run successfully. exit code 1","AnswerCount":1,"Available Count":1,"Score":1.0,"is_accepted":false,"ViewCount":13605,"Q_Id":74238684,"Users Score":10,"Answer":"pip install pygame --pre This should fix it for now. You can upgrade to the normal version once it launches","Q_Score":1,"Tags":"python,pygame,python-3.11","A_Id":74238805,"CreationDate":"2022-10-28T17:05:00.000","Title":"How do i install pygame on python 3.11.0 it's showing the following error","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Kuka Iiwa 7 arm in the scene and I am interested in getting the current(real-time) 3D coordinates of the arm joints w.r.t world (or w.r.t robot base). I am able to get the current joint 1 DOF positions(thetas) but not the exact 3D coordinate representing the position of the joint in some frame(world or base).\nI tried adding Triad for each link and tried get_pose_in_world() method for RigidBody_[float] type object of the frame, but received an error that the method does not exist for RigidBody_[float] class.\nNote: I am using PyDrake for the project.\nWhat is the correct way to approach this problem?\nThanks,\nSarvesh","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":56,"Q_Id":74279453,"Users Score":1,"Answer":"When the parser creates a joint, it'll also crate a \"parent\" frame and a \"child\" frame. These two frames are then constrained by the joint such that in the \"zero configuration\" (say zero angle) the parent and child frames are coincident.\nIf you do happen to have the frame object, then you can call Frame::CalcPoseInWorld(). Now, to retrieve the frame, you need to know its name. For that you will call GetFrameByName().\nSay you want the pose of the parent frame. Here is the convention used to name frames:\n\nIf the pose of the parent frame in the body frame is the identity (either a default or explicitly provided) then the parent frame IS the body frame and you can retrieve it with the body's name.\nIf the pose is not the identity, then a new frame is created (offset by that pose) and its name is \"parent_[body_name]\", where body_name is the name of the parent body.","Q_Score":1,"Tags":"python,transformation,robot,drake","A_Id":74281479,"CreationDate":"2022-11-01T17:12:00.000","Title":"Getting joint location(3D pose) w.r.t world of Kuka Iiwa arm in Drake","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"From what I understand, the pb2.py file is code from the protoc file and the pb2_grpc.py file is code generated by protoc from the .proto file. But I don't understand what that means. I am very confused, can someone please explain this to me.\nThank you\nI have tried to google the question, but I couldn't find anything that I could understand","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":128,"Q_Id":74351626,"Users Score":0,"Answer":"Both are generated by protoc or python -m grpc_tools.protoc (a Python module that wraps protoc).\nA pb2.py file contains the core Protocol Buffer (message) definitions and is created as a result of the --python_out flag being specified.\nA pb2_grpc.py file contains the service and rpc (method) definitions and is created as a result of the --grpc_python_out flag being specified.","Q_Score":0,"Tags":"protocol-buffers,grpc-python","A_Id":74355276,"CreationDate":"2022-11-07T19:02:00.000","Title":"WHat is the difference between the filename_pb2_grpc.py and the filename_pb2.py files?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm in the process of learning Cython and I wasn't able to find a direct answer to this. Also please bear with me as my understanding of C is limited as of now. As far as I understand, with the cythonize command, .pyx files are converted to C, and are compiled to platform-specific libraries (.so \/ .pxd). My questions are:\n\nIf .pyx files are fully converted to C, does it mean that these generated extensions are no longer dependent on python runtime after compilation?\n\nAssuming the same host architecture, can these generated extensions be loaded into other languages, eg. via Java's JNI? If so, are there any hello world examples on this?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":29,"Q_Id":74528482,"Users Score":1,"Answer":"Cython extensions are fully C, but they heavily use the Python C API. This means they can't be run independent of libpython (and usually the Python standard library). However it is possible to load libpython into other languages and then use a Cython extension. Also bear in mind that anything you import within Cython is not compiled but needs to be available for import.\n\nI don't plan to answer this fully, but both ImageJ (in Java) and Julia do support Python interoperability layers and do Cython extensions would work there. You're much better off searching for \"Python-Java interoperability layer\" than trying to create your own way of using Cython specifically.","Q_Score":0,"Tags":"python,java-native-interface,cython","A_Id":74528972,"CreationDate":"2022-11-22T06:48:00.000","Title":"Can Cython compiled .so extensions be imported into other languages, eg. Java?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I'm trying to develop a code that open an image where you can select a point quit the mouse and drag to form a rectangle until you don't release the left button.\nThen from python I should receive the starting coordinates and the height and width in pixel of the rectangle, how can I do it?\nI saw that the packages argparse and cv2 can be used, but I don't really know how to approach it.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":19,"Q_Id":74549601,"Users Score":0,"Answer":"I won't do the job for you but I'm willing to help.\nYou will need 2 blocks of code:\n\nan image displayer\na mouse-event listener\n\nTo start, you may forget about the image displayer. You may concentrate on the mouse listener while you draw your rectangle anywhere on the screen.\nSelect a mouse listener library. There are many on pypi.org.\nI propose pynput because it is easy to work with and is well documented.\n\nread documentation (focus on \"on_click\")\nwrite your code to implement your mouse listener. It's simple (less than 10 lines). At the end of your program, add a statement:\ninput(\">\")\nrun your program. Click anywhere on the screen and drag to another point. Release.\nyour on_click() function will be called twice (once for button press and once for button release). Record the two sets of X-Y coordinates (unit is pixels).\nonce the button is released, compute the size of the rectangle (in pixels).\npress any key on the keyboard to end the program.\n\nOnce your program is working you may work on the imager. If the image is large, you may have to use a scaling factor to reduce it. You will have to introduce the scaling factor in your sizing equations.\nWhen a program skeleton will exist, do not hesitate to ask questions.\nAsking for help when there is no visible sweat will not bring you many answers.","Q_Score":0,"Tags":"python","A_Id":74551986,"CreationDate":"2022-11-23T15:51:00.000","Title":"Draw a Rectangle over an image and get the coordinates in python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have 2 windows, first is the main window (window1) and another window with opencv (window2). I have a button on window1 that opens window2. Whenever I open window2 on window1 the camera won't show on the GUI. But if I open window2 individually which is on a different file, the camera is showing.\nI tried to put it on a single python file, and it still doesn't work, the camera is still not showing.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":44,"Q_Id":74573165,"Users Score":0,"Answer":"I found the answer.\nI fixed it by removing the main loop on window2 since camera window2 also runs in tkinter.","Q_Score":0,"Tags":"python,tkinter,camera,window","A_Id":74587578,"CreationDate":"2022-11-25T12:56:00.000","Title":"python - Opening another tkinter window with opencv camera don't show live feed","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Does anyone know why kivy sometimes does not show new widgets on the screen. I have the identical code for several screens in an app writtin in .kv-language. It works fine in all screen but one screen wont show my the widgets and images.\nI had the same problem a view times now, sometimes it works after a while but it is starting to get annoying since I can not continue coding before my widgets decide to show up.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":16,"Q_Id":74728106,"Users Score":0,"Answer":"it often helps to just change the name of the screen and all its mentions. I still do not get what is going on, so if somebody has an answer please tell me.","Q_Score":0,"Tags":"python,kivy,widget","A_Id":74728167,"CreationDate":"2022-12-08T09:29:00.000","Title":"Kivy sometimes does not show widgets and images","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I want to make my window resizable without changing its aspect ratio. I tried using the pygame.SCALED flag, but the quality becomes horrible. Is there any way to make it resize smoothly like transform.smoothresize? If there isn't, is there any better way to resize my window without losing to much quality?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":34,"Q_Id":74732836,"Users Score":0,"Answer":"Upload the image.\nadobe online tool for resizing images without losing quality\n\nWith most image resizing tools, you can drag and drop an image or upload it from your computer. Some tools even allow you to copy and paste an image.\n\nChoose a resizing option.\nchoosing image dimensions to resize images without losing quality\n\nSome resizing tools allow you to choose from a list of preset resizing dimensions based on various social media platforms and common screen sizes. If you'd like, choose one of these presets from the menu.\nIf you'd rather set custom dimensions yourself, choose the Custom option and move on to the next step.\n\nType in the width and height dimensions.\nchoosing image dimensions to resize an image without losing quality\n\nLet\u2019s say the image you want to resize is 6000 x 4000 pixels, and you want to resize it to 600 x 400 px to make it the featured image of your blog post. You simply have to type in those dimensions.\n\nDownload the resized image.\nresize-image-without-losing-quality-tutorial-4\n\nOnce the image has been resized, click Download. You can now download the image with its new dimensions and upload it to your website.\nAfter completing the above steps, you may find that your image file size is still above 100KB. To get it even lower, we can turn to image compression.","Q_Score":1,"Tags":"python,pygame,window","A_Id":74746271,"CreationDate":"2022-12-08T15:42:00.000","Title":"How can I resize my window without losing to much image quality?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have made a python tkinter program and converted it to exe using auto-py-to-exe, it is not showing GUI properly on a laptop with no python installed.I have used (.place) to set proper alignment of widgets but it is showing distorted on a different laptop with no python installed. What could be the solution for this??? Can anybody help.","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":24,"Q_Id":74855591,"Users Score":1,"Answer":"The best solution is to stop using place. pack and grid make for much more responsive UIs. With place it's up to you to account for different resolutions, different window sizes, and different fonts.","Q_Score":0,"Tags":"python,python-3.x,tkinter,exe,auto-py-to-exe","A_Id":74855621,"CreationDate":"2022-12-19T20:16:00.000","Title":"Tkinter auto-py-to-exe distorted widgets when running in laptop with no python installed. in","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am making blackjack in tkinter and instead of placing buttons over the existing buttons i want to toggle them when, say a new game.","AnswerCount":2,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":56,"Q_Id":74907056,"Users Score":2,"Answer":"There are many ways of doing this. One option (I think he simplest one) is to get your buttons in a frame that you can pack and unpack using pack and packing_forget. In this case you need another frame where your button frame is the only packed widget, so the buttons will appear in the same place when you pack them again. You can also resize the frame so things on it will become invisible when it becomes really small. Another option is to use a canvas where your buttons are canvas objects. You can them move or hide them as you want.","Q_Score":1,"Tags":"python,user-interface,tkinter","A_Id":74907207,"CreationDate":"2022-12-24T10:38:00.000","Title":"Is there a way to toggle\/hide\/show tkinter buttons","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Newbie alert\nI have code that takes a picture with the camera on the ESP32 but then that picture is in the flash memory and I don't know how to retrieve it. How do I get it onto my computer using micropython or circuitpython?","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":93,"Q_Id":74926193,"Users Score":0,"Answer":"If you wrote your code in Circuit Python you can make the esp32-cam connected to a wifi hotspot and transfer... via http or mqtt as you whish.\nBut if you manage to get a picture from the camera WITH circuit python then you need to share how you achieved that!","Q_Score":0,"Tags":"camera,esp32,micropython","A_Id":75083414,"CreationDate":"2022-12-27T06:09:00.000","Title":"Micropython\/Circuitpython - ESP32-Cam - How to download images taken onto computer?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I need a way to play video with sound in tkinter which will not use many RAM.\nI tried many libraries and all of them use many RAM (about 10gb for 5 minute video). The only thing I found is bvPlayer, it dont use much RAM but it creates video in other window, and I need it to be possible to create other objects such as labels here as well.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":47,"Q_Id":75034073,"Users Score":0,"Answer":"How big is your video? If it's 1GB, then the RAM taken by your program will be around 1GB (more like 1.1GB). The size of your video will be roughly the amount of RAM taken. There's no practical way to use less RAM.","Q_Score":0,"Tags":"python,python-3.x,tkinter,tkinter-canvas","A_Id":75034173,"CreationDate":"2023-01-06T17:14:00.000","Title":"Video with sound in tkinter python","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I loaded QtPy5 and QtPy5-tools successfully using pip on VSCode. But I cant for the life of me find it on my system.\nIs it an .exe program?\nwhere should I be looking please and what is it called\nTIA","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":28,"Q_Id":75091456,"Users Score":0,"Answer":"you just hold ctrl key and move your cursor on the QtPy5 and then click it it should take you the the file location of the QtPy5. i think this should work.","Q_Score":0,"Tags":"python,qt-designer","A_Id":75091899,"CreationDate":"2023-01-12T04:03:00.000","Title":"where is the Qt designer app loaded on my system?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I have a Orange python widget that I created. I would like to make it a standard widget in Orange canvas. I have reviewed several tutorials to do this so I understand the code that must be created but after that how do you import that code into the widget library in Canvas?\nNo problems at this point looking for a complete tutorial on widget creation and import into Orange Canvas.\nReviewed several tutorials both text and video but they fall short of successful importing the code into Canvas.\nWhen I followed the widget creation on Orange and ran the install command \"pip install -e .\" from the setup directory the command executed successfully but when I open Orange Canvas the Demo OWDataSampler was not present. Not sure how the setup tool knows how to update the Orange application to recognize where the application is installed.\nAny help would be appreciated.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":29,"Q_Id":75121781,"Users Score":0,"Answer":"I was able to get it to work properly. Need to open the Orange command prompt, navigate to the directory that has the setup.py file, and run the pip install -e . command. The widget is listed properly in canvas.","Q_Score":0,"Tags":"python,orange","A_Id":75140732,"CreationDate":"2023-01-14T22:49:00.000","Title":"Orange Data Mining Widget Creation in Canvas","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am a Python Kivy learner. As part of learning, 2 months back i successfully build a calculator app through google collab. The app was working perfectly. Now when i build the same app, it builds successfully but the orientation doesnt work. It rotates to all direction.\norientation = portrait\ndoesnt seem to work now.\nI tried building other apps too recently through google collab, and the same orientation problem persist. Anyone recently built app through collab successfully without the orientation problem?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":53,"Q_Id":75125280,"Users Score":0,"Answer":"import os\nos.environ[\"KIVY_ORIENTATION\"] = \"Portrait\"\nadding this at the top of the main.py solves the issue.","Q_Score":0,"Tags":"python,kivy,orientation,buildozer,portrait","A_Id":75199999,"CreationDate":"2023-01-15T13:09:00.000","Title":"Buildozer - Orientation Portrait setting not working","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"square = shape.add_textbox(Inches(3), Inches(3), Inches(1), Inches(1))\nI want this textbox to have bullets. I tried adding a textframe instead, but the size of the texframe cannot be adjusted and I want multiple boxes with bullets.\nI tried adding a textframe instead, but the size of the texframe cannot be adjusted and I want multiple boxes with bullets.","AnswerCount":2,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":25,"Q_Id":75187563,"Users Score":0,"Answer":"In the textframe resizing question, you set the size of the shape. Not the textframe that is part of it.","Q_Score":0,"Tags":"python,python-pptx","A_Id":75192047,"CreationDate":"2023-01-20T17:40:00.000","Title":"How do I add a bullet to a textbox? (I tried and it says shapes have to paragraph attribute?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I downloaded pygame on the website. And went to my command prompt to pip install pygame. But it gave me this error message. metadata-generation-failed. How do I uninstall pygame and install a new version? and my version of python installed is 3.11.1\ni tried to uninstall and reinstall my version of python.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":32,"Q_Id":75216111,"Users Score":0,"Answer":"To uninstall Pygame, you can use the command pip uninstall pygame in your command prompt. To install a new version of Pygame, you can use the command pip install pygame==x.x.x where x.x.x is the version number you want to install.","Q_Score":1,"Tags":"python,pygame","A_Id":75216149,"CreationDate":"2023-01-23T23:29:00.000","Title":"I am trying to install pygame","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I learned the hard way that tkinter is not thread-safe when starting independent threads with tkinter functionality from the main tkinter thread. I got error messages in a (for me) non-reproducible way, mostly \"main thread is not in main loop\" in connection to internal del calls after I stopped my application. Sometimes the kernel crashed during or after execution, often everything just ran smoothly.\nThese independent threads should run data acquisitions (DAQ) at a couple of instruments, with different GUIs depending on the type of instrument. Threading seems to be feasible as it is not known from start which instrument will be needed at some time, DAQ tasks should be queued up if an instrument is busy etc.\nSo, my idea now is to start the DAQ threads without any tkinter functionality from the main thread. The specific DAQ thread knows which specific GUI to use and puts this specific GUI class into a queue which is handled in the main GUI\/tkinter thread. The instance of the GUI class will then be created in the GUI\/tkinter thread.\nWill this approach still violate thread-safety or is everything ok, as long as the GUI instances are created in the main tkinter thread?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":26,"Q_Id":75224012,"Users Score":2,"Answer":"As long as you only access tkinter widgets and functions from a single thread, it should work just fine. One exception, as far as I understand, is that it's safe to call the event_genereate method from other threads. You can push data on a queue and then generate an event, then the event can be handled in the main thread where data can be pulled off the queue and processed.","Q_Score":0,"Tags":"python,multithreading,class,tkinter,instance","A_Id":75224146,"CreationDate":"2023-01-24T15:54:00.000","Title":"Does a GUI-class argument violate thread-safety in tkinter?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"Someone setup for us cmake to use pybind to create a .pyd module we package, together with some pure python files, into a wheel.\nWe are switching from an old 3.7 python to a modern one, so we want to support wheels for both the old and new python version, at least for now.\nI've read the pybind documentation and, due to my unfamiliarity with cmake, I found it unclear. So I'm looking for clarification.\nMy understanding is that you would have to compile twice, one time \"targeting\" 3.7 and another time targeting the newer version. But I wouldn't expect this to matter at all (if you were to handcode wrapping to python), or at most I'd expect it to matter if we were targeting two different major version (i.e. python2 vs python3).\nMy question is if this is really needed. Can I just avoid a second compilation and slam the .pyd I get when compiling \"for python 3.7\" into the wheel we build for the newer python too?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":23,"Q_Id":75226530,"Users Score":1,"Answer":"Yes, it is necessary. The CPython ABI changes from version to version, often in incompatible ways, so you have to compile for each version separately.","Q_Score":0,"Tags":"c++,python-3.x,pybind11,python-wheel","A_Id":75230484,"CreationDate":"2023-01-24T19:46:00.000","Title":"pybind c++ for multiple python versions","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":1,"Web Development":0},{"Question":"I am a team member which is developing autonomous fixed-wing. I am using ros to control fixed-wing.\nIn mission script there are callback functions which is giving latitude, longtitude, altitude, compass_angle, velocity, battery_level\nIn local computer I ve got a ground station which shows callback function values on indicator by using Tkinter and PIL\nI am getting values from firebase using firebase_admin but It is not real-time, values reach ground-computer 3-4 seconds late.\nSo I want to connect remote computer , reach mission_script.py and get values on callback functions. Is it possible to do if it is How can I do it?","AnswerCount":1,"Available Count":1,"Score":0.1973753202,"is_accepted":false,"ViewCount":38,"Q_Id":75256781,"Users Score":1,"Answer":"Thanks to Alex's comment I used ZMQ and get real time data flow.","Q_Score":0,"Tags":"python,remote-access","A_Id":75262619,"CreationDate":"2023-01-27T10:25:00.000","Title":"Access values on remote python script from local python script","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":1,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I get this error when I try to run labelimg on windows\nTraceback (most recent call last):\nFile \"C:\\Users\\okeon\\AppData\\Roaming\\Python\\Python39\\site-packages\\labelImg\\labelImg.py\", line 18, in \nfrom PyQt5.QtGui import *\nImportError: DLL load failed while importing QtGui: The specified module could not be found.\nDuring handling of the above exception, another exception occurred:\nTraceback (most recent call last):\nFile \"C:\\Users\\okeon\\anaconda3\\lib\\runpy.py\", line 197, in _run_module_as_main\nreturn _run_code(code, main_globals, None,\nFile \"C:\\Users\\okeon\\anaconda3\\lib\\runpy.py\", line 87, in run_code\nexec(code, run_globals)\nFile \"C:\\Users\\okeon\\AppData\\Roaming\\Python\\Python39\\Scripts\\labelImg.exe_main.py\", line 4, in \nFile \"C:\\Users\\okeon\\AppData\\Roaming\\Python\\Python39\\site-packages\\labelImg\\labelImg.py\", line 29, in \nfrom PyQt4.QtGui import *\nModuleNotFoundError: No module named 'PyQt4'\nTried installing modules and imports based on errors, but nothing is working. Anyone with experience on this?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":28,"Q_Id":75304038,"Users Score":0,"Answer":"A walk around I discovered was to install labelimg and pyqt5 as packages in anaconda and launch labelimg from there. It worked for me","Q_Score":0,"Tags":"python-3.x,windows,pyqt5,pyqt4,labelimg","A_Id":75316948,"CreationDate":"2023-01-31T23:02:00.000","Title":"ImportError: DLL load failed while importing QtGui: The specified module could not be found","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I got python code that has no GUI and works in terminal. Can I convert it to apk and run on android?\nI'm just curious if it's possible.","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":28,"Q_Id":75344601,"Users Score":0,"Answer":"No, you cannot directly run a Python script in the terminal as an Android app. Python scripts are typically run on a computer using the Python interpreter, and Android devices use the Android operating system which is different from the typical computer operating systems.\nHowever, you can use a tool such as Kivy, which is a Python library for creating mobile apps, to create an Android app from your Python script. Kivy provides a way to package your Python code into an Android app, so you can run it on an Android device.\nI am sure there are other tools providing this option as well. These tools essentially bundle the Python interpreter and your script into a single executable file, so the user doesn't need to have Python installed on their device to run your app.\nI believe there are tutorials on youtube as well so as to how to use Kivy to run your python code. I hope this helps :)","Q_Score":0,"Tags":"python,android","A_Id":75344967,"CreationDate":"2023-02-04T10:57:00.000","Title":"Is it possible to run code without gui on android?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"Looking for similar functionality that a browser has? (ctrl:shift:+ for example)\nI tried:\nroot.tk.call('tk', 'scaling', new_scale) but it didn't change anything.\nAny suggestions greatly welcomed...","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":55,"Q_Id":75849560,"Users Score":2,"Answer":"In Tkinter is there any way to Zoom in\/out on the whole of the GUI content?\n\nNo, there is no way to do what you want. There is a way to scale items on a canvas, and you can scale fonts (and thus, widgets that depend on the size of a font) but you can't the UI as a whole.","Q_Score":1,"Tags":"python,tkinter","A_Id":75849762,"CreationDate":"2023-03-26T17:56:00.000","Title":"In Tkinter is there any way to Zoom in\/out on the whole of the GUI content?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":0,"System Administration and DevOps":0,"Web Development":0},{"Question":"I started coding on python and moved on to Kotlin\/android. I'm curious: when you want to convert types in python, it is generally as simple as str(x), but in kotlin - depending on type - it is different:\nInteger.toString(x)\nx.toString()\nthere's probably more since I'm new to this, but am I doing this all wrong or is it really actually this inconsistent. I'm trying to re-learn bad habits :-)","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":48,"Q_Id":76134233,"Users Score":4,"Answer":"The standard way is to use toString(). All classes have a toString() function. In general, conversions from one class to another in Kotlin are always done by calling a function on that class instance that starts with the word .to.\nThe reason Integer.toString() exists is that if you're targeting the JVM, then all the Java standard library is available as well. Java has the concept of \"primitives\" which are not classes so they don't have functions, and so it provides Integer.toString() to be able to convert a primitive integer into a String.\nJava has primitive wrapper classes that you pretty much should never touch in Kotlin:\n\njava.lang.Integer\njava.lang.Long\njava.lang.Float\n\netc.","Q_Score":2,"Tags":"python,kotlin,types","A_Id":76134311,"CreationDate":"2023-04-29T02:12:00.000","Title":"Type conversions inconsistent in Kotlin","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"I am writing a calculator interface in Python using Tkinter. I am aware of the floating point precision issues that can arise in computers, but I have never had to deal with them directly.\nIn my calculator for example, I am multiplying two floats together, say 3.2 and 3.0. Instead of resulting in 9.6, however, I get 9.60000000000001 (or something). Normally, I would just round this number. However, under circumstances where I would need that extra precision, I wish to keep it. What is the standard practice for dealing with this issue?","AnswerCount":1,"Available Count":1,"Score":1.2,"is_accepted":true,"ViewCount":63,"Q_Id":76468069,"Users Score":3,"Answer":"However, under circumstances where I would need that extra precision, I wish to keep it.\n\nYour precision needs exceed what is readily available with standard binary floating point.\nUse decimal or use higher precision binary math to reduce the occurrence of the perceived imprecision.\n\nWhat is the standard practice for dealing with this issue?\n\nCommon calculators always use more internal precision (decimal or not) than they show to avoid such floating point artifacts.\nI recommend internal math that is at least 2-3 decimal places (8-10 bits) more than the significant maximum number of digits displayed.","Q_Score":1,"Tags":"python,floating-point,precision","A_Id":76468329,"CreationDate":"2023-06-13T19:17:00.000","Title":"How do calculators handle floating point errors?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0},{"Question":"In OpenAI's Gymnasium environments, there's a render() method that at the end calls pygame.display.flip() to draw on the screen. I'm trying to prevent the render() method from calling the pygame.display.flip() method without changing the definition of the render() method. Is that possible in any way?","AnswerCount":1,"Available Count":1,"Score":0.0,"is_accepted":false,"ViewCount":24,"Q_Id":76585305,"Users Score":0,"Answer":"If this is for testing environment, then you might be able to use unittest.mock.patch to disable the call.\nIf you want to do this is a production code things gets a bit more tricky, but since it's open source, what you can do is just build your own version of the library.\nIt is possible to use unittest.mock for monkey patching outside the context of unit tests, it's not very recommendable, but if you know what you're doing, we're all consenting adults here.","Q_Score":1,"Tags":"python","A_Id":76585334,"CreationDate":"2023-06-30T00:26:00.000","Title":"Can I prevent a method called by another method from being called without changing the definition of the original method?","Data Science and Machine Learning":0,"Database and SQL":0,"GUI and Desktop Applications":1,"Networking and APIs":0,"Other":0,"Python Basics and Environment":1,"System Administration and DevOps":0,"Web Development":0}]