Rolly Maulana Awangga :: Catatan Ngoprek IT

Pakar dan Awam sama saja, sama sama belajar

Tag Archives: Python

Python Outlook(Microsoft email service) IMAP4 Library

Python Library to read email from live, hotmail, outlook or any microsoft email service, just dowload to yout python script folder. This library using Imaplib python to read email with IMAP protocol.

go here :


To get latest Unread Message in inbox :

import outlook
mail = outlook.Outlook()
print mail.unread()

To get latest Unread Message in Junk :

import outlook
mail = outlook.Outlook()
print mail.unread()

Retrive email element :

print mail.mailbody()
print mail.mailsubject()
print mail.mailfrom()
print mail.mailto()

Python Beginner : Mysql Query

Start with this tutorials

i create script

import MySQLdb
import gc

db = MySQLdb.connect(host=”localhost”, # your host, usually localhost
user=”user”, # your username
passwd=”password”, # your password
db=”db”) # name of the data base

# you must create a Cursor object. It will let
# you execute all the queries you need
cur = db.cursor()

# Use all the SQL you like
cur.execute(“SELECT * FROM db where status=3”)

id_ref = hasil[0]
timestamp_req = hasil[1]
file_path = hasil[2]
status = hasil[3]
secret_code = hasil[4]
id_user = hasil[5]
id_user_acc = hasil[6]
timestamp_acc = hasil[7]
message = hasil[8]
tahun = hasil[9]

print file_path
print “perintah untuk pengambilan data db sudah ok”

%d blogger menyukai ini: