TypeError: __init__() missing 2 required positional arguments: 'price_pil' and 'price_shariki'
button = tk.Button(window, text="Change/Assign prices", command=price)
def __getattribute__(self, name):
print(name)
return super().__getattribute__(name)
sum(accumulate(add, grades))
сумму квадратов можно так sum(lambda x: x**2, grades)
wkhtmltopdf
. Если дистрибутив ubuntu/debian, то рекомендуют ставить бинарник отсюда wkhtmltopdf app.mount('/', StaticFiles(directory='client'), name='static')
import os
def catalog_search(path_to_catalog: str) -> list[str]:
fl_lst = []
directory_ = os.walk(path_to_catalog, topdown=True)
for address, dirs, files in directory_:
for name in files:
fl_lst.append(os.path.join(address, name))
return fl_lst
def amount_file_string(list_: list[str]):
for i_file in list_:
try:
with open(i_file, 'r') as f:
amount = f.readlines()
yield len(amount)
except FileNotFoundError:
print(f'Файл не найден: {i_file}')
catalog = 'L:\\28.Python\\Python_Basic\\Module14'
file_list = catalog_search(catalog)
file_strings = (file_num for file_num in amount_file_string(file_list))
print(f'Найдено {len(file_list)} файлов в каталоге {catalog}.')
for i_value in file_strings:
try:
print(f'Количество строк в файле {i_value}')
except StopIteration:
pass
r = requests.get('https://github.com', timeout=(3.05, 27))