#!/usr/bin/env python
import os, sys, time
from datetime import timedelta, datetime
totalFiles1 = 0;
totalFilesSize1 = 0;
totalFiles2 = 0;
totalFilesSize2 = 0;
days = 0;
daysts = 0;
def checkModificationDates(path):
global totalFiles1, totalFilesSize1,totalFiles2, totalFilesSize2, days, daysts
totalsize1 = float();
files1 = 0;
totalsize2 = float();
files2 = 0;
for directory, subdirectories, filenames in os.walk(path):
for filename in
Read more [...]
Posted in Python | No Comments »
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3 as lite
import os, csv, sys, subprocess, hashlib, time
from datetime import timedelta, datetime, tzinfo
import platform
con = lite.connect('files.db')
con.text_factory = str
with con:
for directory, subdirectories, filenames in os.walk('.'):
print(directory);
cur = con.cursor()
cur.execute("SELECT * FROM data where path=:directory COLLATE NOCASE", {"directory":directory})
con.commit()
Read more [...]
Posted in Python | No Comments »
#!/usr/bin/env python
import os, csv, sys, subprocess, hashlib, time, pytz
from datetime import timedelta, datetime, tzinfo
import pytz
import tzlocal
writer = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL)
il = pytz.timezone('Israel')
local_timezone = tzlocal.get_localzone() # get pytz timezone
with open('file.csv', 'w', newline='', encoding='utf-8') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=',',
quotechar='"', quoting=csv.QUOTE_MINIMAL)
for directory,
Read more [...]
Posted in Python | No Comments »