On 13 Jun, 10:34, Aidan <[EMAIL PROTECTED]> wrote:
> marc wyburn wrote:
> > HI all, I'm a bit stuck with how to work outboolianlogic.
>
> > I'd like to say if A is not equal to B, C or D:
> > do something.
>
> > I've tried
>
> > if
ound this or work out what the
problem is, I'm assuming that the 'open' command buffers the data
somewhere and that data is being wiped out by the CSV module but
surely this shouldn't happen.
thanks, Marc.
--
http://mail.python.org/mailman/listinfo/python-list
ssecorp <[EMAIL PROTECTED]> asked:
> Why is this blowing the stack, thought it was tail-recursive...
Because python does no tail-call optimization.
Ciao
Marc
--
http://mail.python.org/mailman/listinfo/python-list
some possible problems I came up with. I don't know how often some-
thing like this will happen.
Ciao
Marc
--
http://mail.python.org/mailman/listinfo/python-list
recent call last):
File "", line 1, in
MemoryError: can't allocate memory for array
g=Numeric.zeros([1000,1000,500],Numeric.Int32) succeeds.
So it looks like you have a 32bit kernel.
Marc
--
http://mail.python.org/mailman/listinfo/python-list
tion
though.
Any tips on where to start looking?
Thanks, Marc.
--
http://mail.python.org/mailman/listinfo/python-list
Hi and thanks,
I was hoping to avoid having to weld qmarks together but I guess
that's why people use things like SQL alchemy instead. It's a good
lesson anyway.
Thanks, Marc.
On Jul 30, 2:24 pm, Tim Golden <[EMAIL PROTECTED]> wrote:
> Gerhard Häring wrote:
> > My
len(contents)))
for field, content in zip(self.structfields, contents):
setattr(self, field, content)
Struct.structfields = fields
return Struct
Use:
Employee = defstruct("name", "salary")
john = Employee('john doe', 34000)
print john.salary
Marc
--
http://mail.python.org/mailman/listinfo/python-list
c
else:
for i in alphabet:
yield c
for s in gen_strings(length - 1, alphabet):
yield c + s
def regex_matches(regex, max_length, alphabet=all_chars):
r = re.compile('(' + regex + r')\Z')
return (s for s in gen_strings(max_length, alphabet) if r.match(s))
Marc
--
http://mail.python.org/mailman/listinfo/python-list
ou want a shallow copy (i.e. without
any of the children, e.g. text content).
Marc
--
http://mail.python.org/mailman/listinfo/python-list
change. Here are the results of four runs:
final count: 180
should be: 200
final count: 196
should be: 200
final count: 1999123
should be: 200
final count: 178
should be: 200
This is on a AMD64 X2 using Python 2.5.2 and numpy 1.0.4.
Marc
--
http://mail.python.org/mailman/listinfo/python-list
ello(sel):
print "hi"
Foo().Hello()
0:tolot:/tmp>
Marc
--
http://mail.python.org/mailman/listinfo/python-list
I've been learning to write VST plugins in C++ and would like to switch
back to Python. The first step of writing the plugin is to import the
C++ header files from the Steinberg SDK. How can I do this in Python.
I've tried looking at SWIG but didn't really understand what it was
trying to do.
sorry accidentally hit post.
has nyone tried this before? Thanks, Marc.
--
http://mail.python.org/mailman/listinfo/python-list
don't understand is how I inspect the
object to work out what it is programmatically. Do I need to do some
sort of makepy trickery so that the object is understood by Python? I
have already makepy'd MS ActiveX Data Object 2.8.
thanks, Marc.
--
http://mail.python.org/mailman/listinfo/python-list
not be found.
i have tried to figure out what is causing this but i come up empty. where
should i be looking or what can i do?
The file printorders.py first imports win32print with no problems. line 2 is
where it imports win32ui.
win32ui is used for printing.
--
C-ya Later Take Care
Marc Gron
start because
the a
pplication configuration is incorrect. Reinstalling the application may fix
this
problem.
Dependencie walker does not find any major issues. what am i missing here.
thank you in advance for your help.
--
C-ya Later Take Care
Marc Grondin
--
http://mail.python.org/mailman/listinfo/python-list
On 22/12/2009 1:05 PM, Gabriel Genellina wrote:
En Tue, 22 Dec 2009 12:31:37 -0300, Marc Grondin
escribió:
Hello everyone,
So i have been building an app with python(and learning as i go along) my
knowledge of python is still kinda limited but the app work on my pc.
I have
also compiled it to
)
listA.mylist.append(5)
print "1) ", listA.mylist
print "2) ", listB.mylist
>> 1) [5]
>> 2) [5]
I would have expected
>> 1) [5]
>> 2) []
Thanks in advance for advice,
Marc.
--
http://mail.python.org/mailman/listinfo/python-list
Thx all, good to know :)
Le dimanche 22 novembre 2009 à 15:16 -0800, Steve Howell a écrit :
> On Nov 22, 3:14 pm, Steve Howell wrote:
>
> > Explanations of why you need to write it that will follow...
>
> I knew this had to be written up somewhere...
>
> http://www.ferg.org/projects/python_got
th
> Python 3.1 and subsequently open them, when some of those filenames
> include characters with their high bit set?
>
> TIA!
Try using sys.stdin.buffer instead of sys.stdin. It gives you bytes
instead of strings. Also use byteliterals instead of stringliterals for
paths, i.e. os.listdir(b'.').
Marc
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I want to provide an encapsulated static attribute called _registry
for several classes.
I try to use inheritance in order to make it DRY: all classes inherit
from a BaseClass that implements the _registry encapsulation. But with
inheritance it doesn't work how I want, because a single ins
On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote:
> Marc Aymerich wrote:
> > Hi all,
> > I want to provide an encapsulated static attribute called _registry
> > for several classes.
>
> > I try to use inheritance in order to make it DRY: all class
On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote:
> Marc Aymerich wrote:
> > Hi all,
> > I want to provide an encapsulated static attribute called _registry
> > for several classes.
>
> > I try to use inheritance in order to make it DRY: all class
On Feb 2, 12:18 pm, Peter Otten <[email protected]> wrote:
> Marc Aymerich wrote:
> > On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote:
> >> Marc Aymerich wrote:
> >> > Hi all,
> >> > I want to provide an encapsulated static attribute c
On Feb 2, 5:58 pm, Michele Simionato
wrote:
> Notice that Peter's approach also works without inheritance:
>
> registries = {}
>
> @property
> def per_class(self):
> cls = type(self)
> try:
> return registries[cls]
> except KeyError:
> result = registries[cls] = []
> ret
On Feb 3, 10:24 am, Peter Otten <[email protected]> wrote:
> Marc Aymerich wrote:
> > On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote:
> >> Marc Aymerich wrote:
> > Hi!,
> > Unfortunately per_class attribute losses the "independence&quo
Hi!
I need to create a pretty complex class at runtime. something like
this one:
(note: "" means that the number of attributes can be variable)
class VirtualUserLimitForm(ModelForm):
swap_limit = forms.CharField(max_length=100,
initial=monitor1.default_limit)
memory_limit = forms.Char
naries ..), but I
have not yet clear whether this will be usefull for create the
__init__ function at runtime too. Any clue on this?
Many, many thanks!! :)
Marc
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 5, 1:06 pm, Marc Aymerich wrote:
> Thank you all for the answers!
>
> I'll try to give you the context in which I need to generate classes
> like this.
>
> I'm developing a reusable control panel for an ISP. I have several
> modules (VirtualUser, SystemUser,
Am 13.09.2010 05:14, schrieb Xah Lee:
note that reddit was originally somewhat a site for programers,
written in common lisp.
It is still for Lisp programmers:
http://www.reddit.com/r/lisp/
regards
Marc
--
http://mail.python.org/mailman/listinfo/python-list
auty of the concept. But Mathematica has two serious problems: first,
there is only one implementation and it is commercial, and secondly,
Mathematica is very, very slowly and does not generate executable code
that can be used without Mathematica itself. Thus, comparisons to other
languages, s
Am 20.10.2010 14:07, schrieb Xah Lee:
On Oct 20, 4:52 am, Marc Mientki wrote:
Am 20.10.2010 13:14, schrieb Xah Lee:
See also:
• 〈The Importance of Terminology's Quality In Computer Languages〉
http://xahlee.org/UnixResource_dir/writ/naming_functions.html
where i gave some exampl
in map
>return self.map_async(func, iterable, chunksize).get()
> File "/usr/lib64/python2.7/multiprocessing/pool.py", line 491, in get
>raise self._value
> ValueError: cannot convert float NaN to integer
>
The ValueError comes from run_test. It contains an int(x), where
Talk voting is your chance to tell us what you’d like to see at
EuroPython 2021. We will leave talk voting open until:
Sunday, May 23, 23:59:59 CEST
In order to vote, please log in to the website and navigate to the talk
voting page:
* EuroPython 2021 Talk
Our program work group (WG) has been working hard over the last week to
select sessions for EuroPython 2021, based on your talk voting and our
diversity criteria.
We’re now happy to announce the initial list with more than 100
sessions, brought to you by more than 100 speakers.
After two weeks of hard work by our program workgroup, we are very
excited to announce the EuroPython 2021 schedule:
* EuroPython 2021 Schedule *
https://ep2021.europython.eu/schedule/
Seven full days of Python
-
EuroPython 2021 will
In 2019, we have set up the Guido van Rossum Core Developer Grant, to
make it easy for Python Core Developers to attend EuroPython, but also
to give something back to the core team and add a perk to make core
development more attractive.
If you are a core developer, please check our grant page for
EuroPython 2021 offers special discounts on business tickets for company
teams.
* EuroPython Volume Discounts *
https://ep2021.europython.eu/sponsor/packages/#Volume-Discount
If you are going to attend the conference as a team, we offer the
following volume discounts
Have you ever wanted to build an image search system, take a deep dive
into pytest or learn about algorithmic trading? Then we have a treat for
you!
The EuroPython conference will start with two full training and workshop
days on Monday, July 26th, and Tuesday, July 27th:
* Eu
We’re very happy to announce our merchandise shop for EuroPython 2021,
with a fabulous new design for the attendee t-shirts:
* EuroPython 2021 Merch Shop *
https://ep2021.europython.eu/europython/europython-merchandise-shop/
You can find the shop under the "EuroPython
The EuroPython Society (EPS) exists not only to run the EuroPython
Conference, but also to support the wider Python community in Europe. It
accomplishes this in many ways; here are two of them!
* EuroPython Society supporting the community *
https://blog.europython.eu/europython-202
EuroPython 2021 begins next week. We are proud to present the keynote
speakers and our conference booklet.
Keynotes
The following keynotes will take place on Wednesday, Thursday and
Friday. Tickets are still available.
If you want to find out more about our keynote speakers, please head
This year's edition of EuroPython begins with two days of training
sessions as outlined in the schedule. Many of these last 3 hours,
however, we would like to highlight two specific workshops available to
those who want a deeper dive. They are most valuable for people new to
the Python language and
It has become a tradition at EuroPython to include a special data
science track.
* EuroPython 2021 Data Science Mini-Conference *
https://ep2021.europython.eu/events/data-science/
This year, we have expanded on the theme and included more data science
related content than ever be
As last year, we are holding the General Assembly (GA) of the EuroPython
Society (EPS) online for this year.
General Assembly
In accordance with our bylaws, we are calling for the EuroPython Society
General Assembly to be held on Sunday, October 10th 2020, from 19:00 -
21:00 CEST
Hi Robin,
seeing that no one replied to your question, I'd suggest to ask this
on the Python C-API ML:
https://mail.python.org/mailman3/lists/capi-sig.python.org/
That's where the experts are, including the ones who implemented
the mutli-phase logic.
Cheers,
--
Marc-Andre Lemburg
We’re happy to release the first 42 cut videos of EuroPython 2021
covering the first day sessions of the conference. You can watch them on
our YouTube channel:
* EuroPython 2021 Playlist *
https://www.youtube.com/playlist?list=PL8uoeex94UhHgMD9GOCbEHWku7pEPx9fW
Over the next
We’re happy to release another batch of 35 cut videos of EuroPython 2021
covering most of the second day sessions of the conference. Together
with the first day videos, we now have 77 videos waiting for you. You
can watch them on our YouTube channel:
* EuroPython 2021 Playlist
We are excited to announce the new EuroPython Society Fellow Grant.
The grant is intended to honor and show gratitude towards members of the
EuroPython Society (EPS) and the EuroPython Workgroups who have
contributed significantly towards our mission, the EuroPython conference
and the Society as a
We’re happy to release another batch of 41 cut videos of EuroPython 2021
covering the third day sessions of the conference and a number of edited
videos for the previous days. In total, we now have 118 videos waiting
for you. You can watch them on our YouTube channel. We have created a
EuroPython 2
an infinitive number of function pointers stored at `*ip`!?
The Python equivalent might be ::
for w in ip:
w()
if `ip` is a (finite) sequence of functions or callables in general.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
e response object contains just the headers. So you can inspect them
before you decide to download the actual content.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
etails.
> and if I did,
>
> if (l2 = "hello"): # would it become string?
It would become a syntax error. No assignement allowed there.
> and what if I never used it in the definition body?
Again: The objects have types, the names not. A string that is never used
remains a string.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rn repr_str
I'm a bit surprised that `Human_Sex` is subclassing `str`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Philippe C. Martin wrote:
> I am attempting to write a linux logon manager with python.
Have you considered looking at the sources of xdm/gdm/kdm/... to see how
they solve the problems you have?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail
s) = parser.parse_args()
>
> len(options) != 1 or len(options) > 2:
> print "Incorrect number of arguments passed."
>
> How do I accomplish it ?
Just insert an ``if`` in front of the condition and end the program with
``sys.exit()`` after the message.
Ciao
ry
> the language.
Their loss. :-)
> And nobody else sees the need for change? Oh, except those who think
> Tabs are evil and should no longer be allowed.
>
> How about (1) add some more flexibility for optional braces […]
Try this::
from __future__ import braces
Ciao,
Marc &
se an attribute for the city nr.?
Something like . At least if you intent to write a DTD
or Schema this might be better.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, Bulba! wrote:
> I put those dictionaries into the list:
>
>oldl=[x for x in orig] # where orig=csv.DictReader(ofile ...
If you don't "do" anything with each `x` you can write this as:
oldl = list(orig)
Ciao,
Mar
r/lib/python2.3/posixpath.py", line 142, in getsize
return os.stat(filename).st_size
TypeError: coercing to Unicode: need string or buffer, file found
Something expected a string instead of a file object.
>>> os.path.getsize("tmp.txt")
28190L
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nt command % evil.encode('string-escape')
echo '\'; rm -rf /;'
> Will it
> always be safe, even when binary data is submitted through POST?
Don't know if it's always safe. Unprintable bytes like 0x00 will be
escaped as '\x00'.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
become:
""" (Module description)
:var xmlns: A dictionary of the namespaces.
"""
Ciao,
Marc 'BlackJack' Rintsch
.. _epydoc: http://epydoc.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
lophone chinese?
>
> And, did you think of klingons?
Klingons don't do Python, they hack ('n slash) in var'aq:
http://www.geocities.com/connorbd/varaq/
SCNR,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
I need a
"Singleton" I just put it as global into a module. Either initialize it
at module level or define a function with the content of your __init__().
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
;> import os
>>> os.path.getsize('/etc/shadow')
612L
>>> f = open('/etc/shadow', 'r')
Traceback (most recent call last):
File "", line 1, in ?
IOError: [Errno 13] Permission denied: '/etc/shadow'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
()) with this syntax:
``tbl.attr`` and it's also possible to put functions into those tables. So
it's already a prototype based OO language. Remember: you need objects
for an OO language -- classes are optional!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ame__, self.name,
self.age, self.friends, self.comment)
And it's robust against changing the class name. It even works in
subclasses if the signature of the __init__() method stays the same.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ase it's nice to have a
more descriptive name than `File`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
esis. Using tuples it
> would be.
But empty parenthesis are parsed as empty tuple::
In [8]: type( () )
Out[8]:
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
elsewhere). Thanks.
Doesn't Bitzi calculate some kind of audio fingerprint? Just a hash of
the file would result in very different hash values for different codecs,
bitrates etc. for the "same" audio data.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
]
>>>> a+b
> [1, 2, 3, 4, 5, 6]
Both operate on the lists themselves and not on their contents. Quite
consistent if you ask me.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ple (?) test::
def tester(a, b, c):
global tester
print "bogus test function", a, b, c
def tester(a, b):
print "other test function", a, b
tester(1, 2, 3) # This runs fine.
tester(1, 2)# This too.
> Any other comments appreciated (a
# some code
if __name__ == '__main__':
foo()
`__name__` is set to the module name if the module will be imported but to
'__main__' if the module is directly executed.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
clear to a human reader that the wrapping doesn't change
the number of arguments. But it's harder to let a program figure this out.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
"
> ip = ""
> loggedin = 0
> invalid_logins = 0
> allow_login = 1
> status = ""
> realname = ""
> phone = ""
> email = ""
>
> derek = chatuser
If this is copy and pasted and not jus
with 314,572,800 numbers. That seems to eat up all your RAM
and causes the swapping.
You can use `xrange(len)` instead which uses a constant amount of memory.
But be prepared to wait some time because now you are writing 314,572,800
characters *one by one* into the file. It would be faster to write larger
strings in each step.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
epr(b)
Out[232]: '<__main__.A instance at 0x4075e52c>'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
on't give two different objects the same name!?
>>> import shutil
>>>
>>> #variables
>>> s = shutil
This can be written as ``import shutil as s`` or maybe you could use
``from shutil import copy2`` to import the `copy2` function into the
moduls namespac
order
> usable_IDs = range(last_number_used, last_number_used + 1000)
- usable_IDs.sort(random.random())
+ random.shuffle(usable_IDs)
> last_number_used += 1000
> return usable_IDs.pop()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
l entity without sacrificing the stability
of your own project. [...]
The section deals specifically with the situation how to manage 3rd party
source code with subversion which you want to update from time to time and
even apply some modifications.
Ciao,
Marc 'BlackJack' Rintsch
hted in your text
editor. If I type ``dict`` it's immediatly colored differently than
"normal" names and I know it's probably not a good idea to rebind this
name to something else.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
u find it interesting and challenging go ahead and try it. It is
possible and with the help of the 're' and 'mmap' modules it should be
quite easy to filter strings out of files without the need to load them
into memory at once.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, italy wrote:
> Why doesn't this statement execute in Python:
>
> 1 == not 0
>
> I get a syntax error, but I don't know why.
`==` has a higher precedence than `not` so Python interprets it as::
(1 == not) 0
This works::
>>>
d(aline[:-1].split(None, 1))
That works too if md5sum opened the files in binary mode which is the
default on Windows. The filename is prefixed with a '*' then, leaving
just one space between checksum and filename.
> myfile.close()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> I have a python script under linux, I wonder if I can be converted to
> an executable or not?
Place '#!/usr/bin/env python' as the first line of your script and type::
chmod u+x yourscript.py
at the command line. ;
ot; % ("a", "b", "c") )
AFAIK grumfish made the Right Thingâ. If you use '%', some interesting
things can happen, e.g. if your values contain "'" characters. The "%s"s
without quotes and the comma let the DB module format and
;:' serves as a very good hint to "python aware" text editors to
automagically indent the next line after hitting return.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
er line.
for row in reader:
# do something with row
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
http://www.andrewchatham.com/pyogg
It's "beta quality" software and only tested on Linux, so I'm
interested in positive/negative feedback and bug reports.
You can find the script here:
http://www.marc.rintsch.de/software.html#mkplaylist
Ciao,
Marc 'BlackJack'
vePython pack (PythonWin IDE)
>
> Solution anyone?
Yes -> help(reload)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
the subject of your post.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
simple toggle),
> that means a user specified value must always be specified.
I had the following in mind:
http://www.python.org/doc/2.4/lib/optparse-what-options-for.html
Although the optparse documentation discourages `required options` there
are two examples in the source distribution how to i
between unix's it's horrid.
Have you tried this::
import locale
locale
locale.setlocale(LC_ALL, '')
locale.format('%.2f', 100, True)
The `True` turns on grouping. Should work cross platform.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
x27; in latin-1 encoding is a
non breakable space character.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
/ it'd be nicer if i could just select a proper locale
It uses the locale of the system. If *your* systems locale is configured
to use ',' as separator for grouping, then it should be used by
`locale.format()`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
aracter::
In [42]: import unicodedata
In [43]: unicodedata.name('\xc2\xa0'.decode('utf-8'))
Out[43]: 'NO-BREAK SPACE'
In [44]: unicodedata.name('\xc2\xbb'.decode('utf-8'))
Out[44]: 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ell us in complete sentences what you want to achieve, not in
incomplete C snippets.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
of handling multiple
> buffers and how i can map index to a buffer?
Still incomplete. You don't map an index to a buffer in that code. What
is getBuf() doing?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
scape(row[4]), row[1]))
> elif row[2] == 6: # name part = 'toponym'
> query = ("update names set toponym='%s' where name_id=%s" % \
>(escape(row[4]), row[1]))
> sql.execute(query)
> sql.commit()
> connection.close()
A lot of redundant code. Try something like the following instead of the
``elif`` sequence::
name_part = ['prefix', 'given', 'surname', 'suffix', 'patronym', 'toponym']
for row in result:
query = 'update names set %s=%%s where name_id=%%s' % name_part[row[2]-1]
sql.execute(query, (row[4], row[1]))
sql.commit()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
201 - 300 of 1812 matches
Mail list logo