Executing a python script REMOTELY, using another python script - python

I have a python script in a remote system.
I need to run the script stored in remote system from my system, and I need a python script to do so.
Both the systems are windows.
I have found many answers when I searched, but none of them was a python script.
Please help me. If possible, a python code showing an example will be extremely helpful.

Related

How to check if a python script has been copied/accessed on windows

I was wondering if there is a python module that essentially allows for checking whether your python script has been accessed/copied (and which user has done it) from a shared resource. More of a curiosity as most google searches have shown results relating to 'checking if a file copy is complete' and not necessarily 'if a file has been accessed/copied' and by who
Thank you!
As #Kris told System log files controlled by OS...There is an way you can get this...Simply follow steps..
1)Create a PowerShell script that will access system log files..Follow below link.
Link: Powershell script refrence
Next
run that powershell script using python
Link: Running powershell script within python script, how to make python print the powershell output while it is running

Is there a way to open Anaconda prompt, and insert a few commands that would run a python script, only by using VBA?

I am working on a project using VBA, and have found that the best way to perform a certain function within it is with a python script (Pulling data from a web service via a user-inputted serial number, and then populating info associated with that serial in an excel sheet)(Probably the WHOLE thing should've been done in python, but I am not familiar with it, and am with VBA somewhat, so this is the path that was chosen). I have had some success with this by using pyinstaller to make the .py into a .exe, however this caused other issues, such as the script not functioning properly, and taking a while to run.
It is simple enough to run the actual python script via the anaconda3 prompt window. However, this will be used by others, so I would like it to be automatic such that, they only need to click on a VBA macro button, which then automatically runs the python script.
Any thoughts on how this can be achieved?
Thank you!

Running Python Scripts Outside of IDLE

1- i want someone to help with this part
https://automatetheboringstuff.com/appendixb/
about Running Python Scripts Outside of IDLE and sending command line args .
2- i converted my code to .exe by pyinstaller ; what's the difference between this and running it
as a script .
3-how scripts are done . i see experienced people says :"i made a script to do something for me " how is that done >?
*i'm a beginner so try to make answers simple as possible.
If you're wondering about command line arguments, look into the "argparse" library https://docs.python.org/3/library/argparse.html.
The difference in the .exe and the normal script is that that the .exe versions (conventionally) are able to be redistributed to other sytems that don't have python installed whilst still being able to run the script. If you're only making the script for yourself the only real benefit is that you dont have to enter your IDE (code editor) every time you want to run the code, however if it's still in development then you'd have to compile the code every time you made a modification if you're wanting to run the code as an executable, which is very impractical.
Your third part is very, very vague. Python can be very versatile and i recommend you continue looking at the automatetheboringstuff.com website if you're interested in making scripts that can complete repetitive activities (although i must strongly advise you against using scripts maliciously).

My python installation on 1and1 stopped working (bashrc issue)

I installed python 2.7.10 on my 1and1 linux hosting service about 8 months ago (using instructions from http://geeksta.net/geeklog/python-shared-hosting/) and everything was working fine (I had a daily cron job that would call my python script). But recently,my python script stopped working and it appears that the call to python itself is the culprit, rather than the python code. Whenever I type 'python' into the command line in the 1and1 unix ssh session now, i get the following error message
"-bash: /kunden/homepages/26/xxxxxxxxxx/htdocs/python27/bin/python: No
such file or directory"
It's been awhile since I installed things, but I don't believe I had this issue previously. I'm trying to figure out why it's not working and what I can do to get it fixed. It appears that calling python isn't working properly (which would affect my script as well).
Any help with getting this working would be greatly appreciated.
when you type python, system find it in /kunden/homepages/26/xxxxxxxxxx/htdocs/python27/bin/python, but there is no such a file in fact.
what you need to do is trying to locate your python binary executable file, and alias your python to your file
I ended up just reinstalling python 2.7 again and it works again. Not sure why it stopped working before.
Now I can type "python" in the command line and it starts the Python console.

How can I run python3 on my apache server by default?

I am a beginner to Python here, and I am having an issue.
In my setup, I was using a PHP script to call the command line which in turn would execute a python script. Since then, I've discovered that I can run python directly.
My problem is that 2.6 is running when I call the script directly, and I need Python 3.3 to run instead.
After looking this up, I found I need to recompile mod_python, but then I found that I want to use mod_wsgi instead which is giving me a whole series of other errors like my python3 installation not having --shared-libraries when make was ran.
I am pulling my hair out trying to do such a seemingly simple task. Is there any direction someone can point me in? Again, I am a Python beginner. Any help is apprecited!

Categories