macson taylor
macson taylor

Reputation: 181

Python/Kivy : add a calendar in kivy

I am new to kivy/python.I want to add a calendar on textBox.
this code gives error ImportError: No module named KivyCalendar
Can someone tell me how to make it?
Any advise or guidance would be greatly appreciated..!!

demo.py

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
from kivy.uix.popup import Popup
from KivyCalendar import CalendarWidget


class SetIndex(BoxLayout):
    def setDate(self, *args):
        popup = Popup(title='Insert Old Date', content=CalendarWidget(), size_hint=(.9, .5)).open()


class Demo(App):
    def bulid(self):
        return SetIndex()


if __name__ == '__main__':
    Demo().run()

demo.kv

BoxLayout:
    orientation: "vertical"
    size_hint: 1, .4

    TextInput:
        id: old_date
        hint_text: "Old Date"
        on_focus: root.setDate()

Upvotes: 0

Views: 8960

Answers (1)

Pmp P.
Pmp P.

Reputation: 507

the KivyCalendar is an extra module you can find here https://pypi.python.org/pypi/KivyCalendar and install with "python setup.py install" or on posix system just use "sudo -H pip install KivyCalendar" from a terminal prompt to get it downloaded, built and installed system wide.

Upvotes: 3

Related Questions