LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   python FTP send command (https://www.linuxquestions.org/questions/linux-newbie-8/python-ftp-send-command-4175538874/)

simhumcon 04-06-2015 03:43 AM

python FTP send command
 
hello Experts!
need some help here with python FTP. so what i'm trying to do is, from a linux machine, ill be sending over a python script to a windows machine via python ftp. that works fine with no problem. now, i want to execute that python script i sent remotely. im having trouble with that. here's my code to just execute the script:

p.s : please dont suggest other options such as python paramiko due to many network security reasons

Code:


ftp = ftplib.FTP("windows machine name")
ftp.login("username", "password")
ftp.cwd("where\\python\\script\\is kept\\")

ftp.sendcmd("python myscript.py")

but looks like it doesn't recognize that command. how do i accomplish this please?

estabroo 04-06-2015 08:52 AM

Unless you have a really special ftp server like ssh's sftp, you can't. It's not something that is supported by ftp protocol.

simhumcon 04-06-2015 07:53 PM

i thought so. thank you very much! ill have to use ssh paramiko i guess


All times are GMT -5. The time now is 08:19 PM.