Closed Maltysen closed 8 years ago
This can only be aproved, there is no possible regression merging this (AFAIK).
Just a curiosity, why would you use pyth for daily calculation tasks while other languages (e.g python) have much more natural syntax ( 5+4
, instead of +5 4
) ?
Probably because Pyth has more prebuild functions. It's easy to count the
number of occurences, make a run-lenth-encoding, convert a list of numbers
to a base, ... I often wished some of them are standard in Python.
Although a simpler solution would be to open the Python REPL and import all
methods from the file macros.py
.
2016-06-23 16:30 GMT+02:00 Théophile Cailliau notifications@github.com:
This can only be aproved, there is no possible regression merging this (AFAIK).
Just a curiosity, why would you use pyth for daily calculation tasks while other languages (e.g python) have much more natural syntax ( 5+4, instead of +5 4) ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/isaacg1/pyth/pull/200#issuecomment-228068237, or mute the thread https://github.com/notifications/unsubscribe/AG0AlaevOZtoI5jv7uCt8eOFkqzk9YN_ks5qOpiGgaJpZM4I8Z95 .
@FliiFe pyth is a lot more powerful and flexible than other languages, for example, j
vs python join
. I also don't have to import anything, all the built-ins just "work" (e.g. with the itertools_norm
) and everything being one character makes writing quick things very fast.
This obviously comes at the cost of maintainability, etc. but I find it really nice for small tasks.
Dammit, mobile I closed that by mistake when I hit "close and comment"
This is an impressively simple implementation of the repl.
I found myself using Pyth for a lot of daily "desktop calculator" tasks, so I wrote a little REPL for it. This is called up when one has no cmd args, or uses the
-r
or--repl
flags.It just runs each line as a program, but sends the output of one into the other allowing things like:
(Note that an empty line repeats the previous command).
It also uses the
cmd
module for up-arrow/down-arrow history functionality.I also included
help
functionality that lookups the command you enter in the docs:(
help
and?
are the same).I made up the intro txt, flag name, etc. you probably want to change them, and there probably are some bugs.