mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 14:29:11 +00:00
Initial commit
This commit is contained in:
22
example/example3.py
Executable file
22
example/example3.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
sys.path.append('.')
|
||||
|
||||
from example import Vector2, Vector
|
||||
|
||||
v1 = Vector2(1, 2)
|
||||
v2 = Vector(3, -1)
|
||||
|
||||
print("v1 = " + str(v1))
|
||||
print("v2 = " + str(v2))
|
||||
print("v1+v2 = " + str(v1+v2))
|
||||
print("v1-v2 = " + str(v1-v2))
|
||||
print("v1-8 = " + str(v1-8))
|
||||
print("v1+8 = " + str(v1+8))
|
||||
print("v1*8 = " + str(v1*8))
|
||||
print("v1/8 = " + str(v1/8))
|
||||
|
||||
v1 += v2
|
||||
v1 *= 2
|
||||
|
||||
print("(v1+v2)*2 = " + str(v1))
|
||||
Reference in New Issue
Block a user