import sys
from bs4 import BeautifulSoup
DOC = 'test.html'
try:
with open(DOC, encoding='utf-8') as f:
page = f.read()
except IOError as err:
print(f'Error reading the file {DOC}: {err}')
sys.exit()
soup = BeautifulSoup(page, 'lxml')
rows = soup.find_all('tr')
rows = [row.find_all('td') for row in rows]
rows = [row for row in rows if row]
for row in rows:
columns = [cell.text.strip() for cell in row]
columns = [cell for cell in columns if cell]
print(f'{columns[0]}:', *columns[1:-1], f'Ср: {columns[-1]}')
Debian 8, 9, 10, 11 (64-bit)
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pytube import YouTube
>>> yt = YouTube('https://www.youtube.com/watch?v=bmXP-58FItA')
>>> yt.streams.filter(type='video').get_highest_resolution().resolution[0:-1]
'720'
>>>
import json
from bs4 import BeautifulSoup
DOC = '''
<html>
<head></head>
<body>
<pre style="word-wrap: break-word; white-space: pre-wrap;">
[
{"id":1,"name":"Склад 407","quantity":"0.0"},
{"id":9,"name":"Литейка","quantity":"0.0"},
{"id":16,"name":"СЛК - 407 каб.","quantity":"0.0"},
{"id":18,"name":"СЛК - 521 каб. МКШ-96","quantity":"0.0"},
{"id":19,"name":"СЛК - 524 каб.","quantity":"0.0"},
{"id":20,"name":"СЛК - литейка","quantity":"0.0"},
{"id":26,"name":"СЛК - Сборка Lifepad","quantity":"3.0"}
]
</pre>
</body>
</html>
'''
soup = BeautifulSoup(DOC, 'lxml')
data = json.loads(soup.find('pre').text)
for item in data:
print(f"{item['name']} - {item['quantity']}")
import pandas as pd
CSV = 'test.csv'
with open(CSV, 'r', encoding='utf-8') as f:
df = pd.read_csv(f)
row = df[df['user_id'] == 100289]
настройка зависимостей лежит на пользователе
Также наткнулась на информацию, что через snap лучше устанавливать тяжеловесные приложения, а через apt все остальное.
И еще из нескольких статей сделала вывод, что snap предоставляет большую безопасность.