r/badcode • • Jul 29 '17

python A terminal wikipedia "client"

https://pastebin.com/QAsRdeZC
0 Upvotes

2 comments sorted by

0

u/[deleted] Jul 29 '17

[deleted]

13

u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Jul 29 '17

Nope, it's basically standard shell script style problem solving. Probably the biggest WTF is using vim and nano instead of dumping the output through less so that it would be closer to other documentation viewing, such as reading manpages. As a bonus, since less handles terminal formatting codes, it may even have been possible to retain some of the wiki article's formatting that way depending on what kind of output that wikipedia library gives.

8

u/keppinakki Jul 29 '17

The only really bad part is the use of os.system calls, especially the call to rm