• FarmerPaco

    Python scripts can be edited in VIM and run in a shell in a-shell app, if that is what you are looking for.
    Also has GitHub access via lg2.
    Pip for installing packages.
    Pico for quick edits.
    Also, free.

    posted in Pythonista read more
  • FarmerPaco

    @resserone13 This was helpful. Was having difficulty with creating delays and this cleared it up. Thanks for the pointer. Cheers.

    posted in Pythonista read more
  • FarmerPaco

    This is a repeat of a follow-up in a different thread but since it address the matter of access and manipulation of Google Drive files I am going to cross-post it here:

    Just to follow up on this matter. After struggling with PyDrive in pythonista for a while with resulting errors, I opted to just go ahead and try the Google Drive API.

    There is a super simple tutorial in codelabs:
    https://codelabs.developers.google.com/codelabs/gsuite-apis-intro/#0

    Everything installs nicely and runs well. It even lets you complete the authentication in a separate browser if need be. I did the authentication on my raspberry pi and scped the secrets.jason and since then it works perfectly.

    Just in case anyone wants to access and G suite files, you should know that pip in stash running in python3 nicely installs google-api-python-client and oauth2client in the site-packages-3 (which is all you need for Google Drive API).

    posted in Pythonista read more
  • FarmerPaco

    Just to follow up on this matter. After struggling with PyDrive in pythonista for a while with resulting errors, I often to just go ahead and try the Google Drive API.

    There is a super simple tutorial in codelabs:
    https://codelabs.developers.google.com/codelabs/gsuite-apis-intro/#0

    Everything installs nicely and runs well.It even lets you complete the authentication in a separate browser if need be. I did the authentication on my raspberry pi and scped the secrets.jason and since then it works perfectly.

    Just in case anyone wants to access and G suite files, you should know that pip in stash running in python3 nicely installs google-api-python-client and oauth2client in the site-packages-3 (which is all you need for Google Drive API).

    posted in Pythonista read more
  • FarmerPaco

    @bennr01 just want to confirm that installing PyDrive via pip on raspbian downloads pyasn1 0.4.5

    This is not the same with pip in stash 7.1.

    But I honestly don’t know how much it matters.

    posted in Pythonista read more
  • FarmerPaco

    @bennr01 I am not running 7.2. Running 7.1 and that might be part of my problem. Will update shortly.

    Regarding pyasn1, versions 2.1 to 4.2 were released in 2017.

    I believe I am looking at the version of pyasn1 correctly. I only did so because in the original guide I was following @JonB specifically installed a version of pyasn1 after PyDrive. I wanted to make sure my version was the same or higher.

    I looked in: /site-packages-2/pyasn1/init.py

    version = '0.2.1'

    Then I looked in: /site-packages-3/pyasn1/init.py

    version = '0.1.7'

    Not sure why these would be different, or why the version in my python3 would be an earlier version. I am thinking to delete these packages from PyDrive and dependencies, update stash and then reinstall with pip.

    Also plan to do a PyDrive on my raspberry pi today and compare the files.
    I am still new to this stuff but what to understand better what’s happening under the hood.

    posted in Pythonista read more
  • FarmerPaco

    @JonB Thanks again for your time
    I’m going to install PyDrive on my Pi zero to familiarize myself with the normal process so I can debug where along the process my pythonista install is failing.

    I did check the site packages and saw the Stash running 2.7 installs a more updated version of pyasn1 (v. 2.1) where as stash runing at 3.6 installs an earlier version of pyasn1 (v.1.7). This seemed strange.

    Thanks again for your feedback. I will finish a PyDrive install on Rasbian (debian) which should be straightforward and then see where I am going wrong on Pythonista.
    I will also check stash/bin/scp.py

    posted in Pythonista read more
  • FarmerPaco

    @JonB thanks for pointing out my options. Will probably try installing the ssh python module first.
    Normally when I think of ssh I think of Bash, and since Stash (from what I read) is really just emulating a shell, I wasn’t sure if that would get in the way.
    I guess there is only one way to find out.
    Again, thanks.

    posted in Pythonista read more
  • FarmerPaco

    @mikael thanks for this. I will check it out later, but it looks like something I should know.
    I am assuming that in s.connect the port is 22 for sftp.
    Thanks for the pointer.

    posted in Pythonista read more
  • FarmerPaco

    @JonB Yes, it is. I use scp in stash, but was hoping to be able to call scp from inside a python3 script.
    Something like this:

    from paramiko import SSHClient
    from scp import SCPClient
    
    ssh = SSHClient()
    ssh.load_system_host_keys()
    ssh.connect('example.com')
    
    with SCPClient(ssh.get_transport()) as scp:
        scp.put('test.txt', 'test2.txt')
        scp.get('test2.txt')
    

    I know there is an scp python module:
    python scp module

    Can I call a Stash command from a python3 file to run scp from stash?
    Sorry if I am not making sense.
    Thank you again, since I feel like I keep asking you questions.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!