Monthly Archives: March 2014

Kivy Programming Contest 2014

Kivy is organizing its second application development contest!. This is a great chance for users both new and experienced to show off their skills and compete for prizes. Entries will be judged on a range of criteria accessible to both … Continue reading Continue reading

Posted in Coding, Kivy, Planet Python | Comments Off on Kivy Programming Contest 2014

2048, in Python / Kivy

If you don’t know the 2048 puzzle yet, you should. But be careful, it’s time consuming. I won’t go on the whole clone history of the game, but will just say that if you want to play it on the … Continue reading Continue reading

Posted in Coding, Kivy, Planet Python | Comments Off on 2048, in Python / Kivy

Prepare for the Kivy contest #2

Developers, developers… rejoice!

kivy contest

The kivy project is organizing a second contest!

From the 15th of April, when the theme will be revealed, to the 15th of May, the final deadline, all the interested candidates will compete to produce the nicest application possible, once month to make the difference, and collect prices :).

Prizes will be announced before the beginning of the contest, the python software foundation kindly offered to sponsor the contest, if you are or know somebody interested in sponsoring the contest, please contact us at contest@kivy.org.

Continue reading

Comments Off on Prepare for the Kivy contest #2

Prepare for the Kivy contest #2

Developers, developers… rejoice!

The kivy project is organizing a second contest!

From the 15th of April, when the theme will be revealed, to the 15th of May, the final deadline, all the interested candidates will compete to produce the nicest ap… Continue reading

Comments Off on Prepare for the Kivy contest #2

Kivy’s bind method

One of the most common problems for new Kivy users is misunderstanding
how the bind method works, especially amongst newer Python users who
haven’t fully formed their intuition about function calls. For
instance, a user will write code like:

some_screenmanager.bind(current=a_function(arg1, arg2))

Here, the idea is that when the current property changes, it
will call a_function with the arguments arg1 and
arg2.

The problem is that Python itself doesn’t work like
this; the bind method doesn’t know about the existence of
a_function or its arguments, it only receives the result of
this function call. This often leads to confusion when a user doesn’t
understand why the binding is only called once, during the declaration
of the binding.

Stepping back, our real goal is to call a_function with the
given arguments, but bind needs to be passed a function if it
is to work correctly. That means we can solve our problem by creating
a new function with these arguments already passed (and discarding the
extra arguments automatically passed by bind).

It’s usually convenient to do this with the partial function
from the functools module:

from functools import partial
some_screenmanager.bind(current=partial(a_function,arg1, arg2))

partial returns a new function that will automatically be
passed arg1 and arg2, exactly as we want. You can also pass kwargs
this way.

This isn’t the only way to solve the problem, we could have created a
lambda function (though the syntax is longer and can have scope
problems) or an entire new function with def syntax, but both
of these are more complicated than the simple use of
partial. So if you need to do a binding in Python, look at
this way first!

Continue reading

Posted in Kivy, Python | Comments Off on Kivy’s bind method

Kivy’s bind method

One of the most common problems for new Kivy users is misunderstanding
how the bind method works, especially amongst newer Python users who
haven’t fully formed their intuition about function calls. For
instance, a user will write code like:… Continue reading

Posted in Kivy, Python | Comments Off on Kivy’s bind method

Kpritz

Just because it seemed not to hard, i spent the evening (actually about 2 hours) making a Spritz clone using kivy.

Code is a bit crude and all, but here it is for your enjoyment:

https://gist.github.com/9316552

Here is an apk if you want to actually try it.

Only flat text files are supported, opening the option window is a bit slow (because of ColorPickers), but it’s functionnal, progression is saved, all the options i though were needed are there, and it seems usable.

You can find a lot of free book in the .txt format over at project gutenberg.

Continue reading

Comments Off on Kpritz

Kpritz

Just because it seemed not to hard, i spent the evening (actually about 2 hours) making a Spritz clone using kivy.

Code is a bit crude and all, but here it is for your enjoyment:

https://gist.github.com/9316552

Here is an apk if you want to actually… Continue reading

Comments Off on Kpritz