• Skip to main content
  • Skip to primary sidebar

学習記録

python3

虫眼鏡フォーム

2017年10月16日 by 河副 太智 Leave a Comment

http://www.tagindex.com/template/form/textbox2.html

Filed Under: python3 Tagged With: form, フォーム, 虫眼鏡

プルダウンメニュー

2017年10月16日 by 河副 太智 Leave a Comment

http://www.tagindex.com/html5/form/select.html

Filed Under: python3 Tagged With: フォーム, プルダウン

日本語にすると505エラー

2017年10月4日 by 河副 太智 Leave a Comment

#!/usr/bin/env python3
# coding: utf-8

import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding=’utf-8′)
print(‘Content-type: text/html; charset=UTF-8\r\n’)

と記述すれば日本語も表示される

Filed Under: python3

webアプリ 一番簡単なpython

2017年9月30日 by 河副 太智 Leave a Comment

http://hukumoto.pe-gawa.com/news/%E3%82%A8%E3%83%83%E3%82%AF%E3%82%B9%E3%82%B5%E3%83%BC%E3%83%90%E3%81%A7%E3%80%81perl%E3%83%BBruby%E3%83%BBpython%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E3%80%82

 

 

●pythonを動かす。

1、test.pyを作成します。

1
2
3
4
5
#!/usr/bin/python
# coding: shift_jis
print "Content-Type: text/html\n\n"
print "python!!!!"
 

2、test.pyのパーミッションを705に変更します。
3、.htaccessを作成し、
AddHandler cgi-script .py
を書いて保存。

これで。pythonが動くようになりました。

Filed Under: python3

pyファイルクリックするとすぐ閉じる

2017年9月29日 by 河副 太智 Leave a Comment

Pythonのスクリプトが記述されたファイル(.pyファイル)をダブルクリックすると、Pythonのプログラムを実行できます。しかし、この方法でプログラムを実行すると多くの場合、一瞬で処理が終わりウィンドウが閉じてしまいます。実行結果をファイルなどに保存している場合はそれでもよいですが、実行結果を確認したい場合も多いはずです。

このようなとき、
raw_input()
と書くことでウィンドウが閉じることを防げます。

raw_input関数は、標準入力から1行を読み取る関数ですが、その際にプログラムの実行が止まります。そのため、プログラムの末尾にraw_input()と書いておけば、ウィンドウが自動的に閉じないようになります。

Filed Under: python3

URLオープンモジュール

2017年9月29日 by 河副 太智 Leave a Comment

1
2
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">from</span> <span class="nn">urllib.request</span> <span class="kn">import</span> <span class="n">urlopen</span>

Filed Under: python3

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • Page 12
  • Go to Next Page »

Primary Sidebar

カテゴリー

  • AWS
  • Bootstrap
  • Dash
  • Django
  • flask
  • GIT(sourcetree)
  • Plotly/Dash
  • VPS
  • その他tool
  • ブログ
  • プログラミング
    • Bokeh
    • css
    • HoloViews
    • Jupyter
    • Numpy
    • Pandas
    • PosgreSQL
    • Python 基本
    • python3
      • webアプリ
    • python3解説
    • scikit-learn
    • scipy
    • vps
    • Wordpress
    • グラフ
    • コマンド
    • スクレイピング
    • チートシート
    • データクレンジング
    • ブロックチェーン
    • 作成実績
    • 時系列分析
    • 機械学習
      • 分析手法
      • 教師有り
    • 異常値検知
    • 自然言語処理
  • 一太郎
  • 数学
    • sympy
      • 対数関数(log)
      • 累乗根(n乗根)
    • 暗号学

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in