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.
Add words for autocompletion feature (for both console and editor)
-
@Matteo see Pythonista settings like https://imgur.com/a/N5sW5O2
You can add words even without snippet and if you begin by typing its initials, you will see....
Define https://imgur.com/a/R9ev8DS
-
@cvp Thank you for hint about snippet, never used it since I have Pythonista. I will try to use it for adding words.
About your last image link, how can I add words without snippet? I think it could be what I need.Thank you!
Edit: sorry, I've seen now your link about Define, ok, solved. Ignore my previous question.
Best regards -
@Matteo That does not solve the usage in console ...
-
@cvp Yeah, you are right. Also in editor when I try to select an empty snipped just created, Pythonista doesn't insert the word in editor, I can see the word but it is not added in editor, tried just now (v3.1, 301016).
For usage also in console the only way is to write a py file with a list of None definitions, but I think there isna better and simpler way.
I must perform some experiments with snippets.
Again thank you for help.
Bye -
@cvp said
I can see the word but it is not added in editor
You are right, sorry, I did not test it... 😭
Then you have to put the same word as snippet, I guessTested, that works but needs to type twice the word in the settings
-
@cvp ok, it works now.
Thank you cvp
ByePs: do you know a way to change programmatically all snippets in order to add some special character to all snippets, for example?
-
@Matteo asked
do you know a way to change programmatically all snippets in order to add some special character to all snippets, for example?
No idea where there are stored...
But why?
-
@cvp ok, suppose I have a lot of snippets created by hand that start with a specific word, for example 'scipy.xxx' where 'xxx' are some words. How can I change word 'scipy' in 'basic.scipy' (for example) for all snippets of the form 'scipy.xxx'? It is just to add, modifiy, rename, change content of snippets programmatically to be faster than changing them by hand one by one.
If snippets are saved in a file , maybe it could be easier to change content of the file based on certain rules (with python regex for example).Thanks
-
@Matteo understood but no idea how and where are stored these snippets. And don't forget that even if you find the name of the eventual file, Pythonista files are often (always) write protected
-
@cvp maybe that file is writable by user, if user can add , delete, modify by hand snippets. But as you said if user can't see that file in visible directories, probably it is write protected. The best solution for me that works also for console remains the execution of a py file at Pythonista startup with a series of definition like:
def scipy.x1: None def scipy.x2: None ...
Thank you cvp for snippets solution, I've seen it is powerful with common pieces of code user uses often.