Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question