Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)
On 9/11/06, Mike Owens <[EMAIL PROTECTED]> wrote: > I coworker pointed me to this thread. Joy for us. > > < snipped good information > In all seriousness, the information you present here is great, and much appreciated. Your sarcastic, condescending tone kind of gets in the way of the message, though. And here is the crux of the issue. Sqlite doesn't follow the standard for sql. The name certainly implies that it would. This doesn't make it a crappy product, but it is certainly misleading. I must admit, that after 10 years of oracle experience, I don't necessarily read all of the documentation for a new dbms I'm trying out, particularly a light weigth variety. I get in, and try things. Sometimes I get bitten, but I learn better that way. I would expect, however, for each product with 'sql' in the name, to, at least by default, adhere to the standard. And expectations are what set this conversation up. But, I don't expect that anything productive will come from the rest of this thread. Your post had the stink of zealotry all over it, and we all know what happens when a zealots favorite is questioned. Again, thanks for the info. It'll serve me well when I'm playing with sqlite later. -- http://mail.python.org/mailman/listinfo/python-list
Catching external program exceptions
I need to catch exceptions thrown by programs started by the os.system function, as indicated by a non-zero return code (e.g. the mount utility). For example, if I get the following results in a bash shell: $mount test mount: can't find /home/marty/test in /etc/fstab or /etc/mtab then I want to catch the same exception from the corresponding os.system() call, i.e. "os.system('mount test')", but it doesn't work as expected: >>> import os, sys >>> try: os.system('mount test') ... except: print 'error' ... mount: can't find /home/marty/test in /etc/fstab or /etc/mtab 256 >>> I get the same results with popon, popen2, popen3, etc. Apparently these also work only when the program does not generate an exception. Is there any way to catch the return code. or if not, a workaround? -- http://mail.python.org/mailman/listinfo/python-list
Re: for loop without variable
Hrvoje Niksic wrote: > Mike Meyer <[EMAIL PROTECTED]> writes: > >> It sounds to me like your counter variable actually has meaning, > > It depends how the code is written. In the example such as: > > for meaningless_variable in xrange(number_of_attempts): > ... > > the loop variable really has no meaning. Rewriting this code only to > appease pylint is exactly that, it has nothing with making the code > more readable. > >> you've hidden that meaning by giving it the meaningless name "i". If >> you give it a meaningful name, then there's an obvious way to do it >> (which you listed yourself): >> >> while retries_left: > [...] > > This loop contains more code and hence more opportunities for > introducing bugs. For example, if you use "continue" anywhere in the > loop, you will do one retry too much. I recently faced a similar issue doing something like this: data_out = [] for i in range(len(data_in)): data_out.append([]) This caused me to wonder why Python does not have a "foreach" statement (and also why has it not come up in this thread)? I realize the topic has probably been beaten to death in earlier thread(s), but does anyone have the short answer? -- http://mail.python.org/mailman/listinfo/python-list
Re: for loop without variable
Mike Meyer wrote: > On Thu, 10 Jan 2008 22:36:56 -0500 Marty <[EMAIL PROTECTED]> wrote: >> I recently faced a similar issue doing something like this: >> >> data_out = [] >> for i in range(len(data_in)): >> data_out.append([]) > > More succinctly: > > data_out = [] > for _ in data_in: >data_out.append([]) > > Or, as has already been pointed out: > > data_out = [[] for _ in data_in] That's nice. > >> This caused me to wonder why Python does not have a "foreach" statement (and >> also why has it not come up in this thread)? I realize the topic has >> probably >> been beaten to death in earlier thread(s), but does anyone have the short >> answer? > > But I'm curious - what's the difference between the "foreach" you have > in mind and the standard python "for"? > >http://mail.python.org/mailman/listinfo/python-list
Re: ] returns []
MUSATOV -- http://mail.python.org/mailman/listinfo/python-list
first time python learner
Win 10 Anti Virus off [image: image.png] Any idea? -- Martin Konopko -- https://mail.python.org/mailman/listinfo/python-list
Recommended IDE for creating GUI?
What are some good free or inexpensive (<$50) IDE's for learning how to program and create GUI's for Python? I'm pretty good with the simple programming aspect of the language, but I'm a little mystified by the world of GUI's, and the options available in python. -- http://mail.python.org/mailman/listinfo/python-list