开箱即用的数据库支持 [英] Out of the box database support

查看:83
本文介绍了开箱即用的数据库支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿那里。


我想知道Python是否有开箱即用的支持
数据库功能或类似数据库的功能。


例如很多共享主机都安装了Python,但没有安装Python扩展程序,灵活的安装程序会安装它,但大多数<他们不会打扰他们的时间。


我真的在寻找像捆绑的SQLite这样的东西

with PHP这些天。或任何标准方式连接到开箱即用的通用

数据库,即MySQL。

感谢阅读。

Alex Biddle。

解决方案

Alex Biddle< he ******* @ gmail.comwrote:


嘿那里。


我想知道Python是否有开箱即用的支持
数据库功能或类似数据库的功能。


例如很多共享主机都安装了Python,但没有安装Python扩展程序,灵活的安装程序可以安装它,但大多数是

他们不会打扰的时间。


我真的在寻找类似于SQLite的东西,这些东西捆绑在一起

这些天用PHP 。或任何标准方式连接到开箱即用的通用

数据库,即MySQL。



Python 2.5'的标准库包括pysqlite。对于任何其他数据库,或任何以前发布的Python版本,你需要单独下载。


当然,共享主机太懒了(并且不感兴趣

支持Python)执行20秒下载和安装,将在未来20年左右升级到Python 2.5,因此

我怀疑pysqlite成为标准库的一部分有任何

帮助解决你所说的问题(在例如段落中)。

Alex


啊,那么单独下载。至少现在我知道了。


Ergh ...我检查了我当前主机正在运行的Python版本及其2.2。


。 ......呃....


2006年7月3日,Alex Martelli< al *** @ mac.comwrote:


Python 2.5'的标准库包括pysqlite。对于任何其他数据库,或任何以前发布的Python版本,你需要单独下载。


当然,共享主机太懒了(并且不感兴趣

支持Python)执行20秒下载和安装,将在未来20年左右升级到Python 2.5,因此

我怀疑pysqlite成为标准库的一部分有任何

帮助解决你所说的问题(在例如段落中)。


Alex

-
http://mail.python.org/mailman/listinfo/python-list


在7/3/06, Paul McGuire< pt *** @ austin.rr._bogus_.comwrote:


" Alex Biddle" <他******* @ gmail.com写信息

新闻:ma *********************** **************** @ pyt hon.org ...


嘿,谢谢Jean-Paul的回复。


知道Python 2.5将从

框中取出它是非常酷的,但是基本的开箱即用功能呢在2.4(或

甚至更老)?


在我所有的其他经验中,Python已经提供了很多工具

可用,没有基本的数据库功能似乎很奇怪

默认安装。



你想要一匹小马吗?今天可以使用pysqlite *,并且不会因为你自己的软件包安装或捆绑而过于繁重。在接近

的范围内,我们看到它*将*成为所包含电池的一部分,所以

单独安装只是暂时的麻烦。


但目前的Python版本还有另一个数据库电池。

试试这个:


import bsddb


没有SQL支持,相反,这给你一个类似dict的数据库访问权限

(值必须是字符串,所以你必须将列序列化为某些东西

喜欢XML,JSON,YAML等):


import bsddb

db = bsddb.hashopen(" testdb.db")

db [" Paul"] ="""< user name =" Paul" id =" 12345" />"""

db [" Alex"] ="""< user name =" Alex" id =" 12346" />"""

print db.keys()

del db [" Paul"]

print db.keys()

db.close()



感谢您的信息。不,谢谢你的小马小马评论。我不能

安装我自己的版本,因为我在共享服务器上,当然

理想情况下我不喜欢。

2006年7月3日,Shane Hathaway< sh *** @ hathawaymix.org写道:


Alex Biddle写道:
< blockquote class =post_quotes>
啊,那么单独下载。至少现在我知道了。


Ergh ...我检查了我当前主机正在运行的Python版本及其2.2。


。 ..ergh ....



这就是你真正需要VPS(虚拟专用服务器)的原因。与网络主机相似的费用是

,但您可以选择自己的技术和

版本。有几家公司想到:

http://westhost.com/
http://jvds.com/
http://linode.com/

我正在使用Westhost,如果你要求它提供Python 2.2,但是我用
编译了Python 2.4。我甚至不必问我是否允许这样做。
允许这样做。 :-)


Shane



是的,理想情况下,VPS将是最佳选择。在美国托管似乎比英国的便宜
,我不知道为什么。如果我要打造一个Python网络应用程序,那么我会去VPS,现在虽然我只是用PHP做了


On 2006年7月3日09:45:35 -0700,BartlebyScrivener< rp ******* @ gmail.comwrote:


我猜你看到这里没有找到你想要什么?

http:// www .python.org / doc / topics / database /

什么是开箱即用的重大事项?人们有不同的口味

的dbs和访问方式,为什么不选择你想要的那个和

下载它?


你没有说你是在Linux还是Windows上。使用PythonWin,ODBC模块来了
。其他人对mxODBC运气很好,下载并安装后可以开箱即用。




与bx的关系很大;开箱即用如果它得到了MySQL的支持,那么Python可以吸引人们的大众市场

去寻找廉价的东西,这是不可能的打扰升级Python让

单独安装databasefoo支持。目前这个市场更多或仅仅是由PHP占用的b $ b。


是的...我在我的本地Linux服务器上安装了MySQL支持等/>
但是我/不能/在共享主机环境中这样做。


搜索群组会告诉你所有你需要知道的事情这个话题,

,因为它每周出现两次。



对于它的价值,我确实尝试过搜索,但是我猜测我的参数

是错误的。如果它每周出现两次,或许还有一个案例

的需求和供应呢?


Hey there.

I was wondering whether Python had any support out-of-the-box for
database functionality, or database-like functionality.

For instance a lot of shared hosts have Python installed, but not the
MySQL extension, the flexible of these would install it, but most of
the time they wouldn''t bother.

I was really looking for something like SQLite which ships bundled
with PHP these days. Or any standard way of connecting to generic
databases out of the box, i.e. MySQL.
Thanks for reading.
Alex Biddle.

解决方案

Alex Biddle <he*******@gmail.comwrote:

Hey there.

I was wondering whether Python had any support out-of-the-box for
database functionality, or database-like functionality.

For instance a lot of shared hosts have Python installed, but not the
MySQL extension, the flexible of these would install it, but most of
the time they wouldn''t bother.

I was really looking for something like SQLite which ships bundled
with PHP these days. Or any standard way of connecting to generic
databases out of the box, i.e. MySQL.

Python 2.5''s standard library includes pysqlite. For any other DB, or
any previous release of Python, you need separate downloads.

Of course, shared hosts that are too lazy (and uninterested in
supporting Python) to perform a 20-seconds download and install, will
hardly be upgrading to Python 2.5 in the next 20 years or so, therefore
I doubt that pysqlite becoming part of the standard library is of any
help to the problem you have stated (in the "for instance" paragraph).
Alex


Ah, so separate downloads then. At least now I know.

Ergh... I checked the version of Python my current host is running and its 2.2.

....ergh....

On 7/3/06, Alex Martelli <al***@mac.comwrote:

Python 2.5''s standard library includes pysqlite. For any other DB, or
any previous release of Python, you need separate downloads.

Of course, shared hosts that are too lazy (and uninterested in
supporting Python) to perform a 20-seconds download and install, will
hardly be upgrading to Python 2.5 in the next 20 years or so, therefore
I doubt that pysqlite becoming part of the standard library is of any
help to the problem you have stated (in the "for instance" paragraph).
Alex
--
http://mail.python.org/mailman/listinfo/python-list


On 7/3/06, Paul McGuire <pt***@austin.rr._bogus_.comwrote:

"Alex Biddle" <he*******@gmail.comwrote in message
news:ma***************************************@pyt hon.org...

Hey, thanks for the reply Jean-Paul.

That''s pretty cool knowing that Python 2.5 will have it out of the
box, however what about basic out-of-the-box functionality in 2.4 (or
even older)?

In all my other experiences Python comes with a lot of tools already
available, it seems odd not to have basic database functionality
installed as default.


Would you like a pony with that? pysqlite *is* available today, and is not
overly onerous to install or bundle with your own package. And on the near
horizon, we see that it *will* be part of the included batteries, so
separate installation is only a temporary nuisance.

But there is another database battery available in current Python versions.
Try this:

import bsddb
No SQL support, instead this gives you a dict-like access to the database
(values must be strings, so you have to serialize columns into something
like XML, JSON, YAML, etc.):

import bsddb
db = bsddb.hashopen("testdb.db")
db["Paul"]="""<user name="Paul" id="12345"/>"""
db["Alex"]="""<user name="Alex" id="12346"/>"""
print db.keys()
del db["Paul"]
print db.keys()
db.close()


Thanks for the info. No thanks for the smarmy "pony" comment. I can''t
install my own version because I''m on a shared server, of course
ideally I wouldn''t like to be.
On 7/3/06, Shane Hathaway <sh***@hathawaymix.orgwrote:

Alex Biddle wrote:

Ah, so separate downloads then. At least now I know.

Ergh... I checked the version of Python my current host is running and its 2.2.

...ergh....


This is why you really want a VPS (virtual private server). The cost is
similar to a web host but you get to choose your own technologies and
versions. Several companies come to mind:

http://westhost.com/
http://jvds.com/
http://linode.com/

I''m using Westhost, which provides Python 2.2 if you ask for it, but I
compiled Python 2.4 instead. I didn''t even have to ask whether I was
allowed to do that. :-)

Shane

Yeah, ideally a VPS would be the way to go. In the US hosting seems to
be cheaper than here in the UK, I don''t know why. If I was going to
make a Python web app then I would go VPS, nowadays though I just make
do with PHP.
On 3 Jul 2006 09:45:35 -0700, BartlebyScrivener <rp*******@gmail.comwrote:

I guess you looked here without finding what you want?

http://www.python.org/doc/topics/database/

What''s the big deal with "out of the box"? People have different tastes
in dbs and ways to access them, why not just pick the one you want and
download it?

You didn''t say if you are on Linux or Windows. The ODBC module comes
with PythonWin. Others have good luck with mxODBC, which works right
out of the box after you download and install it.

The big deal with "out of the box" is that if it had support from the
outset for MySQL then Python could appeal to the mass market of people
who go for cheap-o hosts that can''t be bothered to upgrade Python let
alone install databasefoo support. Currently this market is more or
less solely occupied by PHP.

Yes... I have installed MySQL support etc. on my local Linux server
but I /can''t/ do that on a shared hosting environment.

Searching the group will tell you all you need to know on this topic,
as it comes up twice a week.

For what it''s worth, I did try searching, but I guess my parametres
were the wrong ones. If it comes up twice a week, perhaps its a case
of demand and supply anyway?


这篇关于开箱即用的数据库支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆