summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/asymptote.py
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/asymptote/asymptote.py')
-rw-r--r--Master/texmf-dist/asymptote/asymptote.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Master/texmf-dist/asymptote/asymptote.py b/Master/texmf-dist/asymptote/asymptote.py
index 71e7b9beed6..19b72c50826 100644
--- a/Master/texmf-dist/asymptote/asymptote.py
+++ b/Master/texmf-dist/asymptote/asymptote.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
# Python module to feed Asymptote with commands
# (modified from gnuplot.py)
from subprocess import *
@@ -6,7 +8,7 @@ class asy:
self.session = Popen(['asy','-quiet','-inpipe=0','-outpipe=2'],stdin=PIPE)
self.help()
def send(self, cmd):
- self.session.stdin.write(cmd+'\n')
+ self.session.stdin.write(bytes(cmd+'\n','utf-8'))
self.session.stdin.flush()
def size(self, size):
self.send("size(%d);" % size)
@@ -23,10 +25,10 @@ class asy:
def erase(self):
self.send("erase();")
def help(self):
- print "Asymptote session is open. Available methods are:"
- print " help(), size(int), draw(str), fill(str), clip(str), label(str), shipout(str), send(str), erase()"
+ print("Asymptote session is open. Available methods are:")
+ print(" help(), size(int), draw(str), fill(str), clip(str), label(str), shipout(str), send(str), erase()")
def __del__(self):
- print "closing Asymptote session..."
+ print("closing Asymptote session...")
self.send('quit');
self.session.stdin.close();
self.session.wait()