とやっているうちに我に返りました。
こんなに重くて、いろいろ面倒なCygwinを入れる必要あるのか??
会社でPythonを使うとすれば、それは何らかのツールを作っているときだし。
わざわざCygwinをいれるほど僕はUnix野郎じゃなかった気がする。。。
というわけで、会社でのPython開発環境もIPythonにしました。
さあ、仕事でつかってみよー。
パッケージベンダーで日々スパゲッティソースと格闘したり、Ubuntuをいじって遊んだりするブログです。
こんなに重くて、いろいろ面倒なCygwinを入れる必要あるのか??
会社でPythonを使うとすれば、それは何らかのツールを作っているときだし。
わざわざCygwinをいれるほど僕はUnix野郎じゃなかった気がする。。。
というわけで、会社でのPython開発環境もIPythonにしました。
さあ、仕事でつかってみよー。
IPythonって最高!
pythonのシェルで入力履歴をファイル保存する

#!/bin/sh
exec `zenity --entry --title="Run command - gedit" --text="Command to run" --entry-text="python "$GEDIT_CURRENT_DOCUMENT_NAME`
ヘルプによるとGEDIT_CURRENT_DOCUMENT_NAMEという変数は現在編集中のファイル名が入るみたいです。
#!/bin/shってな感じで遊んでいます。仕事に関係のないプログラミングは楽しいですね。(今回はプログラミングしてませんが。。)
python $GEDIT_CURRENT_DOCUMENT_NAME
def square(x):
return x*x
def nosquare(x):
return x
x=2
foo = square
print "The square of that number is", foo(x)
square = nosquare
foo = square
print "The square of that number is", foo(x)
print "The square of that number is", square(x)
The square of that number is 4
The square of that number is 2
The square of that number is 2
def square(x):
return x*x
def nosquare(x,y):
return x+y
x=2
y=1
foo = square
print "The square of that number is", foo(x)
square = nosquare
foo = square
print "The square of that number is", foo(x,y)
print "The square of that number is", square(x,y)
The square of that number is 4
The square of that number is 3
The square of that number is 3