Did ever wanted to code with an ipad... maybe with python? Well, one of the best way to do it is with pythonista... beautiful app that allows you to make beautiful code with python... and even create beautiful games or app with awesome gui.
You may have the wish to bring some code from your pc or mac to pythonista. Even if it is easy do the opposite by email for example, I did't know how to get the code from the pc to the ipad.
So, I went in the forum and I discovered a solution someone have found yet.
You just need to make a program in pythonista and import requests, then create a file with a name that you want that will store the code on the ipad and then grab the code from somewhere in the internet (I put it a github repository, for example) and get the text out of it... and save it to the ipad... that's all... 3 or 4 lines of code and you're done.
Here the code is (and you can make this also elsewhere to grab code from your repository to work on your code in different places and with different instruments...):
import requests as r
with open("gamesofcards.py","w",encoding="utf-8") as file:
file.write(r.get("https://apprendimento.github.io/gamesofcards.py").text)
print("File copied in the current directory")
Comments
Post a Comment