I've just developed my first python program! In order to learn something more out of it I think the best idea and post it here. I'm just wondering if there is a better way to write this program.
It is a python program that brings "i-ching, the book of mutations" with the translation by Richard Wilhelm, on command line.
The complete project is on github: https://github.com/roorco/CliChing/blob/master/cliching.py
Interesting to note: in order to recognize which hexagram the program extracts, it transforms the hexagram in a binary number. In coding this I suppose I understood how Leibniz discovered the binary number studying I-Ching.
Thanks to this exercise I understood better the classes in Python but still one thing is not clear for me:
if I wrote:
class Line(object):
def intro():
...
and the end of the code I call:
Line().intro()
the result will be:
TypeError: intro() takes no arguments (1 given)
Why? The only way I figure out is giving a 'x' argument to intro. Other ways are possible?
If you like to, please leave me some feedback.