-
Notifications
You must be signed in to change notification settings - Fork 27
no attribute PYGmain #9
Comments
Hi!
Here's a simple hello world example: from pygopherd.handlers.pyg import PYGBase
from pygopherd.gopherentry import GopherEntry
class PYGMain(PYGBase):
def canhandlerequest(self):
return True
def isdir(self):
return False
def getentry(self):
entry = GopherEntry(self.selector, self.config)
entry.type = '0'
entry.mimetype = 'text/plain'
entry.name = 'My custom .pyg handler!'
return entry
def write(self, wfile):
wfile.write("hello world!".encode()) If you're looking for something that just works like a CGI script, you can use the |
Thank you @michael-lazar ! Pygfarm example is indeed complicated, but I do understand better now what pyg files are and how they work. Regarding Exechandler, I assume files must be executables python files ? |
no problem!
They can be any kind of file (python, bash, perl, etc.) as long as the file is set to executable and has the shebang at the top. The catch is that the |
Hi,
I'm trying to use PYGhandler and generate a very simple print() just to see what happen
so far my file test.pyg looks like this
But I get this error
Am I missing something in my file ?
Thanks !
The text was updated successfully, but these errors were encountered: