Skip to content

Instantly share code, notes, and snippets.

@lpenguin
Created November 10, 2015 20:50
Show Gist options
  • Save lpenguin/2d545ab747494b62731f to your computer and use it in GitHub Desktop.
Save lpenguin/2d545ab747494b62731f to your computer and use it in GitHub Desktop.
read file
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