Re: [BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread Roshan Mathews
On Wed, Oct 21, 2009 at 12:19 PM, Anand Chitipothu wrote: > Literal strings are interned. Python maintains a dict of all literal > strings used in the code and all occurrences get the same object. > What do you mean when you use the word "interned"? id("hello") > 600320 id("hello") > 60

Re: [BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread Anand Chitipothu
On Wed, Oct 21, 2009 at 12:05 PM, Sidharth Kuruvila wrote: > Hi, > >  d = {"a":"Hello"} > >  print d.setdefault("a", "blah") > >  Even though the string blah is not being used an object has to be > created to represent it. Even worse, you could put some complex > expression in there expecting it t

Re: [BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread Roshan Mathews
On Wed, Oct 21, 2009 at 12:05 PM, Sidharth Kuruvila wrote: >  d = {"a":"Hello"} >  print d.setdefault("a", "blah") > >  Even though the string blah is not being used an object has to be > created to represent it. Even worse, you could put some complex > expression in there expecting it to evaluate

Re: [BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread Sidharth Kuruvila
Hi, d = {"a":"Hello"} print d.setdefault("a", "blah") Even though the string blah is not being used an object has to be created to represent it. Even worse, you could put some complex expression in there expecting it to evaluate only if the key is missing. Regards, Sidharth On Wed, Oct 21,

Re: [BangPypers] Posting style

2009-10-20 Thread Kenneth Gonsalves
On Tuesday 20 Oct 2009 6:19:14 pm steve wrote: > > Yes. It is better to have some guidelines and being informed up front > > when joining the list than having to remind each and every person, > > "do this, do that, don't do this, don't use attachments, don't X post" > > etc... > > I vote for ma

Re: [BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread Roshan Mathews
On Wed, Oct 21, 2009 at 8:06 AM, srid wrote: > http://stackoverflow.com/questions/1597764/is-there-a-better-pythonic-way-to-do-this > Nice. Martelli says: (avoid setdefault, that was never a good design and doesn't have good performance either, as well as being pretty murky) Any idea wh

[BangPypers] An interesting beginner post at Stackoverflow

2009-10-20 Thread srid
http://stackoverflow.com/questions/1597764/is-there-a-better-pythonic-way-to-do-this Someone wrote their *first* Python program asking for a more Pythonic way to do it ... and gets valuable feedback from the community including Alex Martelli. I am now researching on a way to gather top posts (w/

Re: [BangPypers] HTML Parsing in python

2009-10-20 Thread srid
On Tue, Oct 20, 2009 at 6:34 PM, Yuvi Panda wrote: > I use lxml.html. Just as good, and MUCH faster. A pain to install though. If you're using ActivePython, the following command is just enough to get lxml installed on Mac, Linux or Windows: $ pypm install lxml http://docs.activestate.com/act

Re: [BangPypers] HTML Parsing in python

2009-10-20 Thread Yuvi Panda
I use lxml.html. Just as good, and MUCH faster. A pain to install though. On Tue, Oct 20, 2009 at 6:32 PM, Anand Balachandran Pillai < abpil...@gmail.com> wrote: > > > On Thu, Sep 10, 2009 at 7:44 PM, Puneet Aggarwal wrote: > >> Thanks all for the suggestions. I think I will start with BeautifulS

Re: [BangPypers] HTML Parsing in python

2009-10-20 Thread Anand Balachandran Pillai
On Thu, Sep 10, 2009 at 7:44 PM, Puneet Aggarwal wrote: > Thanks all for the suggestions. I think I will start with BeautifulSoup > (3.0.7a) and will experiment with other suggested libs if it does not fit > into my requirement or if I face issues with this. > You are not going to believe this,

Re: [BangPypers] Posting style

2009-10-20 Thread steve
On 10/20/2009 06:06 PM, Anand Balachandran Pillai wrote: On Tue, Oct 20, 2009 at 5:53 PM, Kenneth Gonsalves I will add this link to welcome message of this list. once again I need to emphasise that first we need to decide whether this list will have recommended posting guidelines -

Re: [BangPypers] Posting style

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 5:53 PM, Kenneth Gonsalves wrote: > On Tuesday 20 Oct 2009 5:33:21 pm Anand Balachandran Pillai wrote: > > > This helped me when I first ventured into mailing lists and IRC > > > http://catb.org/~esr/faqs/smart-questions.html

Re: [BangPypers] Posting style

2009-10-20 Thread Kenneth Gonsalves
On Tuesday 20 Oct 2009 5:33:21 pm Anand Balachandran Pillai wrote: > > This helped me when I first ventured into mailing lists and IRC > > http://catb.org/~esr/faqs/smart-questions.html >s/smart-questions.html> > > +1<<21 > > This needs to be compulsory reading for thos

Re: [BangPypers] Posting style

2009-10-20 Thread Kenneth Gonsalves
On Tuesday 20 Oct 2009 5:28:52 pm Noufal Ibrahim wrote: > On Tue, Oct 20, 2009 at 3:53 PM, Baiju M wrote: > > Hi, > >I hope this link would be useful for some newly joined > > members: > > http://en.wikipedia.org/wiki/Posting_style > > This helped me when I first ventured into mailing lists an

Re: [BangPypers] Posting style

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 5:28 PM, Noufal Ibrahim wrote: > On Tue, Oct 20, 2009 at 3:53 PM, Baiju M wrote: > > Hi, > >I hope this link would be useful for some newly joined > > members: > > http://en.wikipedia.org/wiki/Posting_style > > This helped me when I first ventured into mailing lists a

Re: [BangPypers] Posting style

2009-10-20 Thread Noufal Ibrahim
On Tue, Oct 20, 2009 at 4:16 PM, Kenneth Gonsalves wrote: > On Tuesday 20 Oct 2009 3:53:40 pm Baiju M wrote: >> Hi, >>     I hope this link would be useful for some newly joined >> members: >> http://en.wikipedia.org/wiki/Posting_style > > I am afraid this is going to confuse readers - what we nee

Re: [BangPypers] Posting style

2009-10-20 Thread Noufal Ibrahim
On Tue, Oct 20, 2009 at 3:53 PM, Baiju M wrote: > Hi, >    I hope this link would be useful for some newly joined > members: > http://en.wikipedia.org/wiki/Posting_style This helped me when I first ventured into mailing lists and IRC http://catb.org/~esr/faqs/smart-questions.html -- ~noufal htt

Re: [BangPypers] I am new to python language. Suggest way to improve my skills in python

2009-10-20 Thread srid
>> On Tue, Oct 20, 2009 at 11:34 AM, Senthil Kumar M >> wrote: >>> I am new to python language. Suggest way to improve my skills in python > On Tue, Oct 20, 2009 at 12:15 PM, Arvind Jamuna Dixit > wrote: >> You may find something useful in the answers to these questions. >> http://stackoverflow.

Re: [BangPypers] Posting style

2009-10-20 Thread Kenneth Gonsalves
On Tuesday 20 Oct 2009 3:53:40 pm Baiju M wrote: > Hi, > I hope this link would be useful for some newly joined > members: > http://en.wikipedia.org/wiki/Posting_style I am afraid this is going to confuse readers - what we need is 'which of these styles is preferred on this list?', or we need

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 3:38 PM, Sidharth Kuruvila < sidharth.kuruv...@gmail.com> wrote: > Hi, > Blargh! Boy! Read the mails! That code you wrote runs fine on 2.6. > But won't run on 3.0. > > This should work. > > intab = "aeiou" > outtab = "12345" > trantab = str.maketrans(intab,outtab) #Watch t

[BangPypers] Posting style

2009-10-20 Thread Baiju M
Hi, I hope this link would be useful for some newly joined members: http://en.wikipedia.org/wiki/Posting_style Regards, Baiju M ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
this works fine.thank you On Tue, Oct 20, 2009 at 3:38 PM, ashok raavi wrote: > > > On Tue, Oct 20, 2009 at 3:24 PM, Senthil Kumar M wrote: > >> See this link. I have tried this site but could not find what is the >> mistake.Thats why I send it here.ok? >> >> http://docs.python.org/dev/3.0/libra

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Sidharth Kuruvila
Hi, Blargh! Boy! Read the mails! That code you wrote runs fine on 2.6. But won't run on 3.0. This should work. intab = "aeiou" outtab = "12345" trantab = str.maketrans(intab,outtab) #Watch this line! st = "this is string examplewow!!!"; print(st.translate(trantab)) Basically they've moved

Re: [BangPypers] help me to fix this error

2009-10-20 Thread ashok raavi
On Tue, Oct 20, 2009 at 3:24 PM, Senthil Kumar M wrote: > See this link. I have tried this site but could not find what is the > mistake.Thats why I send it here.ok? > > http://docs.python.org/dev/3.0/library/stdtypes.html?highlight=maketrans#str.maketrans > > > On Tue, Oct 20, 2009 at 3:14 PM, An

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
See this link. I have tried this site but could not find what is the mistake.Thats why I send it here.ok? http://docs.python.org/dev/3.0/library/stdtypes.html?highlight=maketrans#str.maketrans On Tue, Oct 20, 2009 at 3:14 PM, Anand Balachandran Pillai < abpil...@gmail.com> wrote: > > > On Tue, Oc

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 3:11 PM, Senthil Kumar M wrote: > from string import maketrans > intab = "aeiou" > outtab = "12345" > trantab = maketrans(intab,outtab) > st = "this is string examplewow!!!"; > print(st.translate(trantab)) > -- > > I g

Re: [BangPypers] WSDL

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 12:20 PM, sudhakar s wrote: > > Hey can any one suggest me way's of writing WSDL easily. > Please don't cross post to another list. Someone in the other list will try to do a reply-all and posts will come to this list but won't go through since they will be non-members.

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
from string import maketrans intab = "aeiou" outtab = "12345" trantab = maketrans(intab,outtab) st = "this is string examplewow!!!"; print(st.translate(trantab)) -- I got this error, Traceback (most recent call last): File "C:\Python30\ful

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 2:40 PM, Senthil Kumar M wrote: > -- > #!/usr/bin/python > > from string import maketrans > intab = "aeiou" > outtab = "12345" > trantab = intab.maketrans(outtab) > > str = "this is string examplewow!!!"; > print s

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Sidharth Kuruvila
Hi, Could you print the error message too. I don't have python 3 so i can't run the code you posted. A couple of quick pointers. You don't need this line `#!/usr/bin/python`. That's for telling a unix shell to use python to run the remaining code. Yo don't need this line `from string import mak

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
-- #!/usr/bin/python from string import maketrans intab = "aeiou" outtab = "12345" trantab = intab.maketrans(outtab) str = "this is string examplewow!!!"; print str.translate(trantab); ---

Re: [BangPypers] help me to fix this error

2009-10-20 Thread Sidharth Kuruvila
Hi, This looks like it's because python's strings have change in python 3. The characters used to be 8bit bytes but now they are 16 bits wide. A quick google tells me that str now has a method called maketrans so s1.maketrans(s2) should work. I'm guessing you are using a tutorial written for one

[BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
I am using python IDLE (python3.0.1) . I dont know why this error comes ? I am a new user to python. the link of the image snapshot is http://img197.imageshack.us/img197/3405/pythonshell.png -- M.Senthil Kumar

Re: [BangPypers] Python interpreter in mobile phone (java)

2009-10-20 Thread M.V.Ramana Murty
Check this content @NOKIA to know how to write Python programs that run on the SYMBIAN S60 platform. http://www.forum.nokia.com/info/sw.nokia.com/id/a5da42ca-3cc6-426f-9d98-234523fd9d75/Python_for_the_S60_Platform.html --MVR.Murty, PMP B A N G A L O R E +91-9019652312 +91-80-41267852 __

[BangPypers] help me to fix this error

2009-10-20 Thread Senthil Kumar M
I am using python IDLE (python3.0.1) . I dont know why this error comes ? I am a new user to python. -- M.Senthil Kumar ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/b

Re: [BangPypers] I am new to python language. Suggest way to improve my skills in python

2009-10-20 Thread Senthil Kumar M
OK,.I will follow this in feature On Tue, Oct 20, 2009 at 1:38 PM, Anand Balachandran Pillai < abpil...@gmail.com> wrote: > > > On Tue, Oct 20, 2009 at 1:25 PM, Senthil Kumar M wrote: > >> thank the link. I will check >> >> >> On Tue, Oct 20, 2009 at 12:15 PM, Arvind Jamuna Dixit >> wrote: >> >>>

Re: [BangPypers] I am new to python language. Suggest way to improve my skills in python

2009-10-20 Thread Anand Balachandran Pillai
On Tue, Oct 20, 2009 at 1:25 PM, Senthil Kumar M wrote: > thank the link. I will check > > > On Tue, Oct 20, 2009 at 12:15 PM, Arvind Jamuna Dixit wrote: > >> You may find something useful in the answers to these >> questions >> . >> >> O

Re: [BangPypers] I am new to python language. Suggest way to improve my skills in python

2009-10-20 Thread Senthil Kumar M
thank the link. I will check On Tue, Oct 20, 2009 at 12:15 PM, Arvind Jamuna Dixit wrote: > You may find something useful in the answers to these > questions > . > > On Tue, Oct 20, 2009 at 11:34 AM, Senthil Kumar M > wrote: > >> I am n

Re: [BangPypers] Python interpreter in mobile phone (java)

2009-10-20 Thread Aneesh A
On Sun, Oct 18, 2009 at 7:19 PM, Zaki Manian wrote: > Android also has a python environment as well - the android scripting > environment. > I like to run python apps in low cost phones. so that i opt for java interpreter. > Python isn't really an ideal client language for mobile phone develop

Re: [BangPypers] Django and NIS authentication

2009-10-20 Thread Ramdas S
I've written a similar app, which is actually a mini utm app and is successfully deployed at many of my clients, and publishes reports on the network. Django wont understand NIS by itself. You can use Python to do just that. Also you have a number of Python modules which'll help you to gain some o

Re: [BangPypers] WSDL

2009-10-20 Thread Vivek Khurana
On Tue, Oct 20, 2009 at 12:20 PM, sudhakar s wrote: > > Hey can any one suggest me way's of writing WSDL  easily. Use soaplib or try this http://osdir.com/ml/python.pywebsvcs.general/2006-07/msg00015.html regards Vivek -- The hidden harmony is better than the obvious!!

Re: [BangPypers] I am new to python language. Suggest way to improve my skills in python

2009-10-20 Thread Vivek Khurana
On Tue, Oct 20, 2009 at 11:34 AM, Senthil Kumar M wrote: > I am new to python language. Suggest way to improve my skills in python There is only one way... code, code, code and more code :) regards Vivek -- The hidden harmony is better than the obvious!! __