I hereby claim:
- I am khllkcm on github.
- I am khllkcm (https://keybase.io/khllkcm) on keybase.
- I have a public key ASDDZSXanU8JiqWgAwCzhskEl6XcUEBsw1btk7p1tmr5OQo
To claim this, I am signing this object:
import requests | |
import re | |
import os | |
import urllib.parse | |
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0"} | |
response = requests.get("https://reddit.com/r/france/search?sort=new&q=flair%3AForum%2BLibre&restrict_sr=on&t=day", headers=headers) | |
result = re.search( | |
r"https://www.reddit.com/r/france/comments/?.{6}/forum_.*?libre.*?20.+?/", | |
response.text |
# -*- coding: utf-8 -*- | |
file_lines = open('C:\data_p2.txt', 'r').readlines() #list of file lines | |
fields_lengths = [[] for i in range(6)] #empty 2D list with 6 empty sublists (one for each column) | |
for line in file_lines: | |
fields = line.strip().split("\t") #list of the line's fields, strip() removes the tailing "\n". | |
for i in range(6): | |
fields_lengths[i].append(len(fields[i])) #each sublist stores the length of each field. | |
print([max(x) for x in fields_lengths]) #returns the maximum of each sublist; i.e. the maximum length of each column. |
I hereby claim:
To claim this, I am signing this object: