I write a python code to check mysql service open or close. It is simple and you can change service_name parameter in the code to check another services. You can download from here check_service_status.py Below code maybe can not run because of python language format is tab structure. You can use with download original code…
Tag: Python
Python Commands and Functions
Take value from user. input(“Enter a number : “) raw_input(“Enter a character : “) Counters range(100) # write from 0 to 100 range(100,200) # write from 100 to 200 range(100,200,2) # write from 100 to 200 as 2 by 2 len(“Fatih”) # character count result 5 File and Directory Operations listdir(“/home”/) # list all file…
Mail Send With Python
Mail Send Function | File name : sender.py import string import smtplib from email.mime.text import MIMEText def mailSend(subject,content): mailserver = “192.168.5.2” # Mail Server IP Address mail = MIMEText(content) mail[“From”] = “fromaddress@example.com” mail[“To”] = “toaddress@example.com” mail[“Subject”] = subject gonder = smtplib.SMTP(mailserver) gonder.sendmail(mailfrom,mailto,mail.as_string()) gonder.quit() Notification Example for Disk Status Check | File name : diskcheck.py from…
Python Programing Language Structure
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming styles. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl. Like other dynamic languages, Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts….