Bitcoin Forum
July 17, 2024, 06:22:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can I create a config/table/array that is accessible by Bash and Python?  (Read 114 times)
selenanur (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile WWW
October 07, 2020, 06:25:05 AM
 #1

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?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
October 07, 2020, 04:14:57 PM
 #2

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!'")
bitmover
Legendary
*
Offline Offline

Activity: 2366
Merit: 6132


bitcoindata.science


View Profile WWW
October 07, 2020, 09:44:03 PM
 #3

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!