~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/sdk/resources/lexers/lexer_python.sample

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This is a comment
 
2
## This is a comment block
 
3
 
 
4
import sys, time, string
 
5
 
 
6
month_names = ['Januari', 'Februari', 'Maart',      # These are the
 
7
               'April',   'Mei',      'Juni',       # Dutch names
 
8
               "Juli",    "Augustus", "September",  # for the months
 
9
               "Oktober", "November", "December"]   # of the year
 
10
 
 
11
if len(sys.argv)!=2:
 
12
    print '''Usage: This is a 'Code::Blocks' Example'''
 
13
    print "This String goes to EOL
 
14
    sys.exit(0)
 
15
 
 
16
class ClassName:
 
17
  def perm(l):
 
18
  # Compute the list of all permutations of l
 
19
    if len(l) <= 1:
 
20
      return [l]
 
21
    r = []
 
22
    for i in range(len(l)):
 
23
      s = l[:i] + l[i+1:]
 
24
      p = perm(s)
 
25
      for x in p:
 
26
        r.append(l[i:i+1] + x)
 
27
    return r
 
28
 
 
29
@classmethod           # This is a decorator
 
30
@synchronized(lock)    # And so is this
 
31
def func(self):
 
32
  try:
 
33
    return  """A "Triple Double Quote" String\n"""
 
34
  except SystemExit:
 
35
    pass