Re: BackupRead problem

2011-01-15 Thread Stefan Sonnenberg-Carstens
Am 15.01.2011 16:06, schrieb Stefan Sonnenberg-Carstens: I'm trying to create a Backup/Restore app. I'm really struggeling for a long time. I can successfully read directories, but not files. Every time, I'll try I get "Access denied", Error 5. It's runnin

BackupRead problem

2011-01-15 Thread Stefan Sonnenberg-Carstens
I'm trying to create a Backup/Restore app. I'm really struggeling for a long time. I can successfully read directories, but not files. Every time, I'll try I get "Access denied", Error 5. It's running with admin privs. Any ideas ? #!python import sys import os import os.path import getopt impo

Re: What INI config file module allows lists of duplicate same-named options?

2011-01-09 Thread Stefan Sonnenberg-Carstens
Am 09.01.2011 21:43, schrieb Thomas L. Shinnick: Having (possibly) surveyed all the available pypi config file modules, I still haven't seen one that allows an obvious and familiar extension of the strict Windows INI format. Each INI-style config module seems to enforce the strict rule: each

Re: Attaching C++ libraries to Python app.

2011-01-05 Thread Stefan Sonnenberg-Carstens
yle-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility > > ...Rohit. -- > > http://mail.python.org/mailman

Re: Attaching C++ libraries to Python app.

2011-01-05 Thread Stefan Sonnenberg-Carstens
-box-shadowborder-radiusOtheroverflowcursorvisibility > ...Rohit. > -- > http://mail.python.org/mailman/listinfo/python-list > -- MfG, Stefan Sonnenberg-Carstens IT Architect -- http://mail.pytho

Re: list 2 dict?

2011-01-02 Thread Stefan Sonnenberg-Carstens
Am 02.01.2011 19:19, schrieb Emile van Sebille: On 1/2/2011 8:31 AM Stefan Sonnenberg-Carstens said... A last one: l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b'] dict((x[1],x[0]) for x in ((l.pop(),l.pop()) for x in xrange(len(l)/2))) This also works: l = [1, 2, 3, 4, 5, 6,

Re: list 2 dict?

2011-01-02 Thread Stefan Sonnenberg-Carstens
Am 02.01.2011 16:36, schrieb Octavian Rasnita: From: "Ian Kelly" On 1/2/2011 6:18 AM, Octavian Rasnita wrote: Hi, If I want to create a dictionary from a list, is there a better way than the long line below? l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b'] d = dict(zip([l[x] for x in range(len(l))

Re: list 2 dict?

2011-01-02 Thread Stefan Sonnenberg-Carstens
Am 02.01.2011 14:18, schrieb Octavian Rasnita: Hi, If I want to create a dictionary from a list, is there a better way than the long line below? l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b'] d = dict(zip([l[x] for x in range(len(l)) if x %2 == 0], [l[x] for x in range(len(l)) if x %2 == 1])) print

Re: list 2 dict?

2011-01-02 Thread Stefan Sonnenberg-Carstens
Am 02.01.2011 14:18, schrieb Octavian Rasnita: l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b'] l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b'] dict(zip(l[0::2],l[1::2])) {8: 'b', 1: 2, 3: 4, 5: 6, 7: 'a'} -- http://mail.python.org/mailman/listinfo/python-list

Re: etl tool!!!!!

2010-12-28 Thread Stefan Sonnenberg-Carstens
Am 28.12.2010 13:57, schrieb krishna kumar: Is there any efficient etl tool developed in python? Yes, Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of the N largest values

2010-12-27 Thread Stefan Sonnenberg-Carstens
Am 26.12.2010 19:51, schrieb Stefan Sonnenberg-Carstens: l = [] K = 10 while 1: a = input() if len(l) == K: l.remove(min(l)) l=[x for x in l if x < a] + [a] + [x for x in l if x > a] print l A minor fault made it into my prog: l = [0] K = 10 while 1: a =

Re: Keeping track of the N largest values

2010-12-26 Thread Stefan Sonnenberg-Carstens
Am 25.12.2010 16:42, schrieb Roy Smith: I'm processing a stream of N numbers and want to keep track of the K largest. There's too many numbers in the stream (i.e. N is too large) to keep in memory at once. K is small (100 would be typical). > From a theoretical point of view, I should be able

Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread Stefan Sonnenberg-Carstens
Am 25.12.2010 20:41, schrieb Roy Smith: In article, Adam Tauno Williams wrote: XML works extremely well for large datasets. Barf. I'll agree that there are some nice points to XML. It is portable. It is (to a certain extent) human readable, and in a pinch you can use standard text tools

Re: using strings from extension module question + possible documentation error

2010-12-24 Thread Stefan Sonnenberg-Carstens
Am 24.12.2010 13:31, schrieb Oleg Leschov: Hi, I am writing an extension module in which I want to do some heavy number crunching on large amount of data. The input data is prepared using Python code and passed to this extension module via strings containing binary data, and the result is also

Re: Trying to parse a HUGE(1gb) xml file

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 21:27, schrieb Nobody: On Wed, 22 Dec 2010 23:54:34 +0100, Stefan Sonnenberg-Carstens wrote: Normally (what is normal, anyway?) such files are auto-generated, and are something that has a apparent similarity with a database query result, encapsuled in xml. Most of the time the

Re: round in 2.6 and 2.7

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 19:57, schrieb Hrvoje Niksic: I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. 9.95 9.9493 "%.16g" % 9.95 '9.949' round(9.95,

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 10:04, schrieb Benedict Verheyen: On 22/12/2010 18:47, Stefan Sonnenberg-Carstens wrote: Am 22.12.2010 09:33, schrieb Benedict Verheyen: Did you try apt-get install build-essential apt-get build-dep python2.7 before trying to compile ? Anyway, the config.log file is always

Re: Trying to parse a HUGE(1gb) xml file

2010-12-22 Thread Stefan Sonnenberg-Carstens
Am 20.12.2010 20:34, schrieb spaceman-spiff: Hi c.l.p folks This is a rather long post, but i wanted to include all the details& everything i have tried so far myself, so please bear with me& read the entire boringly long post. I am trying to parse a ginormous ( ~ 1gb) xml file. 0. I am a

Toy http server

2010-12-22 Thread Stefan Sonnenberg-Carstens
Sorry, this one is cross post. I posted my question below some time ago to then jython ml, because this hit me first with jython. Anyway, time passed, problem not solved. So, I'd like to know if some of you know where my error lies: Hi all, I've played around with some code-kata of mine from t

Re: Catching user switching and getting current active user from root on linux

2010-12-22 Thread Stefan Sonnenberg-Carstens
Am 22.12.2010 20:28, schrieb mpnordland: ok, I'll give one more chance. First, to pacify those who hate google groups: What is a good usenet client? second, How should I set up this proxy so that when a connection is made, it request's authentication, and then log's the request, if authentication

Re: Code review request

2010-12-22 Thread Stefan Sonnenberg-Carstens
Am 22.12.2010 19:34, schrieb Jason Staudenmayer: Hi All, I'm a python newbie so please be kind. I've been reading book after book and have written a script or two but this is my first real "program". Just looking for any suggestions and pointers. I've done some work with bash scripts and php (n

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-22 Thread Stefan Sonnenberg-Carstens
Am 22.12.2010 09:33, schrieb Benedict Verheyen: Hi, i'm trying to compile Python 2.7.1 on Debian (Virtual Box). Compiling end successfully but readline and curses fail to build. I'm working with virtualenv and I install all my packages in $HOME/local. I've downloaded readline, compiled and ins

Re: Scanning directories for new files?

2010-12-21 Thread Stefan Sonnenberg-Carstens
Am 21.12.2010 20:17, schrieb Matty Sarro: Hey everyone. I'm in the midst of writing a parser to clean up incoming files, remove extra data that isn't needed, normalize some values, etc. The base files will be uploaded via FTP. How does one go about scanning a directory for new files? For now we'r

Re: Modifying an existing excel spreadsheet

2010-12-20 Thread Stefan Sonnenberg-Carstens
Am 20.12.2010 22:56, schrieb Ed Keith: I have a user supplied 'template' Excel spreadsheet. I need to create a new excel spreadsheet based on the supplied template, with data filled in. I found the tools here http://www.python-excel.org/, and http://sourceforge.net/projects/pyexcelerator/. I

Re: How can I intentionally crash my lappy?

2010-12-20 Thread Stefan Sonnenberg-Carstens
http://pcsupport.about.com/od/tipstricks/ht/makebsodxp.htm Am Mo, 20.12.2010, 09:45 schrieb mechtheist: > I am no programmer, but know the rudiments [the rudi'est of rudiments] > of working with Python. I have a simple need, to have a simple > script/app I can run that will crash my PC. On my de

Re: True lists in python?

2010-12-19 Thread Stefan Sonnenberg-Carstens
Am 19.12.2010 07:18, schrieb Dmitry Groshev: Is there any way to use a true lists (with O(c) insertion/deletion and O(n) search) in python? For example, to make things like reversing part of the list with a constant time. reversing part of the list could also be interpreted as reading it in the

Re: how to measure TCP congestion windows using python ??

2010-12-19 Thread Stefan Sonnenberg-Carstens
Am 19.12.2010 11:39, schrieb plz: hi! i'm newbie about python and i want to measure the value of cwnd in TCP socket. I have searched from an internet and got that we could handle it from SOL_TCP, TCP_INFO...since unix had #include and we could refer to tcp_info for getting the information o

Re: how to measure TCP congestion windows using python ??

2010-12-19 Thread Stefan Sonnenberg-Carstens
Am 19.12.2010 11:39, schrieb plz: hi! i'm newbie about python and i want to measure the value of cwnd in TCP socket. I have searched from an internet and got that we could handle it from SOL_TCP, TCP_INFO...since unix had #include and we could refer to tcp_info for getting the information o

Re: If/then style question

2010-12-16 Thread Stefan Sonnenberg-Carstens
Am 16.12.2010 22:49, schrieb John Gordon: (This is mostly a style question, and perhaps one that has already been discussed elsewhere. If so, a pointer to that discussion will be appreciated!) When I started learning Python, I wrote a lot of methods that looked like this: def myMethod(self

Re: O'Reilly Python Certification

2010-12-15 Thread Stefan Sonnenberg-Carstens
Am 15.12.2010 22:11, schrieb Steve Holden: On 12/15/2010 3:40 PM, Tim Chase wrote: On a more serious note, it would be interesting to know if it's possible to test out of the certification for those of us that have been using Python for a long time. That's an interesting idea - let a bunch of e

Re: Dealing with pywin32 on Linux

2010-12-15 Thread Stefan Sonnenberg-Carstens
Am 15.12.2010 13:58, schrieb Benedict Verheyen: Hi, I'm moving my development environment (python, Django, virtualenv) from Windows to Linux (Debian more specific). However, on one app (uses Django), i have a log on module that uses AD to authenticate users. It's based on the active_directory

Re: hashlib in one line

2010-11-29 Thread Stefan Sonnenberg-Carstens
Am 29.11.2010 14:50, schrieb Thomas Guettler: Hi, I think it would be nice if you could use the hashlib in one line: hashlib.sha256().update('abc').hexdigest() Unfortunately update() returns None. Is there a way to convert a string to the hexdigest of sha256 in one line? Thomas Like so

Re: do something every n seconds

2010-11-25 Thread Stefan Sonnenberg-Carstens
Windows or UNIX ? Am Do, 25.11.2010, 13:38 schrieb Santiago Caracol: > Hello, > > how can I do something (e.g. check if new files are in the working > directory) every n seconds in Python? > > Santiago > -- > http://mail.python.org/mailman/listinfo/python-list > >

Re: Glob in python which supports the ** wildcard

2010-11-22 Thread Stefan Sonnenberg-Carstens
Am 22.11.2010 22:43, schrieb Martin Lundberg: Hi, I want to be able to let the user enter paths like this: apps/name/**/*.js and then find all the matching files in apps/name and all its subdirectories. However I found out that Python's glob function doesn't support the recursive ** wildcard.

Re: Does Pygoogle allows for advanced search options?

2010-11-21 Thread Stefan Sonnenberg-Carstens
Am 21.11.2010 20:35, schrieb Petar Milin: Hello ALL! I am playing with the modified version of the Pygoogle (by Stefan). Interesting thing is that get_result_count() gives numbers/results different from those in Google. Has anyone checked this? Does anyone know why? Best, Petar AFAIK there

Re: Does Pygoogle allows for advanced search options?

2010-11-21 Thread Stefan Sonnenberg-Carstens
Am 21.11.2010 11:01, schrieb Petar Milin: On 20/11/10 22:34, Chris Rebert wrote: On Thu, Nov 18, 2010 at 3:26 AM, neocortex wrote: The library doesn't seem to have built-in support for filtering by language (and Google lacks a search query-string-based operator for that), but it looks like yo

Re: Is it possible to use Google's advanced search options?

2010-11-20 Thread Stefan Sonnenberg-Carstens
Am 20.11.2010 10:37, schrieb Petar Milin: Hello! Can anyone help me with getting number of hits from Google, but with restricton on domain (e.g., .edu) and language (e.g., lang_de)? I have tried with the Pygoogle (from: http://code.google.com/p/pygoogle/

Re: try to use unicode

2010-11-19 Thread Stefan Sonnenberg-Carstens
Am 20.11.2010 06:53, schrieb Mikael B: Hi. I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I try to use unicode to get swedish characters. I've checked wikipedia. utf-8 is said to be an unicode encoding.. this is the test program: # -*- coding: utf-8 -*- import readline s=

Re: Changing the EAX register with Python

2010-11-19 Thread Stefan Sonnenberg-Carstens
can be controlled from Python?" > > I don't know the answer to that. gdb is quite powerful, and you can > certainly control it by connecting to its stdin and stdout connections. > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > -- > http

Re: dpkt

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 19.11.2010 06:39, schrieb Verde Denim: Hi I'm looking to find some help working with dpkt. As you probably know, there really isn't any documentation, and not being astute at Python as of yet leaves me with a lot of gaps. Is there anyone here that can point me in a direction toward writing

Re: Changing the EAX register with Python

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 21:20, schrieb dutche: Hi folks, I have a unusual question here. How can I change the value of EAX register under python under Linux?? As paimei does under Windows. My project is to have a python program that loads a C program and sets a breakpoint at some address, and then with t

Re: I have a question about JavaFit

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 20:17, schrieb Ben James: On 18/11/2010 10:05, Chris Rebert wrote: "We" are a technical discussion maillinglist. About a computer programming language. Named Python. An unrelated computer programming language which happens to be named "Java" also exists, but is not this mailinglist

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Stefan Sonnenberg-Carstens
Am 18.11.2010 17:27, schrieb Daniel Fetchinson: I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And I'

Re: Is a 32-bit build faster than a 64-bit build

2010-11-12 Thread Stefan Sonnenberg-Carstens
Am 12.11.2010 22:24, schrieb Raymond Hettinger: My hypotheses is that for apps not needing the 64-bit address space, the 32-bit version has better memory utilization and hence better cache performance. If so, then switching python versions may enable a single server to handle a greater traffic l

Re: importing site fails - why?

2010-11-12 Thread Stefan Sonnenberg-Carstens
Am 12.11.2010 20:24, schrieb Helmut Jarausch: On Fri, 12 Nov 2010 19:42:46 +0100, Stefan Sonnenberg-Carstens wrote: Am 12.11.2010 19:32, schrieb Helmut Jarausch: Hi, as often before, I've cloned a working system (GenToo) onto another machine. There, from a livecd and chroot to the c

Re: Supporting Python 2.x and 3.x on a PC

2010-11-12 Thread Stefan Sonnenberg-Carstens
Am 12.11.2010 20:05, schrieb Doug Stell: I support multiple projects, some of which will remain on Python 2.x and some of which want to use Python 3.1.2. While I have installed both on my Windows PC, only the last installed version can be used. I do not have admin rights on the machine, so alteri

Re: importing site fails - why?

2010-11-12 Thread Stefan Sonnenberg-Carstens
Am 12.11.2010 19:32, schrieb Helmut Jarausch: Hi, as often before, I've cloned a working system (GenToo) onto another machine. There, from a livecd and chroot to the cloned root partition python -v import site fails with the following error Python 2.6.6 (r266:84292, Oct 13 2010, 09:06:24) [GCC

Re: returning results from function

2010-11-11 Thread Stefan Sonnenberg-Carstens
Am 11.11.2010 22:16, schrieb Neil Berg: Hi Python community, In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) into the utc_to_local function (pasted below) which converts that date and time into local standard time. I am passing several dates and times into this funct

Re: How do I skip over multiple words in a file?

2010-11-11 Thread Stefan Sonnenberg-Carstens
Am 11.11.2010 21:33, schrieb Paul Watson: On 2010-11-11 08:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem

Re: Building a Python app with Mozilla

2007-07-05 Thread Stefan Sonnenberg-Carstens
On Do, 5.07.2007, 03:45, greg wrote: > [EMAIL PROTECTED] wrote: > >> wxWidgets will give you native looking apps on both Linux and Windows > > Well, maybe. There's more to getting a native feel than > just using the right widgets. I once saw a Qt-based app on > MacOSX that had tiny little buttons t

Making decimal default datatype for floats during runtime

2007-06-21 Thread Stefan Sonnenberg-Carstens
Hi, I was wondering if there are any tricks around to do some sort of changing types, float in particular. I do many operations like summing etc on lots of floats and always have to do some extra checks where results are heading 0.0, like round(n,10) for example. My idea was to tell python in some

Re: How can I know the name of "caller"

2007-06-19 Thread Stefan Sonnenberg-Carstens
billiejoex schrieb: > Hi there, > unfortunately, I'm compelled to apply a sort of monkey patching at the > code of an existing libreary that I can't modify directly. > Here's my question > Having such code: > > class test: > > def caller(self): > self.b() > > def called(self): >

Re: labeled break/continue

2007-06-19 Thread Stefan Sonnenberg-Carstens
Matt Chisholm schrieb: > On Mon, 18 Jun 2007 05:28, faulkner <[EMAIL PROTECTED]> wrote: > >> On Jun 18, 12:35 am, Matt Chisholm <[EMAIL PROTECTED]> wrote: >> >>> Hi. I was wondering if there had ever been an official decision on >>> the idea of adding labeled break and continue functionali

Re: subprocess leaves child living

2007-06-05 Thread Stefan Sonnenberg-Carstens
Thomas Dybdahl Ahle schrieb: > Hi, When I do a small program like > > from subprocess import Popen > popen = Popen(["ping", "google.com"]) > from time import sleep > sleep(100) > > start it and kill it, the ping process lives on. > Is there a way to ensure that the ping process is always killed whe

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread Stefan Sonnenberg-Carstens
stef schrieb: > hello > > I can find all kind of procedures to convert an array to a bitmap > (wxPython, PIL), > but I can't find the reverse, > either >- convert a bitmap to an array > or > - read a bitmap file to an array > > thanks, > Stef Mientki > Take a look at the "struct" module. T

Re: updates in sqlite3 do not work

2007-05-29 Thread Stefan Sonnenberg-Carstens
Did you try a commit() ? SQLite3 works in autocommit mode by default, so it would help to see your code. On Mi, 30.05.2007, 00:30, Chris Fonnesbeck wrote: > I have a script set up to perform UPDATE commands on an sqlite database > using the sqlite3 module. Everything appears to run fine (there a

Re: Can python create a dictionary from a list comprehension?

2007-05-27 Thread Stefan Sonnenberg-Carstens
erikcw schrieb: > Hi, > > I'm trying to turn o list of objects into a dictionary using a list > comprehension. > > Something like > > entries = {} > [entries[int(d.date.strftime('%m'))] = d.id] for d in links] > > I keep getting errors when I try to do it. Is it possible? Do > dictionary objects

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-26 Thread Stefan Sonnenberg-Carstens
Paul McGuire schrieb: > I'm starting a new thread for this topic, so as not to hijack the one > started by Steve Howell's excellent post titled "ten small Python > programs". > > In that thread, there was a suggestion that these examples should > conform to PEP-8's style recommendations, including

Re: Writelines() a bit confusing

2007-05-19 Thread Stefan Sonnenberg-Carstens
aiwarrior schrieb: > If file.WriteLines( seq ) accepts a list and it says it writes lines, > why does it write the whole list in a single line. Be cause of that > the reverse of file.writelines(seq) is not file.readlines(). > Are the assumptions i made correct? If yes why is this so? > > I find a f

Re: Is wsgi ready for prime time?

2007-05-17 Thread Stefan Sonnenberg-Carstens
Michele Simionato schrieb: > On May 17, 8:09 pm, Ron Garret <[EMAIL PROTECTED]> wrote: > >> The wsgiref module in Python 2.5 seems to be empty: >> >> [EMAIL PROTECTED]:~/Sites/modpy]$ python >> Python 2.5 (r25:51908, Mar 1 2007, 10:09:05) >> [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darw

Re: Simple Tkinter Progress Bar

2007-05-11 Thread Stefan Sonnenberg-Carstens
On Fr, 11.05.2007, 08:42, Gurpreet Singh wrote: > Hi > > I am a newbie in Python > > I am creating a simple Tkinter based application. > I have written Tkinter GUI source code and the > programme logic in the same .py file. > > I am searching for a way to implement a simple > Progress bar for my ap

Re: Read binary data from MySQL database

2007-05-10 Thread Stefan Sonnenberg-Carstens
On Do, 10.05.2007, 16:19, Christoph Krammer wrote: > Hello, > > I try to write a python application with wx that shows images from a > MySQL database. I use the following code to connect and get data when > some event was triggered: > > dbconn = MySQLdb.connect(host="localhost", user="...", passwd=

Re: Using the CSV module

2007-05-09 Thread Stefan Sonnenberg-Carstens
Most of the time I found the CSV module not as useful as it might be - due to the restrictions you describe. Why not write a simple parser class ? On Mi, 9.05.2007, 10:40, Nathan Harmston wrote: > Hi, > > I ve been playing with the CSV module for parsing a few files. A row > in a file looks like

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 16:50, Carsten Haese wrote: > On Mon, 2007-05-07 at 07:26 -0700, Daniele Varrazzo wrote: >> > >> >> > cur.execute("INSERT INTO datatable (data) VALUES (%s);", >> > >> >> > (pickled_data,)) >> >> > %s is not a placeholder IMHO. >> >> > What happens when using %s is, that the st

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 16:26, Daniele Varrazzo wrote: >> >> >> > cur.execute("INSERT INTO datatable (data) VALUES (%s);", >> >> >> > (pickled_data,)) > >> %s is not a placeholder IMHO. > >> What happens when using %s is, that the string given will be inserted >> where >> %s is; that is something pyt

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 11:32, Daniele Varrazzo wrote: > On 7 Mag, 10:46, "Stefan Sonnenberg-Carstens" > <[EMAIL PROTECTED]> wrote: >> On Mo, 7.05.2007, 10:30, Daniele Varrazzo wrote: >> >> > On 7 Mag, 08:55, "krishnakant Mane" <[EMAIL PROTEC

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 10:30, Daniele Varrazzo wrote: > On 7 Mag, 08:55, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: >> On 6 May 2007 11:22:52 -0700, Daniele Varrazzo >> <[EMAIL PROTECTED]> >> Every serious database driver has a >> complete and solid SQL escaping >> > mechanism. This mechanism tipical

Re: Problem to Download ftp file

2007-05-06 Thread Stefan Sonnenberg-Carstens
Perhaps a problem with name resolution ? On Mo, 7.05.2007, 07:27, Shakil Ahmed wrote: > hi > Actually i need to know that how can i download a ftp file from ncbi by > using python module ftputil. > please help me. > > Thanks > regards, > Shakil > > import ftputil > > host = ftputil.FTPHost('ftp.nc

Re: import conflict

2007-05-06 Thread Stefan Sonnenberg-Carstens
[EMAIL PROTECTED] schrieb: > Hello, > > I have a problem where I need to set up two separate Python projects > that each live under the same package. Once they are distributed, > they will live under the same filesystem path, but during development, > they are separated. > > For example: >proj

Re: import conflict

2007-05-06 Thread Stefan Sonnenberg-Carstens
[EMAIL PROTECTED] schrieb: > Hello, > > I have a problem where I need to set up two separate Python projects > that each live under the same package. Once they are distributed, > they will live under the same filesystem path, but during development, > they are separated. > > For example: >proj

Re: invoke user's standard mail client

2007-05-06 Thread Stefan Sonnenberg-Carstens
Stefan Sonnenberg-Carstens schrieb: > Gabriel Genellina schrieb: > >> En Fri, 04 May 2007 05:07:44 -0300, [EMAIL PROTECTED] >> <[EMAIL PROTECTED]> escribió: >> >> >> >>> the simplest way to launch the user's standard mail clien

Re: Python Binding

2007-05-06 Thread Stefan Sonnenberg-Carstens
Stefan Behnel schrieb: > Georg Grabler wrote: > >> There's a C library which i'd like to have python bindings for. I havn't >> known anything before about how to write python bindings for a C library. >> >> I succeeded now by using distutils to write the first bindings for functions >> and simil

Re: Python Binding

2007-05-06 Thread Stefan Sonnenberg-Carstens
Stefan Behnel schrieb: > Georg Grabler wrote: > >> There's a C library which i'd like to have python bindings for. I havn't >> known anything before about how to write python bindings for a C library. >> >> I succeeded now by using distutils to write the first bindings for functions >> and simil

Re: invoke user's standard mail client

2007-05-06 Thread Stefan Sonnenberg-Carstens
Gabriel Genellina schrieb: > En Fri, 04 May 2007 05:07:44 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > >> the simplest way to launch the user's standard mail client from a >> Python program is by creating a mailto: URL and launching the >> webbrowser: >> But this method is limi

Re: newstyle classes and __getattribute__

2005-10-28 Thread Stefan Sonnenberg-Carstens
Stefan Sonnenberg-Carstens schrieb: > James Stroud schrieb: > >> On Friday 28 October 2005 14:26, Stefan Sonnenberg-Carstens wrote: >> >>> Hi there, >> >> >> [..clip..] >> >>> Now, I do this: >>> >>> class T(o

Re: newstyle classes and __getattribute__

2005-10-28 Thread Stefan Sonnenberg-Carstens
James Stroud schrieb: > On Friday 28 October 2005 14:26, Stefan Sonnenberg-Carstens wrote: > >>Hi there, > > [..clip..] > >>Now, I do this: >> >>class T(object): >> def __init__(self,name='',port=80): >>

Re: newstyle classes and __getattribute__

2005-10-28 Thread Stefan Sonnenberg-Carstens
Stefan Sonnenberg-Carstens schrieb: > Hi there, > I'm facing some strange things - but maybe only me is strange - anyway... > > i wrote the following code: > > > +++ > class T(object): > def __init__(self,name='',port=80): > self.name=n

newstyle classes and __getattribute__

2005-10-28 Thread Stefan Sonnenberg-Carstens
Hi there, I'm facing some strange things - but maybe only me is strange - anyway... i wrote the following code: +++ class T(object): def __init__(self,name='',port=80): self.name=name self.port=port +++ looks fine - to me. Now I can do: >>> t = T(name