Closed zhashuyu closed 7 years ago
Will run some tests on Python 3, but should work.
But I didn't get it work , the error is bellow
[boomer@boomer prometheus-report]$ python3
Python 3.6.2 (default, Aug 11 2017, 11:59:59)
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyGnuplot import *
>>> c("plot sin(x)")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/PyGnuplot.py", line 63, in c
proc.stdin.write(command + '\n') # \n 'send return'
TypeError: a bytes-like object is required, not 'str'
>>>
I found solution from https://stackoverflow.com/questions/5965874/python-3-writing-to-a-pipe, see below
proc.stdin.write(bytearray(command + '\n', 'utf-8'))
Ok thank you, you were faster than me :)
hi, is this going to support python3?