safeboot-loader
safeboot-loader copied to clipboard
How do I display the ncurses form?
I would like to draw a login box using python. I copied the python and ran the script, but nothing was shown on the screen.
import npyscreen
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
F = npyscreen.Form(name = "LOGIN",)
t = F.add(npyscreen.TitleText, name = "Login:",)
t = F.add(npyscreen.TitlePassword, name = "Password:",)
# This lets the user interact with the Form.
F.edit()
if __name__ == "__main__":
App = TestApp()
App.run()
safeboot-loader doesn't include python, so I'm not sure where you want to run this application.
I added python myself. After that I wrote an example in c and it doesn't work either.
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
Error opening terminal: linux.
I did this directly in initrd
@osresearch What do you think of that?