Re: Python 2 EOL; what about P2 packages

2019-05-12 Thread Dietmar Schwertberger
On 12.05.2019 16:38, GerritM wrote: Any suggestions how to port to Python 3, when using Python 2 only packages? You need to decide for each package whether to port it or to replace it. HTMLgen is probably a pure Python package. It should not be too hard to port it to Python 3 yourself. At t

Re: Python 2 EOL; what about P2 packages

2019-05-12 Thread Chris Angelico
On Mon, May 13, 2019 at 12:41 AM GerritM wrote: > > I had missed the End-of-Life announcement of Python 2 for 2020. When > installing a missing package on my new laptop, pip did warn me about this > upcoming event. > > I have been reading up on the conversion. Unfortunately, I can find no > inf

Re: Automate extract domain

2019-05-12 Thread Jon Ribbens via Python-list
On 2019-05-12, Birdep wrote: > I am trying to extract domain name from a adblock rule , so what > pattern should i used to extract domain name only? > > import re > domains = ['ru', ' fr' ,'eu', 'com'] with open('easylist.txt', 'r') as f: > a=f.read() result=re.findall(r'[a-zA-Z0-9-]+\.[a-zA

Automate extract domain

2019-05-12 Thread Birdep
I am trying to extract domain name from a adblock rule , so what pattern should i used to extract domain name only? import re domains = ['ru', ' fr' ,'eu', 'com'] with open('easylist.txt', 'r') as f: a=f.read() result=re.findall(r'[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+',a) unique_result = list(set(

Re: Testing the data type of a value

2019-05-12 Thread Kushal Kumaran
Luuk writes: > On 12-5-2019 16:07, Piet van Oostrum wrote: >> Luuk writes: >> >>> After thinking about this, (i am prettry new to python), i was doing this: >>> >> print(type(5),type(int),type(5)==type(int),type(5)==int) >>> False True >>> >>> Can someone explain why type(5)==int evalu

Python 2 EOL; what about P2 packages

2019-05-12 Thread GerritM
I had missed the End-of-Life announcement of Python 2 for 2020. When installing a missing package on my new laptop, pip did warn me about this upcoming event. I have been reading up on the conversion. Unfortunately, I can find no information yet on coping with Python 2 only packages. So far, I i

Re: Testing the data type of a value

2019-05-12 Thread Luuk
On 12-5-2019 16:07, Piet van Oostrum wrote: Luuk writes: After thinking about this, (i am prettry new to python), i was doing this: print(type(5),type(int),type(5)==type(int),type(5)==int) False True Can someone explain why type(5)==int evaluates to True ? print(int) The valu

Re: Testing the data type of a value

2019-05-12 Thread Piet van Oostrum
Luuk writes: > > After thinking about this, (i am prettry new to python), i was doing this: > print(type(5),type(int),type(5)==type(int),type(5)==int) > False True > > Can someone explain why type(5)==int evaluates to True ? > >>> print(int) The value of int is the class int, which

Re: Testing the data type of a value

2019-05-12 Thread Luuk
On 12-5-2019 10:16, Luuk wrote: On 12-5-2019 09:27, binoythomas1...@gmail.com wrote: When I run the following code, I get the following output: print(type(5)) class 'int' Next, I try to compare the data-type of 5 with the earlier output, I get no output: if type(5) == "": print("I

Re: Testing the data type of a value

2019-05-12 Thread Ben Bacarisse
binoythomas1...@gmail.com writes: > When I run the following code, I get the following output: print(type(5)) > class 'int' > > Next, I try to compare the data-type of 5 with the earlier output, I > get no output: if type(5) == "": > print("Integer") > > Why isn't this working? A

Re: Testing the data type of a value

2019-05-12 Thread Luuk
On 12-5-2019 09:27, binoythomas1...@gmail.com wrote: When I run the following code, I get the following output: print(type(5)) class 'int' Next, I try to compare the data-type of 5 with the earlier output, I get no output: if type(5) == "": print("Integer") Why isn't this working?

Testing the data type of a value

2019-05-12 Thread binoythomas1108
When I run the following code, I get the following output: >>> print(type(5)) class 'int' Next, I try to compare the data-type of 5 with the earlier output, I get no output: >>> if type(5) == "": print("Integer") Why isn't this working? Advance thanks for your time. and regards from Bin