Manage PlItems

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search
Displaying 191-200 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
160PythonExceptionsTry Catch Excepttry: print 1/0 except Exception as e: print traceback.extract_stack() else: print "this is the else block" finally: print "finally clean up or something"View Update Delete
161PythonStringsString nach einem Teilstring durchsuchen# http://www.tutorialspoint.com/python/string_find.htm # this function is case sensitive fullstring = "This is my string" searchFor = "my" startPosition = fullstring.find(searchFor, 0, len(fullstring)) # startPosition will have 8 if startPosition>=0: print "I found it!" startPosition = fullstring.upper().find(searchFor.upper()) # case insensitiveView Update Delete
162PythonStringsString auf Wunschlänge zuschneidenmyString = "Benzinverbrauch" print myString[2:10] # Ausgabe: "nzinverb"View Update Delete
164PythonVariablenAuflistung aller Variablenimport pprint a="This is a test" b=1 c=True pprint.pprint(locals()) #{'__builtins__': <module '__builtin__' (built-in)>, # '__doc__': None, # '__name__': '__main__', # '__package__': None, # 'a': 'This is a test', # 'b': 1, # 'c': True, # 'pprint': <module 'pprint' from '/usr/lib/python2.7/pprint.pyc'>} pprint.pprint(globals())View Update Delete
166PythonFilehandlingDatei auf dem Betriebssystem ausführenimport commands output=commands.getoutput("dir") print output # home tmp myFile.shView Update Delete
170PythonDatum, ZeitGestriges Datumfrom datetime import date, timedelta d=date.today()-timedelta(days=1) output=d.isoformat() # 2014-02-27 View Update Delete
186PythonStringsString nach Delimenter zerlegenmyString = "A;B;C;D;E" myPieces = myString.split(";") # erzeugt ein Arrey mit den einzelnen Zeichen print myPieces[2] # gibt C ausView Update Delete
188PythonProzeduren, Funktionen, MethodenDeklaration einer Funktion/Prozedurdef this_is_my_function_name(param1): print "do something inside the function " + param1 print "do something outside the function" # call the function this_is_my_function_name("hello world") View Update Delete
189PythonSchleifenFor-Schleifefor i in range(0, 10): i=1 time.sleep(1) print i items = ['computer', 'fruits', 'fraggels'] # without indexes for item in items: print item # with indexes for (i, item) in enumerate(items): print i, itemView Update Delete
190PythonSchleifenWhile Schleifei=10 while i<10: i=i+1 print i View Update Delete