Advertisement
johnmahugu

python - Clear ones contact history in Skype

Jul 8th, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. '''
  2. python - Clear ones contact history in Skype
  3. The Python/Pywin32 Script collection - Other
  4.  
  5. This simple script enables you to delete one contact history from your Skype local database.
  6. Let's say your contact display name in Skype is 'Roger G'.
  7. I'm using vacuum statement to compact database, I believe it's more secure that way.
  8. '''
  9.  
  10. import sqlite3
  11.  
  12. conn = sqlite3.connect('C:\\Users\\your_user_name\\AppData\\Roaming\\Skype\\skype_account_name\\main.db')
  13. c = conn.cursor()
  14.  
  15. c.execute("SELECT DISTINCT convo_id FROM Messages WHERE from_dispname = 'Roger G';")
  16. result = c.fetchone()
  17. if result is not None:
  18.     convo_id = int(result[0])
  19.     c.execute("DELETE FROM Messages where convo_id = {}".format(convo_id))
  20.     deleted = int(conn.total_changes)
  21.     print("Deleted: {}".format(deleted))
  22.     c.execute("VACUUM;")
  23.     print("Vacuumed...")
  24. conn.close()
  25. print("Finished")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement