#yaml檔案:
test_obj:
host: 192.168.5.93
port: 1521
user: test3
password: srttest3
server: service_name=mcrm
test_obj1:
host: 192.168.5.93
port: 1521
user: test3
password: srttest3
server: service_name=mcrm
#操作函式:
require "yaml"
require 'pathname'
require 'datebaseos'
#yaml.yml檔案的位址
file_path=file.join(pathname.new(file.dirname(__file__)).realpath,'yaml.yml')
open_file =file.open(file_path)
ruby_obj = yaml::load(open_file)
host = ruby_obj['test_obj']['host']
port = ruby_obj['test_obj']['port']
user = ruby_obj['test_obj']['user']
password = ruby_obj['test_obj']['password']
server = ruby_obj['test_obj']['server']
@query = "select right_id from tab_xn_adminright t where t.admin_id=613"
@tablename="tab_xn_adminright"
puts query_db_single(host,port,user,password,server)
python 配置檔案 操作yaml檔案
修改前 chrome path chromedriver.exe jobs a1 uestcedu url 修改後 chrome path chromedriver.exe jobs a1 a2 new uestcedu url usr bin env python coding utf 8 tim...
python操作YAML檔案之pyyaml庫
yaml是一種被認為可以超越xml json的配置檔案,最早接觸是spring boot,木有想到python也是支援的,遂研究一下。python解析yaml庫叫做pyyaml,話說這個名字一點也不酷,按照習俗應該會省略掉乙個y叫做pyaml之類的呀。執行setup.py安裝 python setu...
python操作YAML檔案之pyyaml庫
yaml是一種被認為可以超越xml json的配置檔案,最早接觸是spring boot,木有想到python也是支援的,遂研究一下。python解析yaml庫叫做pyyaml,話說這個名字一點也不酷,按照習俗應該會省略掉乙個y叫做pyaml之類的呀。執行setup.py安裝 python setu...