需要为OS-X和Windows + SQLite提供跨平台开发环境的建议
我需要一个简单的维护程序来运行,但OS-X和Windows机器更新一个SQLite数据库,一次。
用例:
在OS-X和Windows上应用程序的SQLite数据库上进行数据库维护.
要求
这是一次维护,所以应该尽可能简单。
我能用哪一个开发环境最适合这个?
发布于 2013-07-05 03:32:43
我建议您使用Tcl/Tk。
这里是GUI的一个示例脚本。
package require Tk
package require sqlite3
ttk::label .lbldb -text "Database:"
ttk::entry .db -textvariable db
set db {}
ttk::button .seldb -command seldb -text "..."
grid .lbldb .db .seldb -sticky nesw -columnspan 2
ttk::label .lbldir -text "Directory:"
ttk::entry .dir -textvariable dir
set dir {}
ttk::button .seldir -command seldir -text "..."
grid .lbldir .dir .seldir -sticky nesw -columnspan 2
ttk::button .go -command go -text "Go!" -default active
ttk::button .exit -command exit -text "Exit"
grid .go .exit -sticky nesw -columnspan 3
grid columnconfigure . 2 -weight 1
grid columnconfigure . 3 -weight 1
grid rowconfigure . 2 -weight 1
proc seldb {} {
set res [tk_getOpenFile -initialfile $::db]
if {$res ne {}} {
set ::db $res
}
}
proc seldir {} {
set res [tk_chooseDirectory -initialdir $::dir]
if {$res ne {}} {
set ::dir $res
}
}
proc go {} {
# Connect with the database
sqlite3 db $::db
# Do some stuff...
}发布于 2013-07-05 00:26:50
https://stackoverflow.com/questions/17475311
复制相似问题