[Python-africa] Fwd: HELP

Jessica Upani nabbygirl at gmail.com
Mon Jan 16 05:53:45 EST 2017


---------- Forwarded message ----------
From: Omagano Uushona <oumagano at gmail.com>
Date: Mon, Jan 16, 2017 at 12:37 PM
Subject: Re: HELP
To: Jessica Upani <nabbygirl at gmail.com>


Thank You so Much.

I've used pysftp module and it worked wonders. I can list everything on the
server just have to work on how to put on something and retreave something.
Being file or folder. Thank you so much guys. Below is the code i've used.
Incase anyone has an idea on how I can go about dropping and fetching, I'll
appreciate it so much.

#code is down here

import pysftp

srv = pysftp.Connection(host="10.42.8.161",
username="omagano",password="omagano")
local_path = "C:/Users/Omagano Boom/Downloads/God is reason.jpg"
remote_path = "Omagano"

srv.put(local_path, remote_path)
srv.get(remote_path)


# Get the directory and file listing
data = srv.listdir()

# Closes the connection
srv.close()

# Prints out the directories and files, line by line
for i in data:
    print i


Regards.

On Mon, Jan 16, 2017 at 12:50 AM, Jessica Upani <nabbygirl at gmail.com> wrote:

>
> ---------- Forwarded message ----------
> From: frantic.naturalist <frantic.naturalist at gmail.com>
> Date: Sat, Jan 7, 2017 at 1:53 PM
> Subject: Re: HELP
> To: Python Namibia <pynam-society at googlegroups.com>
>
>
> Hi Jessica,
>
> There is a python library for doing that kind of thing.  I don't know much
> about sftp, but it's just ftp like functionality with ssh.
>
> The library is within pypi (so you can install it with pip).
>
> https://bitbucket.org/dundeemt/pysftp
>
> From there, it should be really easy to set up the functionality.  I don't
> have any experience with it, but happy to help figure things out if needed.
>
> Regards,
> Vernon
>
>
> On Friday, 6 January 2017 16:31:12 UTC+2, Jess wrote:
>>
>> Dear everyone
>>
>> I have a friend who needs help with something. Is anyone able to help her
>> out?
>>
>> "I'm supposed to write a config app that reads from an sftp server. It's
>> supposed to drop and fetch files from it. Any idea on how to go about it?"
>>
>> Any kind of help will be much appreciated. Thanks a lot for your help in
>> advance.
>>
>> Regards
>> Jessica
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Namibia" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pynam-society+unsubscribe at googlegroups.com.
> To post to this group, send email to pynam-society at googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pynam-society/39ac0baf-3530-4e08-be5c-de8f8baa7d22%40googlegroups.com
> <https://groups.google.com/d/msgid/pynam-society/39ac0baf-3530-4e08-be5c-de8f8baa7d22%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> **@_Jessy-Babe_#**
>   +26481 32 86 519
>



-- 
Omagano Uushona (student)
Namibia University of Science and Technology
+264818231395 <+264%2081%20823%201395>



-- 
**@_Jessy-Babe_#**
  +26481 32 86 519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-africa/attachments/20170116/39c2e353/attachment-0001.html>


More information about the Python-africa mailing list