I'm trying to perform automation for transferring the file from Ubuntu(Linux) to Window system using python. I'm stuck with how I can implement this. Can anyone please suggest me a way to implement this. My input for this will username, password, and windows path for the script.
1 Answers
You don't explain what transfer files mean, and if you want to transfer on the same computer (having a Windows file system and a Linux one on two different disk partitions) or on two different ones. You should think in terms of network communication protocols and file systems.
For remote file transfer, think in terms of network communication protocols : you might consider using rcp or scp or HTTPS or HTTP or rsync or to transfer the files (see this and that). Take into account cybersecurity considerations, so consider Python cryptographic services. You could also consider network file systems such as NFS or CIFS (a.k.a. SMB) or sshfs. HTTP and HTTPS and SSH protocols (both client and server side, look also into libssh) which is widely supported by Python or Guile bindings.
For local computer transfer between different disk partitions, think in terms of file systems, you could consider mounting the other's OS partition. Be then aware of VFAT or NTFS and CIFS support in Linux, and Ext2fs and NFS support on Windows.
You can code in Python (with pycurl and/or other Internet protocols) or Guile quite easily web services. Be aware of SOAP and REST (and SMTP to send emails). You could be interested by WebSockets to code a nice web interface. You may be interested by Python or Guile bindings to SMTP client libraries, HTTPS or libssh
server or client libraries.
Consider also using distributed version control systems such as git - with a remote repository. Of course you'll find pygit2, a Python binding to it, and of course git
is running both server side and client side on both Windows and Linux.
Be also aware of legal licensing considerations mentioned here.

- 223,805
- 18
- 296
- 547
-
File transfer on the same computer having a windows file system and a Linux one on two different disk partitions (Dual booted) – Aaditya R Krishnan May 22 '20 at 05:52
-
Can we use Python for this – Aaditya R Krishnan May 22 '20 at 05:53
-
Yes. Python is binding lots of other libraries. – Basile Starynkevitch May 22 '20 at 05:56
-
Do you have any sample implementation for reference – Aaditya R Krishnan May 22 '20 at 05:57
-
My source will be Linux & Destination will be window then which can I choose – Aaditya R Krishnan May 22 '20 at 06:00
-
Can I use SMB for this – Aaditya R Krishnan May 22 '20 at 06:01
-
SMB is called CIFS, mentioned in my answer – Basile Starynkevitch May 22 '20 at 06:02
-
Among NFS, CIFS, sshfs, and libssh what should be better matched with python – Aaditya R Krishnan May 22 '20 at 06:07
-
I don't understand that question, and "better" is strongly a matter of opinion. – Basile Starynkevitch May 22 '20 at 06:08
-
Can we move this to chat – Aaditya R Krishnan May 22 '20 at 06:10
-
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/214396/discussion-between-edward-arrow-and-basile-starynkevitch). – Aaditya R Krishnan May 22 '20 at 06:10