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 11-20 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
18CachéTextdateienTextdatei zeilenweise auslesen Set stream=##class(%FileCharacterStream).%New() Set stream.Filename="c:\myfile.txt" While 'stream.AtEnd { Set line=stream.ReadLine() ; Process the line here }View Update Delete
129Bash ScriptVariablenWert einer Variable zuweisen# Aktuelles Verzeichnis in einer Variable setzen mydir="Mein Verzeichnis lautet $PWD" echo $mydirView Update Delete
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
267PowerShellArrayDictionary Basics# empty Hashtable $myDict = @{} # some static values $myDict.Add("key1", "value1") $myDict.Add("key2", "valueY") $myDict.Add("keyX", "value98") # update a key programmatically $myDict.Remove("key1") $myDict.Add("key1", "new value") # iterate Foreach ($key in $myDict.keys) { $strKey = $key $strValue = $Parameter[$key] } # Exists If ($myDict.ContainsKey("key1") -eq $true) { write-host "yes" } # get an specific item $subdict = $myDict("key2") # valueYView Update Delete
76PythonNetzwerk, EmailEmail versenden# Found at (and little modified): http://www.semi-legitimate.com/sls/blog/37-quick-notes/62-command-line-smtp-from-python #!/usr/bin/python import smtplib, sys if len(sys.argv) != 5: print "You must call me like:" print " mailme from to subject msgfile" sys.exit() fromadr = sys.argv[1] toadr = sys.argv[2] subject = sys.argv[3] msgfile = sys.argv[4] try: f = open(msgfile) msg = f.read() except: print "Invalid Message File: " + msgfile sys.exit() m = "From: %s To: %s Subject: %s X-Mailer: My-Mail " \ % (fromadr, toadr, subject) smtpserver="mysmtp.lan" loginuser="Marty_McFly" loginpwd="DeLorean" smtp = smtplib.SMTP() smtp.connect(smtpserver) smtp.login(loginuser, loginpwd) smtp.ehlo() smtp.sendmail(fromadr, toadr, m+msg) smtp.close() View Update Delete
176Bash ScriptFilehandlingPrüfen ob Datei existiert# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#If-Else-Anweisung #!/bin/bash filePath="/home/myUser/test.txt" if [ -f ${filePath} ] then echo "There it is! ;-)" else echo "Whow, file is missing at this place :-(" fiView Update Delete
174Bash ScriptStringsStrings miteinander verbinden# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#Variablen-abgrenzen #!/bin/bash subString1="Hello" subString2='World!' echo "${subString1} ${subString2}" Hello World! echo "${subString1} ${subString2}. I'm in here ;-)" # Hello World!. I'm in here ;-)View Update Delete
175Bash ScriptFilehandlingVerzeichnis rekursiv durchsuchen# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#Variablen-Teil-2 #!/bin/bash for file in /home/myUser/*/*.png ; do echo "Diese Datei: $file" fname=$(basename "$file") echo "hat den Namen: $fname" fdir=$(dirname "$file") echo "und steht im Verzeichnis: $fdir" # Diese Datei: /home/myUser/galaxy.png # hat den Namen: galaxy.png # und steht im Verzeichnis: /home/myUser 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
215PythonStringsReplace# http://www.tutorialspoint.com/python/string_replace.htm str1 = "abc#def" str1 = str1.replace("#",';") print str1 # Output: abc;defView Update Delete