ruby怎么从命令行读取参数

Python09

ruby怎么从命令行读取参数,第1张

基于文本文档(Markdown) 设想好需要的基本需要的表、字段、类型;

使用 Rails Migration 随着功能的开发逐步创建表;

随着细节功能的开发、需求,逐步增加字段,删除字段,或者调整字段类型;

第一个 Release 的时候清理 Migrations 合并成一个

随着后期的改动,逐步增加、修改、删除字段或表。

基本上我的所有项目都是这么搞的,这和项目是否复杂无关。

所以我前面为什么说思路需要转变。

本文实例讲述了python通过get,post方式发送http请求和接收http响应的方法。分享给大家供大家参考。具体如下:

测试用CGI,名字为test.py,放在apache的cgi-bin目录下:

#!/usr/bin/python

import cgi

def main():

print "Content-type: text/html\n"

form = cgi.FieldStorage()

if form.has_key("ServiceCode") and form["ServiceCode"].value != "":

print "<h1>Hello",form["ServiceCode"].value,"</h1>"

else:

print "<h1>Error! Please enter first name.</h1>"

main()

python发送post和get请求

get请求:

使用get方式时,请求数据直接放在url中

Net::HTTP.new方法,返回resp码和实际的data:

require 'net/http'  

h = Net::HTTP.new("www.baidu.com",80)  

resp,data = h.get("/")   

puts resp  

puts data