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.


    Extract a tar.gz file

    Pythonista
    2
    3
    2818
    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.
    • NorthWind
      NorthWind last edited by

      Today I tried to import some files into Pythonista,and unfortunately it was made into a tar.gz archieve,so I have to extract it first.As my computer and Android phone isn't at my side,I have to upload it to my server(Linux)with ftp and use SSH Connection to extract it,and then download again.I wonder if there is a better way to make this only with my iPhone?Thx.

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

        https://docs.python.org/3/library/tarfile.html

        import tarfile
        with tarfile.open("sample.tar.gz") as tarball:
            tarball.extractall()
        
        1 Reply Last reply Reply Quote 0
        • NorthWind
          NorthWind last edited by

          @ccc Got it.Thanks.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors