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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/// Creates a csv writer to the given file path.
///
/// ## Usage:
/// ```no_run
/// use make_csv::{csv_start, csv_entry};
///
/// let mut wtr = csv_start!("out.csv");
/// ```
/// Adds a row to the given csv writer.
///
/// ## Syntax:
/// `csv_entry!(writer <- one, two, three)`
/// Here, `one` etc are expressions that can be formatted to String.
///
/// ## Usage:
/// ```no_run
/// use make_csv::{csv_start, csv_entry, csv_stop};
///
/// let mut wtr = csv_start!("out.csv");
/// csv_entry!(wtr <- "header_0", "header_1");
/// csv_entry!(wtr <- 0.0, 1.0);
/// csv_stop!(wtr);
/// ```
/// This will result in the following `.csv` file:
/// ```csv
/// header_0,header_1
/// 0.0,1.0
/// ```
/// Flushes the writer and writes to file.
///
/// ## Usage:
/// ```no_run
/// use make_csv::{csv_start, csv_entry, csv_stop};
///
/// let mut wtr = csv_start!("out.csv");
/// csv_entry!(wtr <- "header_0", "header_1");
/// csv_entry!(wtr <- 0.0, 1.0);
/// csv_stop!(wtr);
/// ```
///
/// Runs a python file and blocks until it completes.
///
/// Useful for plotting using a file `plot.py` which
/// reads some `.csv` file and plots the data.
///
/// ## Arguments
/// - `arg0, arg1, arg2, ...`: comma separated arguments to be
/// passed to python3 (python filename for example)
///
/// ## Requirements
/// `python3` needs to be in PATH.
///
/// ## Usage
/// ```no_run
/// make_csv::python!("plot.py", "data.csv");
/// ```