Advertisement
Guest User

Untitled

a guest
May 29th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. from subprocess import call
  2. import sys
  3. import os
  4.  
  5. argv = sys.argv
  6.  
  7. file_string = argv[1].split('.')[0]
  8. print file_string
  9.  
  10. outfile = open('output_file_finished', 'w+')
  11.  
  12. files = []
  13.  
  14. for filename in os.listdir("."):
  15. if filename.startswith(file_string + "_"):
  16. files.append(filename)
  17.  
  18. file_num = len(files)
  19.  
  20. outfiles = []
  21. count = 1
  22. string_for_cat = "cat"
  23. for i in range(file_num):
  24. filename = file_string + "_" + str(i + 1) + ".jpg"
  25. call(["java", "-jar","f5.jar", "x", "-e", "output_file" + str(count), filename])
  26. outfiles.append("output_file" + str(count))
  27. string_for_cat = string_for_cat + " /Users/Kevin/Desktop/file_system/tmp/output_file" + str(count)
  28. count+=1
  29.  
  30.  
  31. string_for_cat = string_for_cat + " > out_file_finished.mp3" #we need to change this to mp3 manually right now
  32. os.system(string_for_cat)
  33. print string_for_cat
  34. os.system("rm " + file_string + "_*")
  35. os.system("rm output_*")
  36.  
  37. print files
  38.  
  39. #full_list_of_files = ' '.join(outfiles)
  40.  
  41. #call(["cat", full_list_of_files])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement