Revision history  [back]

Shell? CYGWIN? EP-Macro? This is 2015!

python>>

for i in glob('*.idf'):
   for w in glob('*.epw'):
      subprocess.call(["EnergyPlus -p %s -w %s %s" % (i[:-len('.idf')] + '_' + w[:-len('.epw')], w, i)])

Good night, drive home safely!

PS Thanks to @scottb for pointer to 'glob' (basically a 'listdir' with regular expressions, like a shell 'ls')!

Shell? CYGWIN? EP-Macro? This is 2015!

python>>

for i in glob('*.idf'):
   for w in glob('*.epw'):
      subprocess.call(["EnergyPlus call(["EnergyPlus -p %s -w %s %s" % (i[:-len('.idf')] + '_' + w[:-len('.epw')], w, i)])

Good night, drive home safely!

PS Thanks to @scottb for pointer to 'glob' (basically a 'listdir' with regular expressions, like a shell 'ls')!

Shell? CYGWIN? EP-Macro? This is 2015!

python>>

for i in glob('*.idf'):
[f in glob('*.idf')]:
   for w in glob('*.epw'):
[f in glob('*.epw')]:
      call(["EnergyPlus -p %s -w %s %s" % (i[:-len('.idf')] + '_' + w[:-len('.epw')], w, i)])

Good night, drive home safely!

PS Thanks to @scottb for pointer to 'glob' (basically a 'listdir' with regular expressions, like a shell 'ls')!

Shell? CYGWIN? EP-Macro? This is 2015!

python>>

for i in [f in glob('*.idf')]:
listdir('.') if f[-len('.idf'):] == '.idf']:
   for w in [f in glob('*.epw')]:
listdir('.') if f[-len('.epw'):] == '.epw']:
      call(["EnergyPlus -p %s -w %s %s" % (i[:-len('.idf')] + '_' + w[:-len('.epw')], w, i)])

Good night, drive home safely!