Kviy button to show current date

392 views
Skip to first unread message

Mike Epps

unread,
Oct 20, 2014, 12:16:50 PM10/20/14
to kivy-...@googlegroups.com
Hello,
    How can I create a kivy button that shows the current date using the linux command   "date".
    More specific how can I use the on_press kv file function.

Zakatell Kanda

unread,
Oct 20, 2014, 10:48:11 PM10/20/14
to kivy-...@googlegroups.com
Kivy is python so you can use all standard library, in your case I would use the subprocess library.
on_press can call any python source code.

Regards,
Zakatell

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mihály Mirk

unread,
Oct 21, 2014, 2:49:26 AM10/21/14
to kivy-...@googlegroups.com
Do you mean something similar?

.kv:

#:kivy 1.8.0
#:import datetime datetime

Button:
    text: str(datetime.datetime.now())

ZenCODE

unread,
Oct 21, 2014, 3:02:22 AM10/21/14
to kivy-...@googlegroups.com
+1 @Mihály Mirk
Reply all
Reply to author
Forward
0 new messages