Posts: 4
Threads: 1
Joined: Jan 2022
Jan-02-2022, 05:44 PM
(This post was last modified: Jan-07-2022, 01:49 AM by medlexo.)
Hi guys, I'm a bit new here. To be frank, after I publish the updated extension I do not know how to make it appear in the search section of vscode so I figure I just register a new account here and share it here since this extension is free.
Do help me rate and share if this extension is useful to you. P.s before install disable other similar extensions first.
This is the link
Happy New Year everyone, the code is available in github so you can see it yourselves:
And this is the changelog: - added with new python function, update legacy code
- fixes a few unintended typo left by previous developer
- use
TAB to rename field in every method / feature
- added label to method belong to string/list/tuple/set/dict
- added python
<datatype> and snippet, try typing str
- added
match snippet - python 3.10
- added
np.init snippet for numpy array [pip3 install numpy]
- added
import snippet
- added
documentation , timeit snippet
- added
random snippet
- added
for -loop snippet
- added matplotlib template
plt
- added
dp decimal place, end , env , benchmark , self , sleep , swap snippet
- new format for easier selection, to see built in example type
apply. random. class
- get example use
<datatype>. while for available method use .<datatype> ex: .string
- welcome to contribute to add more ideas, make it as complete as possible
Posts: 7,313
Threads: 123
Joined: Sep 2016
Jan-02-2022, 10:42 PM
(This post was last modified: Jan-02-2022, 10:42 PM by snippsat.)
Have tested it,and it work fine.
I which that some update where done like using f-string on all code.
#class with method example (python snippets 2)
class Parrot:
# instance attributes
def __init__(self, name, age):
self.name = name
self.age = age
# instance method
def sing(self, song):
return '{} sings {}'.format(self.name, song)
def dance(self):
return '{} is now dancing'.format(self.name)
# instantiate the object
blu = Parrot('Blu', 10)
# call our instance methods
print(blu.sing('Happy'))
print(blu.dance()) Become.
I did just run flynt here to convert.
# class with method example (python snippets 2)
class Parrot:
# instance attributes
def __init__(self, name, age):
self.name = name
self.age = age
# instance method
def sing(self, song):
return f'{self.name} sings {song}'
def dance(self):
return f'{self.name} is now dancing'
# instantiate the object
blu = Parrot('Blu', 10)
# call our instance methods
print(blu.sing('Happy'))
print(blu.dance())
medlexo Wrote:To be frank, after I publish the updated extension I do not know how to make it appear in the search section of vscode so I figure I just register a new account here and share it here since this extension is free. That's fine,will maybe get some users from here,but you need to figure out so it appears in search to get more users.
Posts: 4
Threads: 1
Joined: Jan 2022
(Jan-02-2022, 10:42 PM)snippsat Wrote: Have tested it,and it work fine.
I which that some update where done like using f-string on all code.
#class with method example (python snippets 2)
class Parrot:
# instance attributes
def __init__(self, name, age):
self.name = name
self.age = age
# instance method
def sing(self, song):
return '{} sings {}'.format(self.name, song)
def dance(self):
return '{} is now dancing'.format(self.name)
# instantiate the object
blu = Parrot('Blu', 10)
# call our instance methods
print(blu.sing('Happy'))
print(blu.dance()) Become.
I did just run flynt here to convert.
# class with method example (python snippets 2)
class Parrot:
# instance attributes
def __init__(self, name, age):
self.name = name
self.age = age
# instance method
def sing(self, song):
return f'{self.name} sings {song}'
def dance(self):
return f'{self.name} is now dancing'
# instantiate the object
blu = Parrot('Blu', 10)
# call our instance methods
print(blu.sing('Happy'))
print(blu.dance())
medlexo Wrote:To be frank, after I publish the updated extension I do not know how to make it appear in the search section of vscode so I figure I just register a new account here and share it here since this extension is free. That's fine,will maybe get some users from here,but you need to figure out so it appears in search to get more users.
I see, thank you for f-string, I actually ran a benchmark on .format and f-string but they seem similar.
I would love to know if f-string is faster.
Regardless f-string sure look more elegant, thank you for that I will change it.
I'm collecting more feedback first for maybe 1 month and then pushing a new update together, if not there will be a lot of versions.
Posts: 7,313
Threads: 123
Joined: Sep 2016
Jan-03-2022, 01:29 PM
(This post was last modified: Jan-03-2022, 01:29 PM by snippsat.)
(Jan-03-2022, 08:12 AM)medlexo Wrote: I would love to know if f-string is faster. It's faster,but more important it's more readable.
You can see speed test in links under.
Python 3's f-Strings: An Improved String Formatting Syntax (Guide)
F-strings — make your python code more readable today
It's a interesting project as it can be quite useful to have it insert working code example's of many aspect of Python usage.
The name can be a little confusing python snippets 2 ,can sound like is code snippet for Python 2
Python3 code generator would be me advice,but that's up to you.
It's fine with GIF file to show usage,but it's way to big.
Should have information over,then show concept with a shorter GIF under.
Posts: 4
Threads: 1
Joined: Jan 2022
Jan-03-2022, 04:43 PM
(This post was last modified: Jan-08-2022, 03:56 AM by medlexo.)
(Jan-03-2022, 01:29 PM)snippsat Wrote: (Jan-03-2022, 08:12 AM)medlexo Wrote: I would love to know if f-string is faster. It's faster,but more important it's more readable.
You can see speed test in links under.
Python 3's f-Strings: An Improved String Formatting Syntax (Guide)
F-strings — make your python code more readable today
It's a interesting project as it can be quite useful to have it insert working code example's of many aspect of Python usage.
The name can be a little confusing python snippets 2 ,can sound like is code snippet for Python 2
Python3 code generator would be me advice,but that's up to you.
It's fine with GIF file to show usage,but it's way to big.
Should have information over,then show concept with a shorter GIF under.
The gif was provided by the original developer, I will re-record a new gif then.
Sincerely thank you for the advice, I will change to f-string asap. Maybe this Sunday.
I will name it python snippets 3 thanks for mention it
Posts: 7,313
Threads: 123
Joined: Sep 2016
Jan-03-2022, 05:18 PM
(This post was last modified: Jan-03-2022, 05:18 PM by snippsat.)
There are project that is quite similar that you should be aware of like python snippets.
Python UltiSnippets not maintained anymore.
So your name only add 3 python snippets 3 .
I would certainty think of other name so it stand more out.
Looking at Github so it not updated last two year.
medlexo Wrote:Sincerely thank you for the advice, I will change to f-string asap. Maybe this Sunday. That's fine it you make it more updated to modern Python,it will be much more useful.
Posts: 4
Threads: 1
Joined: Jan 2022
Jan-03-2022, 08:54 PM
(This post was last modified: Jan-03-2022, 08:54 PM by medlexo.)
(Jan-03-2022, 05:18 PM)snippsat Wrote: There are project that is quite similar that you should be aware of like python snippets.
Python UltiSnippets not maintained anymore.
So your name only add 3 python snippets 3 .
I would certainty think of other name so it stand more out.
Looking at Github so it not updated last two year.
medlexo Wrote:Sincerely thank you for the advice, I will change to f-string asap. Maybe this Sunday. That's fine it you make it more updated to modern Python,it will be much more useful. It is from Python Snippet (the first link u mentioned), yes I updated some legacy code.
4 Jan 2021:
I have renamed the extensions and thus required a new update of the link, and of course changed to f-string.
For those who had installed it please uninstall the old one then use the new link in this thread.
Please help to rate the extension in the new link.
|