Hi John,
Thanks for getting back to me. I did find the ASPN article. If I
figure this out then I will make sure I post the code somewhere for
public consumption.
On Oct 18, 6:13 am, [EMAIL PROTECTED] (John J. Lee) wrote:
Devraj [EMAIL PROTECTED] writes:
Hi everyone,
I have been battling to
Hi,
I have a hopefully quick question about how to use Boost.Python to
export an Enum.
I am embedding python in C++ and am currently exporting my classes in
the following way:
nameSpace[OBJECT] = class_OBJECT(OBJECT)
.def(getType, OBJECT::getType)
.def(setSprite,
On Oct 17, 5:58 pm, Ixiaus [EMAIL PROTECTED] wrote:
def bin2dec(val):
li = list(val)
li.reverse()
res = [int(li[x])*2**x for x in range(len(li))]
print sum(res)
It basically does the same thing int(string, 2) does.
Thank you for the responses!
BTW, here is the reverse
Right idea: now to remove all those intermediate lists you construct.
1. reversed(val) creates an iterator that runs over the elements (here
of a string) in reverse order.
2. enumerate() is usually better than using an explicit list index.
3. You can use a generator in your sum to avoid
I would recommend a Debian based distribution like Ubuntu or Debian
itself :)
On Oct 17, 10:29 pm, Anthony Perkins [EMAIL PROTECTED] wrote:
Hi everyone,
What is the best GNU/Linux distribution (or the most preferred) for
developing Python applications? Ideally I would like one with both
Raymond Hettinger pyt...cn.com wrote:
More straight-forward version:
def lastdetecter(iterable):
t, lookahead = tee(iterable)
lookahead.next()
return izip(chain(imap(itemgetter(0), izip(repeat(False),
lookahead)), repeat(True)), t)
If this is what you call straightforward -
Redhat and now Oracle's Linux installer is written in python! They are all
very good but watch for some programs that require legacy versions of
library's like wx
On 17 Oct 2007 23:10:33 -0700, Devraj [EMAIL PROTECTED] wrote:
I would recommend a Debian based distribution like Ubuntu or Debian
Hey all, sorry for the totally newb question. I recently switched over
to python from ruby. I'm having problems figuring out how module
importing works.. as a simple example I've got these files:
/example/loader.py
/example/loadee.py
loadee.py
class loadee(object):
def __init__(self):
got it figured out. nevermind.
--
http://mail.python.org/mailman/listinfo/python-list
On 10/18/07, warhero [EMAIL PROTECTED] wrote:
Hey all, sorry for the totally newb question. I recently switched over
to python from ruby. I'm having problems figuring out how module
importing works.. as a simple example I've got these files:
/example/loader.py
/example/loadee.py
loadee.py
On Oct 18, 1:55 am, Debajit Adhikary [EMAIL PROTECTED] wrote:
I'm writing this little Python program which will pull values from a
database and generate some XHTML.
I'm generating a table where I would like the alternate tr's to be
tr class=Even
and
tr class=Odd
What is the best way to
mirrord/fs_mirror makes use of inotify, which is a functionality afforded
by the recent Linux (from 2.6.12). It is a counterpart of FAM, since Linux
FAM has stopped so long.
On 10/17/07, Roc Zhou [EMAIL PROTECTED] wrote:
Hello:
Recently I started an open source project cutils on the
On Oct 17, 11:45 pm, Raymond Hettinger [EMAIL PROTECTED] wrote:
[Paul Hankin]
def lastdetector(iterable):
t, u = tee(iterable)
return izip(chain(imap(lambda x: False, islice(u, 1, None)),
[True]), t)
Sweet! Nice, clean piece of iterator algebra.
We need a C-speed
On Oct 17, 3:57 pm, sophie_newbie [EMAIL PROTECTED] wrote:
Hi, in my program i need to call a couple of functions that do some
stuff but they always print their output on screen. But I don't want
them to print anything on the screen. Is there any way I can disable
it from doing this, like
Hello,
my name is Albert and I'm looking for help.
Please visit my web page.
www.willmarry.net
Thanks
Albert
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
during development is more then annoying. I find a way to reload my
module:
m =
George Sakkis [EMAIL PROTECTED] writes:
On Oct 16, 7:35 am, Laurent Pointal [EMAIL PROTECTED]
How does it compare to the scalar module ?
(seehttp://russp.us/scalar.htm)
or the Unum module (http://home.scarlet.be/be052320/Unum.html) ?
Both scalar and unum treat units as variables. You are
A further issue, that requires a change of interface: Please comply
with PEP 8 URL:http://www.python.org/dev/peps/pep-0008/ for your
module interface. In particular, please name classes with TitleCase,
and functions, methods, and instance names with
lower_case.
Done, almost. I should have
Following the feedback on the first release of magnitude it
has changed enough to deserve a second release, which
modifies the API, solves a couple of bugs, and brings it in
line with python's style guide. Main changes:
* imul, idiv had wrong output unit, so that after a /= b
printing showed
On Thu, 18 Oct 2007 02:49:12 -0300, Gabriel Genellina wrote:
A reversed object is rather simple: it stores the original sequence (a
reference, as usual, not a copy!) and the next index to use, starting at
len-1. Each time the next() method is called, the index is decremented
until it goes
On Thu, 18 Oct 2007 15:24:27 +1000, Ben Finney wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
and help(reversed) but neither gives any insight to what happens when
you use reversed() on a sequence, then modify the sequence.
I would think the answer is the same for any question about
[EMAIL PROTECTED] wrote:
I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
during development is more then annoying.
Have you read the
Ben Finney wrote:
Diez B. Roggisch [EMAIL PROTECTED] writes:
stef mientki schrieb:
What should I do to the same simple test for existance ?
Use isinstance(obj, type).
No, that's *far* more specific than does it exist, and will give
false negatives.
I've misread the post entirely, so
Steven D'Aprano [EMAIL PROTECTED] wrote:
Note that the starting index is determined at creation time, not when
the iteration begins. So, if you create a reversed object over a list
containing 3 elements, the first returned element will be seq[2],
then
seq[1], then seq[0]. It doesn't matter
Paul Hankin [EMAIL PROTECTED] writes:
On Oct 17, 10:03 pm, Debajit Adhikary [EMAIL PROTECTED] wrote:
How does a.extend(b) compare with a += b when it comes to
performance? Does a + b create a completely new list that it assigns
back to a? If so, a.extend(b) would seem to be faster. How could
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
Without throwing away 500 items:
def sortt(d):
sorted_items = sorted(d.iteritems(),
key=operator.itemgetter(1),
reverse=True)
return map(operator.itemgetter(0), sorted_items)
On 18 Oct, 09:55, Duncan Booth [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
On Wed, 17 Oct 2007 15:01:09 -0700, kiilerix wrote:
On Oct 17, 9:11 pm, Chris Mellon [EMAIL PROTECTED] wrote:
On 10/17/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
o = object()
o.foo = 7
What makes you think it can't be instantiated directly? You just did
it. It's not, however,
On Oct 18, 6:55 pm, Duncan Booth [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
On 10/18/07, Carsten Haese [EMAIL PROTECTED] wrote:
On Wed, 2007-10-17 at 23:55 +, Debajit Adhikary wrote:
I'm writing this little Python program which will pull values from a
database and generate some XHTML.
I'm generating a table where I would like the alternate tr's to be
tr
On 10/18/07, danfolkes [EMAIL PROTECTED] wrote:
I thought I would post the source to a program that I made that will
download the http://ubuntu.media.mit.edu/ubuntu-releases/gutsy/
as soon as its posted.
It checks the site every 10 min time.sleep(600)
This is mostly untested so I would
Joan M. Garcia schrieb:
Following the feedback on the first release of magnitude it
has changed enough to deserve a second release, which
modifies the API, solves a couple of bugs, and brings it in
line with python's style guide. Main changes:
* imul, idiv had wrong output unit, so that
On Oct 18, 12:11 pm, Amit Khemka [EMAIL PROTECTED] wrote:
On 10/18/07, Carsten Haese [EMAIL PROTECTED] wrote:
Rather than spelling out the final result, I'll give you hints: Look at
itertools.cycle and itertools.izip.
Why not just use enumerate ?
clvalues = [Even, Odd]
for i, (id, name)
On Oct 18, 10:21 am, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Paul Hankin [EMAIL PROTECTED] writes:
On Oct 17, 10:03 pm, Debajit Adhikary [EMAIL PROTECTED] wrote:
How does a.extend(b) compare with a += b when it comes to
performance? Does a + b create a completely new list that it assigns
On 10/17/07, Abandoned [EMAIL PROTECTED] wrote:
Very very thanks everbody..
These are some method..
Now the fastest method is second..
1 ===
def sortt(d):
items=d.items()
backitems=[ [v[1],v[0]] for v in items]
backitems.sort()
#boyut=len(backitems)
Debajit Adhikary a écrit :
I have two lists:
a = [1, 2, 3]
b = [4, 5, 6]
What I'd like to do is append all of the elements of b at the end of
a, so that a looks like:
a = [1, 2, 3, 4, 5, 6]
I can do this using
map(a.append, b)
And what about a.extend(b) ?
How do I do this
On Oct 18, 2007, at Oct 18:7:47 AM, Paul Hankin wrote:
On Oct 18, 12:11 pm, Amit Khemka [EMAIL PROTECTED] wrote:
Why not just use enumerate ?
clvalues = [Even, Odd]
for i, (id, name) in enumerate(result):
stringBuffer.write('''
tr class=%s
td%d/td
td%s/td
On 10/17/07, Alex Martelli [EMAIL PROTECTED] wrote:
fake_str is not called, because special-method lookup occurs on the
TYPE, *NOT* on the instance.
So it does; I'd forgotten that. I need to remember to actually check
that the code does what I think it does before posting it on c.l.p
:-|
On 2007-10-18, Gerard Flanagan [EMAIL PROTECTED] wrote:
On Oct 18, 1:55 am, Debajit Adhikary [EMAIL PROTECTED] wrote:
I'm writing this little Python program which will pull values from a
database and generate some XHTML.
I'm generating a table where I would like the alternate tr's to be
tr
Paul Hankin [EMAIL PROTECTED] writes:
Not to me: I can never remember which of a.append and a.extend is
which.
Interesting, with me it's the other way around. Maybe it's because I
used Python before extend was available.
Falling back to a = a + b is exactly what you want.
Not if you want
On Wed, 17 Oct 2007 22:05:36 +0200, Bruno Desthuilliers wrote:
[snip]
Note that there's also the reverse() function that returns a reverse
iterator over any sequence, so you could also do:
li = list('allo')
print ''.join(reverse(li))
Note this certainly should've been `reversed()`, with
Thomas Heller [EMAIL PROTECTED] writes:
- physical, not phisical ;-)
I see a worrisome pattern starting to emerge :-). Thanks.
- you raise string exceptions in various places; these are
deprecated and should not be used. Also it is very
difficult to catch them.
Yes, I believe it is the
Stargaming a écrit :
On Wed, 17 Oct 2007 22:05:36 +0200, Bruno Desthuilliers wrote:
[snip]
Note that there's also the reverse() function that returns a reverse
iterator over any sequence, so you could also do:
li = list('allo')
print ''.join(reverse(li))
Note this certainly should've
First off, apologies for posting code that had issues. My bad and
promise next time to do due diligence.
learn about semaphores.
Definitely will.
While this may not be an issue in this snippet
Even when more than one user concurrently launches this python
program? Let me read up on this like
danbrotherston wrote:
snip
Wow, more of a response than I expected, thanks very much for the
research. While not related to the mutex, the problem did appear to
be permission related. For the record, on windows XP
import sys
import mmap
import win32event
buffer_ready =
snip
Wow, more of a response than I expected, thanks very much for the
research. While not related to the mutex, the problem did appear to
be permission related. For the record, on windows XP
import sys
import mmap
import win32event
buffer_ready = win32event.CreateEvent (None, 0, 0,
Grant Edwards [EMAIL PROTECTED] wrote:
...
I like the solution somebody sent me via PM:
def toggle():
while 1:
yield Even
yield Odd
I think the itertools-based solution is more elegant:
toggle = itertools.cycle(('Even', 'Odd'))
and use toggle rather than toggle()
Debajit Adhikary [EMAIL PROTECTED] wrote:
...
How does a.extend(b) compare with a += b when it comes to
performance? Does a + b create a completely new list that it assigns
back to a? If so, a.extend(b) would seem to be faster. How could I
verify things like these?
That's what the timeit
On Oct 18, 2:29 am, Grant Edwards [EMAIL PROTECTED] wrote:
On 2007-10-17, Debajit Adhikary [EMAIL PROTECTED] wrote:
# Start of Code
def evenOdd():
values = [Even, Odd]
state = 0
while True:
yield values[state]
state = (state + 1) % 2
I'd replace the
On Thu, Oct 18, 2007 at 11:57:10AM -, Paul Hankin wrote regarding Re:
Appending a list's elements to another list using a list comprehension:
Not to me: I can never remember which of a.append and a.extend is
which. Falling back to a = a + b is exactly what you want. For
instance:
a =
On Oct 18, 3:48 pm, Iain King [EMAIL PROTECTED] wrote:
On Oct 18, 2:29 am, Grant Edwards [EMAIL PROTECTED] wrote:
On 2007-10-17, Debajit Adhikary [EMAIL PROTECTED] wrote:
# Start of Code
def evenOdd():
values = [Even, Odd]
state = 0
while True:
yield
Scott David Daniels wrote:
Steven W. Orr wrote:
We have an app and I'm trying to decide where the app ... .
/usr/lib/python2.3/site-packages
or
/usr/lib/site-python
The latter would solve a lot of problems for me.
Fewer than you suspect
If there are multiple versions of python installed
I want to convert a string to command..
For example i have a string:
a=['1']
I want to do this list..
How can i do ?
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 18, 10:23 am, Abandoned [EMAIL PROTECTED] wrote:
I want to convert a string to command..
For example i have a string:
a=['1']
I want to do this list..
How can i do ?
Use the builtin function eval.
--
http://mail.python.org/mailman/listinfo/python-list
Abandoned wrote:
I want to convert a string to command..
For example i have a string:
a=['1']
I want to do this list..
How can i do ?
The correct wording here would be expression. To evaluate expressions, there
is the function eval:
a = eval(['1'])
But beware: if the expression contains
On Oct 18, 12:25 am, Gabriel Genellina [EMAIL PROTECTED]
wrote:
I prefer the calendar module in that case:
py import locale
py locale.setlocale(locale.LC_ALL, '')
'Spanish_Argentina.1252'
py
py import calendar
py calendar.month_abbr[12]
'Dic'
py def prev_months(since, howmany):
...
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
--
http://mail.python.org/mailman/listinfo/python-list
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
How big? How slow? For me, a 1-element list takes 0.04 seconds to be
parsed. Which I find fast.
Diez
--
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
How big? How slow? For me, a 1-element list takes 0.04 seconds
rc wrote:
On Oct 17, 11:07 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
rc wrote:
How to insert NULL values in to int field using params.
I'm trying to use pymssql.execute, passing the operation and list of
params. One of the values in the params is a NULL value going to int
field.
Fabian Braennstroem wrote:
Hi,
I would like to use python to start an terminal, e.g. xterm, and login on a
remote machine using rsh or ssh. This could be done using 'xterm -e ssh
machine', but after the login I would like to jump to a given directory.
Does anyone have an idea how to do this
allen.fowler wrote:
One CGI question - since all of my CGIs are spitting out HTML is their
source code safe? wget and linking to the source deliver the output
HTML. Are there any other methods of trying to steal the source CGI I
need to protect against?
Thank you.
Not sure I fully
Abandoned [EMAIL PROTECTED] writes:
173.000 dict elements and it tooks 2.2 seconds this very big time
for my project
If you're generating the string from Python, use cPickle instead.
Much faster:
import time
d = dict((i, i+1) for i in xrange(17))
len(d)
17
s=repr(d)
t0 =
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
How big? How slow? For me, a 1-element list
On Oct 18, 6:26 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
173.000 dict elements and it tooks 2.2 seconds this very big time
for my project
If you're generating the string from Python, use cPickle instead.
Much faster:
import time
d = dict((i, i+1)
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any
On Thu, 18 Oct 2007 08:41:30 -0700, Abandoned wrote:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a string ??
In Python terms yes, strings in Python can contain any byte value.
On Oct 18, 6:51 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Thu, 18 Oct 2007 08:41:30 -0700, Abandoned wrote:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a
Version 1.4 of my scalar class is available at
http://RussP.us/scalar.htm
No major changes. I have corrected the repr function to make it more
useful, and I have added a unit_type function that returns the type
of a unit (e.g., time, length, force). The unit_type function is
intended mainly for
Abandoned wrote:
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Hello,
I'm actually writing an application with pyinotify which watchs a
directory.
Pyinotify lets me know the events (access, modify, suppression, etc.) on
and in the directory, but not the users who are responsable of them.
Does someone know a library which could give me that information
Hi there,
I am trying to use strptime to parse my microseconds but I was not
able the documentation for it. The only list I found was:
http://docs.python.org/lib/module-time.html
So I can get seconds with %S, but nowhere is there a microsecond
symbol...
Thanks for pointer to doc,
-Mathieu
Abandoned [EMAIL PROTECTED] writes:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a string ??
Because you gave it a string. If you give it a dict, you'll get a
dict:
import
On Oct 18, 6:57 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very
On Oct 18, 7:02 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a string ??
Because you gave
Abandoned [EMAIL PROTECTED] writes:
I select where id=56 and 100.000 rows are selecting but this took 2
second. (very big for my project)
I try cache to speed up this select operation..
And create a cache table:
id-1 | all
56{68:66, 98:32455, 62:655}
If you use Python to create this
On Oct 18, 9:09 am, Abandoned [EMAIL PROTECTED] wrote:
On Oct 18, 6:57 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
On Oct 18, 6:36 pm, mathieu [EMAIL PROTECTED] wrote:
On Oct 18, 6:00 pm, mathieu [EMAIL PROTECTED] wrote:
Hi there,
I am trying to use strptime to parse my microseconds but I was not
able the documentation for it. The only list I found was:
On Oct 18, 6:00 pm, mathieu [EMAIL PROTECTED] wrote:
Hi there,
I am trying to use strptime to parse my microseconds but I was not
able the documentation for it. The only list I found was:
http://docs.python.org/lib/module-time.html
So I can get seconds with %S, but nowhere is there a
On Oct 16, 9:17 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote:
the first: what is the differences between a function and a classe?
A class bundles data and functions into one object.
In which case i should use a function ?
In which
Abandoned [EMAIL PROTECTED] writes:
Sorry i can't understand :(
Yes my database already has data in the {..} format and i select
this and i want to use it for dictionary..
But, do you use Python to create that data? If so, simply convert it
to pickle binary format instead of {...}. As
-- Forwarded message --
From: Roc Zhou [EMAIL PROTECTED]
Date: Oct 19, 2007 12:48 AM
Subject: Re: Pyinotify : which user ?
To: Sébastien Weber [EMAIL PROTECTED]
The command lsof or fuser can report who is using the file, maybe you can
have a look at their source code, but they
On Oct 18, 7:40 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
Sorry i can't understand :(
Yes my database already has data in the {..} format and i select
this and i want to use it for dictionary..
But, do you use Python to create that data? If so, simply
On 10/18/07, Adam Atlas [EMAIL PROTECTED] wrote:
Use the builtin function eval.
What is the difference with os.system()?
--
Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología.
Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6
GPG Fingerprint: 9470 0980 620D ABFC
On 18 Okt, 17:24, Steve Holden [EMAIL PROTECTED] wrote:
allen.fowler wrote:
[Quoting IamIan...]
One CGI question - since all of my CGIs are spitting out HTML is their
source code safe? wget and linking to the source deliver the output
HTML. Are there any other methods of trying to steal
Matimus [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I think several people have given you the correct answer, but for some
reason you aren't getting it. Instead of saving the string
representation of a dictionary to the database...
Mind you, if this were Jeopardy, Store a
On 15 Oct, 15:15, Frank Aune [EMAIL PROTECTED] wrote:
What I'm wondering, is if its possible to specify the database handler in a
config file like:
[handler_database]
class=DBHandler
level=DEBUG
formatter=database
args=('localhost', uid='root')
I've seen the log_test14.py example bundled
Abandoned a écrit :
On Oct 18, 6:51 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Thu, 18 Oct 2007 08:41:30 -0700, Abandoned wrote:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but
Abandoned a écrit :
(snip)
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a string ??
Of course it's a string. That's what you pickled. What did you hope ? If
you want a dict
Richard Brodie a écrit :
Matimus [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I think several people have given you the correct answer, but for some
reason you aren't getting it. Instead of saving the string
representation of a dictionary to the database...
Mind you, if
Abandoned a écrit :
(snip)
I'm very confused :(
I try to explain main problem...
I have a table like this:
id-1 | id-2 | value
23 24 34
56 68 66
56 98 32455
55 62 655
56 28 123
( 3 millions elements)
I select where id=56 and
On Thursday 18 October 2007 09:09, Grant Edwards wrote:
I like the solution somebody sent me via PM:
def toggle():
while 1:
yield Even
yield Odd
That was me.
Sorry, list, I meant to send it to everyone but I my webmail didn't respect
the list* headers :(.
Thanks,
On Oct 18, 7:06 am, Ixiaus [EMAIL PROTECTED] wrote:
[...]
I know '' is shifting x over by n bits; but could you point me to
some literature that would explain why it is the same as x*2**n?
I haven't got literature but I've got a (hopefully straightforward)
explanation:
In binary 2 is 10. When
Hello,
I have several servers which link to each other (and of course, to clients).
At present, I am starting them in turn manually. Is there a way with
python to say, open gateway.py in a new interpreter window?
I looked at execv, etc, but they seem to replace the current process.
Ah, maybe
Abandoned [EMAIL PROTECTED] writes:
When you load it, convert the string to dict with cPickle.loads
instead of with eval.
Yes i understand and this very very good ;)
Good! :-)
psycopg2.ProgrammingError: invalid byte sequence for encoding UTF8:
0x80
HINT: This error can also happen
On Thu, 2007-10-18 at 19:53 +0200, Hrvoje Niksic wrote:
Don't
forget to also use a bind variable, something like:
cursor.execute(INSERT INTO cache2 VALUES (?), a)
I second the advice, but that code won't work. The bind parameters must
be a sequence, and psycopg2 (unfortunately) uses %s for
Well, I tried:
os.spawnv(os.P_NOWAIT, gateway.py, ())
and got:
OSError: [Errno 8] Exec format
Simon Pickles wrote:
Hello,
I have several servers which link to each other (and of course, to clients).
At present, I am starting them in turn manually. Is there a way with
python
Hello,
I have a string:
INSERT INTO mailboxes (`name`, `login`, `home`, `maildir`, `uid`,
`gid`, `password`) VALUES (%s, %s, %s, %s, %i, %i, %s)
that is passed to a MySQL cursor from MySQLdb:
ret = cursor.execute(sql, paras)
paras is:
('flindner', '[EMAIL PROTECTED]', '/home/flindner/',
On Oct 18, 9:47 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
Debajit Adhikary [EMAIL PROTECTED] wrote:
How does a.extend(b) compare with a += b when it comes to
performance? Does a + b create a completely new list that it assigns
back to a? If so, a.extend(b) would seem to be faster. How
On Oct 18, 2:25 am, Duncan Booth [EMAIL PROTECTED] wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote:
Note that the starting index is determined at creation time, not when
the iteration begins. So, if you create a reversed object over a list
containing 3 elements, the first returned element
1 - 100 of 177 matches
Mail list logo