Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
snippets:python:start [2011/06/13 17:15] – fix config note enrico | snippets:python:start [2019/11/18 05:08] (current) – Remove double 'the' spotlightkid | ||
---|---|---|---|
Line 3: | Line 3: | ||
The Python snippets are inspired by Gedit. | The Python snippets are inspired by Gedit. | ||
- | Just copy the the [Special] and [Python] sections from the code below into your snippets file, e.g. in // | + | Just copy the [Special] and [Python] sections from the code below into your snippets file, e.g. in // |
- | < | + | < |
[Special] | [Special] | ||
wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | ||
Line 23: | Line 23: | ||
set=def set%cursor%(self): | set=def set%cursor%(self): | ||
.=self.%cursor% | .=self.%cursor% | ||
+ | prop=property %cursor%: | ||
try=try: | try=try: | ||
py=# | py=# | ||
Line 28: | Line 29: | ||
with=with %cursor%: | with=with %cursor%: | ||
head=""" | head=""" | ||
+ | pp=from pprint import pprint\npprint(%cursor%) | ||
+ | cod=# coding: utf-8 | ||
+ | dt=from datetime import datetime | ||
</ | </ | ||
+ | |||
+ | ===== Alternative ===== | ||
+ | |||
+ | Modified Specifically for Python3 and PEP8-compliant | ||
+ | |||
+ | <code properties> | ||
+ | utf8=#-*- coding: utf-8 -*-\n# vim: | ||
+ | for=for i in xrange(%cursor%): | ||
+ | doc=""" | ||
+ | elif=elif %cursor%: | ||
+ | else=else: | ||
+ | if=if %cursor%: | ||
+ | from=from %cursor% import \n | ||
+ | main=if __name__ == ' | ||
+ | class=class %cursor%(object): | ||
+ | def=def %cursor%(ARG: | ||
+ | get=def get%cursor%(self): | ||
+ | set=def set%cursor%(self): | ||
+ | try=try: | ||
+ | py=# | ||
+ | while=while %cursor%: | ||
+ | with=with %cursor%: | ||
+ | head=""" | ||
+ | # Django models | ||
+ | # by Tomasz Karbownicki < | ||
+ | mclass=class %cursor%(models.Model): | ||
+ | mchar=%cursor% = models.CharField(max_length=50, | ||
+ | mint=%cursor% = models.IntegerField(verbose_name=u' | ||
+ | mtext=%cursor% = models.TextField(verbose_name=u' | ||
+ | mkey=%cursor% = models.ForeignKey(%cursor%, | ||
+ | mimage=%cursor% = models.ImageField(upload_to='', | ||
+ | mbool=%cursor% = models.BooleanField(verbose_name=u' | ||
+ | mdate=%cursor% = models.DateField(verbose_name=u' | ||
+ | memail=%cursor% = models.EmailField(verbose_name=u' | ||
+ | murl=%cursor% = models.URLField(verbose_name=u' | ||
+ | mslug=%cursor% = models.SlugField(verbose_name=u' | ||
+ | # by Devyn Collier Johnson < | ||
+ | license=__license__ = """ | ||
+ | all=__all__ = [\n\t' | ||
+ | debug=print(' | ||
+ | |||
{{tag> | {{tag> |