>>> import json
>>> f = open('t.json')
>>> j = json.load(f)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
>>>
from apscheduler.schedulers.blocking import BlockingScheduler
def job_function():
print "Hello World"
sched = BlockingScheduler()
# Schedules job_function to be run on the third Friday
# of June, July, August, November and December at 00:00, 01:00, 02:00 and 03:00
sched.add_job(job_function, 'cron', month='6-8,11-12', day='3rd fri', hour='0-3')
sched.start()
Из-за чего возникает ошибка при компиляции с помощью Nuitka?
C:\Users\Rimush\AppData\Local\Temp\ccGg5Cla.ltrans0.ltrans.o
Nuitka-Options:WARNING: You did not specify to follow or include anything but main program. Check options and make sure that is intended.
df['Time'] = pd.to_datetime(df['Time'], format="%Y-%m-%dT%H:%M:%S.%f", errors = 'coerce')
wipe_triger = ['вайп']
@bot.event
async def on_message(message):
if message.author == bot.user: return
if int(message.channel.id) != 000000000000000: return
stop_words = 0
for word in message.content.split():
if word.lower() in wipe_triger: # вместо цикла - IF
# if content.lower() == wipe_messages: # нафиг не нужно
stop_words += 1 # считаем стоп-слова
if stop_words > 0: # если пользователь флудит
await message.channel.send(f'{message.author.mention} - текст!') # посытаем ему 'одно' сообщение
my_store = {}
my_store[22345] = "my text for 22345" # туда
a = my_store[22345] # обратно
>>> from datetime import date
>>> today = date.today()
>>> today
datetime.date(2022, 12, 12)
>>> lastbirthday = date(today.year, 6, 14)
>>> today - lastbirthday
datetime.timedelta(days=181)
>>> today >= lastbirthday
True
>>> lastbirthday = date(today.year+1, 6, 14)
>>> today >= lastbirthday
False
>>> lastbirthday - today
datetime.timedelta(days=184)
>>>