> > This works fine as long as they are in English:
> > "??? is not a valid value for BrowseNodeId.
>
> > Please change this value and retry your request.",
> > for instance, will raise an InvalidParameterValue
>
> > exception. However, the Japanese version returns the error message "???
> > は、
On 21 Apr, 20:42, John Nagle wrote:
> luca72 wrote:
> > Hello i have this question :
> > i connect to the server in this way:
> > sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
> > sock.connect(('192.168.1.11',11502))
> > rcv = sock.recv(8124)
> > here i get 14 random bytes , in a string
>> ... or because Mingw32 doesn't provide the header files (in particular
>> wrt. C++), or because linking with a library is necessary that uses the
>> MSVC mangling, not the g++ one (again, for C++).
>
> Again, that would be code that’s not portable off Windows.
Probably (although it *is* possib
>> ... or because Mingw32 doesn't provide the header files (in particular
>> wrt. C++), or because linking with a library is necessary that uses the
>> MSVC mangling, not the g++ one (again, for C++).
>
> Again, that would be code that’s not portable off Windows.
Probably (although it *is* possib
* Lawrence D'Oliveiro:
In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
Since in python nothing is guaranteed about implicit file close ...
It is guaranteed that objects with a reference count of zero will be
disposed.
Only in current CPython.
In my experiments, this happens i
C. Benson Manica, 21.04.2010 19:19:
I have the following simple script running on 2.5.2 on a machine where
the default character encoding is "ascii":
#!/usr/bin/env python
#coding: utf-8
import xml.dom.minidom
import codecs
str=u""
doc=xml.dom.minidom.parseString( str )
xml=doc.toxml( encoding
Hi everyone,
Here's some updates for PyCon Australia 2010, to be held at the Sydney
Masonic Center over the weekend of June 26 and 27.
1. Registration is now open
2. Keynotes announced
3. Call For Proposals proceeds
4. Several sponsors confirmed
Please pass this message on to those you feel will
On Thu, 22 Apr 2010 12:53:51 +1200, Lawrence D'Oliveiro wrote:
> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
>
>> Since in python nothing is guaranteed about implicit file close ...
>
> It is guaranteed that objects with a reference count of zero will be
> disposed.
Not all Pyth
A little while back, I was browsing these newsgroups, just like you
are now, and came across an article similar to this that said you
could make thousands of dollars within weeks with only an initial
investment of $5.00 ! So I thought, "Yeah, right, this must be a
scam", like most of us, b
On Thu, Apr 22, 2010 at 9:59 AM, Lawrence D'Oliveiro
wrote:
>> ... or because Mingw32 doesn't provide the header files (in particular
>> wrt. C++), or because linking with a library is necessary that uses the
>> MSVC mangling, not the g++ one (again, for C++).
>
> Again, that would be code that’s
In message <4bc8547...@dnews.tpgi.com.au>, Lie Ryan wrote:
> ... so you should get the full installer if you want to insure yourself
> from Microsoft pulling the plug out.
I wonder how many Windows users will be able to figure that out...
--
http://mail.python.org/mailman/listinfo/python-list
Ryan,
> So if you don't care about portability or about that dirty feeling you get
> from messing with the Python internals, then have at it :-)
Warnings aside, its very clever code. Thanks for sharing!
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote:
> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
>
>> Since in python nothing is guaranteed about implicit file close ...
>
> It is guaranteed that objects with a reference count of zero will be
> disposed.
> In my experiments
In message , "Martin
v. Löwis" wrote:
> Brian Blais wrote:
>
>> On Apr 12, 2010, at 16:36 , Martin v. Loewis is wrote:
>>
>>> If you are planning to build Python extension modules in the next five
>>> years, I recommend that you obtain a copy of VS Express
>>
>> Am I missing something here? I
In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
> Since in python nothing is guaranteed about implicit file close ...
It is guaranteed that objects with a reference count of zero will be
disposed. In my experiments, this happens immediately.
--
http://mail.python.org/mailman/listinfo
On Wed, 2010-04-21 at 19:43 -0400, pyt...@bdurham.com wrote:
> Ryan,
>
> Your withhacks module looks very interesting.
> http://pypi.python.org/pypi/withhacks
>
> What are your specific concerns about its use? Are there portability
> concerns?
It combines two things you just don't see in respec
Ryan,
Your withhacks module looks very interesting.
http://pypi.python.org/pypi/withhacks
What are your specific concerns about its use? Are there portability
concerns?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Ryan Kelly wrote:
On Tue, 2010-04-20 at 14:43 +0100, Alan Harris-Reid wrote:
Hi,
During my Python (3.1) programming I often find myself having to repeat
code such as...
class1.attr1 = 1
class1.attr2 = 2
class1.attr3 = 3
class1.attr4 = 4
etc.
Is there any way to achieve the same result wi
QOTW: "There's no RightAnswer(tm), just our best guess as to what is
the most
useful behavior for the most number of people." - Raymond Hettinger
http://groups.google.com/group/comp.lang.python/msg/e7f78ef27811781b
First beta version of Python 2.7 is available:
http://groups.google.
Thanks for your reponses.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2010-04-20 at 14:43 +0100, Alan Harris-Reid wrote:
> Hi,
>
> During my Python (3.1) programming I often find myself having to repeat
> code such as...
>
> class1.attr1 = 1
> class1.attr2 = 2
> class1.attr3 = 3
> class1.attr4 = 4
> etc.
>
> Is there any way to achieve the same result wit
Here's the method I was using. Note that tmp_char_ptr is of type
c_void_p. This should avoid the memory leak, assuming I am
interpreting the semantics of the cast correctly. Is there a cleaner
way to do this with ctypes?
def get_prop_string(self, prop_name):
# Have to work with c_void_
QOTW: "You see? That's what I like about the Python community: people
even
apologise for apologising :)" - Tim Golden
http://groups.google.com/group/comp.lang.python/msg/858d1c31d0c2adff
The third alpha version of Python 2.7 is ready for testing:
http://groups.google.com/group/comp
QOTW: "... [T]hat kills yet another usage of C ..." - Maciej
Fijalkowski
http://morepypy.blogspot.com/2009/11/some-benchmarking.html
Making operations in the Fraction class automatically return a
subclass
instance when called with subclass arguments:
http://groups.google.com/grou
QOTW: "I used to think anonymous functions (AKA blocks, etc...) would
be a
nice feature for Python.
Then I looked at a stack trace from a different programming language
with
lots of anonymous functions. (I believe it was perl.)
I became enlightened." - Jonathan Gardner, apparently echoing Guido'
I have a function exposed through ctypes that returns a c_char_p.
Since I need to deallocate that c_char_p, it's inconvenient that
ctypes copies the c_char_p into a string instead of giving me the raw
pointer. I believe this will cause a memory leak, unless ctypes is
smart enough to free the string
I'm looking for a Python-based, small, self-contained package to
hand out API keys, in the same spirit as Google API keys.
The basic specs are simple: 1) enforce the "one key per customer"
rule; 2) be robot-proof; 3) be reasonably difficult to circumvent
even for humans.
(This is for a web se
Hi everyone,
I have a production server running a Windows Service written in Python, which
uses python 2.5.4 (yes I know it is old, but I am somewhat stuck with this for
now) and pywin32 214.
Given a set of manipulations, I get a stack overflow in the service, and a bad
crash. The same opera
On 4/21/2010 12:56 PM candide said...
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
Not as I see it -- watch your index values - they change after each
delete is co
On Apr 21, 2:56 pm, candide wrote:
> Is the del instruction able to remove _at the same_ time more than one
> element from a list ?
>
> For instance, this seems to be correct :
>
> >>> z=[45,12,96,33,66,'c',20,99]
> >>> del z[2], z[6],z[0]
> >>> z
> [12, 33, 66, 'c', 20]
> >>>
>
> Howe
candide wrote:
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[2], z[6],z[0]
>>> z
[12, 33, 66, 'c', 20]
>>>
However, the following doesn't work :
>> z=
On 21 April 2010 20:56, candide wrote:
> Is the del instruction able to remove _at the same_ time more than one
> element from a list ?
Yup:
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[:]
>>> z
[]
--
Cheers,
Simon B.
--
http://mail.python.org/mailman/listinfo/python-list
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[2], z[6],z[0]
>>> z
[12, 33, 66, 'c', 20]
>>>
However, the following doesn't work :
>> z=[45,12,96,33,66,
According to the ctypes docs: http://docs.python.org/library/ctypes.html
An errcheck function should return the args tuple when used with out
parameters (section 15.15.2.4. Function prototypes). However, in other
cases it says to return the result, or whatever result you want
returned from the fun
In article <4bcddc5a$0$1630$742ec...@news.sonic.net>,
John Nagle wrote:
>Iain King wrote:
>> Not sure on the volume of addresses you're working with, but as an
>> alternative you could try grabbing the zip code, looking up all
>> addresses in that zip code, and then finding whatever one of those
On 4/21/2010 11:37 AM Bryan said...
'Round here we love Python. I prefer Python to Perl or PHP even in
those languages' particular areas of specialization. Advocating for
Python does not require spreading myths about PHP.
You're missing the point -- set-up and tear-down overhead is involved
fo
C. Benson Manica wrote:
> On Apr 21, 2:25 pm, Peter Otten <__pete...@web.de> wrote:
>
>> Are you sure that your script has
>>
>> str = u"..."
>>
>> like in your post and not just
>>
>> str = "..."
>
> No :-)
>
> str=u" \"ó\"/>"
> doc=xml.dom.minidom.parseString( str.encode("utf-8") )
> xml=doc.
On Apr 21, 2:25 pm, Peter Otten <__pete...@web.de> wrote:
> Are you sure that your script has
>
> str = u"..."
>
> like in your post and not just
>
> str = "..."
No :-)
str=u""
doc=xml.dom.minidom.parseString( str.encode("utf-8") )
xml=doc.toxml( encoding="utf-8")
file=codecs.open( "foo.xml", "w
Bruno Desthuilliers wrote:
> Bryan a écrit :
>
> > Bruno Desthuilliers wrote:
> >> Nope. I want to keep all my settings parsed, my librairies loaded, all
> >> my connections opened etc. That is, all the time consuming stuff at app
> >> startup - which, with PHP, mostly happens for each and every re
C. Benson Manica wrote:
> On Apr 21, 1:58 pm, Peter Otten <__pete...@web.de> wrote:
>> C. Benson Manica wrote:
>>> (snip)
>>
>> It seems that parseString() doesn't like unicode
>
> Yes, I noticed that, and I already tried...
>
>> -- let's try a byte string
>> then:
>>
>> >>> doc = xml.dom.minido
luca72 wrote:
Hello i have this question :
i connect to the server in this way:
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(('192.168.1.11',11502))
rcv = sock.recv(8124)
here i get 14 random bytes , in a string with strange chars like :
¬¨^.á‹•Ò
a„ãj
I think because sock.
On Apr 21, 1:58 pm, Peter Otten <__pete...@web.de> wrote:
> C. Benson Manica wrote:
>> (snip)
>
> It seems that parseString() doesn't like unicode
Yes, I noticed that, and I already tried...
> -- let's try a byte string
> then:
>
> >>> doc = xml.dom.minidom.parseString(s.encode("utf-8"))
> >>> xm
C. Benson Manica wrote:
> I have the following simple script running on 2.5.2 on a machine where
> the default character encoding is "ascii":
>
> #!/usr/bin/env python
> #coding: utf-8
>
> import xml.dom.minidom
> import codecs
>
> str=u" \"ó\"/>"
> doc=xml.dom.minidom.parseString( str )
> xml=
I have the following simple script running on 2.5.2 on a machine where
the default character encoding is "ascii":
#!/usr/bin/env python
#coding: utf-8
import xml.dom.minidom
import codecs
str=u""
doc=xml.dom.minidom.parseString( str )
xml=doc.toxml( encoding="utf-8" )
file=codecs.open( "foo.xml"
On 4/21/2010 9:29 AM, Peter Otten wrote:
pyt...@bdurham.com wrote:
Are you saying all open() calls in Python that read text files,
automatically convert UTF-8 content to Unicode in the same manner as the
following might when using Python 2.6?
codecs.open( fileName, mode='r', encoding='UTF8', .
On 4/21/2010 5:31 AM, Sebastian wrote:
This works fine as long as they are in English:
"??? is not a valid value for BrowseNodeId.
> Please change this value and retry your request.",
> for instance, will raise an InvalidParameterValue
exception. However, the Japanese version returns the err
On 4/21/2010 7:46 AM, Sebastian wrote:
The Amazon API returns an XML response which contains error messages
if a request fails. These messages consist of an error code and an
error description in natural language. Luckily, the description seems
to stick to the same format and is (in all but one
Dave Angel wrote:
> ++imanshu wrote:
>> Hi,
>>
>> Is it possible to something along these lines in python :-
>>
>> map = {
>> 'key1': f(),
>> 'key2': modify_state(); val = f(); restore_state(); val,
>> 'key3': f(),
>> }
>>
>> For 'key2' I want to store the value returned by f() but afte
On Apr 21, 12:45 pm, Rotwang wrote:
> Apologies in advance if this is a totally stupid question, I've tried
> looking at the Tkinter documentation on the web but since I'm something
> of an ignoramus when it comes to programming generally I didn't
> understand what I was reading. Anyway...
>
> I'v
On Apr 21, 6:10 pm, Chris Rebert wrote:
> On Wed, Apr 21, 2010 at 5:51 AM, ++imanshu wrote:
> > Is it possible to something along these lines in python :-
>
> > map = {
> > 'key1': f(),
> > 'key2': modify_state(); val = f(); restore_state(); val,
> > 'key3': f(),
> > }
>
> > For 'key2' I
On Apr 21, 7:31 pm, Dave Angel wrote:
> ++imanshu wrote:
> > Hi,
>
> > Is it possible to something along these lines in python :-
>
> > map = {
> > 'key1': f(),
> > 'key2': modify_state(); val = f(); restore_state(); val,
> > 'key3': f(),
> > }
>
> > For 'key2' I want to store the value
On 04/21/2010 08:46 AM, Bruno Desthuilliers wrote:
Bryan a écrit :
Bruno Desthuilliers wrote:
Many large, sopĥisticated etc applications are written in C. Does that
make C a practical application programming language ?
It's at least a strong clue.
Oh, yes ? Then why don't you use C for web
++imanshu wrote:
Hi,
Is it possible to something along these lines in python :-
map = {
'key1': f(),
'key2': modify_state(); val = f(); restore_state(); val,
'key3': f(),
}
For 'key2' I want to store the value returned by f() but after
modifying the state. Do we have something like
Hi Peter,
>> Are you saying all open() calls in Python that read text files,
>> automatically convert UTF-8 content to Unicode in the same manner as the
>> following might when using Python 2.6?
>>
>> codecs.open( fileName, mode='r', encoding='UTF8', ... )
> That's what I meant to say, but it's
Bryan a écrit :
Bruno Desthuilliers wrote:
Nope. I want to keep all my settings parsed, my librairies loaded, all
my connections opened etc. That is, all the time consuming stuff at app
startup - which, with PHP, mostly happens for each and every request.
O.K. I wasn't clear on your objection.
On Wed, Apr 21, 2010 at 2:29 AM, luca72 wrote:
> On 20 Apr, 19:38, Peter Otten <__pete...@web.de> wrote:
>> luca72 wrote:
>> > Hello i have to do this :
>> > glibc crypt() function, using salt $1$abcdefgh$
>>
>> > cryptPw = crypt(plainPw, "$1$abcdefgh$")
> Thanks
> The result is correct i obtain t
pyt...@bdurham.com wrote:
> Are you saying all open() calls in Python that read text files,
> automatically convert UTF-8 content to Unicode in the same manner as the
> following might when using Python 2.6?
>
> codecs.open( fileName, mode='r', encoding='UTF8', ... )
That's what I meant to say,
Bruno Desthuilliers wrote:
> Nope. I want to keep all my settings parsed, my librairies loaded, all
> my connections opened etc. That is, all the time consuming stuff at app
> startup - which, with PHP, mostly happens for each and every request.
O.K. I wasn't clear on your objection. As I said the
On Wed, Apr 21, 2010 at 5:51 AM, ++imanshu wrote:
> Is it possible to something along these lines in python :-
>
> map = {
> 'key1': f(),
> 'key2': modify_state(); val = f(); restore_state(); val,
> 'key3': f(),
> }
>
> For 'key2' I want to store the value returned by f() but after
> modi
Hi Peter,
> Just a quick reminder: UTF-8 is not the same as unicode. Python3 works in
> unicode and by default uses UTF-8 to read from or write into files.
I'm not the OP, but wanted to make sure I was fully understanding your
point.
Are you saying all open() calls in Python that read text file
On Wed, Apr 21, 2010 at 5:37 AM, luca72 wrote:
> Hello i have this question :
> i connect to the server in this way:
> sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
> sock.connect(('192.168.1.11',11502))
> rcv = sock.recv(8124)
> here i get 14 random bytes , in a string with strange char
Hi,
Is it possible to something along these lines in python :-
map = {
'key1': f(),
'key2': modify_state(); val = f(); restore_state(); val,
'key3': f(),
}
For 'key2' I want to store the value returned by f() but after
modifying the state. Do we have something like a "bare block". I a
Hello i have this question :
i connect to the server in this way:
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(('192.168.1.11',11502))
rcv = sock.recv(8124)
here i get 14 random bytes , in a string with strange chars like :
¬¨^.á‹•Ò
a„ãj
I think because sock.recv return a st
On Wed, Apr 21, 2010 at 4:46 AM, Sebastian wrote:
>> > My regular expressions turn the Amazon error messages into Python
>> > exceptions.
>>
>> > This works fine as long as they are in English: "??? is not a valid
>> > value for BrowseNodeId. Please change this value and retry your
>> > request.",
> > My regular expressions turn the Amazon error messages into Python
> > exceptions.
>
> > This works fine as long as they are in English: "??? is not a valid
> > value for BrowseNodeId. Please change this value and retry your
> > request.", for instance, will raise an InvalidParameterValue
> > ex
On 21 Apr, 12:36, Chris Rebert wrote:
[cut]
>
> Explanation:
> The explicit assignment back to the `store` pseudo-dictionary lets it
> properly update its internal state to reflect the change to the value
> (in this case, the list) associated with the region key. In your
> original version, you me
f...@slick.airforce-one.org wrote:
> I have taken the easy way out, I read on a page that python 3 worked
> by default in UTF-8, so I downloaded and installed it.
Just a quick reminder: UTF-8 is not the same as unicode. Python3 works in
unicode and by default uses UTF-8 to read from or write int
Sebastian writes:
> My regular expressions turn the Amazon error messages into Python
> exceptions.
>
> This works fine as long as they are in English: "??? is not a valid
> value for BrowseNodeId. Please change this value and retry your
> request.", for instance, will raise an InvalidParameterVa
Andreas Löscher wrote:
You can do something like this:
class A(): pass
inst=)
exec("""
... a=
... b=2
... c=3
... d=4
... """) in inst.__dict__
inst.a
1
This executes the Statement in the exec function and uses inst.__dict__
as namespace. But be aware, that this
On Wed, Apr 21, 2010 at 8:45 PM, Rotwang wrote:
> def draw(self, w, h):
> out = Tkinter.Canvas(width = w, height = h)
> # a load of out.create_line(...)'s go here
> out.pack()
> out.mainloop()
>
> It works, but the problem is that I can't do anything else with IDLE unti
On Wed, Apr 21, 2010 at 3:33 AM, Alf P. Steinbach wrote:
> * Chris Rebert:
>> On Wed, Apr 21, 2010 at 2:59 AM, Stef Mientki
>> wrote:
>>> On 21-04-2010 10:56, Chris Rebert wrote:
On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki
wrote:
>
> With the following code, I would expect a
On 21-04-2010 12:33, Alf P. Steinbach wrote:
> * Chris Rebert:
>> On Wed, Apr 21, 2010 at 2:59 AM, Stef Mientki
>> wrote:
>>> On 21-04-2010 10:56, Chris Rebert wrote:
On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki
wrote:
> With the following code, I would expect a result of 5 !!
Thanks for your insights.
I have taken the easy way out, I read on a page that python 3 worked
by default in UTF-8, so I downloaded and installed it.
Apart from a few surprises (print is not a funtion, and rules about
mixing spaces and tabs in indentation are much more strict, and I
guess more is
Apologies in advance if this is a totally stupid question, I've tried
looking at the Tkinter documentation on the web but since I'm something
of an ignoramus when it comes to programming generally I didn't
understand what I was reading. Anyway...
I've written a module that allows me to manipul
Dear all,
Last week, I raised the question "Could declarative programming be
useful for the Model part of an application ?", and I suggested an
open-source project, Yoopf, to provide such a paradigm in Python.
Stefan told me that the proposal lacked clarity. I have thus updated
the description, a
On Wed, Apr 21, 2010 at 2:51 AM, Alex wrote:
> I'm trying to use the shove module (http://pypi.python.org/pypi/shove)
> for a simple script. The script read a CSV file ad store the data.
> When I check the content of the "store" object (instance of Shove)
> *before* I close it, the data are all th
* Chris Rebert:
On Wed, Apr 21, 2010 at 2:59 AM, Stef Mientki wrote:
On 21-04-2010 10:56, Chris Rebert wrote:
On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote:
With the following code, I would expect a result of 5 !!
a= 'word1 word2 word3'
a.rfind(' ',7)
11
Is this a bug ?
No. Don'
On Wed, Apr 21, 2010 at 2:59 AM, Stef Mientki wrote:
> On 21-04-2010 10:56, Chris Rebert wrote:
>> On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote:
>>> With the following code, I would expect a result of 5 !!
>>>
>> a= 'word1 word2 word3'
>> a.rfind(' ',7)
>>
>>> 11
>>>
>>> Is thi
Stef Mientki wrote:
On 21-04-2010 10:56, Chris Rebert wrote:
On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote:
With the following code, I would expect a result of 5 !!
a= 'word1 word2 word3'
a.rfind(' ',7)
11
Is this a bug ?
No
On Wed, Apr 21, 2010 at 2:33 AM, Adam Tauno Williams
wrote:
> On Wed, 2010-04-21 at 10:28 +0200, Bruno Desthuilliers wrote:
>> Bryan a écrit :
>> >
>> > I think I see what you mean
>>
>> Err...
>>
>> > -- correct me if I'm wrong:
>>
>> You are, sorry !-)
>>
>> > You want to
>> > keep complex appli
You can do something like this:
>>> class A(): pass
>>> inst=A()
>>> exec("""
... a=1
... b=2
... c=3
... d=4
... """) in inst.__dict__
>>> inst.a
1
>>>
This executes the Statement in the exec function and uses inst.__dict__
as namespace. But be aware, that this is not recommended. If you mess
w
Bruno Desthuilliers writes:
> Nope. I want to keep all my settings parsed, my librairies loaded, all
> my connections opened etc. That is, all the time consuming stuff at
> app startup - which, with PHP, mostly happens for each and every
> request.
I thought we have WSGI for this? Nothing stops
On Wed, Apr 21, 2010 at 7:36 PM, kaiix wrote:
> before i wrote the email, i've already read the python docs carefully.
> i need the proof from code, i mean python source code. i tried to
> prove some of my assumptions that lead the loop quit, and i traced
> back to Queue.py, threading.py, dummy_th
Paul Rudin wrote:
> Peter Otten <__pete...@web.de> writes:
>
>
>> OP: you may be looking for
>>
> a = "a bb ccc"
> a[::-1].find(" ")
>> 3
>
>
> But you should be aware of the effeciency implications of doing
> this. a[::-1] constructs a new list.
A new string, yes.
> It's probably f
On 21-04-2010 10:56, Chris Rebert wrote:
> On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote:
>
>> With the following code, I would expect a result of 5 !!
>>
>>
> a= 'word1 word2 word3'
> a.rfind(' ',7)
>
>> 11
>>
>> Is this a bug ?
>>
> No. Don't you think s
Dear all,
I'm trying to use the shove module (http://pypi.python.org/pypi/shove)
for a simple script. The script read a CSV file ad store the data.
When I check the content of the "store" object (instance of Shove)
*before* I close it, the data are all there but when I close and re-
open it some da
(For some reason you posted your response before the message you were
replying to. That's called Top-posting, and is bad form on these
mailing lists)
Sandy wrote:
Thanks for the replies.
Terry,
What does 'immediately' mean? I did a small test and here are the
results.
import psutil
def tes
Peter Otten <__pete...@web.de> writes:
> OP: you may be looking for
>
a = "a bb ccc"
a[::-1].find(" ")
> 3
But you should be aware of the effeciency implications of doing
this. a[::-1] constructs a new list. It's probably faster to do e.g.:
len(a) - a.rfind(..) - 1
--
http://mail.pyt
On Wed, 2010-04-21 at 10:28 +0200, Bruno Desthuilliers wrote:
> Bryan a écrit :
> >
> > I think I see what you mean
>
> Err...
>
> > -- correct me if I'm wrong:
>
> You are, sorry !-)
>
> > You want to
> > keep complex application data structures around between requests.
>
> Nope. I want to
@kushal, thanks for your replies.
before i wrote the email, i've already read the python docs carefully.
i need the proof from code, i mean python source code. i tried to
prove some of my assumptions that lead the loop quit, and i traced
back to Queue.py, threading.py, dummy_thread.py, now i need
Alan Harris-Reid wrote:
Jean-Michel Pichavant wrote:
Alan Harris-Reid wrote:
Hi,
During my Python (3.1) programming I often find myself having to
repeat code such as...
class1.attr1 = 1
class1.attr2 = 2
class1.attr3 = 3
class1.attr4 = 4
etc.
Is there any way to achieve the same result with
On Wed, Apr 21, 2010 at 2:29 AM, wrote:
>> Change your string literals to unicode by adding the u-prefix and you should
>> be OK.
>
> Thanks, it solved the problem... for a while!
>
> I need now to know if s[i] gives the next byte or the next character,
> when I scan the string s. I've googled pa
> General advice with character sets in Python apply: always explicitly
> declare the encoding of input, then decode to Unicode interally as early
> as possible, and process all text that way. Only fix into an encoding
> when it's time to output.
Maybe I was too vague when describing my problem. A
> Change your string literals to unicode by adding the u-prefix and you should
> be OK.
Thanks, it solved the problem... for a while!
I need now to know if s[i] gives the next byte or the next character,
when I scan the string s. I've googled pages about python and unicode,
but didn't find a sol
Chris Rebert wrote:
[didn't see the original message]
> On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki
> wrote:
>> With the following code, I would expect a result of 5 !!
>>
> a= 'word1 word2 word3'
> a.rfind(' ',7)
>> 11
>>
>> Is this a bug ?
>
> No. Don't you think someone would have
On Wed, Apr 21, 2010 at 6:51 PM, Stef Mientki wrote:
>
> With the following code, I would expect a result of 5 !!
>
a= 'word1 word2 word3'
a.rfind(' ',7)
> 11
>
> Is this a bug ?
Python's documentation states:
| rfind(...)
| S.rfind(sub [,start [,end]]) -> int
|
| Return
On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote:
> With the following code, I would expect a result of 5 !!
>
a= 'word1 word2 word3'
a.rfind(' ',7)
> 11
>
> Is this a bug ?
No. Don't you think someone would have found such an obvious bug by now?
You want regular str.find(), which s
With the following code, I would expect a result of 5 !!
>>> a= 'word1 word2 word3'
>>> a.rfind(' ',7)
11
Is this a bug ?
thanks,
Stef
--
http://mail.python.org/mailman/listinfo/python-list
f...@slick.airforce-one.org wrote:
> Hello.
>
> I read a string from an utf-8 file:
>
> fichierLaTeX = codecs.open(sys.argv[1], "r", "utf-8")
> s = fichierLaTeX.read()
> fichierLaTeX.close()
>
> I can then print the string without error with 'print s'.
>
> Next I parse this string:
>
> def pa
On Apr 19, 3:45 pm, J wrote:
> First, before I get farther,
>
> Is there a way for theloggingmodule to natively handle lists and
> dict objects whenlogging?
>
> e.g. take this {'key1':'val1','key2':'val2'} and have it logged like this:
>
> INFO: key1: val1
> INFO: key2: val2
>
> If I pass the dict
1 - 100 of 109 matches
Mail list logo