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 111-120 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
195PythonExceptionsException auslösenif (a!=b): raise Exception("Not implemented, yet")View Update Delete
196PythonJSONJSON Daten ladenimport json myJSONFile = "/tmp/Test/myData.json" json_data = open(myJSONFile) # In Python werden JSON Daten nach dem Laden wie Dictionaries behandelt data_dict = json.load(json_data)View Update Delete
197PythonJSONJSON Daten speichernmyData_dict = {"key1":"value1"} fileObj = open('myData.json', 'w+') jsonDump = json.dumps(myData_dict) fileObj.write(jsonDump) fileObj.close()View Update Delete
204PythonFallunterscheidungTernary operatorthisVar = "OK" resultVar = False # [on_true] if [cond] else [on_false] resultVar = True if thisVar == "OK" else False // same as if-else construction if (thisVar == "OK"): resultVar = True else: resultVar = FalseView Update Delete
215PythonStringsReplace# http://www.tutorialspoint.com/python/string_replace.htm str1 = "abc#def" str1 = str1.replace("#",';") print str1 # Output: abc;defView Update Delete
240PythonStringsText in Großschrift oder KleinschriftmyString = "my lovely Mr Singing Club" print myString.upper() // MY LOVELY MR SINGING CLUB print myString.lower()View Update Delete
249PythonSysteminfoBetriebssystem ermittelnimport os os.name # nt, posix import platform platform.system() # 'Windows', 'Linux', 'Darwin' platform.release() # Linux, Windows, Windows, Darwin '2.6.22-15-generic', 'Vista' ,'10', '8.11.1' # Example from https://stackoverflow.com/questions/1854/python-what-os-am-i-running-on from sys import platform as _platform if _platform == "linux" or _platform == "linux2": # linux elif _platform == "darwin": # MAC OS X elif _platform == "win32": # Windows elif _platform == "win64": # Windows 64-bitView Update Delete
251PythonStringsErster Buchstable Groß in Wort# Siehe auch: http://www.php2python.com/wiki/function.ucwords/ myString = "nothingspecial" import string uc = string.capwords(myString) print(uc) # NothingspecialView Update Delete
252PythonDateihandlingTextdatei schreiben# Modes # r: Read mode which is used when the file is only being read # w: Write mode which is used to edit and write new information to the file (any existing files with the same name will be erased when this mode is activated) # a: Appending mode, which is used to add new data to the end of the file; that is new information is automatically amended to the end # r+: Special read and write mode, which is used to handle both actions when working with a file myFile = open("myFile.txt","w") myFile.write("Hello World") myFile.close() View Update Delete
69C#GUI, .NET-WPFRessource aus separater Style-Ressource var tbo = new TextBlock { Style = (Style)Application.Current.FindResource("MyTextBlockStyle") };View Update Delete