Opening Multiple Files with their paths in a list
So I'm trying to write a script (I have no computer science background so
bare with me please) that gathers a certain type of file from a data
folder, opens all of them in their default program (called iNMR) and
processes them with different mathematical functions, gather some values,
and record those in a text file.
Right now i'm just trying to focus on opening all of the files.
Here's what I have so far:
import os
import glob
import subprocess
os.chdir("/Users/BabyJ/Desktop/MRSDATA")
reflist = glob.glob('*raw_ref.SDAT')
actlist = glob.glob('*raw_act.SDAT')
for i in reflist:
open('%r') %i
for i in actlist:
open('%r') %i
Yes I want to open all of the files at once, but I'm not too sure of the
syntax of open(). I need to open the file as if I were double clicking the
file, but i'm pretty sure it only opens it in the python background or
whatever it is so that I can edit it. But I need to do physical clicks on
it, so I need it open physically.
Thank you so much for your time! Any help is appreciated!
No comments:
Post a Comment