Python: Different Files for Different Tasks? - python

I'm working on an app that has several buttons (10+) on the home screen that take the user to different pages with different functions, like home screen on Android or iOS where apps are located. The problem is, if all the different functions accessed from the home screen were to be put into one file, it would end up being over 10,000 lines in a single .py, which I've read is not good practice and can slow down the process.
How would one make it so that when the user presses a button for a task on the home screen, it accesses the code from a different .py without opening up a new window?
Thanks for your help!

Related

Can I run a Python script targeting only a certain application (screen)?

As I mentioned in the title, I want a feature such as applications that target a certain screen and only target that screen in applications that take more screen recordings or in applications where we share screens such as google meet.
In short, I opened the word file and I write something here every 10 seconds with a python script, but when I put this word file in the background, I want the relevant python script to run on this word file again and not interfere with my other works. Is this possible ? How can I do that ?

Automatically controlling an app on the PC using openCV Python

I am working on a project to control the PC exclusively by voice control and gestures(via webcam). So, with the voice control I open the app(for example, YouTube). Now, without typing anything on the search bar, I want to do it through voice typing (without even touching the keyboard), like if I say "search water videos" the cursor will automatically search the thing for me, and give me the result.
Basically, I want to find a text box on a screen of an app using image processing.
There shall be some predefined keywords like, search(for searching), delete(for deleting anything that is mistyped) Go Back(to go back to the previous window), Exit(for exiting the app).
Can it be done with the help of openCV Python?
Many thanks in advance!

Access variables from Go in Python and vise versa

My engine is written in GO and I already use SQLITE because I generate some plots that I want to display in a GUI. So far, I think that GO does not have a mature GUI package, so I am building my GUI in Python, with Tkinter that I am familiar with.
When I run my engine in GO with a certain flag, it calls the Python script for the GUI and it generates the content on the background continuously. There are certain modes that the GO engine runs and normally I have to change them by going back to the terminal that runs GO (different plots etc).
What I want, is to create action buttons in my Python GUI that they will change those flags/variables values and the GO script will generate different plots for example, without me going back to the terminal that runs the GO engine and manually do it.
So far, the only implementation from my side, was to create another SQLITE database and save my settings there. Then, when I press an action button at my GUI, it changes the value at my Settings Database and GO reads this value from there all the time, instead of waiting me to input it.
Is there any better way of doing it, passing a variable value(flag etc) from one programming language to the other(Python-GO) without using a database?
The variables that I am changing from the GUI are strings in general and I am asking this question because I think that it is a waste of resources to do it the way I do it.

issues in coding programs without a user "save"

I'm a (relatively) novice programmer working in Python and Tkinter. The GUI app I'm building has many input fields, and all the data ultimately needs to end up in a file.
I'm wondering about the wisdom of trying to build this without a "save" button, so that it would operate like, say, Google Docs, in which the saving seems to happen more-or-less continuously. I'm worried about my (relatively computer-phobic) users assuming things are being saved to the file as they change various menu entries.
Specifically: is that just done via a background process saving every few seconds, with a save forced if the user tries to close between the auto-saves? Does one try to trigger the saves more intelligently than that? What are the issues?

Globally poll which files are being dragged in Windows API?

I'm wondering if it's possible to globally poll which (if any) files are currently being dragged in Windows using the Windows API, independently of any particular window.
For example, I'm doing some stuff with networking where, when the user drags a file to the edge of the screen, it notifies a separate computer that the file has hit the screen edge. I've got my program running in the background, but it's not windowed, and it's hard (impossible) to place my window around all 4 screen edges.
I'm doing this in Python, but if I have to use another language and write a wrapper around it that's fine too.
You want to hook DoDragDrop.

Categories

Resources