Re: [Tutor] kwds

2007-04-10 Thread John Fouhy
On 11/04/07, Adam Pridgen <[EMAIL PROTECTED]> wrote: > Hello, > > I am having a difficult time understanding the whole "def > function(*args, **kwds):" business, and I have not really found a > clear or concise explanation via Google. > > My question is pretty much this, is **kwds a dictionary and

[Tutor] kwds

2007-04-10 Thread Adam Pridgen
Hello, I am having a difficult time understanding the whole "def function(*args, **kwds):" business, and I have not really found a clear or concise explanation via Google. My question is pretty much this, is **kwds a dictionary and can I use it like a dictionary, and what is the deal with the * o

Re: [Tutor] iscube function

2007-04-10 Thread Terry Carroll
On Tue, 10 Apr 2007, Robert William Hanks wrote: > how is the best way to find out if a number is a perfect cube in python? > i am working if integer numbers only. i am asking because > pow(1728, 1.0/3.0) --> 11.998 def iscube(n): cubed_root = n**(1/3.0) if round(cubed_roo

[Tutor] iscube function

2007-04-10 Thread Robert William Hanks
how is the best way to find out if a number is a perfect cube in python? i am working if integer numbers only. i am asking because pow(1728, 1.0/3.0) --> 11.998 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/

[Tutor] Fw: Command line args

2007-04-10 Thread ALAN GAULD
Please use REPLY ALL to include the rest of the group. The code looks OK although the error that you raise should probably be a RuntimeError rather than a SyntaxError since its not really a syntax problem. You can get a list of the built in exceptions by doing: >>> import exceptions >>> dir(ex

Re: [Tutor] File storage vs DB storage.

2007-04-10 Thread Alan Gauld
"OkaMthembo" <[EMAIL PROTECTED]> wrote > Ok, to get to the point: when building a web app that should store > an > retrieve photos, what would be more efficient between the app > storing the > files on a local hard disk, or saving blobs/ binary data to a > database? > Someone toldme that databa

Re: [Tutor] copy2 arguments?

2007-04-10 Thread ALAN GAULD
> > I didn't hardly notice that vim 7 was out! > alias vim='/usr/bin/env emacs' No editor wars please! :-) But actually I use Xemacs when wortking in Unix but for some reason it never felt right on Windows. So I use both depending on the OS. (Actually I use vim on Unix too for short edits, but

Re: [Tutor] copy2 arguments?

2007-04-10 Thread Rikard Bosnjakovic
On 4/10/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > vim 8?!! > I didn't hardly notice that vim 7 was out! alias vim='/usr/bin/env emacs' -- - Rikard. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Movies from jpg files

2007-04-10 Thread Hugo González Monteverde
János Juhász wrote: > > Thanks your response. > It should works well with some images, but I would do it with a scheduled > way > with some 1000 files. Hi, I previously have used python to control mencoder. Mencoder does the combining and putting together into a video. You script the argumen

Re: [Tutor] vim confusion (was copy2 arguments?)

2007-04-10 Thread Alan Gauld
"Robert H. Haener IV" <[EMAIL PROTECTED]> wrote > What you mistook for "vim 8" (with some garbage afterward) > was in fact a smiley I use frequently. ROTFL! :-) Alan G ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

Re: [Tutor] File storage vs DB storage.

2007-04-10 Thread Hugo González Monteverde
Hi, Managaing a lot of files is not a nightmare if you use/build the right tools. Why not saving filenames in the DB and then just using the ordinary web server to deliver them? Getting the blob out of the DB and then serving it through the web app is going to be a lot slower than letting, say

Re: [Tutor] Command line args

2007-04-10 Thread Alan Gauld
"Kirk Bailey" <[EMAIL PROTECTED]> wrote > Try: > filename=sys.arv[1] > except Exception, e: This still doesn't help for the problem where a different exception is raised.It really does need to be try: filename = sys.argv[1]: except IndexError: > if filename='': > filename='fo

[Tutor] File storage vs DB storage.

2007-04-10 Thread OkaMthembo
Hello all, Im a newbie and am currently going through the Python Tutorial for the second time. At work, i use C#, but what a delight Python is! Ok, to get to the point: when building a web app that should store an retrieve photos, what would be more efficient between the app storing the files on

Re: [Tutor] ConfigParser and multiple option names

2007-04-10 Thread Iyer
wow, Andrei, that is a really very neat solution ! It worked. So it seems configparser is dict based. Thanks a lot for your help. -iyer --- Andrei <[EMAIL PROTECTED]> wrote: > Iyer wrote: > > > > > I cannot change the config file layout -- it is a > > > [dir_options] > > dir="/home/floria