L
L
lil_rainnn2020-05-21 15:34:03
Python
lil_rainnn, 2020-05-21 15:34:03

Python: Is it possible to import a plain json text file into a module?

Python: Is it possible to import a plain json text file into a module?
Those. file without .py

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Pankov, 2020-05-21
@lil_rainnn

You cannot import.
You can load and assign the contents of the json file to a variable inside the module.
You explain what you need, and they will tell you how to do it right. Judging by your question, no answer to it will help you.

A
Alexey Yeletsky, 2020-05-21
@Tiendil

You can't and shouldn't do that.
But if you really want, you can: https://github.com/kragniz/json-sempai

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question