473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

curses for different terminals

Hi all,

I want to use curses in a server application that provides a GUI for
telnet clients. Therefore, I need the functionality to open and handle
several
screens. Concerning
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However, this
function seems not to be defined in the python library. Does anyone know
how this can be done in python?

cheers,

- harold -

--
Life is what happens while you're busy making other plans
-- John Lennon

Jul 19 '05 #1
3 2794
On Thu, 14 Apr 2005 18:39:14 +0200, rumours say that harold fellermann
<ha***************@upf.edu> might have written:
Hi all, I want to use curses in a server application that provides a GUI for
telnet clients. Therefore, I need the functionality to open and handle
several
screens.
Just to make sure we understand what you want to do:

1. Are you doing an single process application that produces output on
many terminals? ie the program is kind of like a service?

2. Are you doing an application with one session per terminal? ie a
user starts your app in every terminal, no multi-term output from a
single process.

3. Are you doing an application that runs on one terminal but with many
"virtual" sessions (or screens), kind of like the `screen(1)` program or
the behaviour of the linux or Novell console?
Concerning
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However, this
function seems not to be defined in the python library. Does anyone know
how this can be done in python?


Select one of the above, or describe more the desired situation if I
didn't cover your case, and we will try to help you more.

--
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...
Jul 19 '05 #2

On 14.04.2005, at 19:17, Christos TZOTZIOY Georgiou wrote:
On Thu, 14 Apr 2005 18:39:14 +0200, rumours say that harold fellermann
<ha***************@upf.edu> might have written:
Hi all,

I want to use curses in a server application that provides a GUI for
telnet clients. Therefore, I need the functionality to open and handle
several
screens.


Just to make sure we understand what you want to do:

1. Are you doing an single process application that produces output on
many terminals? ie the program is kind of like a service?


gotcha. I want to write a TCP server that handles incoming requests in
threads (one thread per request using SocketServer.ThreadingTCPServer).
Now, I want the server to use curses for client-server communication
(client will be telnet). Thus, my programm runs in a single process
(although several threads) and provides several curses screens (one for
each client.)
Concerning
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However,
this
function seems not to be defined in the python library. Does anyone
know
how this can be done in python?


Select one of the above, or describe more the desired situation if I
didn't cover your case, and we will try to help you more.


great, thanks,

- harold -

--
Dieses Schreiben wurde maschinell erstellt und bedarf daher keiner
Unterschrift.
--

Jul 19 '05 #3
On Thu, 14 Apr 2005 19:38:26 +0200, rumours say that harold fellermann
<ha***************@upf.edu> might have written:
1. Are you doing an single process application that produces output on
many terminals? ie the program is kind of like a service?
gotcha. I want to write a TCP server that handles incoming requests in
threads (one thread per request using SocketServer.ThreadingTCPServer).
Now, I want the server to use curses for client-server communication
(client will be telnet). Thus, my programm runs in a single process
(although several threads) and provides several curses screens (one for
each client.)


I see. At first, here is some relevant source from
Modules/_cursesmodule.c :

"""
A number of SysV or ncurses functions don't have wrappers yet; if you
need
a given function, add it and send a patch. Here's a list of currently
unsupported functions:

addchnstr addchstr chgat color_set define_key
del_curterm delscreen dupwin inchnstr inchstr innstr keyok
mcprint mvaddchnstr mvaddchstr mvchgat mvcur mvinchnstr
mvinchstr mvinnstr mmvwaddchnstr mvwaddchstr mvwchgat
mvwgetnstr mvwinchnstr mvwinchstr mvwinnstr newterm
resizeterm restartterm ripoffline scr_dump
scr_init scr_restore scr_set scrl set_curterm set_term setterm
tgetent tgetflag tgetnum tgetstr tgoto timeout tputs
vidattr vidputs waddchnstr waddchstr wchgat
wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl
"""

So the answer is that, no, you can't use newterm currently.

But even if you did, it's not certain that you could use multiterminal
ncurses in a multithreaded environment; AFAIK in ncurses you just change
the "current" term and then go on with normal curses calls; is there a
"current" term per thread, or is there one per process? I couldn't find
an answer in the short search I did.

I am afraid you will have to make it into a 3-tier arch; that is, your
server has the data model and absolutely no curses knowledge, and the
clients run a middle application, interfacing ncurses I/O and server
protocol.
--
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brian Victor | last post by:
I am attempting to write a curses-based program. I would like to use the default terminal background rather than a black one (a significant difference with transluscent terminals, regardless of...
7
by: M.Senthil Kumar | last post by:
hai all, I need a help from you. I 'm working in a project using "curses.h" in Linux using 'C'. I have some doughts regarding menus and line. 1. I used to draw box in window using...
30
by: Ian Ward | last post by:
When I run the following code in a terminal with the encoding set to UTF-8 I get garbage on the first line, but the correct output on the second. import curses s = curses.initscr()...
4
by: meLlamanJefe | last post by:
I have a C++ application that instantiates various instances of the same object (let's call it MainExec) and puts them into a vector. Each instance of a MainExec runs in its own thread. The code was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.