我有以下ruby代码(来自Codeacademy API课程)。
require 'open-uri'
# Open http://placekitten.com/ for reading on line 4!
kittens = open('http://placekitten.com')
body = kittens.read[559, 441]
# Add your puts statement below!
puts body
如何在tcl中编写?
答案 0 :(得分:2)
如果我理解正确,你只想转储文件?如果是这样,以下是最小代码:
package require http
puts [http::data [http::geturl "http://placekitten.com"]]