• Почему при сравнение числа код неправильно работает?

    good_br
    @good_br Автор вопроса
    Спасибо, видел! Но вы можете объяснить, почему то же самое внутри цикла не сработало в этой строчке if (n % 10) == ((n // 10) % 10) :
  • Почему при сравнение числа код неправильно работает?

    good_br
    @good_br Автор вопроса
    Vindicar, Я пробовал ставить в начало n //= 10 , но это не совсем правильно, так как мы не сможем увидеть получить тогда последнюю цифру, так как мы ее раньше отбрасываем чем получаем с помощью n %= 10 .
    Но во всяком случае все это не работает, так как надо
    62bc92d723beb534581971.png
  • Почему при сравнение числа код неправильно работает?

    good_br
    @good_br Автор вопроса
    Уже по разному пробовал, почему-то вторую операцию с введенным числом внутри чикла не производит, ни как не могу разобраться (((((62bc8b5d4c4cf020712455.png
  • Telegam parser выдает ошибку при получении участников из группы, в чем проблема?

    good_br
    @good_br Автор вопроса
    В этой строчки, если не поменять значение True на False, то возникает следующая ошибка ( ранее работало с True) :
    >>>> client c1 created
    Traceback (most recent call last):
      File "C:/Users/Сергей/PycharmProjects/pythonProject7/Telegram-Invite-to-Channel-Group/invite_to_channel_group.py", line 78, in <module>
        all_participants[key] = clients[key].get_participants(sour, aggressive=True)
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\sync.py", line 39, in syncified
        return loop.run_until_complete(coro)
      File "C:\Users\Сергей\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
        return future.result()
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\client\chats.py", line 507, in get_participants
        return await self.iter_participants(*args, **kwargs).collect()
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\requestiter.py", line 113, in collect
        async for message in self:
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\requestiter.py", line 74, in __anext__
        if await self._load_next_chunk():
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\client\chats.py", line 222, in _load_next_chunk
        results = await self.client(self.requests)
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\client\users.py", line 30, in __call__
        return await self._call(self._sender, request, ordered=ordered)
      File "C:\Users\Сергей\PycharmProjects\pythonProject7\pythonProject\lib\site-packages\telethon\client\users.py", line 80, in _call
        raise MultiError(exceptions, results, requests)
    telethon.errors.common.MultiError: ([FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), None, None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)')], [None, <telethon.tl.types.channels.ChannelParticipants object at 0x000001E1E1683190>, <telethon.tl.types.channels.ChannelParticipants object at 0x000001E1E163AD60>, None, None, None, <telethon.tl.types.channels.ChannelParticipants object at 0x000001E1E1677EB0>, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], [<telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16513D0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16511C0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16512E0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651A90>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651B50>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651C10>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651CD0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651D90>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651E50>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651F10>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1651FD0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16620D0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662190>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662250>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662310>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16623D0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662550>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662610>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16626D0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662790>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662850>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662910>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E16629D0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000001E1E1662B50>])
  • Telegam parser выдает ошибку при получении участников из группы, в чем проблема?

    good_br
    @good_br Автор вопроса
    shurshur,
    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    
    # Scripts inviting members 
    #
    
    
    from telethon import TelegramClient, sync, errors
    from telethon.errors import SessionPasswordNeededError
    
    from telethon.tl.functions.account import UpdateProfileRequest
    from telethon.tl.functions.messages import AddChatUserRequest
    from telethon.tl.functions.channels import InviteToChannelRequest
    from telethon.tl.types import PeerUser, PeerChat, PeerChannel
    
    import python3pickledb as pickledb
    
    from time import gmtime, strftime
    import time, sys
    import os.path
    import random
    
    # Need change those api to yours
    c_info = {
       'c0': ('cody_client1', 388159, 'b6337b1e003b7eax780fd2d77f7e0478')
    }
    
    if c_info['c1'][0] == 388159:
        sys.exit('Need change api to yours')
    sour = 'https://t.me/HR0408g'  # отсюда берет   
    dest = 'https://t.me/test'  # сюда добавляет
    
    clients = {}
    dests = {}
    all_participants = {}
    
    for key, value in c_info.items():
        print('>> client %s creating' % key)
    
        clients[key] = TelegramClient(*value)
        clients[key].start()
    
        print('>>>> client %s created' % key)
    
        dests[key] = clients[key].get_entity(dest)
        all_participants[key] = clients[key].get_participants(sour, aggressive=True)
    
    print('Works!')
    
    db = pickledb.load('clientbot_test.db', True)
    
    ind = 0
    if not db.get('start'):
        db.set('start', ind)
    else:
        ind = int(db.get('start'))
        print('Start from ', ind)
    
    while True:
        users = {}
        for key, value in all_participants.items():
            users[key] = value[ind]
    
        for key, value in users.items():
            if value == None:
                sys.exit('All members (%d) done' % ind)
        rd_ind = random.sample(list(clients.keys()), len(clients))[0]
        print('>>>> client %s works' % rd_ind)
    
        client = clients[rd_ind]
        dest = dests[rd_ind]
        user = users[rd_ind]
    
        try:
            client(InviteToChannelRequest(
                dest,
                [user],
            ))
    
            print("%-6d: %-9d | @%s | %s | %s | Done" % (ind, user.id, user.username, user.first_name, user.last_name))
    
        except errors.rpcerrorlist.UserPrivacyRestrictedError:
            print('>>>>0. UserPrivacyRestrictedError...')
        except errors.rpcerrorlist.ChatAdminRequiredError:
            print('>>>>1. ChatAdminRequiredError...')
        except errors.rpcerrorlist.ChatIdInvalidError:
            print('>>>>2. ChatIdInvalidError...')
        except errors.rpcerrorlist.InputUserDeactivatedError:
            print('>>>>3. InputUserDeactivatedError...')
        except errors.rpcerrorlist.PeerIdInvalidError:
            print('>>>>4. PeerIdInvalidError...')
        except errors.rpcerrorlist.UserAlreadyParticipantError:
            print('>>>>5. UserAlreadyParticipantError...')
        except errors.rpcerrorlist.UserIdInvalidError:
            print('>>>>6. UserIdInvalidError...')
        except errors.rpcerrorlist.UserNotMutualContactError:
            print('>>>>>7. UserNotMutualContactError...')
        except errors.rpcerrorlist.UsersTooMuchError:
            print('>>>>>8. UsersTooMuchError...')
        except errors.rpcerrorlist.PeerFloodError:
            ind -= 1
            print('>>>>>9. PeerFloodError try again in 2 Mins...')
            continue
            time.sleep(120) #тут нужно сделать многопоточность, что бы данный акк засыпал, а остальнгые работали
        except errors.rpcerrorlist.UserChannelsTooMuchError:
            ind += 1  # пропускает пльзователя, если его не возможно добавить
            print('Пропускаем участника так как он в слишком многих каналах')
        except errors.rpcerrorlist.FloodWaitError:
            ind -= 1
            print('Аккаунт в бане на время, нужно пропустить его на сутки ')
    
            # CPU sleep
        time.sleep(random.randint(10, 30))
        ind += 1
        db.set('start', ind)
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    ThunderCat, Как ни странно, но нотпед при таком же порядке смены кодировки не помог
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    Все таки, я придерживаюсь мнения, что это можно было сделать, через настройки WB , но так и не нашел, где это. Если кто знает, дайте подробную инфу)

    Еще один способ тут https://www.youtube.com/watch?time_continue=1&v=F1...

    Кротко говоря, нужно открыть файл чрез блокнот, затем выбрать "сохранить как " -> кодировка ANSI -> открыть чрез excel
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    Открыть в нормальной кодировке смог, через Openoffice, выбрав UTF- 8, правда название полей объединилось в шапке.
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    Я составил такой запрос, но при экспорте, кодировка все равно кривая :
    use test1 ;
    
    SET NAMES 'utf8';
    SET CHARACTER SET 'utf8';
    SET SESSION collation_connection = 'cp1251_general_ci';
    
    
    SELECT 
        `firstname`,
        `middlname`,
        `lastname`,
        `phone1`,
        `phone2`,
        `desired_profession`,
        `email1`,
        `payment`,
        `pol`,
        `birthday`,
        `birthmonth`,
        `birthyear`
    FROM
        profil
    WHERE
        town = 4
            AND `desired_profession` REGEXP 'Бухгалтер';
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    pfg21, Не нашел к сожалению, как в WORKBANCH это прописать .
  • Как сменить кодировку в excel после выборки из базы mysql?

    good_br
    @good_br Автор вопроса
    Можно подробнее пожалуйста
  • Как исправить данный код?

    good_br
    @good_br Автор вопроса
    Я понял, что ни чего не понял, пойду обогащаться знаниями )
  • Как исправить данный код?

    good_br
    @good_br Автор вопроса
    Если поставить эту строчку, то возникает куча ошибок
    Traceback (most recent call last):
      File "C:/Users/Сергей/PycharmProjects/pythonProject7/requests_plus_proxy/main.py", line 32, in <module>
        proxies = get_free_proxies()
      File "C:/Users/Сергей/PycharmProjects/pythonProject7/requests_plus_proxy/main.py", line 10, in get_free_proxies
        for row in soup.find("table", attrs={"id": "proxylisttable"}).find_all("tr")[1:]:
    AttributeError: 'NoneType' object has no attribute 'find_all'
  • С чего начать изучение telegram bot?

    good_br
    @good_br Автор вопроса
    Сергей Горностаев, видел как делают ботов на данном фреймворке, причём не плохих.
  • Как сделать интеграцию AMO CRM с telegram bot?

    good_br
    @good_br Автор вопроса
    Валерий Чмых, Проверили, проблема не в этом
  • Как решить проблема с работой клавиатуры magick keyboard?

    good_br
    @good_br Автор вопроса
    Да, только она потом не подключается вообще