1. Wilfried Huss
  2. sws2tex

Commits

whuss  committed 8fea7f1

Use module "tarfile" to extract the sage worksheet.

  • Participants
  • Parent commits 89f769e
  • Branches default

Comments (0)

Files changed (1)

File sws2tex.py

View file
  • Ignore whitespace
     print "Temp directory: "+temp_dir
     print "Input filename: "+input_filename
 
-command = "tar xjvf %s --directory=%s" % (input_filename, temp_dir)
-result = os.popen(command).read()
-if not options.quiet:
-    print result
+# extract sage worksheet
+import tarfile
+tar = tarfile.open(input_filename)
+tar.extractall(path = temp_dir)
+tar.close()
 
 worksheet = open(temp_dir + os.sep + "sage_worksheet" + os.sep + "worksheet.html", 'r')
 try: