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.
How to ask a good question
-
@Matteo An approach to enable fstrings in 3.1:
In stash:
pip install tokenize_rt
Then, Download future_fstrings.py, and install into site-packages-3.
Create usercustomize.py in site-packages-3, which includes
import future_fstrings future_fstrings.register()
(Iirc, pythonista_startup doesnt get executed by the extension, but usercustomize.py does)
Finally, add
# -*- coding: future_fstrings -*-
to the top of any file where you want fstrings enabled, such as zrzka's script.
-
Hi @JonB, thank you for suggestion! I will try your procedure.
@enceladus thank you for showing me an other way to do what I ask: when I will be able to use @zrzka script with python 2.7.12 by trying to copy the code here (as you suggest) in clipboard, I will try also the @omz script!
Regards
-
-
Guys, below in the snippet is a func 'pythonista_info'. I am pretty sure @JonB wrote this function a long time ago. It still seems to work ok. My wapper to copy it to the clipboard is not so nice(user friendly). But a refined version of what is below could be used as a wrench item to get details about the env when you are posting to the forum. I didn't attempt to make a nice version of it. I think others would do a better job than me.
This is quite old, so maybe it does need updating...
import clipboard, console import os, platform, plistlib, scene, sys def pythonista_info(): plist = plistlib.readPlist(os.path.abspath(os.path.join (sys.executable, '..', 'Info.plist'))) ios_ver, _, machine_model = platform.mac_ver() return dict(pythonista_ver_str=plist['CFBundleShortVersionString'], pythonista_ver_num=plist['CFBundleVersion'], ios_ver_str=ios_ver, screen_resoultion=scene.get_screen_size(), screen_scale=scene.get_screen_scale(), machine_architecture=platform.architecture()[0], machine_model=machine_model, ) if __name__ == '__main__': info = pythonista_info() str_info = "\n".join(str((k, v)) for k, v in info.items()) clipboard.set(str_info) print(str_info) console.hud_alert('Pythonista Env copied to clipboard')
-
@Phuket2 Immediately integrated in my apps/tools
-
Regarding the pythonista_info function I posted above. I have since had a few freezes with using it (Pythonista becomes unresponsive) and a hard restart is required.
Ok, I found the original post, its over 2 years old. @ccc , @JonB and @dgelessus all helped out on this post. It would be nice if anyone could see why it would be intermittently freezing now. I can imagine quite a few things have changed in 2 years :). Anyway, it would nice to have it stable or an equivalent for easily getting your devices info, to be able to paste into posts if needed. I realise the dict keys could be better if they are to be used as part of the output.
@cpv, have you had a freeze using it? -
@Phuket2 No freeze but not used a lot...
-
@cvp , ok thanks. There is something wrong though, if I use it multiple times I can get it to freeze. Hopefully someone will spot the problem
-
@Phuket2 I've corrected a serious error 😂