File: csv_2_py

package info (click to toggle)
mayavi2 4.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,892 kB
  • sloc: python: 49,447; javascript: 32,885; makefile: 129; fortran: 60
file content (30 lines) | stat: -rwxr-xr-x 499 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python

# Small tool to read .csv files and print the .py files for the tests

import sys
import pprint

from mayavi.tools.wizards.csv_sniff import Sniff


filename = sys.argv[1]

s = Sniff(filename)

d = {'kwds': s.kwds(),
     'array': s.loadtxt()}

pp = pprint.PrettyPrinter(indent=2, width=40)

out = pp.pformat(d)
out = out.replace("<type 'float'>", 'float')
out = out.replace("'<f8'", 'float')
out = out.replace("|S", 'S')

print(out)


# Local Variables:
# mode: python
# End: