Gharke
4 months ago
6 changed files with 4903 additions and 0 deletions
@ -0,0 +1,20 @@
|
||||
spam = "That is Alice's cat." |
||||
|
||||
############################################################################### |
||||
# Escape Characters |
||||
# \' single quote |
||||
# \" double quote |
||||
# \\ backslash |
||||
# \n newline |
||||
# \t tab |
||||
############################################################################### |
||||
|
||||
# Raw string prints everything literally |
||||
print(r"That is Alice\'s cat/n") |
||||
|
||||
# Multiline strings |
||||
print(""" |
||||
This is a multi-line string. |
||||
It is made up of three lines. |
||||
""") |
||||
|
@ -0,0 +1,8 @@
|
||||
import requests |
||||
|
||||
res = requests.get('https://automatetheboringstuff.com/files/rj.txt') |
||||
print(type(res)) |
||||
|
||||
if res.status_code == requests.codes.ok: |
||||
print(len(res.text)) |
||||
print(res.text[:250]) |
@ -0,0 +1,13 @@
|
||||
import os |
||||
import requests |
||||
|
||||
cwd = os.getcwd() |
||||
print('Current working directory is: ', cwd) |
||||
|
||||
res = requests.get('https://automatetheboringstuff.com/files/rj.txt') |
||||
res.raise_for_status() |
||||
|
||||
playFile = open(cwd + '\\web-scraping\\files\\RomeoAndJuli.txt', 'wb') |
||||
for chunk in res.iter_content(10000): |
||||
playFile.write(chunk) |
||||
playFile.close() |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
import webbrowser |
||||
webbrowser.open('https://chat.harmonyhealthmedical.com') |
Loading…
Reference in new issue