Home > Backend Development > Python Tutorial > python opens the file, reads the file command line by line and executes it

python opens the file, reads the file command line by line and executes it

巴扎黑
Release: 2016-11-26 09:38:08
Original
1588 people have browsed it

python code:

Java code

import os

file = open ("cc.txt")

.system(line)

ruby code:

Java code

file = File.open("ttt.txt")

file.each_line do |line|

%x(scp #{line.cho mp} #{ line.replace("/","")})

end

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template