self.dispatch = {pygl.QUIT: self.exit_game(), # whatever else
...}
self.dispatch = {pygl.QUIT: self.exit_game, # whatever else
...}
for i, value in enumerate(my_list)
Вы можете изменить конфигурацию из командной строки conda:
запустите командную строку anaconda.
выполните в ней jupyter notebook --generate-config.
Каталог .jupyter/ должен создаться после этого в вашем домашнем каталоге, файл jupyter_notebook_config.py должен оказаться внутре. В нём раскомментируйте и отредактируйте поле c.NotebookApp.notebook_dir.
def check_two(m):
m = m.content
return m.isdigit() and (1 <= int(m) <= 139)
def check_two(m):
m = m.content
return m.isdigit() and (1 <= int(m) <= 139)
DataBook_Page = await client.wait_for('message', check=check_two)
ну и так далее tops = [(1,), (2,), (3,), (4,), (None,), (7,)]
tops.sort()
tops = [(1,), (2,), (3,), (4,), (None,), (7,)]
tops = [(0, ) if item[0] == None else item for item in tops]
allt = [item[0] for item in sorted(tops, reverse=True)][:5]
print(allt)
import sqlite3
con = sqlite3.connect(':memory:')
data = [
["item90", 12],
["item3", 0],
["item60", 35],
["item21", 15]
]
con.execute('''create table if not exists inv
(items text, number integer)'''
)
def print_db(con):
for row in con.execute('select * from inv'):
print(row)
def add_data(con, query, data):
con.executemany(query, data)
con.commit()
query = 'INSERT into inv values (?, ?)'
add_data(con, query, data)
print_db(con)
print('\nadd newstroke\n')
data = [['newstroke', 0]]
add_data(con, query, data)
print_db(con)
con.close()
import json
data = '''{
"Items128": 7,
"Item29": 3,
"Item32": 17,
"Item45": 0,
"Item93": 4
}'''
items_dict = json.loads(data)
item_numbers = dict((number, key) for number, key in enumerate(items_dict.keys()))
while True:
for number, item in item_numbers.items():
print(f'item {number} - {item}')
my_number = input('выбери номер:')
try:
my_number = int(my_number)
if my_number in item_numbers.keys():
print(f'{item_numbers[my_number]}: {items_dict[item_numbers[my_number]]}')
else:
print('--- нет такого номера ---')
except ValueError:
print(f'--- "{my_number}" - это не номер! ---')
wow = 0
keys = [
["text1", wow],
["text2", wow],
["text3", wow],
["text4", wow],
["text5", wow],
["text6", wow],
["text7", wow],
["text8", wow],
["text9", wow],
["text10", wow],
]
keys = [i[0] for i in keys]
text = dict((key, value) for value, key in enumerate(keys))
print(text)
wow = 0
keys = [
["text1", wow],
["text2", wow],
["text3", wow],
["text4", wow],
["text5", wow],
["text6", wow],
["text7", wow],
["text8", wow],
["text9", wow],
["text10", wow],
]
keys = [i[0] for i in keys]
text = [[key, value] for value, key in enumerate(keys)]
print(text)
string_a = 'Санкт-Петербург, Ленинградская область'
string_b = 'Санкт-Петербург'
print(string_b in string_a)