diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-28 18:48:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-28 18:48:48 +0000 |
commit | 3a9439b815af6c2d41c60f6694d88f2852544442 (patch) | |
tree | 6cc1c05e02ef84a1aeb2448b30814d7fc360ed9e /Master/texmf-dist/asymptote/asymptote.py | |
parent | 61a286ce26800c5976ff5c8c8795dc7eea404fd2 (diff) |
asymptote 2.47 support files
git-svn-id: svn://tug.org/texlive/trunk@50168 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/asymptote.py')
-rw-r--r-- | Master/texmf-dist/asymptote/asymptote.py | 10 |
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() |