whenever I run my python code it should close running application [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 months ago.
Improve this question
I am working on an project which is using opencv. this closes any opened application when an specific hand gesture is given.
So what I want is to close any application whenever I run my python code.
This code will be running in background so whatever application is running at that time that should be closed when a specific hand gesture is shown

Just use pyautogui library in python and use this following command
first it will close your your ide but if your code is running in background same as mine it will do the work.
pyautogui.hotkey('alt','f4')

Related

How to make a voice assistant in python that always listen for inputs? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am making a voice assistant in python following the tutorial on YouTube by "Code with harry". I have successfully added some more functionalities. The file is of extension .pyw so it runs in the background. The problem I am facing is that sometimes when I run the script it runs as I want it to i.e. always listening for inputs especially after executing a command but most of the time, when I run the script it stops listening after I give it a command. Let's say I asked it to open chrome and it opened it then it would stop listening until I close chrome. How do I fix this?
tutorial link - https://www.youtube.com/watch?v=Lp9Ftuq2sVI&t=1693s
Any help would be really appreciated. Just so you know I am not a pro in coding.
I got it working. The culprit was "webbrower.open()"
The code stopped once this line ran. So I found an alternative. "os.system()"
This worked perfectly.

How to upload a file with selenium on remote node [Python] [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Found here (stackoverflow) a way to handle a file selection on local host. I'm using Autoit and run a local script which writes in the file path.
But how can I run this on the remote node, when I'm using selenium hub.
Is there a way run on a remote node a command line (windows) process ?
Prefer Python example.
Thank you!
Here is a solution, basically you need to run AutoIt server on the node:
https://github.com/daluu/AutoItDriverServer

Can a python file run on a Raspberry Pi? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have developed a webserver in Python (using Bottle). In this moment it runs on my laptop, but in future it will run on a board (like Raspberry).
The webserver shows a html page that allow to the users to put some data and it should save locally in a file.
Is it possible? I have to use php?
Thanks
You can just run your python apps on a Raspberry Pi. There are many tutorials on the web.
Video:
https://www.youtube.com/watch?v=VFs1dhJPYa4
Tutorials:
https://makezine.com/projects/program-raspberry-pi-with-python/
http://www.makeuseof.com/tag/10-raspberry-pi-projects-beginners/
http://www.techradar.com/news/software/learn-to-program-your-raspberry-pi-1148194/2

run a code every 5 minutes when django server is running [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a django project and inside I have an app. Inside this app I created a management folder, inside this one I create a commands folder, and inside the last one I put my script with the init.py file too. My question is: how can I do to autorun that code every X minutes once the server is running to don't worry about execute the script myself.
You can refer, django-chronograph is a simple application that allows you to control the frequency at which a Django management command gets run.
chronograph
Hope this is helps you.

Python (3.4) run SSH commands on local terminal [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm writing a script that I'm running through a terminal, and would like it to run BASH commands in that same terminal. All solutions that I found were geared toward connecting remotely through SSH, whereas I just need to run SSH commands on the same machine.
Can someone please point in a direction how that can be done, since Googling didn't really give me relevant results.
You might be looking for the subprocess module. You can do (for example):
subprocess.call("<bash command here>", shell = True)
For more details check the documentation.

Categories