File transfer with python

  • Thread starter Valentin de Pablo Fouce
  • Start date
V

Valentin de Pablo Fouce

Hi there,

I hope this is the rigth place, if not please, tell me which is the
right dicussion place. I apologize in such case.

Ok, I am trying to do a very quick application (is "home based" so is
not a big deal...). My intention is to transfer files from one
computer to another.

I am using several OS (Linux and Windows basicly, but potentially in
the future Mac too), and the computers won't be potentially in the
same network (ok, the most times will... but there will be
exceptions).

My intention is to be able to transfer files from one computer to
another in this environment.

Looking (and surfing) at internet the only suggestion given is to use
low level sockets for this file transfer. Is there another way to do
it, is there any top level library that helps you to do that?

That's a lot!
 
L

Lie Ryan

My intention is to be able to transfer files from one computer to
another in this environment.

Do you have a USB flashdrive?
Looking (and surfing) at internet the only suggestion given is to use
low level sockets for this file transfer. Is there another way to do
it, is there any top level library that helps you to do that?

Networked file system (e.g. Samba/SMB), File Transfer Protocol (FTP),
whatever works for you. pysamba is available from sourceforge and there
is ftplib in the standard library. For most purposes though, you could
just setup a network shared directory and drag and drop files from the
file manager.
 
J

Jan Kaliszewski

Valentin de Pablo Fouce said:
Ok, I am trying to do a very quick application (is "home based" so is
not a big deal...). My intention is to transfer files from one
computer to another.
My intention is to be able to transfer files from one computer to
another in this environment.

Looking (and surfing) at internet the only suggestion given is to use
low level sockets for this file transfer. Is there another way to do
it, is there any top level library that helps you to do that?

Python standard library offers tools for HTTP communication (rather easy
to use) -- see:
http://docs.python.org/library/simplehttpserver.html
http://docs.python.org/library/cgihttpserver.html
http://docs.python.org/library/basehttpserver.html
-- as well as:
http://docs.python.org/library/urllib.html
http://docs.python.org/library/urllib2.html

Cheers,
*j
 
E

Emile van Sebille

On 1/6/2010 10:00 AM Valentin de Pablo Fouce said...
Hi there,

I hope this is the rigth place, if not please, tell me which is the
right dicussion place. I apologize in such case.

Ok, I am trying to do a very quick application (is "home based" so is
not a big deal...). My intention is to transfer files from one
computer to another.

I am using several OS (Linux and Windows basicly, but potentially in
the future Mac too), and the computers won't be potentially in the
same network (ok, the most times will... but there will be
exceptions).

cygwin + scp or rsync are other options.

Emile
 
R

r0g

Valentin said:
Hi there,

I hope this is the rigth place, if not please, tell me which is the
right dicussion place. I apologize in such case.

Ok, I am trying to do a very quick application (is "home based" so is
not a big deal...). My intention is to transfer files from one
computer to another.

I am using several OS (Linux and Windows basicly, but potentially in
the future Mac too), and the computers won't be potentially in the
same network (ok, the most times will... but there will be
exceptions).

My intention is to be able to transfer files from one computer to
another in this environment.

Looking (and surfing) at internet the only suggestion given is to use
low level sockets for this file transfer. Is there another way to do
it, is there any top level library that helps you to do that?

That's a lot!


Well there's several file transfer protocols you could use, TFTP, FTP,
SFTP and you can do SCP and Rysnc over SSH.

AFAIK there's python libs that handle all of those. Unless you need very
high performance I'd suggest using SFTP (Secure file transfer protocol).

Lookup the Paramiko library, it does this and other SSH based stuff.

Roger.
 
A

alex23

Valentin de Pablo Fouce said:
My intention is to be able to transfer files from one computer to
another in this environment.

Looking (and surfing) at internet the only suggestion given is to use
low level sockets for this file transfer. Is there another way to do
it, is there any top level library that helps you to do that?

If your computers are distributed across many networks, and they all
have internet access, Richard Jones' GmailFS[1] might give you some
ideas. It uses the Python bindings for FUSE to create a local
filestore that's a wrapper around the Gmail API, stashing the actual
data on Google's servers. It's out of date now, but it shouldn't be
much of an effort to update to the latest Gmail API, or to replace
with any other backend data store you like. Google App Engine[2]
provides a hefty amount of free storage to developers, so that's
another option.

1: http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html
2: http://code.google.com/appengine/
 
J

Jan Kaliszewski

Your solution looks quite nice...but one question, just by looking to
it I think I will need to create an HTTP server on a "file" server PC,
isn't it?

Yes, in case of such communication protocols like HTTP always one side
have a role of a serwer, and the other -- of a client. However, please
note that files can be both downloaded *from* serwer and uploaded *to*
serwer. You can also run *each* side both as a client *and* as a serwer
(though it's rather unnecessary...).

Cheers,
*j
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top