This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from smtplib import SMTPException | |
from email.utils import COMMASPACE | |
import smtplib | |
_default_address = ['[email protected]'] | |
def SendGmail(subject, body, to_addresses=_default_address, | |
from_address='[email protected]', debug=False): | |
email_header = "From: My Server <[email protected]>\n" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from smtplib import SMTP | |
from smtplib import SMTPException | |
from mimetypes import guess_type | |
from os.path import basename | |
from email.utils import COMMASPACE | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.base import MIMEBase | |
from email.encoders import encode_base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Thread | |
# from redisutils import redis_connect | |
import redis | |
import wx | |
########################################################################### | |
## Class Listener | |
########################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
def check_net(address='google.com', debug=False): | |
""" | |
Checks if internet connection to address given is valid and working | |
Defaults to using 'google.com' in an event nothing is passed | |
Returns : True if resolved and False if not resolved | |
""" | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target photoshop | |
// $.level = 2; | |
/* | |
* Script by Tomek Cejner (tomek (at) japko dot info) | |
* based on work of Damien van Holten: | |
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/ | |
* | |
* My version adds support of nested layer groups, | |
* and exports single layers in addition to groups. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def listLocation(root_location,files = [],folders = []): | |
""" A recursive function to get directory content into arrays | |
Usage : x,y = listLocation(directory/path) | |
Returns 2 arrays 1 files array and 1 folders array """ | |
for eachitem in os.listdir(root_location): | |
filePath = os.path.join(root_location,eachitem) | |
if os.path.isdir(filePath) and not eachitem.startswith('.'): | |
folders.append(filePath) | |
listLocation(filePath,files,folders) | |
elif os.path.isfile(filePath) and not eachitem.startswith('.'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'kumar' | |
from bs4 import BeautifulSoup | |
import requests | |
page = requests.get('http://www.imdb.com/chart/?ref_=nv_ch_cht_2%3F') | |
soup = BeautifulSoup(page.text) | |
for x in soup.find_all('td', {"class": "ratingColumn"}): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In[5]: | |
x = [[ 795. , 501.0292887 ], | |
[ 794.97154472, 501. ], | |
[ 794.96078431, 500. ], | |
[ 795. , 499.09090909], | |
[ 795.03921569, 500. ], | |
[ 795.02777778, 501. ], | |
[ 795. , 501.0292887 ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from platform import system | |
from os import stat | |
from os.path import basename, splitext, dirname, split as splitpath, \ | |
join as joinpath | |
from datetime import datetime | |
from glob import glob | |
import hashlib | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import copy | |
import subprocess as sp | |
zip_cmd = ['zip', '-r', '-9', '-T'] | |
lwza_cmd = ['7za', 'a', '-t7z', '-mx9', '-v2g'] | |
def loadExcludedListFromPath(path): | |
excludedList = list() | |
for afile in os.listdir(path): |
OlderNewer