Petra Lamborn 5 years ago
parent
commit
03cea601d2
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      py/pickletocsv.py

+ 1
- 1
py/pickletocsv.py View File

4
 import pandas as p
4
 import pandas as p
5
 
5
 
6
 def main():
6
 def main():
7
-    signal(SIGPIPE, SIG_DFL) # Prevent broken pipe errors when piping to less or head
8
     parser = ArgumentParser(description='Transform a "pickle" to a csv file')
7
     parser = ArgumentParser(description='Transform a "pickle" to a csv file')
9
     parser.add_argument(dest="input",      help = "input pickle path", type = FileType('rb'))
8
     parser.add_argument(dest="input",      help = "input pickle path", type = FileType('rb'))
10
     parser.add_argument(dest="output",  nargs="?",   help = "output csv path", type = FileType('w'))
9
     parser.add_argument(dest="output",  nargs="?",   help = "output csv path", type = FileType('w'))
27
         print(ptc.info())
26
         print(ptc.info())
28
         print("Saving as csv")
27
         print("Saving as csv")
29
 
28
 
29
+    signal(SIGPIPE, SIG_DFL) # Prevent broken pipe errors when piping to less or head
30
     ptc.to_csv(args.output, index = args.rownames)
30
     ptc.to_csv(args.output, index = args.rownames)
31
 
31
 
32
 
32