This file contains hidden or 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 queue import Empty, Queue | |
import subprocess | |
import sys | |
import threading | |
if sys.version[0] > '2': | |
import tkinter | |
else: | |
import Tkinter as tkinter |
This file contains hidden or 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 conc(text): | |
return ''.join(c.split('(')[0]+c.split('(')[1][::-1] | |
if '(' in c | |
else c | |
for c in text.split(')')) | |
print(conc('(ur)ss(ai)(edocn)c(pu)')) |
This file contains hidden or 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 python3 | |
import tkinter as tk | |
import tkinter.ttk as ttk | |
from threading import Thread | |
import socket | |
PORT=1235 | |
root = tk.Tk() | |
root.title('QIP 0.0') |
This file contains hidden or 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
# параметр сглаживания | |
a = 1/100 | |
# аппроксимация модуля | |
ma = (a + x^2)^(1/2) | |
# выражение максимума через модуль | |
var('xm1 xm2') | |
xmax=1/2*(ma(xm1-xm2) + xm1 + xm2) | |
var_names = 'x1 x2 x3 x4' | |
args = var(var_names) |
This file contains hidden or 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/python3 | |
#Grabbing pics from nightmaresfearfactory galleries | |
import re, sys, os | |
import concurrent.futures | |
import urllib.request | |
sfolder = 'pics' | |
os.makedirs(sfolder,exist_ok=True) | |
os.chdir(sfolder) |
This file contains hidden or 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; print sum(len(f) for _,_,f in os.walk(".")) |
This file contains hidden or 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
class AssignOnce: | |
''' Descriptor, which prevents accidential overwriting of attributes: | |
>>> class T: | |
... a = AssignOnce('a') | |
... | |
>>> t = T() | |
>>> t.a | |
>>> t.a = 3 | |
>>> t.a = 4 | |
Traceback (most recent call last): |
This file contains hidden or 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/python | |
''' | |
BeautifulSoup is required: | |
http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.1.tar.gz | |
''' | |
from BeautifulSoup import BeautifulSoup as soup | |
from urllib import urlopen as uopen, urlretrieve | |
import re, os, errno, subprocess as sp, threading | |
from time import sleep | |
from urlparse import urljoin |
NewerOlder