Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Author: Xiaoou Wang [linkedin](https://www.linkedin.com/in/xiaoou-wang)/[email](mailto:xiaoouwangfrance@gmail.com) | |
# https://xiaoouwang.medium.com/complete-tutorial-on-scraping-french-news-from-le-monde-%EF%B8%8F-4fa92bc0a07b | |
# Have a look at https://soshace.com/responsible-web-scraping-gathering-data-ethically-and-legally/ before using the code. | |
import os # helper functions like check file exists | |
import datetime # automatic file name | |
import requests # the following imports are common web scraping bundle | |
from urllib.request import urlopen # standard python module | |
from bs4 import BeautifulSoup | |
from urllib.error import HTTPError | |
from collections import defaultdict |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# https://xiaoouwang.medium.com/comprendre-la-m%C3%A9thode-str-en-python-et-lavantage-de-repr-d40fceb833a1 | |
# Author: Xiaoou Wang, Master's student in natural language processing looking for a phd position/contrat cifre. https://www.linkedin.com/in/xiaoou-wang/ | |
class Person: | |
def __init__(self, name, age): | |
self.name = name | |
self.age = age | |
p1 = Person("John", 36) | |
print(p1) # <__main__.Animal object at 0x7f9060250410> |
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
# Author: Xiaoou Wang, Master’s student in natural language processing looking for a phd position/contrat cifre. | |
# https://xiaoouwang.medium.com/get-readable-bash-command-history-with-cut-and-vscode-4eb8d56f38b4 | |
history | tail -n 15 # show the last 15 commands | |
echo "abcdefghi" | cut -c2-6 # extract the 2nd to the 6th character | |
# output = bcdef | |
echo "a-b-c" | cut -d'-' -f2 # split the string into 3 parts and get the 2nd part | |
# output = b | |
history | cut -d' ' -f4- | tail -n 15 # separate using space, get the 4th to nth column, get the last 15 commands | |
history | cut -d' ' -f4- | tail -n 15 | code - # show the results in vsc | |
history | grep “python” | cut -d' ' -f 4- | tail -n 15 | code - # Seach a command containing specific string |
NewerOlder