Created
November 10, 2015 20:50
-
-
Save lpenguin/2d545ab747494b62731f to your computer and use it in GitHub Desktop.
read file
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
file_name = '/path/to/file' | |
pubchem_ids = [] | |
# reading all pubchem ids | |
with open(file_name) as f: | |
for line in f: | |
# removing endline symbols | |
line = line.rstrip('\n') | |
# convert to int | |
pubchem_id = int(line) | |
pubchem_ids.append(pubchem_id) | |
for cid in pubchem_ids: | |
# do stuff | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment