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 
 
193PythonArrayDictionary Basics# empty dict myDict = {} # some static values myDict ={ "key1" : {"item1":"value1"}, "key2" : {"itemX":"valueY"}, "keyX" : {"item99":"value98"} } # update a key programmatically myDict.update({"key1" = {"item2":"new value"}}) # iterate for (key, subdict) in myDict.items(): current_key = key current_subdict = subdict # get an specific item subdict = myDict.get("key2") print subdict.get("itemX") # valueYView Update Delete
194PythonFilehandlingFilename-Manipultation Basicsimport os myFilename = "/tmp/Test/myFile.txt" # Get only the path path_only = os.path.dirname(myFilename) # /tmp/Test # Filename only filename_only = os.path.basename(myFilename) # myFile.txt # get only filename without extention filename_without_ext = os.path.basename(os.path.splitext(myFilename)[0]) # myFile # get only the extension filename_extention_only = os.path.splitext(myFilename)[1] # .txt # put them together again myFilename_together = os.path.join(path_only, filename_without_ext + filename_extention_only) # /tmp/Test/myFile.txt View Update Delete
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
198BatchKonsolenverwaltungEinlesen Konsoleneingabe@echo off SET mydir=%CD% set /p number=search this number?: echo %number% > "%mydir%\lastnumbersearched.txt" echo dir/b/s *%number%*.* echo. echo. dir/b/s *%number%*.* echo. echo. pause View Update Delete
199JavaScriptStringsString auf Wunschlänge zuschneidenmyString = "abc"; mySubString = myString.substring(0,2); // abView Update Delete
200JavaScriptDatum, ZeitAktuelles Datum/Uhrzeitdate = new Date(); // Sat Jun 14 2014 13:15:27 GMT+0200 (CEST) dateStringISO = date.toISOString(); // "2014-06-14T11:15:27.097Z" // Attention: Time is different because of the timezone date.toISOString().substring(0,10); //"2014-06-14" dateStringISO.split("T")[1]; // 11:15:27.097ZView Update Delete
201ExcelStringsReplace/* Cell A1 contains text "abc#def" */ =SUBSTITUTE(A1;"*";"/") /* Result will be: "abc/def" */View Update Delete
202PHPFallunterscheidungTernary operator$testVar = "OK"; $resultVar; $resultVar = $testVar=="OK" ? true : false; // same as if-else construction if ($testVar == "OK") { $resultVar = true; } else { $resultVar = false; };View Update Delete