Re: [Tutor] Postgresql+Python -tutorial?

2006-02-11 Thread Alan Gauld
> Alan G wrote:
>> Is there some advantage to Postgres over MySql?
> 
> Yes and no. Postgresql offers more features and is IMO more flexible 
> than most SQL servers out there.

Thanks for the list, several things I didn't know.

> Example: postgresql enables you to set up editable sql views. 

Most databases I've used (Oracle, DB2, Interbase) can do this, 
I wasn't aware MySql couldn't.

> However, MySQL is used a lot in web pages because it can return queries 
> much faster than any other database - the catch is that it can only do 
> this with transaction-less tables.

And I didn't know about Transactionless tables.

> Hope that helped?
> 
> Joal Heagney

Yes thanks. My interest comes from the fact that I am in the process 
of reconfiguring my home network and in particular wanted a popular 
opensource database to replace my ancient copy of Oracle for Linux.
The choices are Firebird, MySql and Postgres. I am familiar with the 
first but the others are more popular (think job experience...)

Thanks again,

Alan G.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Postgresql+Python -tutorial?

2006-02-11 Thread Python
On Sat, 2006-02-11 at 16:19 +1000, Joal Heagney wrote:
> > I'm curious. Why?
> > Is there some advantage to Postgres over MySql?
> 
> Yes and no. Postgresql offers more features and is IMO more flexible 
> than most SQL servers out there.

A friend described MySQL as the RDBMS for people who do not really need
an RDBMS.  This is a little unfair, but has just enough truth to bear
repeating.  MyISAM tables offer good performance at the cost of
transactions, views, row locking, etc.  The MySQL documentation suggests
some work-arounds.

I use MySQL for these benefits:

replication - (off-site near real time backups; simple distributed
processing)

enum and set datatypes - easy to use integer to text mapping fields.
enums == radio buttons (single-select), sets == check boxes (multi-
select)

very easy administration

good performance


Obviously, the lack of transactions is a nuisance.  If you are
converting software from another RDBMS, the MySQL limitations will be
especially painful.  When replication and/or easy administration trump
other concerns, MySQL can be a good choice.

-- 
Lloyd Kvam
Venix Corp

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Change files

2006-02-11 Thread David Holland
Bruce,  Thanks but is was not the solution.  It goes through all the directories but does not seem to work. Here is the modified code :- def getfiles(file1,file2,top):     for root, dirs, files in os.walk(top):     for name in dirs:     print name     for name in files:     if name == file1:     name = os.getcwd()+'/'+name     print "the name is" + name
     shutil.copy(file2,name)     print "copied one file"     print os.getcwd()  import os import shutil #main top = '/home' a = os.getcwd() filename = 'abcde' file1 = filename file2 = a+'/'+filename print file2 getfiles(filename, file2,top) print "finished"  David Bruce <[EMAIL PROTECTED]> wrote: I guess that you need to fix two things:1 the indentaion error after for name in files:2 specify full path for the destination arg in
 shutil.copyOn 2/10/06, David Holland  wrote:> I wrote a little program that replaces all files called 'abcde' with the> file in the directory from which you riun the program.  However it does not> find them (there is another one).>  What have I done wrong :->  #this program copies the file x to all other places in the directory.>  #however it does not go to the right places>  def getfiles(file1,file2,top):>  for root, dirs, files in os.walk(top):>  for name in dirs:>  for name in files:>  if name == file1:>  shutil.copy(file2,name)>  print "copied one file">>  import os>  import shutil>  #main>  top = '/home'>  a = os.getcwd()>  filename = 'abcde'>  file1 = filename>  file2 = a+'/'+filename>  getfiles(file1,
 file2,top)>  print "finished">  > To help you stay safe and secure online, we've developed the all new Yahoo!> Security Centre.>>> ___> Tutor maillist  -  Tutor@python.org> http://mail.python.org/mailman/listinfo/tutor>>>
		Yahoo! Photos – NEW, now offering a quality print service from just 8p a photo.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Change files

2006-02-11 Thread Danny Yoo
>  for root, dirs, files in os.walk(top):
>  for name in dirs:
>  print name
>  for name in files:

This code looks suspicious.  At this point, when we say "name", what do we
expect to get here?  Do you mean the directory name, or the file name?
It can't be both!  *grin*

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor