Re: Need Help Starting Out

2008-03-18 Thread Michael Mabin
Pylons is a Ruby on Rails-like web framework that allows you build dynamic web applications with a database backend. Here is a link to the Pylons web site: http://pylonshq.com/ On Tue, Mar 18, 2008 at 11:10 AM, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I would like to start using Python, but

Re: finding items that occur more than once in a list

2008-03-18 Thread Michael Mabin
How about using list comprehension? l1 = ["apples","apples","bananas","oranges","oranges","peaches"] s1 = set([x for x in l1 if l1.count(x) > 1]) On Tue, Mar 18, 2008 at 4:56 PM, sturlamolden <[EMAIL PROTECTED]> wrote: > On 18 Mar, 22:25, sturlamolden <[EMAIL PROTECTED]> wrote: > > > def nonun

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-05 Thread Michael Mabin
Warren, weren't you aware that Python.org is now a church. So you can never live up to the standards of the Pythonista high priests. You can only ask a question or submit your comment then cower, hoping the pythonista high priests don't beat you with clubs for heresy. ;) 2008/12/4 Warren DeLa

Re: MVC

2008-05-22 Thread Michael Mabin
In fact, the Pylons web framework is geared toward the MVC approach. http://pylonshq.com/ On Thu, May 22, 2008 at 7:48 PM, George Maggessy <[EMAIL PROTECTED]> wrote: > Hi Gurus, > > I'm a Java developer and I'm trying to shift my mindset to start > programming python. So, my first exercise is to

Re: php vs python

2008-05-22 Thread Michael Mabin
I used python to generate php code. But that was before I knew what vast troves of python web frameworks there were. :) On Thu, May 22, 2008 at 11:40 PM, inhahe <[EMAIL PROTECTED]> wrote: > > > PHP can do that. There are also a number of templating engines > > available. The nice thing about PH

Re: Hungarian Notation

2008-05-30 Thread Michael Mabin
Variable names should have prefixes or suffixes (as I prefer) that represent the "kind" of data they represent rather than the data type itself. For example account_bal_am, order_qt, line_ct, first_nm. Where am is amount, qt is quantity and ct is count. Coding standards could impose rules on data

Re: Constructor re-initialization issue

2008-06-03 Thread Michael Mabin
Changing the default for data to None and creating a new dict inside your function might handle this. But I don't know what it is you want. It never even occurred to me that this behavior might be desired in the first place. class Param(object): def __init__(self,data=None,condition=False):

Re: Squeak-like environment for Python?

2008-06-05 Thread Michael Mabin
Check out the Brainwave platform, which uses a new "neural" database model. It allows you to create databases to store any kind of Python object as a "neuron" and allows objects to be connected via link to create complex structures that don't require conventional tables and columns. It is a develo

Re: Python and Harry Potter?

2008-06-05 Thread Michael Mabin
Harry Potter is a Parselmouth. He can speak to snakes. Of course, Amazon would get this right! Sheesh! On Thu, Jun 5, 2008 at 6:10 AM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 05 Jun 2008 11:58:14 +0200, Helmut Jarausch wrote: > > > Today I've got an email from Amazon recom

Building 64-bit Python on AIX

2008-06-10 Thread Michael Mabin
Hi all. I am trying to rebuild Python on our AIX system in 64 bit so I can use our installed 64-bit UnixODBC library. Has anyone successfully done this and can they share the configure options they used? Thanks. Mike -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Building 64-bit Python on AIX

2008-06-10 Thread Michael Mabin
Oops. Forgot to mention this is AIX 5.3 and I'm trying to install Python 2.5.2. Using xlc compiler. On Tue, Jun 10, 2008 at 10:34 AM, Michael Mabin <[EMAIL PROTECTED]> wrote: > Hi all. I am trying to rebuild Python on our AIX system in 64 bit so I can > use our installe

Re: does paramiko support python2.5?

2008-06-13 Thread Michael Mabin
paramiko is an ssh module On Fri, Jun 13, 2008 at 2:49 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Praveena B" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > when i used paramiko in python2.5 i got the error below. > File "C:\praveena\python scripts\sshlib\ssh.py", line 5, i

Re: python/ruby question..

2008-06-19 Thread Michael Mabin
The commands module might help you out as well. import commands as c output = c.getoutput('testruby.rb') On Thu, Jun 19, 2008 at 5:14 AM, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Jun 18, 10:33�pm, "bruce" <[EMAIL PROTECTED]> wrote: > >> hi... > >> > >> can someone poi

Re: Getting column names from a cursor using ODBC module?

2008-06-22 Thread Michael Mabin
The pyodb module doesn't implement this behavior. You would have to create a dictionary of column positions and column names in advance. On Sat, Jun 21, 2008 at 3:52 PM, Chris <[EMAIL PROTECTED]> wrote: > On Jun 21, 3:58 pm, [EMAIL PROTECTED] wrote: > > Is there any way to retrieve column names

Re: Passing arguments to subclasses

2008-06-24 Thread Michael Mabin
But if you couldn't find readily available confirmation of what you presumed to be true, weren't the responses showing how you might come that answer using the interpreter helpful, rather than harsh? The Python interpreter is the shizzit. On Mon, Jun 23, 2008 at 12:17 PM, John Dann <[EMAIL PROTECT

Re: Mako vs. Cheetah?

2008-06-26 Thread Michael Mabin
Cheetah also allows you to embed Python code in the HTML. On Thu, Jun 26, 2008 at 11:10 AM, John Salerno <[EMAIL PROTECTED]> wrote: > "John Salerno" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >I always have the desire to learn one thing well instead of split my > >attention b

Classes for processing/parsing Wiki Markup text

2008-07-01 Thread Michael Mabin
Does anyone know if there are any generally available classes for parsing various wiki markup formats? -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes for processing/parsing Wiki Markup text

2008-07-01 Thread Michael Mabin
Thanks! This looks like just what I need! :) On Tue, Jul 1, 2008 at 1:25 PM, Joshua Kugler <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > > > Does anyone know if there are any generally available classes for parsing > > various wiki markup formats? &g

Re: Getting a path from a file object

2008-07-04 Thread Michael Mabin
f.name will return the path. But if you want to guarantee getting the absolute pathname use os.path.abspath >>> import os >>> os.path.abspath(f.name) '/some/path/file.ext' On Fri, Jul 4, 2008 at 1:37 PM, Andrew Fong <[EMAIL PROTECTED]> wrote: > Newbie question: > > Let's say I open a new file

Re: question

2008-07-20 Thread Michael Mabin
I think the question was: why does anyone still use perl when Python is clearly the better language? On Sun, Jul 20, 2008 at 2:17 PM, Paddy <[EMAIL PROTECTED]> wrote: > On Jul 20, 6:39 pm, <[EMAIL PROTECTED]> wrote: > > Nobody any sensible answers. Too complicated I suppose! > > The sensible ques

Re: Protecting instance variables

2008-07-28 Thread Michael Mabin
What about __setattr__()? On Mon, Jul 28, 2008 at 5:23 AM, Nikolaus Rath <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry for replying so late. Your MUA apparently messes up the > References:, so I saw you reply only now and by coincidence. > > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > Nikolau

Brainwave: A Complete Web Platform With Database Out of the Box

2008-08-05 Thread Michael Mabin
What do you all think of this? Brainwave is a complete Web Development Platform with a DDL-free database. Its application server is built on CherryPy. It comes already bundled with Cheetah and Mako templating engines. And its database is its true gem. The database is built on a "neural" model.

Re: Brainwave: A Complete Web Platform With Database Out of the Box

2008-08-05 Thread Michael Mabin
Actually this is not my web site or my product. But this is the kind of tough love I'd like the creators to read. On Tue, Aug 5, 2008 at 10:36 AM, Avinash Vora <[EMAIL PROTECTED]> wrote: > On Aug 5, 2008, at 8:37 PM, Michael Mabin wrote: > > Brainwave is a complete Web Devel

Re: SSH utility

2008-08-11 Thread Michael Mabin
I use pexpect. On Mon, Aug 11, 2008 at 7:22 AM, Jean-Paul Calderone <[EMAIL PROTECTED]>wrote: > On Sun, 10 Aug 2008 21:25:38 -0700 (PDT), James Brady < > [EMAIL PROTECTED]> wrote: > >> Hi all, >> I'm looking for a python library that lets me execute shell commands >> on remote machines. >> >> I'v

Re: From Ruby to Python?

2008-08-14 Thread Michael Mabin
I kind of went the other way. I knew some Python and then learned Ruby. I found that the two languages were similar enough that I didn't really need a Ruby for Python programmers help doc. There's not much of a paradigm shift (except for the whitespace and indentedness of Python) going from one

Re: Java or C++?

2008-04-15 Thread Michael Mabin
I'm shocked. I've seen no mention of Smalltalk at all. Which should be soo oobvious! ;) I would take an incremental approach. Learn Java first, since it is still OO, offers a rich set of libraries for just about every task but requires a bit more work. C++ requires that you do more work still (

Re: Is vs Equality Operator

2008-05-01 Thread Michael Mabin
'is' tests for identity (variable references the same memory location) while '==' tests for equality. Though it's probably best to use 'is' with more complex classes and not the simpler built-in types like integers. See how 'is' works for lists below: >>> l1 = [1,2,3,4] >>> l3 = [1,2,3,4] >>> l1

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-03 Thread Michael Mabin
I work on an AIX system where /usr/bin and /usr/local/bin apps can only be installed by root. Our system doesn't have python or many other tools we like to use installed so we have to install python in an alternate directory location. We have a system installation of Perl installed, but it's a rele

Re: Why is None <= 0

2008-05-03 Thread Michael Mabin
New style classes are classes inherited from class object. Therefore: class A: pass is oldstyle, while class B(object): pass is newstyle. On Tue, Apr 29, 2008 at 8:29 AM, blaine <[EMAIL PROTECTED]> wrote: > On Apr 29, 5:32 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > > =?ISO-8859-15?

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-08 Thread Michael Mabin
For me, the difference is #!python doesn't work for me. I get a bad interpreter error. On Thu, May 8, 2008 at 6:31 AM, Brian Vanderburg II < [EMAIL PROTECTED]> wrote: > This is sort of related, but I'm wondering what is different between > "#!/usr/bin/env python" and "#!python". Wouldn't the se

python equivalent to perl's inplace edit mechanism

2008-05-08 Thread Michael Mabin
Does python have an equivalent to Perl's inplace-edit variable $^I? For example, the following perl code below changes mike to dave in a file that is passed as an argument. #!/usr/bin/env perl #chgit script $^I = ''; while(<>) { s/mike/dave/g; print; } The script would be used as below: chgit

Re: python equivalent to perl's inplace edit mechanism

2008-05-08 Thread Michael Mabin
hu, May 8, 2008 at 2:11 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > > Does python have an equivalent to Perl's inplace-edit variable $^I? > > > > I misread your question. > > No, Python eschews magic characters and symbols. They make code ugly > and harder to

Twisted vs. CherryPy vs. ??? for light-weight web servers

2008-09-23 Thread Michael Mabin
Is there any consensus on what the best lightweight web-server is? Or rather would Twisted be a better choice to choose as a framework that allows me to serve html or xml data for light webservices. Or is CherryPy just as good? -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.o

Fwd: Twisted vs. CherryPy vs. ??? for light-weight web servers

2008-09-24 Thread Michael Mabin
t;[EMAIL PROTECTED]>wrote: > On Tue, 23 Sep 2008 21:22:08 -0500, Michael Mabin <[EMAIL PROTECTED]> > wrote: > >> Is there any consensus on what the best lightweight web-server is? Or >> rather would Twisted be a better choice to choose as a framework that >>

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """ % ','.join([str(x) for x in [1,5,9]]) On Fri, Sep 26, 2008 at 6:23 AM, Tino Wildenhain <[EMAIL PROT

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
I laugh in the face of danger. Give me a use case for an exploit. On Fri, Sep 26, 2008 at 8:05 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > >> cursor.execute(""" >> SELECT titem.object_id,

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
Sep 26, 2008 at 10:38 AM, Michael Mabin <[EMAIL PROTECTED]>wrote: > >> I laugh in the face of danger. >> >> Give me a use case for an exploit. >> > > http://xkcd.com/327/ > > -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.org/mailman/listinfo/python-list

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
hat I happen to do) which won't be run by the general public. Incidentally, couldn't input field edits prevent such exploits prior to interpolation? On Fri, Sep 26, 2008 at 11:38 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 11:00:59 -0500 > &

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
so you wouldn't object then to something like ' in (%)' % ','.join([str_edit_for_exploit(x) for x in aList]) if str_edit_for_exploit applied security edits? On Fri, Sep 26, 2008 at 2:28 PM, Benjamin Kaplan <[EMAIL PROTECTED]>wrote: > > >

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
oops. i meant. ' in (%s)' % ','.join([str_edit_for_exploit(x) for x in aList]) On Fri, Sep 26, 2008 at 5:05 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > so you wouldn't object then to something like ' in (%)' % > &

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-27 Thread Michael Mabin
ata from the database does not have DROP, ALTER, or CREATE privileges on that database? On Sat, Sep 27, 2008 at 9:14 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Hi, > > Michael Mabin wrote: > >> so you wouldn't object then to something like >>

Re: python for *nix system admins

2008-09-27 Thread Michael Mabin
import commands ? On Sat, Sep 27, 2008 at 8:06 AM, George Boutsioukis <[EMAIL PROTECTED]>wrote: > On Sat, 27 Sep 2008 10:05:01 +0200, Lars Stavholm wrote: > > > Hi All, > > > > I'm new to this list and hoping that this is not off-topic. If it is, > > please point me in the right direction. > > >

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-27 Thread Michael Mabin
e this as if it were input by a user that might be a hacker? This seems retarded and paranoid to me. And where in that post does it say that the list is from web input? Although to be fair maybe most of the Python community is doing web development. Thanks for the stimulating and educational

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Michael Mabin
Tino, dude, I'm afraid I lied about my previous post being the last word. There are some things you said here that must be addressed. On Sun, Sep 28, 2008 at 6:00 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > >> I'm exhausted, so I'l

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Michael Mabin
Sadly no. There is no utterance too inconsequential. On Sun, Sep 28, 2008 at 3:10 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > > Tino, dude, I'm afraid I lied about my previous post being the last > > word. There are some things you said h