Kero4 Wiki
Top
/
linux
/
python examples
/ python ファイルの読み込み 一行ずつ読み込んで表示する
Last-modified: 2018-05-01 (火) 13:14:42 (292d)
python ファイルの読み込み 一行ずつ読み込んで表示する
†
SampleCode:
#!/bin/python # -*- coding: utf-8 -*- # ファイルをオープンする TEST_TEXT = open("test.txt", "r") # 一行ずつ読み込んでは表示する for LINE in TEST_TEXT: print (LINE) # ファイルをクローズする TEST_TEXT.close()
comment:
ファイルをオープンして一行読み込んで一行表示する。
Example:
# cat test.py #!/bin/python # -*- coding: utf-8 -*- # ファイルをオープンする TEST_TEXT = open("test.txt", "r") # 一行ずつ読み込んでは表示する for LINE in TEST_TEXT: print (LINE) # ファイルをクローズする TEST_TEXT.close() # #cat test.txt ぴちゅー ぴかちゅー らいちゅー # # ./test.py ぴちゅー ぴかちゅー らいちゅー #
Tag:
Linux
python
Goto Top Page
Top
/
linux
/
python examples
/ python ファイルの読み込み 一行ずつ読み込んで表示する
総閲覧数 : 207
今日の閲覧数: 3
楽天
Amazon
Yahooトラベル
honto
ネットオフ
Yahoo!
最新の20件
2018-05-01
linux/python examples/python ファイルの読み込み ファイルの内容を読み込んで一度に表示する方法
linux/python examples/python ファイルを読み込み、リストにし、一行ずつ表示する
linux/python examples/python ファイルの読み込み 一行ずつ読み込んで表示する
2018-02-23
linux/System Command Examples/find examples/find パーミッションで検索
linux/System Command Examples/find examples/find ファイルのみを検索対象とする
linux/System Command Examples/find examples/find ファイルの容量を指定して検索
linux/System Command Examples/find examples/find ファイルやディレクトリの容量が0の物を検索
linux/System Command Examples/find examples/find 任意のファイルの更新日時よりも新しいファイルを検索
linux/System Command Examples/find examples/find 2日以内に変更されたファイルを検索する
linux/System Command Examples/find examples/find 2日よりも前に変更されたファイルを検索する
linux/System Command Examples/find examples
2018-02-08
MenuBar
2018-02-02
計算機性能評価/NAS Parallel Benchmark
計算機性能評価/NAS Parallel Benchmark/NAS Parallel OMP HP Z8 G4 Workstation Gold6132 CentOS7.4.1708x64 gcc
計算機性能評価/姫野 Benchmark
計算機性能評価/姫野 Benchmark/Himeno HP Z8 G4 Workstation Gold6132 CentOS7.4.1708x64 gcc
計算機性能評価/CuDA n-body simulation
計算機性能評価/CuDA n-body simulation/CuDA n-body HP Z8 G4 Workstation QuadroP400 CuDA9.1-387.26
計算機性能評価/CuDA n-body simulation/CuDA n-body HP Z8 G4 Workstation Gold6132 CentOS7.4x64 gcc
2018-01-23
RecentDeleted
Benchmark
CPU
CuDA
E52683v4
E52687Wv4
E52697 v2
E52697v2
E5504
Example
FUJITSU
GPU
Gold 6132
Gold6130
HIMENO
HP
HewlettPackard
Linux
NAS
Platinum8160
Quadro P400
R
Silver4112
Silver4114
System Config
bash
find
firewallcmd
gcc
grep
nbody
python
rpm
sed
edit