Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Reading variables from a .Config file using a Python script based on condition

$
0
0

I have a python script which generates a feed file for downstream. The feed file name is being picked from a variable inside sample.config file. For e.g FEED_FILE = my_feed_file.dat. My requirement is that feed name variable from the sample.config file should be picked on a condition. Say if conditiion 1 is met then below file name should be picked.

##Variable name in sample.configFEED_FILE = <my_feed_file1.dat>

If not then below file name should be picked.

##Variable name in sample.configFEED_FILE = <my_feed_file.dat>

Is this doable? Is yes, can someone please help in achieving this?

I tried the following logic in my sample.config file but did not succeed:

@if ( true ){    Feed_FILE = "my_feed_file_1.dat";}@else{    Feed_FILE = "my_feed_file.dat";}

Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>