Skip to content

Commit 45c3dca

Browse files
committed
Update ct_python example.
1 parent f02ac85 commit 45c3dca

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

macros/examples/example.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
use inline_python_macros::ct_python;
44

5-
static DIRECTIONS: [(f64, f64); 32] = ct_python! {
5+
ct_python! {
6+
print("static A: i32 = 1;")
7+
}
8+
9+
static DIRECTIONS: [(f64, f64); 4] = ct_python! {
610
from math import sin, cos, tau
7-
n = 32
11+
n = 4
812
print("[")
913
for i in range(n):
10-
x = cos(i / n * tau)
11-
y = sin(i / n * tau)
12-
print(f"({x}, {y}),")
14+
print(f"({cos(i / n * tau)}, {sin(i / n * tau)}),")
1315
print("]")
1416
};
1517

1618
fn main() {
19+
dbg!(&A);
1720
dbg!(&DIRECTIONS);
1821
}

0 commit comments

Comments
 (0)