captions = []
for objItem in colItems:
if objItem.Caption != None:
print("Caption:" + objItem.Caption)
print("Command:" + objItem.Command)
print("User:" + objItem.User)
captions.append('<p>{}<p>'.format(objItem.Caption))
captions = '\n'.join(captions)
return self.wfile.write(captions.encode('utf-8'))
usecols: int, str, list-like, or callable default None
If None, then parse all columns.
If str, then indicates comma separated list of Excel column letters and column ranges (e.g. “A:E” or “A,C,E:F”). Ranges are inclusive of both sides.
If list of int, then indicates list of column numbers to be parsed.
If list of string, then indicates list of column names to be parsed.
New in version 0.24.0.
If callable, then evaluate each column name against it and parse the column if the callable returns True.
Returns a subset of the columns according to behavior above.
data_designation = ["Дата заключения", "Валюта", "Код финансового инструмента", "Операция", "Количество", "Цена", "Объём сделки"]
securities_transactions = pandas.read_excel(file_location, usecols = data_designation)
securities_transactions = securities_transactions[data_designation]
securities_transactions = securities_transactions.values.tolist()
black_list = ['password']
while True:
password1 = str(input("Введите пароль "))
if len(password1) < 8:
print("Короткий!")
continue
elif password1 in black_list:
print("Простой!")
continue
password2 = str(input("Введите пароль еще раз "))
if password1 == password2:
print("OK")
break
else:
print("Различаются!")
with open(file_name, 'r') as f:
for line in f:
# your code
@app.route('/choice/<planet_name>')
def choice(planet_name):
print(planet_name)
return '''<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
<title>Привет</title>
</head>
<body>
<h1>Мое предложение: {}</h1>
</body>
</html>'''.format(planet_name)
Как установить именно в редактор, чтобы переключаться между разными версиями?
И как найти директории exe установленных глобально версий python
$ which python
/usr/bin/python
$ which python3
/usr/bin/python3
>>> import datetime
>>> from dateutil import relativedelta
>>> past_date = '2017-07-31'
>>> past_date = datetime.datetime.strptime(past_date, '%Y-%m-%d')
>>> today = datetime.datetime.now()
>>> diff = relativedelta.relativedelta(today, past_date)
>>> f'{diff.years} years, {diff.months} months and {diff.days} days'
'2 years, 8 months and 17 days'