Вопрос,как улучшить код,чтобы при нажатие пробела нажатие на все координаты происходило одновременно
import keyboard as kb
import pyautogui as pt
pt.PAUSE = 0.01
if __name__ == '__main__':
coordinates = [
(-1241, 624),
(-303, 720),
(604, 634),
(1363, 679),
(1363, 679),
(2265, 654),
(558, 1342),
(2476, 1255),
]
while True:
if kb.is_pressed('Space'):
for x, y in coordinates:
pt.click(x, y)
Или есть какое-нибудь другое решение?
заказчику требуется также CMS
или подключить все на WordPress, но там все как-то сделано через одно место
import telebot
from telebot import types
bot = telebot.TeleBot('token')
file = open('./start1.jpg', 'rb')
@bot.message_handler(commands=['start'])
def start(message):
markup = types.InlineKeyboardMarkup()
markup.add(types.InlineKeyboardButton('Оценка', url='https://google.com'))
markup.add(types.InlineKeyboardButton('Кадастровые работы', callback_data='cadastral'))
markup.add(types.InlineKeyboardButton('Строительные экспертизы', callback_data='expertise'))
bot.send_photo(message.chat.id, file,
caption='Здравствуйте, это Бот-помощник группы компаний "Стандарт Оценка", я помогу Вам определиться с нужной услугой, оформить заявку и связаться с администратором. Выберете желаемую услугу',
reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback_message(call):
if call.data == 'cadastral':
bot.delete_message(call.message.chat.id, call.message.message_id)
bot.send_message(call.message.chat.id, 'Введите свое ФИО')
bot.register_next_step_handler(call.message, message_input_step)
elif call.data == 'expertise':
bot.send_message(call.message.chat.id, 'Вы выбрали Строительные экспертизы')
elif call.data == 'all':
bot.send_message(call.message.chat.id, 'Все данные верны')
def message_input_step(message):
global name
name = message.text
bot.send_message(message.chat.id, 'Введите свой номер телефона')
bot.register_next_step_handler(message, phone)
def phone(message):
global phone
phone = message.text
markup = types.InlineKeyboardMarkup()
markup.add(types.InlineKeyboardButton('Все верно✅', callback_data='all'))
markup.add(types.InlineKeyboardButton('Начать сначало❌', callback_data='cadastral'))
bot.send_message(message.chat.id, f'Ваше ФИО: {name}\nВаш номер телефона: {phone}', reply_markup=markup)
if __name__ == "__main__":
bot.polling(none_stop=True)
// app/layout.js
'client'
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "@/base.scss";
import { Provider } from 'react-redux';
import { store } from '../redux/store';
import Layout from "@/components/Layout";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Home | PlayCloud",
description: "Unique web application for listening to a huge amount of music in a unique format",
}
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en">
<body className={inter.className}>
<Provider store={store}>
<Layout>
{children}
</Layout>
</Provider>
</body>
</html>
)
}
Cannot destructure property 'store' of 'useReduxContext2(...)' as it is null?
<?php
$args = array(
'post_type' => 'post', // posts
'posts_per_page' => -1, // counts per page
'order' => 'ASC', // по умолчанию get_posts() возвращает посты в порядке от новых к старым, изменим на обратное
);
$posts = get_posts($args);
if (!empty($posts)) :
foreach ($posts as $post) : setup_postdata($post); ?>
<div>
<h3><?php the_title(); ?></h3>
<h4>Краткое описание:</h4>
<p><?php the_excerpt(); ?></p>
<a href="<?php the_permalink(); ?>">Ссылка на запись</a>
<p>Тип записи: <?php echo get_post_type($post); ?></p> <!-- check post type -->
</div>
<?php endforeach;
wp_reset_postdata();
endif; ?>
Есть 2 сайта. Тематически второй можно разместить на поддомене.
server_response = "..." # https://gist.github.com/serrhiy/56b1f296cb7b4fbf42febaf8c08347a1
def decode_unicode_escapes(string):
return re.sub(r'\\u([0-9A-Fa-f]{4})', lambda m: chr(int(m.group(1), 16)), string)
unicode_decoded = decode_unicode_escapes(server_response)
try:
res = unicode_decoded.encode('utf-8').decode('utf-8')
except UnicodeEncodeError as e:
print(f"Ошибка: {e}.")
res = unicode_decoded.encode('utf-8', errors='replace').decode('utf-8', errors='replace')
print(res) # <a href='https://www.immowelt.de/immoweltag/datenschutz' target="_blank" class="hm_link" title="Datenschutzerklärung der AVIV Germany GmbH">
function test() {
if (is_search()) {
remove_action('wp_head', 'noindex', 10);
}
}
add_action('wp', 'test');
развернуть на субдоменах
Может ли Яндекс зачесть деньги, предназначенные для другого сервиса в счет старого долга?
Вопрос: является ли количество работ в разделе "портфолио" сайта фактором ранжирования в Яндексе и Google?
В поиске не нашёл информации, является ли это коммерческим фактором ранжирования или чем-то подобным.
во всех видео и статьях рассказывается, про единый файл app.js неужели один файл нужно прикреплять вообще на все страницы сайта и этот монстр будет по id или вызову компонентов понимать
Или происходит сборка под каждую сложную сущность?
project/
- home/
-- home.html <-- подключение home.js/scss и библиотек (если они не требуют кастомной настроки)
-- home.js <-- импорт js библиотек и кастомная настройка именно под страницу home
-- home.scss <-- импорт scss библиотек и кастомная настройка именно под страницу home
- catalog/
-- catalog.html <-- подключение catalog.js/scss и библиотек (если они не требуют кастомной настроки)
-- catalog.js <-- импорт js библиотек и кастомная настройка именно под страницу catalog
-- catalog.scss <-- импорт scss библиотек и кастомная настройка именно под страницу
- libs/
-- popup.js
-- form.js
dist/
- home.html <-- подключено main.js/css + home.js/css
- catalog.html <-- подключено main.js/css + catalog.js/css
- assests/
-- main.js <-- общие
-- main.css <-- общие
-- home.js
-- home.css
-- catalog.js
-- catalog.css