Re: cjson 1.0.5 keyword argument

2008-09-14 Thread Clodoaldo
On Sep 14, 11:45 am, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > On Sun, Sep 14, 2008 at 10:33 AM, Clodoaldo <[EMAIL PROTECTED]> wrote: > > I have installed cjson 1.05 in Fedora 8 (python 2.5.1). > > > The cjson home page shows a keyword argument "e

Re: cjson 1.0.5 keyword argument

2008-09-14 Thread Clodoaldo
On Sep 14, 10:33 am, Clodoaldo <[EMAIL PROTECTED]> wrote: > I have installed cjson 1.05 in Fedora 8 (python 2.5.1). > > The cjson home page shows a keyword argument > "encoding".http://python.cx.hu/python-cjson/ > > When i use it i get an error: > &

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
On Mar 28, 1:56 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 28 Mar 2008 13:22:06 -0300, Clodoaldo <[EMAIL PROTECTED]> > escribió: > > > > > On Mar 28, 12:09 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >>

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
On Mar 28, 12:09 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 28 Mar 2008 10:54:49 -0300, Clodoaldo <[EMAIL PROTECTED]> > escribió: > > > > > I'm using a md5 hash encoded with base64.urlsafe_b64encode as a > > parameter of

base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
swer will make my regexp safer. In another point, does the "=" char make it urlunsafe? I guess not because i believe it would only be unsafe if the equal appeared like in "&var=" and since there are no "&" in the string than there is no problem right? Or wrong? Re

Re: sendmail should throw an exception but does not

2008-03-25 Thread Clodoaldo
2008/3/25, D'Arcy J.M. Cain <[EMAIL PROTECTED]>: > On Tue, 25 Mar 2008 06:39:57 -0700 (PDT) > Clodoaldo <[EMAIL PROTECTED]> wrote: > > I need to know if an email was refused for whatever reason, it makes > > no difference. > > > > The email is se

sendmail should throw an exception but does not

2008-03-25 Thread Clodoaldo
an exception but it does not. And the returned dictionary is empty as if the email was accepted. d = smtpserver.sendmail(sender, recipient, m.as_string()) I guess that the error code returned by the destination mail server is not is not forwarded to the client by my mail server. Regards, Clodoaldo

Re: Unicode to HTML entities

2007-05-30 Thread Clodoaldo
On May 30, 4:25 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Clodoaldo <[EMAIL PROTECTED]> wrote: > > On May 29, 12:57 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > >> "Clodoaldo" <[EMAIL PROTECTED]> wrote in message > &

Re: Unicode to HTML entities

2007-05-30 Thread Clodoaldo
On May 30, 8:53 am, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > On 29 maj 2007, at 17.52, Clodoaldo wrote: > > > > > I was looking for a function to transform a unicode string into > > htmlentities. Not only the usual html escaping thing but all > > character

Re: Unicode to HTML entities

2007-05-29 Thread Clodoaldo
On May 29, 12:57 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > "Clodoaldo" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >I was looking for a function to transform a unicode string into > >htmlentities. > >

Unicode to HTML entities

2007-05-29 Thread Clodoaldo
python builtin modules? If not is there a better way to do it? Regards, Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

Re: Locale case change not working

2007-05-24 Thread Clodoaldo
On May 24, 6:40 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Clodoaldo wrote: > > When using unicode the case change works: > > >>>> print u'É'.lower() > > é > > > But when using the pt_BR.utf-8 locale it doesn't: > >

Locale case change not working

2007-05-24 Thread Clodoaldo
27;utf') >>> print 'É'.lower() É What am I missing? I'm in Fedora Core 5 and Python 2.4.3. # cat /etc/sysconfig/i18n LANG="en_US.UTF-8" SYSFONT="latarcyrheb-sun16" Regards, Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

How to format a number?

2007-01-02 Thread Clodoaldo
76, True) '9876' >>> locale.localeconv()['thousands_sep'] '' >>> locale.localeconv()['mon_thousands_sep'] '.' The thousands separator is defined only for the ['mon_thousands_sep'] key and not for the ['thousands_sep

Re: Problem reading with bz2.BZ2File(). Bug?

2006-11-15 Thread Clodoaldo Pinto Neto
s like one byte of garbage is appended at the end of file. Please > file a bug report. Bug number 1597011 Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem reading with bz2.BZ2File(). Bug?

2006-11-15 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > Clodoaldo Pinto Neto wrote: > > > The offending file is 5.5 MB. Sorry, i could not reproduce this problem > > with a smaller file. > > but surely you can post the repr() of the last two lines? This is the output: $ python bzp.py line number: 588

Problem reading with bz2.BZ2File(). Bug?

2006-11-15 Thread Clodoaldo Pinto Neto
lines += 1 if line1 != line2: print 'line number:', lines print repr(line1) print repr(line2) f1.close() f2.close() ## The offending file is 5.5 MB. Sorry, i could not reproduce this problem with a smaller file. http://fahstats.c

Re: Output from subprocess.Popen()

2006-10-17 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > Clodoaldo Pinto Neto wrote: > > > But I still don't understand what is happening. The manual says that > > when shell=True the executable argument specifies which shell to use: > > no, it says that when shell=True, it runs the command "thro

Re: Output from subprocess.Popen()

2006-10-16 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I can't see any obvious way to ask subprocess to use a shell other than > > the default. > > -c ? > > >>> f = Popen(["/bin/bash", "-c", "set|grep IFS"], stdout=PIPE) > >>> f.stdout.read() > "IFS=$' \\t\\n'\n" > >>> f = Popen(["/bin/sh", "-c",

Re: Output from subprocess.Popen()

2006-10-16 Thread Clodoaldo Pinto Neto
Now we have 3 different outputs from 3 people to the command: >>> f = subprocess.Popen("set | grep IFS", shell=True, stdout=subprocess.PIPE) >>> f.stdout.readlines() >From me on FC5: ["BASH_EXECUTION_STRING='set | grep IFS'\n", "IFS=' \t\n"] >From Fredrik Lundh on unknown

Re: Output from subprocess.Popen()

2006-10-15 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > this works for me: > > >>> f = subprocess.Popen("set | grep IFS", shell=True, > stdout=subprocess.PIPE) > >>> f.stdout.readlines() > ["IFS=$' \\t\\n'\n"] > > what does the above return on your machine? >>> f = subprocess.Popen("set | grep IFS", shell=True, stdout=subproce

Output from subprocess.Popen()

2006-10-15 Thread Clodoaldo Pinto Neto
27; \t\n" Both outputs for comparison: IFS=$' \t\n' "IFS=' \t\n" The subprocess.Popen() output is missing the $ and the last ' How to get the raw shell output from subprocess.Popen()? Regards, Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI Tutorial

2006-10-06 Thread Clodoaldo Pinto Neto
[EMAIL PROTECTED] wrote: > Clodoaldo Pinto Neto wrote: > > > print 'The submited name was "' + name + '"' > > Bzzt! Script injection security hole. See cgi.escape and use it (or a > similar function) for *all* text -> HTML output. >

Re: CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
le-structure, etc), > and thus should only be used while debugging, and turned off in > any sort of production code. Yes, another warning was issued. Thanks for your help. Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
Clodoaldo Pinto Neto wrote: > I'm just building a Python CGI Tutorial and would appreciate any > feedback from the many experts in this list. http://webpython.codepoint.net -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
Clodoaldo Pinto Neto wrote: > I'm just building a Python CGI Tutorial and would appreciate any > feedback from the many experts in this list. http://webpython.codepoint.net -- http://mail.python.org/mailman/listinfo/python-list

CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
I'm just building a Python CGI Tutorial and would appreciate any feedback from the many experts in this list. Regards, Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting using dictionaries

2006-04-22 Thread Clodoaldo Pinto
Thank you guys, you are great! -- http://mail.python.org/mailman/listinfo/python-list

String formatting using dictionaries

2006-04-22 Thread Clodoaldo Pinto
I know how to format strings using a dictionary: >>> d = {'list':[0, 1]} >>> '%(list)s' % d '[0, 1]' Is it possible to reference an item in the list d['list']?: >>> '%(list[0])s' % d Traceback (most recent call

Re: String To Dict Problem

2006-04-22 Thread Clodoaldo Pinto
ry: > return self.allowed[node.name] > except KeyError: > raise Unsafe_Source_Error("Strings must be quoted", > node.name, node) > Thank you both Michael and Felipe. The solutions work great! Regards, Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: String To Dict Problem

2006-04-21 Thread Clodoaldo Pinto
) File "safe_eval.py", line 19, in visit return meth(node, **kw) File "safe_eval.py", line 47, in visitName node.name, node) __main__.Unsafe_Source_Error: Line 1. Strings must be quoted: True This is just to let you know. I can live with that. I just replace True for 1. Regards, Clodoaldo Pinto -- http://mail.python.org/mailman/listinfo/python-list

How to create a dictionary from a string?

2006-04-21 Thread Clodoaldo Pinto
Is there a simple way to build a dictionary from a string without using eval()? >>> s = '{"a":1}' >>> d = eval(s) >>> d {'a': 1} Regards, Clodoaldo Pinto -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-11 Thread Clodoaldo Pinto
easy and intuitive to learn, and in > most cases it is. It just happens that division is one area where it is > a bit awkward. Right again !! Although the Python way is almost always easy to learn I won't be pythonic (as in specific to Python) where it won't help. Regards, Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
Frank Millman wrote: > > We know that Python is in the process of changing the division > operator. The main reason for the change is that the current approach > is not intuitive to a newcomer (whether experienced or not). > > Why not think to the future, and do it like this. Instruct the reader >

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
where this issue can be discussed. http://programming-crash-course.com/integer_versus_float_division Regards, Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
glish speaker I don't know what sounds less mathematical and more natural. I changed integer to whole following the previous suggestion but I really don't know. Regards, Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
John Salerno wrote: > Clodoaldo Pinto wrote: > > > "Python is a remarkably powerful dynamic programming language that is > > used in a wide variety of application domains. Python is often compared > > to Tcl, Perl, Ruby, Scheme or Java. Some of its key distin

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
I used the term "integer" for the lack of a better one and I didn't mention "float". Any suggestions? Regards, Clodoaldo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
Bruno Desthuilliers wrote: > Clodoaldo Pinto a écrit : > > bill pursell wrote: > > > (snip) > >>2) In the section on installing, you begin with: > >>"Python is an interpreted, interactive, object-oriented programming > >>language.". The comp

Re: Programming Tutorial for absolute beginners

2006-04-07 Thread Clodoaldo Pinto
ary) If you have any suggestions for that page's title please do so. Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-07 Thread Clodoaldo Pinto
The complete novice sees those words and expects > them to be explained, but there is no definition given. I would > recommend simplifying that sentence, or explaining the terms. Ok, i will think about something, or just delete it. Clodoaldo -- http://mail.python.org/mailman/listinfo/python-list

Programming Tutorial for absolute beginners

2006-04-07 Thread Clodoaldo Pinto
I'm starting a programming tutorial for absolute beginners using Python and I would like your opinions. http://programming-crash-course.com Regards, Clodoaldo Pinto -- http://mail.python.org/mailman/listinfo/python-list