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 signal | |
from functools import wraps | |
import errno | |
import os | |
import time | |
import traceback | |
''' | |
Usage example: |
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 smtplib | |
def sendemail(from_addr, to_addr_list, cc_addr_list, | |
subject, message, | |
login, password, | |
smtpserver='smtp.gmail.com:587'): | |
header = 'From: %s\n' % from_addr | |
header += 'To: %s\n' % ','.join(to_addr_list) | |
header += 'Cc: %s\n' % ','.join(cc_addr_list) |
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 random import random | |
from kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.uix.button import Button | |
from kivy.graphics import Color, Ellipse, Line | |
class MyPaintWidget(Widget): | |
def on_touch_down(self, touch): |
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
#!/usr/bin/env python | |
from os import rename, listdir | |
badprefix = "prefix_" | |
fnames = listdir('C:\\Users\\User\\Downloads') | |
dir = "C:\\Users\\User\\Downloads" | |
for fname in fnames: | |
#print(fname) | |
if fname.startswith(badprefix): |
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 unittest | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.common.exceptions import NoSuchElementException | |
import os | |
chromedriver = "D:\\chromedriver.exe" | |
os.environ["webdriver.chrome.driver"] = chromedriver | |
class CS(unittest.TestCase): |
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
print (" __ __ __ __ ") | |
print (" / \ / \ / \ / \ ") | |
print ("________/ __\/ __\/ __\/ __\__________") | |
print ("_______/ /__/ /__/ /__/ /_____________") | |
print (" | / \ / \ / \ / \ \___ ") | |
print (" |/ \_/ \_/ \_/ \ o \ ") | |
print (" \_____/--< ") |
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
#!/usr/bin/env python | |
from os import rename, listdir | |
import xlrd | |
rb = xlrd.open_workbook('C:\\Users\\IEUser\\Downloads\\test.xlsx',formatting_info=False) | |
sheet = rb.sheet_by_index(0) | |
for rownum in range(sheet.nrows): | |
row = sheet.row_values(rownum) | |
for c_el in row: | |
if type(c_el) is float: |
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 selenium import webdriver | |
from selenium.webdriver.common.by import By | |
import time | |
driver = webdriver.Ie() | |
driver.get("https://www.download.com") | |
print("download") | |
driver.set_page_load_timeout(10) | |
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
def csv_get_image(self, file): | |
image_arr = [] | |
fi = open(file, 'rb') | |
data = fi.read() | |
fi.close() | |
fo = open(file, 'wb') | |
fo.write(data.replace('\x00', '')) | |
#fo.write(data.replace('0xff', '')) | |
fo.close() |
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 replace(self, file_from, file_to): | |
data = open(file_from, 'rb') | |
res = open(file_to, 'wb') | |
for line in data: | |
res.write(line.replace('"', '\'')) |
OlderNewer