hi all
I am no expert in Python although I can see the wonder it does with Pure Data
I am looking for a way to use pyext in PD to write user input (on Pure Data) into a textfile and also to be able to read it from the text file (line by line, or character by character) and to display on GEM. I thought it is better to use Python to manipulate text rather than PD.
I tried with this but it didnt work
import pyext
class text(pyext._class):
_inlets=2
_outlets=2
def write(self, *args):
a = args
file = open("datafile.txt", "w")
file.write(a)
file.close()
def read(self):
file = open("datafile.txt", "r")
filedata = file.read()
file.close()
self._outlet(1, filedata)
It would be great if you someone could guide me as I am pretty desperate for help! its for my Master project.