Created
May 18, 2018 16:43
-
-
Save ssirois/7f1b09b2987397fe2635235346771a33 to your computer and use it in GitHub Desktop.
Python string builder ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConfigurationFile(): | |
def __init__(self, config1, config2): | |
self._config1 = config1 | |
self._config2 = config2 | |
def output_file(self): | |
print( | |
"configuration-group={\n" | |
" config1=\"" + self._config1 + "\"\n" | |
" config2=\"" + self._config2 + "\"\n" | |
"}" | |
) | |
myConfigFile = ConfigurationFile('value of config 1', 'value of config 2') | |
myConfigFile.output_file() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're using python 3.6 ; You could use f-strings