169 похожих чатов

Import json import platform import os # What OS is the script running

on? (OK)
OS = platform.system()

# Read properties.json (OK) and parse it (ERROR)
PROP_FILE_LOCATION = os.getcwd() + '/properties.json'

decodedProp = ''

with open(PROP_FILE_LOCATION) as PROP_JSON:
decodedProp = json.loads(PROP_JSON.read())


print("Current platform: " + OS)
print("JSON: " + PROP_JSON.read())
print("decodedProp: " + decodedProp)

1 ответов

5 просмотров

Why don't you use json.load instead of loads?

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

Обсуждают сегодня

type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
45
А чем вам питонисты не угодили?😂
.
79
Можно ли загрузить скрипт py в бота чтобы он работал по нему? как это сделать?
huskadam #RCC Фанат? @hitlerpvp
13
А дин типизация это хорошо или плохо?
Alexey
12
Исходники плюс документация? Вы гоните)) демок хватит всем
zamtmn
11
Язык Си можно выучить за день? По книжке ANSI C на 230 страниц
Vincent Vegan
29
Hello. Could you please help me with finding all coordinates within a radius using a spatial index, given that I have a table with coordinates? SET @lng = 37.57925; SET @lat ...
Rinchin G
7
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
76
а что есть "статистика" ? просто подсчет фактов обращения и времен выполнения ?
Сергей
9
Карта сайта