Answer the question
In order to leave comments, you need to log in
How to make a dictionary from a list of strings in Sublime text 3 in Python?
How to create a dictionary from a simple list of strings? About 1000 lines.
Previously:
Apple Inc.
Google Inc.
Microsoft
Became:
dictionary = { 'Apple Inc.' : '',
'Google Inc.' : '',
'Microsoft' : ''}
How to automate? Plugins, hotkeys?
Answer the question
In order to leave comments, you need to log in
dictionary = {}
with open('filename', 'r', encoding="utf-8") as f:
for l in f:
dictionary[l.strip()] = ''
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question