LoginSignup
13

More than 5 years have passed since last update.

どうやってコードを書けばいいのかな? というときに役立つかもしれない howdoi

Posted at

コードを書いているときに とりあえず動くけどきれいな書き方かはわからない というときに便利そう

install

pip install howdoi

いろいろインストールされてきます

requirements

Pygments==1.5
argparse==1.2.1
cssselect==0.7.1
lxml==3.2.4
pyquery==1.2.6
requests==2.0.1
requests-cache==0.4.4

HOWTO

% howdoi format dict python
geopoint = {'latitude':41.123,'longitude':71.091}
print('{latitude} {longitude}'.format(**geopoint))

%howdoi install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

%howdoi print golang
return fmt.Sprintf("at %v, %s", e.When, e.What)

%howdoi print lisp
CL-USER> (format t "~{~{~A ~}~%~}"
                 '((X X X) (X X X X X X) (X X X X X X X X X)))
X X X 
X X X X X X 
X X X X X X X X X

という感じで 英文法っぽくかけばそれなりに返ってくるみたいです

cf.
https://github.com/gleitz/howdoi

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13