Bitcoin Forum

Other => Off-topic => Topic started by: selenanur on October 07, 2020, 06:25:05 AM



Title: How can I create a config/table/array that is accessible by Bash and Python?
Post by: selenanur on October 07, 2020, 06:25:05 AM
I would like to construct a config file that is accessible by both a Bash script and a Python script.
https://rb.gy/rgdmwz

For example:

"Item1" 64 "Blue" "B1UE"
"Item2" 45 "Red" "R3D"
"Item3" 95 "Green" "GR33N"
What can I do to easily import to both Bash and Python? Was thinking maybe to create it in JSON format, does anyone have any recommendations?


Title: Re: How can I create a config/table/array that is accessible by Bash and Python?
Post by: jackg on October 07, 2020, 04:14:57 PM
What exactly are you trying to do? You can import an api to the command line via "import os" in python and then do os.system("your command here")?

Eg
Code:
import os
os.system("echo 'hello world!'")


Title: Re: How can I create a config/table/array that is accessible by Bash and Python?
Post by: bitmover on October 07, 2020, 09:44:03 PM
I would like to construct a config file that is accessible by both a Bash script and a Python script.
https://rb.gy/rgdmwz

For example:

"Item1" 64 "Blue" "B1UE"
"Item2" 45 "Red" "R3D"
"Item3" 95 "Green" "GR33N"
What can I do to easily import to both Bash and Python? Was thinking maybe to create it in JSON format, does anyone have any recommendations?

Maybe you are in the wrong forum?
https://stackoverflow.com/

I believe some people can help you here with some coding, but usually this is a place to discuss bitcoin related coding. In Stackoverflow you will find better help.