-
-
Save halspg/fed438340c59e77f87fa to your computer and use it in GitHub Desktop.
Pythonista用モジュール
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def openapp(url): | |
import webbrowser | |
webbrowser.open(url) | |
def saveimage(img): | |
import photos | |
if isinstance(img, list): | |
map(photos.save_image, img) | |
else: photos.save_image(img) | |
def createnewfile(source, filename='New_Untitled.py'): | |
import console, os.path | |
if os.path.isfile(filename) is False : | |
with open(filename, 'w') as wf: | |
wf.write(source) | |
elif console.alert('File already exists.', 'Overwrite?', 'OK') == 1: | |
with open(filename, 'w') as wf: | |
wf.write(source) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment