gleitz / howdoi

instant coding answers via the command line
http://blog.gleitzman.com/post/43330157197/howdoi-instant-coding-answers-via-the-command-line
MIT License
10.58k stars 871 forks source link

Error in command `howdoi print in python` #470

Closed CaedenPH closed 2 years ago

CaedenPH commented 2 years ago

What happened:

howdoi print in python
'd' Signed integer decimal.  
'i' Signed integer decimal.  
'o' Signed octal value. (1)
'u' Obsolete type – it is identical to 'd'. (7)
'x' Signed hexadecimal (lowercase). (2)
'X' Signed hexadecimal (uppercase). (2)
'e' Floating point exponential format (lowercase).  (3)
'E' Floating point exponential format (uppercase).  (3)
'f' Floating point decimal format.  (3)
'F' Floating point decimal format.  (3)
'g' Floating point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.  (4)
'G' Floating point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.  (4)
'c' Single character (accepts integer or single character string).   
'r' String (converts any Python object using repr()).   (5)
's' String (converts any Python object using str()).    (6)

What you expected to happen:

Something like "print()"

Output with --explain

The same error

gleitz commented 2 years ago

That is unfortunate. It seems that the search results in Google lists https://stackoverflow.com/questions/20450531/python-operator-in-print-statement as the top result.

I get a little bit better results with howdoi print string in python 3, but ultimately it is up to the search engine which answers ranks first.

CaedenPH commented 2 years ago

That is unfortunate. It seems that the search results in Google lists https://stackoverflow.com/questions/20450531/python-operator-in-print-statement as the top result.

I get a little bit better results with howdoi print string in python 3, but ultimately it is up to the search engine which answers ranks first.

Oh, this isn't some sort of weird/broken logging you guys have implemented?

gleitz commented 2 years ago

Yes the results are chosen by the search engine (configurable with --engine) and then by the top rated answer on Stack Overflow.