omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Reference a file located in Dropbox using Python

    Editorial
    2
    2
    1313
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zenimot
      zenimot last edited by

      I want to use Python to get a random line from a text file located in Dropbox.
      So far I have not been very successful, as I am not able to even open a file.

      My question: How do I open a file located in Dropbox using Python?

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        Do you have https://gist.github.com/4034526 working already?

        http://omz-forums.appspot.com/pythonista/post/6675908186341376

        Once dropboxlogin is working, you can:

        Use https://www.dropbox.com/developers/core/docs/python#DropboxClient.get_file

        with client.get_file('/magnum-opus.txt') as in_file:
            the_data =  in_file.read()
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors