Задать вопрос
@dini88r96
Я начинающий программист хочу успешную карьеру

Что не так с кодом?

from SimpleQIWI import *

print('Q I W I Software 1.0 / coded by m1wka!');
token=input('Enter token: ')
phone=input('Enter phone: ');
api = QApi(token=token, phone=phone)
print('Balance Founded')
print(api.balance)
api.pay(account="+996508107310", amount=3, comment='hi')
print(api.balance)
input()

выдает ошибку

Balance Founded
Traceback (most recent call last):
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 37, in _scan_once
nextchar = string[idx]
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\python\Balance_Check.py", line 9, in
print(api.balance)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 80, in balance
balances = self.full_balance
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 70, in full_balance
return self._get_balance()
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 128, in _get_balance
json = response.json()
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 79, in scan_once
return _scan_once(string, idx)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 39, in _scan_once
raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

C:\Users\MUTESHOV>c:/python/Balance_Check.py
Q I W I Software 1.0 / coded by m1wka!
Enter token: c02d2908ab8fb84f466dc944514b2423
Enter phone:
Balance Founded
Traceback (most recent call last):
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 37, in _scan_once
nextchar = string[idx]
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\python\Balance_Check.py", line 9, in
print(api.balance)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 80, in balance
balances = self.full_balance
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 70, in full_balance
return self._get_balance()
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\SimpleQIWI\Session.py", line 128, in _get_balance
json = response.json()
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 79, in scan_once
return _scan_once(string, idx)
File "C:\Users\MUTESHOV\AppData\Local\Programs\Python\Python39\lib\site-packages\simplejson\scanner.py", line 39, in _scan_once
raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  • Вопрос задан
  • 150 просмотров
Подписаться 1 Средний 1 комментарий
Пригласить эксперта
Ответы на вопрос 1
RayProgrammer
@RayProgrammer
Ищу познание в мире программирования!
nextchar = string[idx]
IndexError: string index out of range

Проблема скорее всего в этом, если дословно, то вы вышли за рамки массива string
37 строка
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы