Kent Johnson wrote:
> Leon Keylin wrote:
>> Thanks Mike, unfortunately that's the mod I had problems with before.
>> The one that
>> can't do truncate. I've written about it before here and it was easier
>> to look for
>> another solution.
>
> You could try adodbapi
> http://adodbapi.sourceforge
How do I go about creating a buffer object from a file containing binary data ?
I have a function that accepts only buffer objects for it's parameters and
would like to pass on the contents of a file to that function.
thanks,
iyer
-
You snooze, you l
Bill Campbell wrote:
> Is the behaviour defined if one is processing a dictionary using
> iteritems, and delete items?
>
> for k, v in d.iteritems():
> if somecondition(k, v): del d[k]
>
> Would this process all the original members of the dictionary?
This is not well-defined. You can use
Leon Keylin wrote:
> Thanks Mike, unfortunately that's the mod I had problems with before.
> The one that
> can't do truncate. I've written about it before here and it was easier
> to look for
> another solution.
You could try adodbapi
http://adodbapi.sourceforge.net/
Kent
> Is there any other
On Monday 21 May 2007 16:21, Leon Keylin wrote:
> Thanks Mike, unfortunately that's the mod I had problems with before. The
> one that
> can't do truncate. I've written about it before here and it was easier to
> look for
> another solution.
>
> Is there any other way? Should I be looking for a dif
Is the behaviour defined if one is processing a dictionary using
iteritems, and delete items?
for k, v in d.iteritems():
if somecondition(k, v): del d[k]
Would this process all the original members of the dictionary?
How about doing something similar with bsddb files?
I've always been leary
Thanks Mike, unfortunately that's the mod I had problems with before. The
one that
can't do truncate. I've written about it before here and it was easier to
look for
another solution.
Is there any other way? Should I be looking for a different language to do
it in?
-Original Message-
F
On 22/05/07, John Washakie <[EMAIL PROTECTED]> wrote:
> I have a Dictionary, that is made up of keys which are email
> addresses, and values which are a list of firstname, lastnamet,
> address, etc...
>
> If I run the following:
>
> last = {}
[...]
> for k,v in last:
> print "Email: %s , ha
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Leon Keylin
> Sent: Monday, May 21, 2007 3:52 PM
> To: tutor@python.org
> Subject: [Tutor] MS SQL Connection
>
> Been trying to do a very small and simple select via Python.
> First I tried a modul
Been trying to do a very small and simple select via Python.
First I tried a module that looked clean but it couldn't truncate tables.
Then I started sifting through docs at python.org and couldn't find a simple
way of communicating with a MS SQL via Python program.
Do I have to use ODBC?
Any e
I have a Dictionary, that is made up of keys which are email
addresses, and values which are a list of firstname, lastnamet,
address, etc...
If I run the following:
#! /bin/python
import csv
last = {}
rdr = csv.DictReader(file("reg-data.csv"))
for row in rdr:
#print row
last[row
Chandrashekar wrote:
> Hi,
>
> I am trying to do something like this in python. Can you please help?
>
> handle= open('test.txt','a')
>
> handle.write('''
>
> Testsomething$i
>
> something$i-test
>
> '''
> )
>
> when i write into the file, i would like to have the output like this.
>
> Testsomethin
One way is...
CODE
#!/usr/bin/python
handle = file("test.txt",'a')
number = 1
for num in range(1,5):
handle.write("TestingSome%s\n" % (number))
handle.write("something%s-test\n" % (number))
number += 1
handle.close()
OUTPUT
TestingSome1
something1-
Alan & Martin,
Thanks for the feedback and suggestions. Kodos is a great tool. I use it
regularly to debug my regex mistakes. It can also be a excellent learning
tool to those unfamiliar with regular expressions. Thanks for the
Python-LDAP link and ldif example code.
On 5/20/07, Martin Wals
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Well, there are a number of ways to achieve this, but the classical one
would be:
"""abc%(i)s
def%(i)s
""" % dict(i=1)
Andreas
Chandrashekar wrote:
> Hi,
>
> I am trying to do something like this in python. Can you please help?
>
> handle= open('t
Hi,
I am trying to do something like this in python. Can you please help?
handle= open('test.txt','a')
handle.write('''
Testsomething$i
something$i-test
'''
)
when i write into the file, i would like to have the output like this.
Testsomething1
something1-test
Testsomething2
something2-test
16 matches
Mail list logo