I made a telnet server library for python reddit / bbs ---------------------------------------------------------------------- oderjunks · 2020-10-23 19:15 I hope it helps anyone but since I haven't added a proper long description, probably no one will use it. [https://pypi.org/project/telserv/0.1/](https://pypi.org/project/telse rv/0.1/) EDIT: Docs added EDIT 2: PiP doesn't work, use git. ---------------------------------------------------------------------- CharlieBrown197 · 2020-10-23 19:46 How does it work? Does the server just allow you to print whatever is going on in the python output to the telnet client? This sounds cool, and I absolutely might use this if this can do what I think it can! ---------------------------------------------------------------------- [deleted] · 2020-10-23 21:29 [deleted] ---------------------------------------------------------------------- oderjunks · 2020-10-23 22:24 Its a simple system to turn functions into BBSes. [ TIME: 1:08 why am I awake ] ```python import telserv as tel def main(line): # "line" Represents the terminal or command LINE. line.printnonew('This text gets printed without a newline.\r\nI need to manually place newlines.\r\n') line.print('This print function does have a newline.') # line.bbtoans(string) converts bbcode into ANSI escape sequences. # line.printbb and line.printbbnonew use line.bbtoans line.printbb('This is [b]BBcode[/b] text. It gets [b][color=91]converted[/color][/b] to [b][color=94]ANSI[/color][/b].') # line.input(term='\r\n') Takes input from user until it gets the terminator. line.printbb('Username: [b][color=91]') username = line.input() line.printbb('[/color][/b]Password: [b][color=94]') # line.inputhidden(placeholder, delim='\r\n') Takes user input and hides it using the placeholder, if the args are ('',' ') it waits for user input of 1 char and doesn't show it. password = line.inputhidden('*') line.printbb('\1b[m\1b[1mThank you!') # You can still use ANSI codes as shown here. server = tel.TelnetServer(main) # TelnetServer(func, port=23) server.start() # Starts the server, non blocking. ``` EDIT: omg MD on reddit is so annoying sometimes ---------------------------------------------------------------------- CharlieBrown197 · 2020-10-23 23:46 I love this! This may just convince me to give a 3rd shot at getting a decent BBS up and running once I actually have some time to really commit. Thanks for this. It really does look like good work, and I am sure some other guys will be interested in this. ---------------------------------------------------------------------- oderjunks · 2020-10-24 00:03 Thanks! also correction: printbb and printbbnonew NOT bbprint and bbprintnonew. ---------------------------------------------------------------------- banksy_h8r · 2020-10-24 09:58 import telserv as tel def main(line): # "line" Represents the terminal or command LINE. line.printnonew('This text gets printed without a newline.\r\nI need to manually place newlines.\r\n') line.print('This print function does have a newline.') # line.bbtoans(string) converts bbcode into ANSI escape sequences. # line.printbb and line.printbbnonew use line.bbtoans line.printbb('This is [b]BBcode[/b] text. It gets [b][color=91]converted[/color][/b] to [b][color=94]ANSI[/color][/b].') # line.input(term='\r\n') Takes input from user until it gets the terminator. line.printbb('Username: [b][color=91]') username = line.input() line.printbb('[/color][/b]Password: [b][color=94]') # line.inputhidden(placeholder, delim='\r\n') Takes user input and hides it using the placeholder, if the args are ('',' ') it waits for user input of 1 char and doesn't show it. password = line.inputhidden('*') line.printbb('\1b[m\1b[1mThank you!') # You can still use ANSI codes as shown here. server = tel.TelnetServer(main) # TelnetServer(func, port=23) server.start() # Starts the server, non blocking. ---------------------------------------------------------------------- oderjunks · 2020-10-24 11:59 THANK YOU. ---------------------------------------------------------------------- oderjunks · 2020-11-12 20:14 20 Days later: If anyone's wondering if I'm still working on it, Yes! [Top sneaky for next update](https://imgur.com/a/xqkGGn4)