Pythonpy – Command-line Kung Fu with Python
11–20 of 40 posts
Re: Pythonpy – Command-line Kung Fu with Python
#12I had used a very similar one for a while https://github.com/ksamuel/Pyped and found it quite useful. In that other utility they mention "'py' has been renamed to 'pyp' to avoid conflict with the new tool in the Python stdlib named 'py'" I wonder if such a problem would arise for your project.
Re: Pythonpy – Command-line Kung Fu with Python
#13Re: Pythonpy – Command-line Kung Fu with Python
#14However, division behavior was unexpected in Python 2. It looks like it imports division from __future__ without asking.
python -V
Python 2.7.8
python -c 'print(4 / 3)'
1
In [1]: 4 / 3
Out[1]: 1
py '4 / 3'
1.33333333333
EDIT: Yes, it does do that import, and others from __future__.Unless these imports are essential to the operation of pythonpy, I suggest making these optional/configurable, and default to Python 2 defaults, i.e. don't import.
Re: Pythonpy – Command-line Kung Fu with Python
#15Python 2 :(
Re: Pythonpy – Command-line Kung Fu with Python
#16Very nice. However, division behavior was unexpected in Python 2. It looks like it imports division from __future__ without asking. python -V Python 2.7.8 python -c 'print(4 / 3)' 1 In [1]: 4 / 3 Out[1]: 1 py '4 / 3' 1.33333333333 EDIT: Yes, it does do that import, and others from __future__. Unless these imports are essential to the operation of pythonpy, I suggest making these optional/configurable, and default to…
Re: Pythonpy – Command-line Kung Fu with Python
#17Very nice. However, division behavior was unexpected in Python 2. It looks like it imports division from __future__ without asking. python -V Python 2.7.8 python -c 'print(4 / 3)' 1 In [1]: 4 / 3 Out[1]: 1 py '4 / 3' 1.33333333333 EDIT: Yes, it does do that import, and others from __future__. Unless these imports are essential to the operation of pythonpy, I suggest making these optional/configurable, and default to…
OK, someone downvoted this. That's OK, but can you say why you think it's good for the default in Python 2 to not act like Python 2?
Also in a shared code base where you use division this is almost always necessary, or at least easier.
Re: Pythonpy – Command-line Kung Fu with Python
#18I had used a very similar one for a while https://github.com/ksamuel/Pyped and found it quite useful. In that other utility they mention "'py' has been renamed to 'pyp' to avoid conflict with the new tool in the Python stdlib named 'py'" I wonder if such a problem would arise for your project.
Re: Pythonpy – Command-line Kung Fu with Python
#19Re: Pythonpy – Command-line Kung Fu with Python
#20Python 2 :(
why sad face? I have written thousands of lines of python and and never once wanted to go to 3.