Python – Decision generator


[code] #!/usr/bin/python # Kenneth Holmqvist 2014 # kholmqvist88@gmail.com # Hvad siger Kenneth # Version 0.1 ########################## import random, time class magickanswer: def magic(self): number = random.randrange(0,3,1); return number; def answer(): generate = magickanswer(); n = generate.magic(); options = [“Yes”,”No”,”Maybe”]; print “Kenneth says: %s” % options[n]; count = 0; while count < 3: answer(); time.sleep(1); count

Python – NCP Mount, Rsync


[code] #!/usr/bin/python # Kenneth Holmqvist 2014 # kholmqvist88@gmail.com # Use this script to rsync folders from source to destination # and receive an email with the output. # Version 0.1 ########################## import smtplib, subprocess, argparse, time; class Email(object): def __init__(self, smtp_server, port, ssl, username, password, to, subject, message): self.smtp_server = smtp_server; self.port = int(port); self.ssl