phone_code()def family_buttons(message):
email(message)
def email(message):
markup = types.InlineKeyboardMarkup(row_width=1)
email = types.InlineKeyboardButton("Введите почту", callback_data="email")
markup.add(email)
bot.send_message(message.chat.id, "Время заполнения поля 30 секунд", reply_markup=markup)
def phone_code(message):
markup = types.InlineKeyboardMarkup(row_width=1)
phone_code = types.InlineKeyboardButton("Введите код телефона", callback_data="phone_code")
markup.add(phone_code)
bot.send_message(message.chat.id, "Нажмите для заполнения поля!", reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback(call):
if call.message:
if call.data == "email":
text_email = bot.send_message(chat_id=call.message.chat.id, text="Введите почту")
bot.register_next_step_handler(text_email, next)
elif call.data == "phone_code":
text_phone_code = bot.send_message(chat_id=call.message.chat.id, text="Введите код телефона")
bot.register_next_step_handler(text_phone_code, next)
def next(message):
if message.text:
# Здесь вы можете обработать введенный текст для первой кнопки
# Например, сохранить его в переменную или базу данных
# Затем вызовите функцию phone_code() для отображения второй кнопки
phone_code(message)
import sqlite3
connection = sqlite3.connect('my_database.db')
cursor = connection.cursor()
cursor.execute('SELECT nickname FROM users WHERE discord_id = ' + str(discord_id))
result = cursor.fetchone()
nickname = result[0]
connection.close()
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class LoadingScene : MonoBehaviour
{
public Image loadingBarFill;
public Text loadingText;
private string sceneName = "Scene1";
void Start()
{
StartCoroutine(LoadSceneCoroutine());
}
IEnumerator LoadSceneCoroutine()
{
yield return new WaitForSeconds(1f);
AsyncOperation asyncOperation;
asyncOperation = SceneManager.LoadSceneAsync(sceneName);
while (!asyncOperation.isDone)
{
float progress = asyncOperation.progress / 0.9f;
loadingBarFill.fillAmount = progress;
loadingText.text = "Загрузка" + string.Format("{0:0}%", progress * 100f);
yield return 0;
}
SceneManager.UnloadScene(sceneName);
}
}
Set используется для исключения дубликатов в списке случайных чисел.
function generateUniqueRandomNumbers(count, min, max) {
if (max - min + 1 < count) {
throw new Error('Диапазон меньше количества уникальных чисел');
}
const uniqueNumbers = new Set();
while (uniqueNumbers.size < count) {
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
uniqueNumbers.add(randomNumber);
}
return Array.from(uniqueNumbers);
}
const uniqueRandomNumbers = generateUniqueRandomNumbers(10, 1, 100);
console.log(uniqueRandomNumbers);function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
const random = new Set();
while (random.size < 3) {
let number = getRandomInt(1, 5);
random.add(number);
}
console.log(Array.from(random));
n, m = map(int, input().split())
field = [input() for _ in range(n)]
valid_field = True
for i in range(n):
for j in range(m):
if field[i][j] != '.':
valid_move = any(0 <= i+dx < n and 0 <= j+dy < m and field[i+dx][j+dy] == '.' for dx, dy in [(1,0),(-1,0),(0,1),(0,-1)])
if not valid_move:
valid_field = False
break
if valid_field:
print("YES")
for i in range(n):
for j in range(m):
if field[i][j] != '.':
print(i + 1, j + 1)
else:
print("NO")
import play
import time
play.set_backdrop("light grey") # Изменено на более светлый цвет
w = play.screen.width
h = play.screen.height
@play.repeat_forever
def do():
if play.key_is_pressed("w"): # Исправлены горячие клавиши
cat.y += 2
if play.key_is_pressed("s"):
cat.y -= 2
if play.key_is_pressed("d"):
cat.x += 2
if play.key_is_pressed("a"):
cat.x -= 2
if play.key_is_pressed("up"):
mouse.y += 2
if play.key_is_pressed("down"):
mouse.y -= 2
if play.key_is_pressed("right"):
mouse.x += 2
if play.key_is_pressed("left"):
mouse.x -= 2
if (cat.x - 20 <= mouse.x <= cat.x + 20) and (cat.y - 35 <= mouse.y <= cat.y + 35):
ToT = play.new_box(color="grey", x=0, y=0, width=w, height=h)
win = play.new_text(words="Cat win", x=0, y=0, color="red", font_size=150)
play.pygame.mixer_music.load("Fluffing-a-Duck.mp3") # Кавычки для названия файла
play.pygame.mixer_music.play()
cat.x += 10
mouse.x -= 10
time.sleep(0.8)
if cat.y >= h / 2:
cat.y -= 2
if cat.y <= h / 2:
cat.y += 2
if cat.x >= w / 2:
cat.x -= 2
if cat.x <= w / 2:
cat.x += 2
if mouse.y >= h / 2:
mouse.y -= 2
if mouse.y <= h / 2:
mouse.y += 2
if mouse.x >= w / 2:
mouse.x -= 2
if mouse.x <= w / 2:
mouse.x += 2
cat = play.new_circle(color="blue", x=-320, y=-220, radius=20, border_color="light blue")
mouse = play.new_circle(color="brown", x=320, y=220, radius=10, border_color="yellow")
// localStorage
// darkMode: dark
const darkMode = localStorage.getItem("darkMode")?.trim();
console.log(darkMode); // "dark"
const dark = "dark";
console.log(darkMode === dark); // true
const black = "black";
const textShadow = darkMode === dark ? black : ""; // убедитесь, что добавите условие для другого значения
console.log(textShadow); // "black"
const styles = {
mainTheme: {
textShadow: "2px 2px 2px black",
textShadowColorMode: `2px 2px 2px ${textShadow}`,
},
};localStorage.getItem(darkMode) вы должны передать строку с именем ключа. darkMode с переменной dark которая не была определена.styles значения textShadow и textShadowColorMode должны быть строками.
schedule:scheduleс помощью pip:pip install scheduleimport schedule
import time
import os
import sys
def restart_program():
os.execv(sys.executable, ['python'] + sys.argv)
def main_function():
# Ваш основной код здесь
# Планируйте перезапуск программы каждый день
schedule.every().day.at("00:00").do(restart_program)
while True:
schedule.run_pending()
time.sleep(1)
if __name__ == "__main__":
main_function()
@bot.message_handler(content_types=['text'])
def name(message):
if message.chat.type == 'private':
if message.text == 'Ищу':
bot.send_message(message.chat.id, f'Наши каналы:' '\n\n 1. [Канал по трейдингу](https://t.me/+uUaJjz412eK7EyMwdjVi)' '\n 2. [Твоя онлайн девушка](https://t.me/+WV26714WA4hyWIssIoL7Vp)' '\n 3. [FULL ТУТ](https://t.me/boootyyyaara3222bot)' '\n 4. [Пустое рекламное место]()', parse_mode='Markdown', disable_web_page_preview=True)
--noconsole при запуске Pyinstaller. Эта опция скрывает консольное окно при запуске скомпилированного файла, и тем самым обеспечивает доступ к stderr.pyinstaller --noconsole your_script.py--noconsole в поле "Additional Arguments".