should help you out How to store a password containing # in a config file .I have a config file of frmat .cfg and when i try to store password finally#! in the variable password the #! gets commented.I am using python to read the file .cfg.I am using ubuntu , wrap it around with single quot?
With these it helps I want to assign numbers to words (starting from one) and create two lists, one of the words, one of the numbers. Then create a file and store both lists in it. So far I have: , What you can try (if this is what you want) is:
sentence = input('Please enter a sentence: ')
list_of_words = sentence.split()
words_with_numbers = enumerate(list_of_words, start=1)
filename = 'yourfilename.txt'
with open(filename, 'w+') as file:
file.write(str(list_of_words) + '\n' + str(words_with_numbers) + '\n')
How to take a word from a file, and store it in a variable? C++
this one helps. Your comp_selection is defined as a std::string, but you are comparing it against a char ('r', etc). You should compare it against another string ("r") or just redefine comp_selection to be a character:
Find the specific word in the text file and to store that word in array list