1

npyscreenには、日付を選択するためのウィジェット「DateCombo」と「TitleDateCombo」があります。

urwidに似たようなものはありますか? そうでない場合、推奨されるサードパーティ ライブラリはありますか?

npyscreen を使用した例を次に示します。

ここに画像の説明を入力

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import npyscreen

class DateForm(npyscreen.Form):
    def afterEditing(self):
        self.parentApp.setNextForm(None)

    def create(self):
        self.date = self.add(npyscreen.TitleDateCombo, name="Date")

class TestApplication(npyscreen.NPSAppManaged):
    def onStart(self):
        new_user = self.addForm("MAIN", DateForm, name="Read Date")

if __name__ == "__main__":
    TestApplication().run()
4

2 に答える 2