changed few things
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
from selenium import webdriver
|
||||
import time
|
||||
|
||||
url = 'https://protonmail.com/'
|
||||
|
||||
driver = webdriver.Chrome('/Users/olivierpartensky/Programs/Library/Selenium/chromedriver')
|
||||
driver.get(url)
|
||||
driver.find_element_by_xpath('//*[@title="Sign Up"]').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('panel-heading').click()
|
||||
time.sleep(4)
|
||||
driver.find_element_by_id('freePlan').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('username').send_keys('usernameForUser')
|
||||
time.sleep(1.5)
|
||||
driver.find_element_by_id('password').send_keys('passwordForUser')
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('passwordc').send_keys('passwordForUser')
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('signUpProcess-btn-create').click()
|
||||
time.sleep(1)
|
||||
driver.find_element_by_id('confirmModalBtn').click()
|
||||
def createMailAddress(adress,password):
|
||||
url = 'https://protonmail.com/'
|
||||
driver = webdriver.Chrome('/Users/olivierpartensky/Programs/Library/Selenium/chromedriver')
|
||||
driver.get(url)
|
||||
driver.find_element_by_xpath('//*[@title="Sign Up"]').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('panel-heading').click()
|
||||
time.sleep(4)
|
||||
driver.find_element_by_id('freePlan').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('username').send_keys(adress)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('password').send_keys(password)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('passwordc').send_keys(password)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('signUpProcess-btn-create').click()
|
||||
time.sleep(1)
|
||||
driver.find_element_by_id('confirmModalBtn').click()
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
from selenium import webdriver
|
||||
import time
|
||||
|
||||
def createMailAddress(adress,password):
|
||||
try:
|
||||
url = 'https://protonmail.com/'
|
||||
driver = webdriver.Chrome('/Users/olivierpartensky/Programs/Library/Selenium/chromedriver')
|
||||
driver.get(url)
|
||||
driver.find_element_by_xpath('//*[@title="Sign Up"]').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('panel-heading').click()
|
||||
time.sleep(4)
|
||||
driver.find_element_by_id('freePlan').click()
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('username').send_keys(adress)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('password').send_keys(password)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_id('passwordc').send_keys(password)
|
||||
time.sleep(2)
|
||||
driver.find_element_by_class_name('signUpProcess-btn-create').click()
|
||||
time.sleep(1)
|
||||
driver.find_element_by_id('confirmModalBtn').click()
|
||||
except:
|
||||
raise Exception("Failed to create email adress.")
|
||||
|
||||
|
||||
def sendEmail(subject,msg,receiver):
|
||||
try:
|
||||
server=smtplib.SMTP('smtp.gmail.com:587')
|
||||
server.ehlo()
|
||||
server.starttls()
|
||||
server.login(credentials.SENDER, credentials.PASSWORD)
|
||||
message = 'Subject: {}\n\n{}'.format(subject, msg)
|
||||
server.sendmail(credentials.SENDER, receiver, message)
|
||||
server.quit()
|
||||
print("Success: Email sent!")
|
||||
except:
|
||||
print("Email failed to send.")
|
||||
+308
@@ -0,0 +1,308 @@
|
||||
import inspect
|
||||
|
||||
|
||||
def test(arg1,arg2):
|
||||
a = arg1 + arg2
|
||||
return a
|
||||
|
||||
#do something with args
|
||||
|
||||
keywords=["assert","break","class","continue","def","del","elif","else","except","finally","for",
|
||||
"from","global","if","import","in","pass","print","raise","return","try","while","yield"]
|
||||
|
||||
conversion1 = {"assert":"ASSERT",
|
||||
"break":"SORTIR DE LA BOUCLE",
|
||||
"class":"CLASSE",
|
||||
"continue":"CONTINER",
|
||||
"def":"DONNEES",
|
||||
"del":"SUPPRIMER",
|
||||
"elif":["SINON SI","FAIRE"],
|
||||
"else":["SINON","FAIRE"],
|
||||
"except":"EXCEPTE",
|
||||
"finally":"FINALLEMENT",
|
||||
"for":["POUR","FAIRE"],
|
||||
"from":"DEPUIS",
|
||||
"global":"GLOBAL",
|
||||
"if":"SI",
|
||||
"import":"IMPORTER",
|
||||
"in":"DANS",
|
||||
"pass":"PASSER",
|
||||
"print":"AFFICHER",
|
||||
"raise":"RELEVER",
|
||||
"return":"AFFICHER",
|
||||
"try":"ESSAYER",
|
||||
"while":["TANT QUE","FAIRE"],
|
||||
"yield":"PASSER AU TOUR SUIVANT",
|
||||
"==":"=",
|
||||
"=":"<-"}
|
||||
|
||||
|
||||
|
||||
def algorithm(name):
|
||||
lines = inspect.getsource(name)
|
||||
print(lines)
|
||||
output = []
|
||||
lines = lines.split("\n")
|
||||
lines=removeUselessIndent(lines)
|
||||
lines=Converter(lines)
|
||||
for line in lines:
|
||||
output.append(Converter(line)())
|
||||
#print("output: ",output)
|
||||
return "\n".join(output)
|
||||
|
||||
|
||||
class Converter:
|
||||
def __init__(self,name):
|
||||
self.name=name
|
||||
self.code=inspect.getsource(name)
|
||||
print(self.code)
|
||||
self.lines=self.code.split("\n")
|
||||
self.indent_historic=[]
|
||||
self.indent=0
|
||||
self.cleanCode()
|
||||
|
||||
self.conversion= {"assert": [[None,"assert",None], [None,"ASSERT",None]],
|
||||
"break": [[None,"break"], [None,"SORTIR DE LA BOUCLE"]],
|
||||
"class": [["class",None], ["CLASS",None]],
|
||||
"continue": [[None,"continue",None], [None,"CONTINUER",None]],
|
||||
"def": [["def",None,"(",None,"):"], [None,":\nDONNES: ",None," :"]],
|
||||
"del": [[None,"del",None], [None,"SUPPRIMER",None]],
|
||||
"elif": [[None,"elif",None,":"], [None,"SINON SI",None," FAIRE"]],
|
||||
"else": [[None,"else:",None], [None,"SINON",None," FAIRE"]],
|
||||
"except": [[None,"except:",None], [None,"EXCEPTE",None]],
|
||||
"finally": [[None,"finally:",None], [None,"FINALLEMENT",None]],
|
||||
"for": [["for",None," in ",None,":"], ["POUR",None," DANS ",None," FAIRE"]],
|
||||
"from": [["from",None,"import",None], ["DEPUIS",None,"IMPORTER",None]],
|
||||
"global": [["global",None], ["GLOBAL",None]],
|
||||
"if": [[None,"if",None], [None,"SI",None]],
|
||||
"import": [[None,"import",None], [None,"IMPORTER",None]],
|
||||
" in ": [[None," in ",None], [None, "DANS ",None]],
|
||||
" is ": [[None," is ",None], [None," EST ",None]],
|
||||
"lambda": [[None,"lambda",None,":",None], [None,":\nDONNEES: ",None," :\nRENVOIE",None]],
|
||||
"pass": [[None,"pass"], [None,"PASSER",None]],
|
||||
"print": [[None,"print",None,"(",None,")"], [None,"AFFICHER: ",None,None]],
|
||||
"raise": [[None,"raise",None], [None,"RELEVER",None]],
|
||||
"return": [[None,"return",None], [None,"AFFICHER",None]],
|
||||
"try": [[None,"try:",None], [None,"ESSAYER",None]],
|
||||
"while": [["while ",None,":"], ["TANT QUE ",None," FAIRE"]],
|
||||
"yield": [[None,"yield"], [None,"PASSER AU TOUR SUIVANT"]],
|
||||
"True": [[None,"True",None], [None,"VRAI",None]],
|
||||
"False": [[None,"False",None], [None,"FAUX",None]],
|
||||
"==": [[None,"==",None], [None,"=",None]],
|
||||
"!=": [[None,"!=",None], [None,"≠",None]],
|
||||
"=": [[None,"=",None], [None," <- ",None]],
|
||||
"append": [[None,".append(",None,")"], ["AJOUTER A ",None," LA VALEUR ",None]],
|
||||
"not": [[None,"not",None], [None,"NON",None]]}
|
||||
|
||||
|
||||
def cleanCode(self):
|
||||
self.cleanIndents()
|
||||
|
||||
|
||||
def cleanIndents(self):
|
||||
self.line=self.lines[0]
|
||||
count=self.countIndent(self.line)
|
||||
for i in range(len(self.lines)):
|
||||
self.lines[i]=self.lines[i][4*count:]
|
||||
|
||||
def trackIndent(self,i):
|
||||
print(i)
|
||||
indent=self.countIndent(self.lines[i])
|
||||
if indent>len(self.indent_historic):
|
||||
self.addElementIndentHistoric(i)
|
||||
if indent<len(self.indent_historic):
|
||||
self.delElementIndentHistoric(i)
|
||||
print("i:",i)
|
||||
print("self.lines[i]:",self.lines[i])
|
||||
print("indent:",indent)
|
||||
print("historic:",self.indent_historic)
|
||||
print("")
|
||||
self.indent=indent
|
||||
self.removeIndent(i)
|
||||
|
||||
#self.indent_historic.append()
|
||||
|
||||
def addElementIndentHistoric(self,i):
|
||||
l={ " while ":" TANT QUE ",
|
||||
" for ": " POUR ",
|
||||
" if ": " SI "}
|
||||
for e in l:
|
||||
if e in self.lines[i]:
|
||||
self.indent_historic.append(l[e])
|
||||
print(self.lines[i])
|
||||
print(e)
|
||||
print(e in self.lines[i])
|
||||
|
||||
def delElementIndentHistoric(self,i):
|
||||
print(len(self.lines))
|
||||
print(i+1)
|
||||
self.lines[i]+="\n"+" "*4*(self.countIndent(self.lines[i+1])+1)+"FIN "+self.indent_historic[-1]
|
||||
del self.indent_historic[-1]
|
||||
|
||||
def countIndent(self,line):
|
||||
i=0
|
||||
for i in range(len(line)):
|
||||
if line[i]!=" ":
|
||||
break
|
||||
return int(i/4)
|
||||
|
||||
def removeIndent(self,i):
|
||||
count=self.countIndent(self.lines[i])
|
||||
self.line=self.line[count*4:]
|
||||
|
||||
def removeCommentaries(self):
|
||||
self.commentaries=""
|
||||
if "#" in self.line:
|
||||
i=self.next(self.line,"#")
|
||||
self.commentaries=self.line[i:]
|
||||
self.line=self.line[:i]
|
||||
if "\"\"\"" in self.line:
|
||||
i=self.next(self.line,"\"\"\"")
|
||||
self.commentaries=self.line[i:]
|
||||
self.line=self.line[:i]
|
||||
|
||||
def convert(self):
|
||||
breaking=False
|
||||
for key in self.conversion:
|
||||
if key=="==":
|
||||
breaking=True
|
||||
if key in self.line:
|
||||
self.apply(key)
|
||||
if breaking:
|
||||
break
|
||||
|
||||
def apply(self,key):
|
||||
#print("key:",key)
|
||||
l=self.missing(self.conversion[key][0])
|
||||
#print("l:",l)
|
||||
filled=self.fill(self.conversion[key][1],l)
|
||||
#print("filled:",filled)
|
||||
self.line="".join(filled)
|
||||
#print(self.line)
|
||||
|
||||
def missing(self,l):
|
||||
"""
|
||||
l= ["def ",None,"(",None,"):"]
|
||||
self.line= "def algorithm(name):"
|
||||
l1=["def","(","):"]
|
||||
"""
|
||||
line=[]
|
||||
if l[0]==None:
|
||||
i=self.next(self.line,l[1])
|
||||
line.append(self.line[:i])
|
||||
for i in range(1,len(l)-1):
|
||||
#print("missing loop:",l[i-1],l[i],l[i+1])
|
||||
if l[i]==None:
|
||||
a=self.between(self.line,l[i-1],l[i+1])
|
||||
line.append(a)
|
||||
#print("a",a)
|
||||
if l[-1]==None:
|
||||
i=self.next(self.line,l[-2])+len(l[-2])
|
||||
line.append(self.line[i:])
|
||||
return line
|
||||
|
||||
def removeNone(self,l):
|
||||
l1=[]
|
||||
for word in l:
|
||||
if word!=None:
|
||||
l1.append(word)
|
||||
return l1
|
||||
|
||||
def between(self,text,word1,word2):
|
||||
i1=self.next(text,word1)+len(word1)
|
||||
i2=i1+self.next(text[i1:],word2)
|
||||
return text[i1:i2]
|
||||
|
||||
def cut(self,text,word):
|
||||
for i in range(len(text)-len(word)+1):
|
||||
if text[i:i+len(word)]==word:
|
||||
break
|
||||
return [text[:i],word,text[i+len(word):]]
|
||||
|
||||
def next(self,text,word):
|
||||
for i in range(len(text)-len(word)+1):
|
||||
if text[i:i+len(word)]==word:
|
||||
break
|
||||
return i
|
||||
|
||||
def fill(self,l1,l2):
|
||||
line=[]
|
||||
for e1 in l1:
|
||||
if e1==None:
|
||||
line.append(l2[0])
|
||||
del l2[0]
|
||||
else:
|
||||
line.append(e1)
|
||||
return line
|
||||
|
||||
def assemble(self):
|
||||
pass
|
||||
|
||||
def __call__(self):
|
||||
for i in range(len(self.lines)):
|
||||
if i<len(self.lines)-1:
|
||||
self.trackIndent(i)
|
||||
self.indent=self.countIndent(self.lines[i])
|
||||
self.line=self.lines[i]
|
||||
self.removeCommentaries()
|
||||
self.convert()
|
||||
self.lines[i]= " "*4*self.indent+self.line+" "+self.commentaries
|
||||
self.cleanCode()
|
||||
|
||||
l1,l2=self.lines[0].split("\n")
|
||||
l1="ALGORITHME: "+l1.upper() +"\n\n"
|
||||
self.lines[0]=l1+l2
|
||||
return "\n".join(self.lines)
|
||||
|
||||
if __name__=="__main__":
|
||||
print(Converter(test)())
|
||||
#c=Converter("def test(arg1,arg2):")
|
||||
#print(c.between("def test(arg1,arg2):","(",")"))
|
||||
|
||||
|
||||
|
||||
from random import randint
|
||||
|
||||
#6b
|
||||
liste1=[]
|
||||
for i in range(50):
|
||||
liste1.append(randint(0,10))
|
||||
|
||||
|
||||
liste2=[randint(0,10) for i in range(50)]
|
||||
|
||||
#7b
|
||||
def Compter1(liste,valeur):
|
||||
compteur=0
|
||||
for element in liste:
|
||||
if element==valeur:
|
||||
compteur+=1
|
||||
return compteur
|
||||
|
||||
|
||||
Compter2=lambda liste,valeur:sum([element==valeur for element in liste])
|
||||
|
||||
#8b
|
||||
def Positionner(liste,valeur):
|
||||
positions=[]
|
||||
for i in range(liste):
|
||||
if liste[i]==valeur:
|
||||
positions.append(i)
|
||||
return positions
|
||||
|
||||
Positionner2=lambda liste,valeur:[n for n,element in enumerate(liste) if element==valeur]
|
||||
|
||||
def puissancede2(number):
|
||||
if number<2:
|
||||
return 0
|
||||
else:
|
||||
a=1
|
||||
while a*2<number:
|
||||
a*=2
|
||||
return a
|
||||
|
||||
#print(Converter(Positionner)())
|
||||
|
||||
|
||||
a=[1,2,3,5,1,3,5,4,4,2]
|
||||
print(puissancede2(4))
|
||||
Vendored
BIN
Binary file not shown.
+103
-7
@@ -11,10 +11,17 @@ Features:
|
||||
9: factoriser #renvoie str ou liste de liste des coefficients "pareil"
|
||||
10: racines reelles #renvoie liste des racines reelles
|
||||
11: racines complexes #renvoie liste des racines complexes
|
||||
12: Decomposition en éléments simples
|
||||
12: show #Affiche le polynome sur une fenetre pygame, pyglet ou matplotlib
|
||||
"""
|
||||
|
||||
from copy import deepcopy
|
||||
from mymaths.infinity import Infinity
|
||||
from mymaths.limit import lim
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from mygrapher.grapher import Grapher
|
||||
from mygrapher.mycolors import *
|
||||
|
||||
|
||||
class Polynomial:
|
||||
@@ -43,11 +50,13 @@ class Polynomial:
|
||||
|
||||
def __add__(self, other):
|
||||
"""Add 2 polynomials together by adding their coefficients."""
|
||||
maxdegree = max(self.degree(),other.degree())
|
||||
maxdegree = max(self.degree()+1,other.degree()+1)
|
||||
cA = self.adapt(self.coefficients,maxdegree)
|
||||
cB = self.adapt(other.coefficients,maxdegree)
|
||||
newcoefficients = [a+b for (a,b) in zip(cA, cB)]
|
||||
return Polynomial(newcoefficients)
|
||||
A=Polynomial(newcoefficients)
|
||||
A.correct()
|
||||
return A
|
||||
|
||||
def __sub__(self, other):
|
||||
"""Substract 2 polynomials together by multiplying the second polynomial by -1 and adding it to the first using add method."""
|
||||
@@ -143,8 +152,6 @@ class Polynomial:
|
||||
R0.correct()
|
||||
R1.correct()
|
||||
listR=[R0,R1]
|
||||
R2,Q2=R0/R1
|
||||
listR.append(R2)
|
||||
while listR[-1].degree()>0:
|
||||
R,Q=listR[-2]/listR[-1]
|
||||
listR.append(R)
|
||||
@@ -177,8 +184,6 @@ class Polynomial:
|
||||
C[-1] = R[-1]/B[-1]
|
||||
R = R-B*C
|
||||
Q = Q+C
|
||||
Q.correct()
|
||||
R.correct()
|
||||
return [R,Q]
|
||||
|
||||
#Ce que j'ai du faire pour trouver l'implementation...
|
||||
@@ -191,6 +196,94 @@ class Polynomial:
|
||||
|
||||
#5=8*0+5 cas particulier de la division euclidienne
|
||||
|
||||
def __call__(self,x):
|
||||
"""Evaluate the polynomial given an x value."""
|
||||
sum=0
|
||||
for n,c in enumerate(self.coefficients):
|
||||
sum+=c*x**n
|
||||
return sum
|
||||
|
||||
def getTrivialRoots(self):
|
||||
"""Return the list of trivial roots found."""
|
||||
l=[]
|
||||
for e in range(-10,11,1):
|
||||
if self(e)==0:
|
||||
l.append(e)
|
||||
return l
|
||||
|
||||
def roots(self):
|
||||
"""Return the list of all the roots of the polynomial."""
|
||||
#print("Trivial Roots:",self.getTrivialRoots())
|
||||
B=deepcopy(A)
|
||||
derivatives=[deepcopy(A)]
|
||||
roots=[]
|
||||
while B.degree()>1:
|
||||
B.derivate()
|
||||
derivatives.append(deepcopy(B))
|
||||
print(derivatives)
|
||||
derivatives.reverse()
|
||||
oldextrema=[]
|
||||
for derivative in derivatives:
|
||||
newextrema=[]
|
||||
neglim=lim(derivative,-Infinity())
|
||||
poslim=lim(derivative,Infinity())
|
||||
if type(neglim)==Infinity:
|
||||
neglim=~neglim
|
||||
if type(poslim)==Infinity:
|
||||
poslim=~poslim
|
||||
extrema=[neglim]+oldextrema+[poslim]
|
||||
for i in range(len(extrema)-1):
|
||||
print("extrema:",extrema[i],extrema[i+1])
|
||||
print("derivatives:",derivative(extrema[i]),derivative(extrema[i+1]))
|
||||
print("")
|
||||
if derivative(extrema[i])*derivative(extrema[i+1])<=0:
|
||||
newextrema.append(derivative.gradientDescent(extrema[i],extrema[i+1]))
|
||||
print("newextrema:",newextrema)
|
||||
print("")
|
||||
print("")
|
||||
oldextrema=newextrema[:]
|
||||
return newextrema
|
||||
|
||||
|
||||
|
||||
def gradientDescent(self,a,b,precision=10e-10):
|
||||
"""Return a int value x between a and b for which the polynomial canceled itself."""
|
||||
print("descent",self(a),self(b))
|
||||
if (self(a)>0 and self(b)>0) or (self(a)<0 and self(b)<0):
|
||||
raise Exception("The polynomial cannot cancel itself within this interval.")
|
||||
return None
|
||||
if a>b:
|
||||
c=a
|
||||
a=b
|
||||
b=c
|
||||
x=(a+b)/2
|
||||
while abs(self(x))>precision:
|
||||
print("descending:",x,self(x))
|
||||
if self(x)>0:
|
||||
b=x
|
||||
if self(x)<0:
|
||||
a=x
|
||||
x=(a+b)/2
|
||||
return x
|
||||
|
||||
|
||||
def _floordiv__(self,other):
|
||||
"""Return a string of the decomposition in simple elements of the polynomial."""
|
||||
pass
|
||||
|
||||
def show(self,zone=[-5,5],precision=0.1):
|
||||
"""Show the polynomial using matplotlib."""
|
||||
Grapher([self])()
|
||||
"""
|
||||
z,Z=zone
|
||||
X=list([precision*x for x in range(int(z/precision),int(Z/precision))])
|
||||
Y=list([self(x) for x in X])
|
||||
plt.plot(X,Y,label="Polynomial")
|
||||
plt.show()
|
||||
|
||||
print("executed")
|
||||
"""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
suite1 = [3,2,4,5,1]
|
||||
@@ -206,6 +299,9 @@ if __name__ == "__main__":
|
||||
print("A*B =",A*B)
|
||||
print("Derivative of A =",A.derivative())
|
||||
print("A/B :",A/B)
|
||||
print("Unit polynomial of C =",A.unit())
|
||||
print("Unit polynomial of C =",C.unit())
|
||||
print("HCF (PGCD en francais) of A and B (written A^B) =",A^B)
|
||||
print("LCM (PPCM en francais) of A and B (written A|B) =",A|B)
|
||||
#print(A.gradientDescent(-10,10))
|
||||
print(A.roots())
|
||||
A.show()
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import math
|
||||
|
||||
def mean(*args):
|
||||
l=allout(args)
|
||||
return sum([e for e in l])/len(l)
|
||||
|
||||
def prod(*args):
|
||||
l=allout(args)
|
||||
r=1
|
||||
for e in l:
|
||||
r*=e
|
||||
return r
|
||||
|
||||
def sum(*args):
|
||||
l=allout(args)
|
||||
r=0
|
||||
for e in l:
|
||||
r+=e
|
||||
return r
|
||||
|
||||
|
||||
sign=lambda x:x>=0
|
||||
|
||||
def sign2(x):
|
||||
if x>0:
|
||||
return 1
|
||||
elif x<0:
|
||||
return -1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def container(object):
|
||||
if type(object)==str:
|
||||
return False
|
||||
try:
|
||||
a=object[0]
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
"""
|
||||
def sum(*args):
|
||||
r=0
|
||||
for e in args:
|
||||
if container(e):
|
||||
for x in e:
|
||||
r+=sum(x)
|
||||
else:
|
||||
r+=e
|
||||
return r
|
||||
"""
|
||||
|
||||
def out(l):
|
||||
if container(l):
|
||||
r=[]
|
||||
for e2 in l:
|
||||
if container(e2):
|
||||
r+=e2
|
||||
else:
|
||||
r.append(e2)
|
||||
return r
|
||||
else:
|
||||
return l
|
||||
|
||||
def allout(l):
|
||||
if container(l):
|
||||
r=[]
|
||||
for e2 in l:
|
||||
if container(e2):
|
||||
r+=allout(e2)
|
||||
else:
|
||||
r.append(e2)
|
||||
return r
|
||||
else:
|
||||
return l
|
||||
|
||||
def analyse(l):
|
||||
r=[]
|
||||
if container(l):
|
||||
for e in l:
|
||||
r.append(analyse(e))
|
||||
else:
|
||||
r.append(type(l))
|
||||
return r
|
||||
|
||||
bijection=lambda x,i1,i2:(i2[1]-i2[0])/(i1[1]-i1[0])*(x-i1[0])+i2[0]
|
||||
|
||||
pi=PI=math.pi
|
||||
e=E=euler=math.e
|
||||
|
||||
if __name__=="__main__":
|
||||
l1=[1,[3,1],[1,2,[2,1]],3]
|
||||
l2=["12",["1","6"],"manger"]
|
||||
print(analyse(l2))
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,69 @@
|
||||
from infinity import Infinity
|
||||
|
||||
def pgcd(a,b):
|
||||
if b==0:
|
||||
return a
|
||||
else:
|
||||
r=a%b
|
||||
return pgcd(b,r)
|
||||
|
||||
sign=lambda x:(x>=0)
|
||||
|
||||
class Fraction:
|
||||
def __new__(self,*args):
|
||||
if len(args)==1:
|
||||
self.find(args)
|
||||
elif len(args)==2:
|
||||
if args[1]==0:
|
||||
if args[0]==0:
|
||||
raise Exception("Undetermined")
|
||||
if args[0]>0:
|
||||
return Infinity()
|
||||
if args[0]<0:
|
||||
return -Infinity()
|
||||
else:
|
||||
return self.__init__(self,args[0],args[1])
|
||||
|
||||
def __init__(self,numerator,denominator):
|
||||
self.numerator=numerator
|
||||
self.denominator=denominator
|
||||
self.simplify()
|
||||
|
||||
def __le__(self,other):
|
||||
if type(other):
|
||||
return False
|
||||
|
||||
def sign(self):
|
||||
if sign(self.numerator)!=sign(self.denominator):
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
||||
|
||||
def __mul__(self,other):
|
||||
if type(other)==int:
|
||||
self.numerator*=other
|
||||
if type(other)==Fraction:
|
||||
pass
|
||||
|
||||
def __add__(self):
|
||||
pass
|
||||
|
||||
def find(self,value):
|
||||
pass
|
||||
|
||||
def simplify(self):
|
||||
a=pgcd(self.numerator,self.denominator)
|
||||
self.numerator//=a
|
||||
self.denominator//=a
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
if abs(self.denominator==1):
|
||||
return str(sign(self))+str(self.numerator)
|
||||
return str(self.numerator)+"/"+str(self.denominator)
|
||||
|
||||
f=Fraction(-15,1)
|
||||
print(f)
|
||||
print(f.numerator,f.denominator)
|
||||
#print(f)
|
||||
@@ -0,0 +1,75 @@
|
||||
# coding: utf-8
|
||||
|
||||
sign=lambda x:(x>=0)
|
||||
|
||||
class Infinity:
|
||||
def __init__(self,sign=1):
|
||||
self.sign=sign
|
||||
def __ge__(self,other):
|
||||
if self.sign: return True
|
||||
else: return False
|
||||
def __gt__(self,other):
|
||||
if self.sign: return True
|
||||
else: return False
|
||||
def __le__(self,other):
|
||||
if self.sign: return False
|
||||
else: return True
|
||||
def __lt__(self,other):
|
||||
if self.sign: return False
|
||||
else: return True
|
||||
def __pos__(self):
|
||||
return self
|
||||
def __neg__(self):
|
||||
sign=(self.sign+1)%2
|
||||
return Infinity(sign)
|
||||
def __abs__(self):
|
||||
return Infinity()
|
||||
def __add__(self,other):
|
||||
return self
|
||||
def __sub__(self,other):
|
||||
return self
|
||||
def __pow__(self,other):
|
||||
if other==0:
|
||||
return 1
|
||||
if other<0:
|
||||
return 0
|
||||
if type(other)==Infinity:
|
||||
if other>0:
|
||||
return self
|
||||
else:
|
||||
return 0
|
||||
return self
|
||||
def __mul__(self,other):
|
||||
if other==0:
|
||||
raise Exception("Undetermined")
|
||||
return None
|
||||
else:
|
||||
if sign(other)!=sign(self):
|
||||
return Infinity(0)
|
||||
else:
|
||||
return Infinity(1)
|
||||
def __truediv__(self,other):
|
||||
if type(other)==Infinity:
|
||||
raise Exception("Undetermined")
|
||||
return None
|
||||
else:
|
||||
if sign(other)!=sign(self):
|
||||
return Infinity(0)
|
||||
else:
|
||||
return Infinity(1)
|
||||
def __repr__(self):
|
||||
if self.sign:
|
||||
sign="+"
|
||||
else:
|
||||
sign="-"
|
||||
#return (sign+"∞").encode("utf-8")
|
||||
return sign+"oo"
|
||||
def __invert__(self,value=10e10):
|
||||
if self>0: return value
|
||||
else: return -value
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
inf=Infinity()
|
||||
print(abs(inf)/inf)
|
||||
#print(-inf*4*inf*(-inf)+inf**(-inf))
|
||||
@@ -0,0 +1,16 @@
|
||||
from mymaths.infinity import Infinity
|
||||
|
||||
def lim(function,value):
|
||||
if type(value)==int:
|
||||
return function(value)
|
||||
if type(value)==Infinity:
|
||||
if value>=0:
|
||||
value=10e10
|
||||
else:
|
||||
value=-10e10
|
||||
if function(value)>10e5:
|
||||
return Infinity()
|
||||
elif function(value)<-10e5:
|
||||
return -Infinity()
|
||||
else:
|
||||
return function(value)
|
||||
@@ -0,0 +1,24 @@
|
||||
class Variable:
|
||||
def __init__(self,name="Unknown",content=[None]):
|
||||
self.name=name
|
||||
self.content=content
|
||||
def __add__(self,other):
|
||||
if type(other)==int:
|
||||
name=self.name+"+"+str(other)
|
||||
content=self.content+Variable(other,[other]).content
|
||||
return Variable(name,content)
|
||||
if type(other)==Variable:
|
||||
name=self.name+"+"+other.name
|
||||
content=self.content+other.content
|
||||
return Variable(name,content)
|
||||
def __repr__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
|
||||
x=Variable("x")
|
||||
y=Variable("y")
|
||||
z=Variable("z")
|
||||
print(x+z+1*4*23+1)
|
||||
|
||||
#print(1.__name__)
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/Python
|
||||
@@ -0,0 +1,78 @@
|
||||
# This file must be used with "source bin/activate" *from bash*
|
||||
# you cannot run it directly
|
||||
|
||||
deactivate () {
|
||||
unset -f pydoc >/dev/null 2>&1
|
||||
|
||||
# reset old environment variables
|
||||
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
|
||||
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
|
||||
PATH="$_OLD_VIRTUAL_PATH"
|
||||
export PATH
|
||||
unset _OLD_VIRTUAL_PATH
|
||||
fi
|
||||
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
|
||||
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
|
||||
export PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
fi
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
||||
|
||||
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
|
||||
PS1="$_OLD_VIRTUAL_PS1"
|
||||
export PS1
|
||||
unset _OLD_VIRTUAL_PS1
|
||||
fi
|
||||
|
||||
unset VIRTUAL_ENV
|
||||
if [ ! "${1-}" = "nondestructive" ] ; then
|
||||
# Self destruct!
|
||||
unset -f deactivate
|
||||
fi
|
||||
}
|
||||
|
||||
# unset irrelevant variables
|
||||
deactivate nondestructive
|
||||
|
||||
VIRTUAL_ENV="/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv"
|
||||
export VIRTUAL_ENV
|
||||
|
||||
_OLD_VIRTUAL_PATH="$PATH"
|
||||
PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
export PATH
|
||||
|
||||
# unset PYTHONHOME if set
|
||||
if ! [ -z "${PYTHONHOME+_}" ] ; then
|
||||
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
|
||||
unset PYTHONHOME
|
||||
fi
|
||||
|
||||
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
|
||||
_OLD_VIRTUAL_PS1="$PS1"
|
||||
if [ "x" != x ] ; then
|
||||
PS1="$PS1"
|
||||
else
|
||||
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
|
||||
fi
|
||||
export PS1
|
||||
fi
|
||||
|
||||
# Make sure to unalias pydoc if it's already there
|
||||
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
|
||||
|
||||
pydoc () {
|
||||
python -m pydoc "$@"
|
||||
}
|
||||
|
||||
# This should detect bash and zsh, which have a hash command that must
|
||||
# be called to get it to forget past commands. Without forgetting
|
||||
# past commands the $PATH changes we made may not be respected
|
||||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
||||
hash -r 2>/dev/null
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
# This file must be used with "source bin/activate.csh" *from csh*.
|
||||
# You cannot run it directly.
|
||||
# Created by Davide Di Blasi <davidedb@gmail.com>.
|
||||
|
||||
set newline='\
|
||||
'
|
||||
|
||||
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
|
||||
|
||||
# Unset irrelevant variables.
|
||||
deactivate nondestructive
|
||||
|
||||
setenv VIRTUAL_ENV "/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv"
|
||||
|
||||
set _OLD_VIRTUAL_PATH="$PATH:q"
|
||||
setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q"
|
||||
|
||||
|
||||
|
||||
if ("" != "") then
|
||||
set env_name = ""
|
||||
else
|
||||
set env_name = "$VIRTUAL_ENV:t:q"
|
||||
endif
|
||||
|
||||
# Could be in a non-interactive environment,
|
||||
# in which case, $prompt is undefined and we wouldn't
|
||||
# care about the prompt anyway.
|
||||
if ( $?prompt ) then
|
||||
set _OLD_VIRTUAL_PROMPT="$prompt:q"
|
||||
if ( "$prompt:q" =~ *"$newline:q"* ) then
|
||||
:
|
||||
else
|
||||
set prompt = "[$env_name:q] $prompt:q"
|
||||
endif
|
||||
endif
|
||||
|
||||
unset env_name
|
||||
|
||||
alias pydoc python -m pydoc
|
||||
|
||||
rehash
|
||||
@@ -0,0 +1,76 @@
|
||||
# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
|
||||
# Do not run it directly.
|
||||
|
||||
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
|
||||
# reset old environment variables
|
||||
if test -n "$_OLD_VIRTUAL_PATH"
|
||||
set -gx PATH $_OLD_VIRTUAL_PATH
|
||||
set -e _OLD_VIRTUAL_PATH
|
||||
end
|
||||
|
||||
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
|
||||
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
|
||||
set -e _OLD_VIRTUAL_PYTHONHOME
|
||||
end
|
||||
|
||||
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
|
||||
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
|
||||
set -l fish_function_path
|
||||
|
||||
# Erase virtualenv's `fish_prompt` and restore the original.
|
||||
functions -e fish_prompt
|
||||
functions -c _old_fish_prompt fish_prompt
|
||||
functions -e _old_fish_prompt
|
||||
set -e _OLD_FISH_PROMPT_OVERRIDE
|
||||
end
|
||||
|
||||
set -e VIRTUAL_ENV
|
||||
|
||||
if test "$argv[1]" != 'nondestructive'
|
||||
# Self-destruct!
|
||||
functions -e pydoc
|
||||
functions -e deactivate
|
||||
end
|
||||
end
|
||||
|
||||
# Unset irrelevant variables.
|
||||
deactivate nondestructive
|
||||
|
||||
set -gx VIRTUAL_ENV "/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv"
|
||||
|
||||
set -gx _OLD_VIRTUAL_PATH $PATH
|
||||
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
||||
|
||||
# Unset `$PYTHONHOME` if set.
|
||||
if set -q PYTHONHOME
|
||||
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
|
||||
set -e PYTHONHOME
|
||||
end
|
||||
|
||||
function pydoc
|
||||
python -m pydoc $argv
|
||||
end
|
||||
|
||||
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
|
||||
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
|
||||
functions -c fish_prompt _old_fish_prompt
|
||||
|
||||
function fish_prompt
|
||||
# Save the current $status, for fish_prompts that display it.
|
||||
set -l old_status $status
|
||||
|
||||
# Prompt override provided?
|
||||
# If not, just prepend the environment name.
|
||||
if test -n ""
|
||||
printf '%s%s' "" (set_color normal)
|
||||
else
|
||||
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
|
||||
end
|
||||
|
||||
# Restore the original $status
|
||||
echo "exit $old_status" | source
|
||||
_old_fish_prompt
|
||||
end
|
||||
|
||||
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
|
||||
end
|
||||
@@ -0,0 +1,150 @@
|
||||
# This file must be dot sourced from PoSh; you cannot run it
|
||||
# directly. Do this: . ./activate.ps1
|
||||
|
||||
# FIXME: clean up unused vars.
|
||||
$script:THIS_PATH = $myinvocation.mycommand.path
|
||||
$script:BASE_DIR = split-path (resolve-path "$THIS_PATH/..") -Parent
|
||||
$script:DIR_NAME = split-path $BASE_DIR -Leaf
|
||||
|
||||
function global:deactivate ( [switch] $NonDestructive ){
|
||||
|
||||
if ( test-path variable:_OLD_VIRTUAL_PATH ) {
|
||||
$env:PATH = $variable:_OLD_VIRTUAL_PATH
|
||||
remove-variable "_OLD_VIRTUAL_PATH" -scope global
|
||||
}
|
||||
|
||||
if ( test-path function:_old_virtual_prompt ) {
|
||||
$function:prompt = $function:_old_virtual_prompt
|
||||
remove-item function:\_old_virtual_prompt
|
||||
}
|
||||
|
||||
if ($env:VIRTUAL_ENV) {
|
||||
$old_env = split-path $env:VIRTUAL_ENV -leaf
|
||||
remove-item env:VIRTUAL_ENV -erroraction silentlycontinue
|
||||
}
|
||||
|
||||
if ( !$NonDestructive ) {
|
||||
# Self destruct!
|
||||
remove-item function:deactivate
|
||||
}
|
||||
}
|
||||
|
||||
# unset irrelevant variables
|
||||
deactivate -nondestructive
|
||||
|
||||
$VIRTUAL_ENV = $BASE_DIR
|
||||
$env:VIRTUAL_ENV = $VIRTUAL_ENV
|
||||
|
||||
$global:_OLD_VIRTUAL_PATH = $env:PATH
|
||||
$env:PATH = "$env:VIRTUAL_ENV/bin:" + $env:PATH
|
||||
if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
||||
function global:_old_virtual_prompt { "" }
|
||||
$function:_old_virtual_prompt = $function:prompt
|
||||
function global:prompt {
|
||||
# Add a prefix to the current prompt, but don't discard it.
|
||||
write-host "($(split-path $env:VIRTUAL_ENV -leaf)) " -nonewline
|
||||
& $function:_old_virtual_prompt
|
||||
}
|
||||
}
|
||||
|
||||
# SIG # Begin signature block
|
||||
# MIISeAYJKoZIhvcNAQcCoIISaTCCEmUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
|
||||
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
|
||||
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUS5reBwSg3zOUwhXf2jPChZzf
|
||||
# yPmggg6tMIIGcDCCBFigAwIBAgIBJDANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQG
|
||||
# EwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERp
|
||||
# Z2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2Vy
|
||||
# dGlmaWNhdGlvbiBBdX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aGZ6cMSd8db3EaG3ijD/0bud
|
||||
# SItbm/OlNVbQOFRR76D+ZNgPcU5iNZ3bmvQQIg6aSB9MHUpIE/SeCkNl9YeVk1/1
|
||||
# GFULgNMRmIYP4KLvu9ylh5Gu3hvD5VNhH6+FlXANwFy07uXks5uF8mfZVxVCnodG
|
||||
# xkNCx+6PsrA5Z7WP4pXcmYnMn97npP/Q9EHJWw==
|
||||
# SIG # End signature block
|
||||
@@ -0,0 +1,36 @@
|
||||
"""By using execfile(this_file, dict(__file__=this_file)) you will
|
||||
activate this virtualenv environment.
|
||||
|
||||
This can be used when you must use an existing Python interpreter, not
|
||||
the virtualenv bin/python
|
||||
"""
|
||||
|
||||
try:
|
||||
__file__
|
||||
except NameError:
|
||||
raise AssertionError(
|
||||
"You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))"
|
||||
)
|
||||
import os
|
||||
import site
|
||||
import sys
|
||||
|
||||
old_os_path = os.environ.get("PATH", "")
|
||||
os.environ["PATH"] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path
|
||||
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if sys.platform == "win32":
|
||||
site_packages = os.path.join(base, "Lib", "site-packages")
|
||||
else:
|
||||
site_packages = os.path.join(base, "lib", "python%s" % sys.version[:3], "site-packages")
|
||||
prev_sys_path = list(sys.path)
|
||||
|
||||
site.addsitedir(site_packages)
|
||||
sys.real_prefix = sys.prefix
|
||||
sys.prefix = base
|
||||
# Move the added items to the front of the path:
|
||||
new_sys_path = []
|
||||
for item in list(sys.path):
|
||||
if item not in prev_sys_path:
|
||||
new_sys_path.append(item)
|
||||
sys.path.remove(item)
|
||||
sys.path[:0] = new_sys_path
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from setuptools.command.easy_install import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from setuptools.command.easy_install import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from pip._internal import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from pip._internal import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from pip._internal import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
python3.7
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python
|
||||
|
||||
import sys
|
||||
import getopt
|
||||
import sysconfig
|
||||
|
||||
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
|
||||
'ldflags', 'help']
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
valid_opts.insert(-1, 'extension-suffix')
|
||||
valid_opts.append('abiflags')
|
||||
if sys.version_info >= (3, 3):
|
||||
valid_opts.append('configdir')
|
||||
|
||||
|
||||
def exit_with_usage(code=1):
|
||||
sys.stderr.write("Usage: {0} [{1}]\n".format(
|
||||
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)))
|
||||
sys.exit(code)
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
|
||||
except getopt.error:
|
||||
exit_with_usage()
|
||||
|
||||
if not opts:
|
||||
exit_with_usage()
|
||||
|
||||
pyver = sysconfig.get_config_var('VERSION')
|
||||
getvar = sysconfig.get_config_var
|
||||
|
||||
opt_flags = [flag for (flag, val) in opts]
|
||||
|
||||
if '--help' in opt_flags:
|
||||
exit_with_usage(code=0)
|
||||
|
||||
for opt in opt_flags:
|
||||
if opt == '--prefix':
|
||||
print(sysconfig.get_config_var('prefix'))
|
||||
|
||||
elif opt == '--exec-prefix':
|
||||
print(sysconfig.get_config_var('exec_prefix'))
|
||||
|
||||
elif opt in ('--includes', '--cflags'):
|
||||
flags = ['-I' + sysconfig.get_path('include'),
|
||||
'-I' + sysconfig.get_path('platinclude')]
|
||||
if opt == '--cflags':
|
||||
flags.extend(getvar('CFLAGS').split())
|
||||
print(' '.join(flags))
|
||||
|
||||
elif opt in ('--libs', '--ldflags'):
|
||||
abiflags = getattr(sys, 'abiflags', '')
|
||||
libs = ['-lpython' + pyver + abiflags]
|
||||
libs += getvar('LIBS').split()
|
||||
libs += getvar('SYSLIBS').split()
|
||||
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
||||
# shared library in prefix/lib/.
|
||||
if opt == '--ldflags':
|
||||
if not getvar('Py_ENABLE_SHARED'):
|
||||
libs.insert(0, '-L' + getvar('LIBPL'))
|
||||
if not getvar('PYTHONFRAMEWORK'):
|
||||
libs.extend(getvar('LINKFORSHARED').split())
|
||||
print(' '.join(libs))
|
||||
|
||||
elif opt == '--extension-suffix':
|
||||
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
if ext_suffix is None:
|
||||
ext_suffix = sysconfig.get_config_var('SO')
|
||||
print(ext_suffix)
|
||||
|
||||
elif opt == '--abiflags':
|
||||
if not getattr(sys, 'abiflags', None):
|
||||
exit_with_usage()
|
||||
print(sys.abiflags)
|
||||
|
||||
elif opt == '--configdir':
|
||||
print(sysconfig.get_config_var('LIBPL'))
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
python3.7
|
||||
Executable
BIN
Binary file not shown.
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/Users/olivierpartensky/Programs/Python/Repository-2019/Teletype/venv/bin/python3.7
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
|
||||
from wheel.cli import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/__future__.py
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_bootlocale.py
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_dummy_thread.py
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_weakrefset.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/abc.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/base64.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/bisect.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/collections
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/copy.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/copyreg.py
|
||||
@@ -0,0 +1,116 @@
|
||||
import imp
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
# opcode is not a virtualenv module, so we can use it to find the stdlib
|
||||
# Important! To work on pypy, this must be a module that resides in the
|
||||
# lib-python/modified-x.y.z directory
|
||||
import opcode
|
||||
|
||||
dirname = os.path.dirname
|
||||
|
||||
distutils_path = os.path.join(os.path.dirname(opcode.__file__), "distutils")
|
||||
if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
|
||||
warnings.warn("The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
|
||||
else:
|
||||
__path__.insert(0, distutils_path) # noqa: F821
|
||||
real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ("", "", imp.PKG_DIRECTORY))
|
||||
# Copy the relevant attributes
|
||||
try:
|
||||
__revision__ = real_distutils.__revision__
|
||||
except AttributeError:
|
||||
pass
|
||||
__version__ = real_distutils.__version__
|
||||
|
||||
from distutils import dist, sysconfig # isort:skip
|
||||
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
basestring = str
|
||||
|
||||
# patch build_ext (distutils doesn't know how to get the libs directory
|
||||
# path on windows - it hardcodes the paths around the patched sys.prefix)
|
||||
|
||||
if sys.platform == "win32":
|
||||
from distutils.command.build_ext import build_ext as old_build_ext
|
||||
|
||||
class build_ext(old_build_ext):
|
||||
def finalize_options(self):
|
||||
if self.library_dirs is None:
|
||||
self.library_dirs = []
|
||||
elif isinstance(self.library_dirs, basestring):
|
||||
self.library_dirs = self.library_dirs.split(os.pathsep)
|
||||
|
||||
self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
|
||||
old_build_ext.finalize_options(self)
|
||||
|
||||
from distutils.command import build_ext as build_ext_module
|
||||
|
||||
build_ext_module.build_ext = build_ext
|
||||
|
||||
# distutils.dist patches:
|
||||
|
||||
old_find_config_files = dist.Distribution.find_config_files
|
||||
|
||||
|
||||
def find_config_files(self):
|
||||
found = old_find_config_files(self)
|
||||
if os.name == "posix":
|
||||
user_filename = ".pydistutils.cfg"
|
||||
else:
|
||||
user_filename = "pydistutils.cfg"
|
||||
user_filename = os.path.join(sys.prefix, user_filename)
|
||||
if os.path.isfile(user_filename):
|
||||
for item in list(found):
|
||||
if item.endswith("pydistutils.cfg"):
|
||||
found.remove(item)
|
||||
found.append(user_filename)
|
||||
return found
|
||||
|
||||
|
||||
dist.Distribution.find_config_files = find_config_files
|
||||
|
||||
# distutils.sysconfig patches:
|
||||
|
||||
old_get_python_inc = sysconfig.get_python_inc
|
||||
|
||||
|
||||
def sysconfig_get_python_inc(plat_specific=0, prefix=None):
|
||||
if prefix is None:
|
||||
prefix = sys.real_prefix
|
||||
return old_get_python_inc(plat_specific, prefix)
|
||||
|
||||
|
||||
sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__
|
||||
sysconfig.get_python_inc = sysconfig_get_python_inc
|
||||
|
||||
old_get_python_lib = sysconfig.get_python_lib
|
||||
|
||||
|
||||
def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
|
||||
if standard_lib and prefix is None:
|
||||
prefix = sys.real_prefix
|
||||
return old_get_python_lib(plat_specific, standard_lib, prefix)
|
||||
|
||||
|
||||
sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__
|
||||
sysconfig.get_python_lib = sysconfig_get_python_lib
|
||||
|
||||
old_get_config_vars = sysconfig.get_config_vars
|
||||
|
||||
|
||||
def sysconfig_get_config_vars(*args):
|
||||
real_vars = old_get_config_vars(*args)
|
||||
if sys.platform == "win32":
|
||||
lib_dir = os.path.join(sys.real_prefix, "libs")
|
||||
if isinstance(real_vars, dict) and "LIBDIR" not in real_vars:
|
||||
real_vars["LIBDIR"] = lib_dir # asked for all
|
||||
elif isinstance(real_vars, list) and "LIBDIR" in args:
|
||||
real_vars = real_vars + [lib_dir] # asked for list
|
||||
return real_vars
|
||||
|
||||
|
||||
sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__
|
||||
sysconfig.get_config_vars = sysconfig_get_config_vars
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
# This is a config file local to this virtualenv installation
|
||||
# You may include options that will be used by all distutils commands,
|
||||
# and by easy_install. For instance:
|
||||
#
|
||||
# [easy_install]
|
||||
# find_links = http://mylocalsite
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/encodings
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/enum.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/fnmatch.py
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/functools.py
|
||||
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/genericpath.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/hashlib.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/heapq.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/hmac.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/io.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/keyword.py
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user