itools 0.20.0 released

2007-12-20 Thread J. David Ibáñez
itools is a Python library, it groups a number of packages into a single meta-package for easier development and deployment: itools.catalog itools.i18n itools.uri itools.csv itools.ical itools.vfs itools.datatypesitools.odf

Re: New+old-style multiple inheritance

2007-12-20 Thread Bruno Desthuilliers
Jonathan Gardner a écrit : On Dec 18, 7:08 am, [EMAIL PROTECTED] (snip) Monkey patching is definitely unpythonic. You must be a Ruby guy. Strange enough, I learned monkey-patching with Python, years before I first heard of a language named Ruby. Why don't you try doing something else to

Re: Problem untaring python2.5

2007-12-20 Thread Shane Geiger
You might want to try an all-python implementation for sanity testing. I haven't tested this snippet much. I am not sure it handles nested files all that well. import tarfile tar = tarfile.open(TarTest.tar.gz2, r:gz) # other options: r:bz2, and ?? file_list = tar.getnames() import os

Re: Where best to put local modules?

2007-12-20 Thread tinnews
Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 19 Dec 2007 14:02:20 -0300, [EMAIL PROTECTED] escribi?: I'm just beginning to create some python modules for my own use and I'm wondering where to put them. Initially I have put them in $HOME/bin and I have set PYTHONPATH to point to

Re: New+old-style multiple inheritance

2007-12-20 Thread Robert Kern
Bruno Desthuilliers wrote: Jonathan Gardner a écrit : On Dec 18, 7:08 am, [EMAIL PROTECTED] (snip) Monkey patching is definitely unpythonic. You must be a Ruby guy. Strange enough, I learned monkey-patching with Python, years before I first heard of a language named Ruby. Indeed. I

Re: Static linking of python and pyqt

2007-12-20 Thread BlueBird
On Dec 19, 1:26 pm, Markus Dahlbokum [EMAIL PROTECTED] wrote: I just want the qt libs linked to the interpreter without accessing them by a module. I tried the configure option '--with-libs='lib ...''. The make did fine but the executable is too small and the qt symbols are not known

Re: pop3_ssl Attachment problem

2007-12-20 Thread Chris
On Dec 20, 9:22 am, los117 [EMAIL PROTECTED] wrote: I am trying to fetch email from gmail, but what I am really interested is the attachment. I manage to access the gmail server and get the messege but the attachment came as text: --=_Part_5286_15861975.1197955173158 Content-Type:

Re: Where best to put local modules?

2007-12-20 Thread tinnews
Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I'm just beginning to create some python modules for my own use and I'm wondering where to put them. Initially I have put them in $HOME/bin and I have set PYTHONPATH to point to them there. It all seems to be OK

Question about email-handling modules

2007-12-20 Thread Robert Latest
Hello, I'm new to Python but have lots of programming experience in C, C++ and Perl. Browsing through the docs, the email handling modules caught my eye because I'd always wanted to write a script to handle my huge, ancient, and partially corrupted email archives. Of course I know that this

Re: Question about email-handling modules

2007-12-20 Thread Matt Nordhoff
Robert Latest wrote: Hello, I'm new to Python but have lots of programming experience in C, C++ and Perl. Browsing through the docs, the email handling modules caught my eye because I'd always wanted to write a script to handle my huge, ancient, and partially corrupted email archives.

Re: More than one interpreter per process?

2007-12-20 Thread sturlamolden
On 19 Des, 08:02, Christian Heimes [EMAIL PROTECTED] wrote: No, you can't. Sub-interpreters share a single GIL and other state. Why don't you run multiple processes? It's on of the oldest and best working ways use the full potential of your system. Lot's of Unix servers like postfix, qmail,

Is there *any* real documentation to PyWin32?

2007-12-20 Thread Benoit
I understand that the Win32 has been said to be itself poorly documented, so perhaps that the documentation that comes with the modules is of similar quality is no coincidence. Maybe I'm still too young in my programming to grasp the good of that documentation, but for myself, it tells me next to

Re: Problem untaring python2.5

2007-12-20 Thread John Machin
On Dec 20, 5:25 pm, abhishek [EMAIL PROTECTED] wrote: On Dec 19, 12:16 pm, [EMAIL PROTECTED] wrote: Hello, It is not possible to give sharp hints without more relevant information like: - What is your platform? - Which version of python? - What is the version of: $tar--version

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread Tim Golden
Benoit wrote: I understand that the Win32 has been said to be itself poorly documented, so perhaps that the documentation that comes with the modules is of similar quality is no coincidence. Maybe I'm still too young in my programming to grasp the good of that documentation, but for myself,

Re: How to detect if a image file has icc profile embeded?

2007-12-20 Thread hi and hello
On Dec 15, 7:19 pm, has [EMAIL PROTECTED] wrote: On 15 Dec, 02:40, hi and hello [EMAIL PROTECTED] wrote: thx. What OS? windows xp and linux -- http://mail.python.org/mailman/listinfo/python-list

Valgrind and pexpect

2007-12-20 Thread Salvatore Iovene
Hi, I'm using the pexpect module to spawn some processes in a testing environment. pexpect uses, internally, os.execv. What I need to do is valgrind python and get memory leaks from the spawned children (assuming that python doesn't leak :)). Here's a simple testcase: === leak.c:

Hexadecimal list conversion

2007-12-20 Thread Neil Webster
Hi All. I have a list which is a line from a file: ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00', '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\x002\x00'] This should be in the format: ['381475.502599', '213622.174282'] I've tried a few options using

Re: How to detect if a image file has icc profile embeded?

2007-12-20 Thread has
On 20 Dec, 12:09, hi and hello [EMAIL PROTECTED] wrote: On Dec 15, 7:19 pm, has [EMAIL PROTECTED] wrote: On 15 Dec, 02:40, hi and hello [EMAIL PROTECTED] wrote: thx. What OS? windows xp and linux Not my areas of expertise, unfortunately. This might be looking into though:

Re: Question about email-handling modules

2007-12-20 Thread Steven D'Aprano
On Thu, 20 Dec 2007 09:31:10 +, Robert Latest wrote: 1. Why can I get the 'subject' and 'from' header field unsig the [] notation, but not 'to'? When I print Message.keys I get a list of all header fields of the message, including 'to'. What's the difference between message['to'] and

Re: Hexadecimal list conversion

2007-12-20 Thread Paul Hankin
On Dec 20, 12:30 pm, Neil Webster [EMAIL PROTECTED] wrote: Hi All. I have a list which is a line from a file: ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00', '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\x002\x00'] This should be in the format:

Re: How to generate pdf file from an html page??

2007-12-20 Thread MonkeeSage
On Dec 19, 10:17 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-12-19, Terry Jones [EMAIL PROTECTED] wrote: Grant == Grant Edwards [EMAIL PROTECTED] writes: Grant On 2007-12-19, abhishek [EMAIL PROTECTED] wrote: Hi everyone, I am trying to generate a PDF printable format file from

RE: Hexadecimal list conversion

2007-12-20 Thread Andreas Tawn
Hi All. I have a list which is a line from a file: ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009 \x009\x00', '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\ x002\x00'] This should be in the format: ['381475.502599', '213622.174282'] I've tried a few

Re: Hexadecimal list conversion

2007-12-20 Thread Gabriel Genellina
En Thu, 20 Dec 2007 09:30:14 -0300, Neil Webster [EMAIL PROTECTED] escribi�: I have a list which is a line from a file: ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00', '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\x002\x00'] This should be in the

Re: New to Python Would like debug advice

2007-12-20 Thread Nir
On Dec 17, 9:17 pm, PatrickMinnesota [EMAIL PROTECTED] wrote: Yep, I'm new to the language, it's been a couple of months. I opted for gvim and console window for developing on a Windows XP box. I'm not a huge fan of IDEs except for when I need some debugging. I've done my googling and see a

Re: int vs long

2007-12-20 Thread Nick Craig-Wood
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Nick Craig-Wood nic...od.com wrote: So you might see longs returned when you expected ints if the result was = 0x800. did you mean 0x8000 ? ;-) Yes - well spotted! -- Nick Craig-Wood [EMAIL PROTECTED] --

Re: pypi and easy_install

2007-12-20 Thread Giampaolo Rodola'
On 20 Dic, 04:33, Giampaolo Rodola' [EMAIL PROTECTED] wrote: On 20 Dic, 03:47, Istvan Albert [EMAIL PROTECTED] wrote: On Dec 19, 9:44 pm, Istvan Albert [EMAIL PROTECTED] wrote: On Dec 19, 8:07 pm, Giampaolo Rodola' [EMAIL PROTECTED] wrote: download_url =

Re: Question about email-handling modules

2007-12-20 Thread tinnews
Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 20 Dec 2007 09:31:10 +, Robert Latest wrote: [snip most of question and helpful answer] But note that message.get_payload() will return either a string (for single part emails) or a list of Messages (for multi-part messages). Note also

Re: help displaying pdf thru client/server

2007-12-20 Thread PaulS
PaulS [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Connecting to a Linux server from XP pc using a telnet program, I run a report and convert it to a pdf document(using Reportlab) which I need to display. The pdf is on the Linux server. Ideas how to display to the pc would

Re: .NET and Python Integration Problem and PDF Library (Need Help and Suggestions)

2007-12-20 Thread [EMAIL PROTECTED]
On Dec 18, 7:34 am, Ravi Kumar [EMAIL PROTECTED] wrote: Hi. First I am explaining the Problem so it would not get messed up. :) == PROBLEM I have to integrate a small part in .NET Projects. .NET project is actually all Web-based application, user interface is

Re: Question about email-handling modules

2007-12-20 Thread Robert Latest
Steven D'Aprano wrote: message['to'] looks up the key 'to', raising an exception if it doesn't exist. message.get('to') looks up the key and returns a default value if it doesn't exist. Ah, so the [] notation got hung up on some message right at the beginning and didn't even let the script

Re: Where best to put local modules?

2007-12-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I'm just beginning to create some python modules for my own use and I'm wondering where to put them. Initially I have put them in $HOME/bin and I have set PYTHONPATH to point to them there.

Re: Debugging pipe IPC

2007-12-20 Thread Jim B. Wilson
Ian Clark wrote: import os os.system(netcat -l -p 1234 localhost) HTH, Nope, but the network theme got me thinking about how one might run Python on a remote host. After a few false starts, Googling remote python shell led me to Guido's ripshell.py (not *that* Guido, a different

Re: clearing text on canvas

2007-12-20 Thread [EMAIL PROTECTED]
thanx a lot Peter dn -- http://mail.python.org/mailman/listinfo/python-list

Re: Hexadecimal list conversion

2007-12-20 Thread Mark T
Gabriel Genellina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] En Thu, 20 Dec 2007 09:30:14 -0300, Neil Webster [EMAIL PROTECTED] escribi�: I have a list which is a line from a file: ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00',

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread anton
Hi Marek, thanks for the link .. I knew VPython already by I forgot it ( the last time it was only python 2.4 compatible) but as I see they support python 2.5 now ;-) I will check it and thanks again. Anton Hi anton, Have you take a look at vpython? Here's their

where is uno?

2007-12-20 Thread johnf
I'm using SUSE 10.3 have installed OpenOffice Python interface from the distro DVD. But still I need help because I can't import uno. And that's because it's not in my site-packages. I read about how to use it and have reviewed code that uses it but no where did any of the articles explain

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread anton
Hi Jason, I know ctypes, my problem is not PyOpenGL itself, but during my tests with different python based 3D tools, some of them depend on PyOpenGL and since PyOPenGL is only available for python 2.4 the story ends here. Sorry I don't actually remember exactly what tool it was, I tried

Re: Hexadecimal list conversion

2007-12-20 Thread Peter Otten
Mark T wrote: Gabriel Genellina [EMAIL PROTECTED] wrote in message If you got that from a file, I bet you read it using the wrong encoding. Try opening the file using codecs.open(filename, rb, encoding=utf-16-be) instead of plain open. There is an odd number of bytes in each string.

Re: How to generate pdf file from an html page??

2007-12-20 Thread Grant Edwards
On 2007-12-20, MonkeeSage [EMAIL PROTECTED] wrote: This looks a little better for me ... | a2ps -B --borders=0 -- columns=1 -f 10.0 | ... Right. I forgot that I've adjusted my a2ps defaults to using a single column and a readable font size instead of the standard 2-up tiny-font mode. --

Ping Implementation in Python

2007-12-20 Thread Mrown
Hi, I was wondering if there was a ping implementation written in Python. I'd rather using a Python module that implements ping in a platform/OS-independent way than rely on the underlying OS, especially as every OS has a different implementation. Furthermore, if you're going to ping a large

Re: where is uno?

2007-12-20 Thread Carsten Haese
On Thu, 2007-12-20 at 07:44 -0800, johnf wrote: I'm using SUSE 10.3 have installed OpenOffice Python interface from the distro DVD. But still I need help because I can't import uno. And that's because it's not in my site-packages. I read about how to use it and have reviewed code that

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread rurpy
On Dec 20, 6:35 am, Benoit [EMAIL PROTECTED] wrote: I understand that the Win32 has been said to be itself poorly documented, so perhaps that the documentation that comes with the modules is of similar quality is no coincidence. Maybe I'm still too young in my programming to grasp the good of

Re: where is uno?

2007-12-20 Thread Zentrader
It's installed by default with Python 2.5 on Ubuntu. Actually it is a link to /usr/share/pycentral/python-uno/site-packages/uno.py so first do a search for uno.py. If not found post back. -- http://mail.python.org/mailman/listinfo/python-list

How to memoize/cache property access?

2007-12-20 Thread thebjorn
I seem to be writing the following boilerplate/pattern quite frequently to avoid hitting the database until absolutely necessary, and to only do it at most once: class Foo(object): @property def expensive(self): if not hasattr(self, '_expensiv'): self._expensive =

Re: Where best to put local modules?

2007-12-20 Thread tinnews
Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I'm just beginning to create some python modules for my own use and I'm wondering where to put them. Initially I have put them in $HOME/bin

Re: Ping Implementation in Python

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 9:41 AM, Mrown [EMAIL PROTECTED] wrote: Hi, I was wondering if there was a ping implementation written in Python. I'd rather using a Python module that implements ping in a platform/OS-independent way than rely on the underlying OS, especially as every OS has a different

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread Jason
On Dec 20, 8:48 am, anton [EMAIL PROTECTED] wrote: Hi Jason, I know ctypes, my problem is not PyOpenGL itself, but during my tests with different python based 3D tools, some of them depend on PyOpenGL and since PyOPenGL is only available for python 2.4 the story ends here. Sorry I

Re: Where best to put local modules?

2007-12-20 Thread Zentrader
Wherever it is physically located, I would suggest linking the dir to / usr/lib/python/site-python (on a Linux system). AFAIK the sole purpose of this dir is for the type of thing you are describing. On my system it also gets copied when Python is updated. What permissions you give the dir is

Re: How to memoize/cache property access?

2007-12-20 Thread Duncan Booth
thebjorn [EMAIL PROTECTED] wrote: It would have been nice to be able to write class Foo(object): @property def expensive(self): self.expensive = insert expensive db call here return self.expensive but apparently I can't set [that] attribute :-( You can set and

Re: Is there a simple way to parse this string ?

2007-12-20 Thread George Sakkis
On Dec 19, 8:44 pm, Paul McGuire [EMAIL PROTECTED] wrote: I think the last thread of this nature also cited a similar tool by the effbot, which he describes here:http://www.effbot.org/zone/simple-iterator-parser.htm. This parser is about 10X faster than the equivalent pyparsing parser.

Re: How to memoize/cache property access?

2007-12-20 Thread Michele Simionato
On Dec 20, 5:02 pm, thebjorn [EMAIL PROTECTED] wrote: I seem to be writing the following boilerplate/pattern quite frequently to avoid hitting the database until absolutely necessary ... I use the following module: $ cat cache.py class cached(property): 'Convert a method into a cached

Re: Ping Implementation in Python

2007-12-20 Thread Mrown
On Dec 20, 6:13 pm, Chris Mellon [EMAIL PROTECTED] wrote: On Dec 20, 2007 9:41 AM, Mrown [EMAIL PROTECTED] wrote: Hi, I was wondering if there was a ping implementation written in Python. I'd rather using a Python module that implements ping in a platform/OS-independent way than rely

Re: Ping Implementation in Python

2007-12-20 Thread Lorenzo Mainardi
Nel mezzo del cammin di nostra vita, mi ritrovai con Mrown che diceva: Hi, I was wondering if there was a ping implementation written in Python. I'd rather using a Python module that implements ping in a platform/OS-independent way than rely on the underlying OS, especially as every OS

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread kyosohma
On Dec 20, 9:57 am, [EMAIL PROTECTED] wrote: On Dec 20, 6:35 am, Benoit [EMAIL PROTECTED] wrote: I understand that the Win32 has been said to be itself poorly documented, so perhaps that the documentation that comes with the modules is of similar quality is no coincidence. Maybe I'm still

Amusement - rotational palindrome generator

2007-12-20 Thread Paul McGuire
Here is some semi-obfuscated Python, to generate rotational palindromes: from random import choice base = sznuoxpqbdMWOINZXSH rot = dict(zip(base,szunoxdbqpWMOINZXSH)) for i in range(40): s1 = [choice(base) for j in range(choice((2,3,4)))] start = (1,2)[rot[s1[-1]]==s1[-1] and

Re: How to memoize/cache property access?

2007-12-20 Thread thebjorn
On Dec 20, 5:43 pm, Michele Simionato [EMAIL PROTECTED] wrote: On Dec 20, 5:02 pm, thebjorn [EMAIL PROTECTED] wrote: I seem to be writing the following boilerplate/pattern quite frequently to avoid hitting the database until absolutely necessary ... I use the following module: [...] I

Python; jump to a concrete line

2007-12-20 Thread Horacius ReX
Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the different data (separated by spaces). In each line there is different number of columns so sometimes i get kind of index out error. Is there a

Re: How to memoize/cache property access?

2007-12-20 Thread Michele Simionato
On Dec 20, 6:40 pm, thebjorn I'm a bit ambivalent about the reset functionality. While it's a wonderful demonstration of a staticmethod, the very few times I've felt the need to freshen-up the object, I've always felt it was best to create it again from scratch. Do you have many uses of it in

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 7:56 pm, Horacius ReX [EMAIL PROTECTED] wrote: Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the different data (separated by spaces). In each line there is different number of

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread Peter Wang
On Dec 19, 8:15 am, anton [EMAIL PROTECTED] wrote: Hi, I would like to know if some of you knows a - working - actual - out of the box (for me: binaries available) Package/Lib to do 3D plotting out of the box. There is MayaVi from enthon but you need to use their python (2.4.3), all

xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread Dmitry Teslenko
Hello! I've made a trivial xml filter to modify some attributes on-the-fly: ... from __future__ import with_statement import os import sys from xml import sax from xml.sax import saxutils class ReIdFilter(saxutils.XMLFilterBase): def __init__(self, upstream, downstream):

Re: Python; jump to a concrete line

2007-12-20 Thread Russell Blau
Horacius ReX [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the different data (separated by spaces). In each line there is

Re: Problem untaring python2.5

2007-12-20 Thread Florian Diesch
abhishek [EMAIL PROTECTED] wrote: Hi everyone , i am not able to untar python 2.5 source code using tar -xvzf . Is it a problem with my system settings or python 2.5 itself. When i tried to do it it resulted in following errors -- tar: Skipping to next header

Re: pydoc - how to generate documentation for an entire package?

2007-12-20 Thread Florian Diesch
kirillrd [EMAIL PROTECTED] wrote: On Nov 20, 4:28 pm, Jens [EMAIL PROTECTED] wrote: On 20 Nov., 08:19, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Mon, 19 Nov 2007 10:50:28 -0800, Jens wrote: Generating documentation form code is a nice thing, but this pydoc.py is driving me

Passing by reference

2007-12-20 Thread MartinRinehart
Is the following correct? x = some string x is a reference to some string foo(x) Reference is passed to function. In foo: x += change Strings are immutable, so x in foo() now points to a different string than x outside foo(). Right? Back outside foo. x = [some string] x is a

How to make this Python code print blocks of text?

2007-12-20 Thread chriswilliams
This code prints output in rows like this: ** ** ** How to make print in blocks like this? * * ** * * ** * * * start= int (raw_input(StartTable?)) upperlimit= int (raw_input (FinalTable?)) cycle= start while cycle = upperlimit: ...table= cycle

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 8:13 pm, Russell Blau [EMAIL PROTECTED] wrote: Horacius ReX [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the

Re: How to make this Python code print blocks of text?

2007-12-20 Thread Chris
On Dec 20, 9:00 pm, chriswilliams [EMAIL PROTECTED] wrote: This code prints output in rows like this: ** ** ** How to make print in blocks like this? * * ** * * ** * * * start= int (raw_input(StartTable?)) upperlimit= int (raw_input

Re: Ping Implementation in Python

2007-12-20 Thread Roger Miller
On Dec 20, 5:41 am, Mrown [EMAIL PROTECTED] wrote: Hi, I was wondering if there was a ping implementation written in Python. http://www.gnist.org/~lars/code/ping/ping.html -- http://mail.python.org/mailman/listinfo/python-list

Accessing Visuall C++ DLL with Python

2007-12-20 Thread Murray, John
I recently obtained USB device. Other users of the device apparently use C or C++ to access it. I am more comfortable with Python and have used it for other USB devices on a Windows system. I'm more of a hacker than a programmer especially when it comes to Windows. The manufacturor supplies xxx.h,

Re: Python; jump to a concrete line

2007-12-20 Thread Rob Wolfe
Horacius ReX [EMAIL PROTECTED] writes: Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the different data (separated by spaces). In each line there is different number of columns so

Re: Hexadecimal list conversion

2007-12-20 Thread John Machin
On Dec 21, 2:51 am, Peter Otten [EMAIL PROTECTED] wrote: Mark T wrote: Gabriel Genellina [EMAIL PROTECTED] wrote in message If you got that from a file, I bet you read it using the wrong encoding. Try opening the file using codecs.open(filename, rb, encoding=utf-16-be) instead of plain

readlines() reading incorrect number of lines?

2007-12-20 Thread Wojciech Gryc
Hi, I'm currently using Python to deal with a fairly large text file (800 MB), which I know has about 85,000 lines of text. I can confirm this because (1) I built the file myself, and (2) running a basic Java program to count lines yields a number in that range. However, when I use Python's

Regex Matching on Readline()

2007-12-20 Thread jwwest
Anyone have any trouble pattern matching on lines returned by readline? Here's an example: string = Accounting - General pat = .+\s- Should match on Accounting -. However, if I read that string in from a file it will not match. In fact, I can't get anything to match except .*. I'm almost

Re: Passing by reference

2007-12-20 Thread Ben Finney
[EMAIL PROTECTED] writes: Is the following correct? [lots of references to references] All good so far. x[0] += other Another string is created, the first element of x is modified to point to the new string and back outside foo(), x[0] will point to the new string. Change these to

Re: Passing by reference

2007-12-20 Thread John Machin
On Dec 21, 5:57 am, [EMAIL PROTECTED] wrote: Is the following correct? x = some string x is a reference to some string foo(x) Reference is passed to function. In foo: x += change Strings are immutable, so x in foo() now points to a different string than x outside foo(). Right?

Re: Regex Matching on Readline()

2007-12-20 Thread John Machin
On Dec 21, 6:50 am, jwwest [EMAIL PROTECTED] wrote: Anyone have any trouble pattern matching on lines returned by readline? Here's an example: string = Accounting - General pat = .+\s- Should match on Accounting -. However, if I read that string in from a file it will not match. In fact, I

Re: Regex Matching on Readline()

2007-12-20 Thread jwwest
On Dec 20, 2:13 pm, John Machin [EMAIL PROTECTED] wrote: On Dec 21, 6:50 am, jwwest [EMAIL PROTECTED] wrote: Anyone have any trouble pattern matching on lines returned by readline? Here's an example: string = Accounting - General pat = .+\s- Should match on Accounting -. However,

Re: xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread infidel
def startElement(self, name, attrs): self.__downstream.startElement(name, attrs) return I want prevent it from shuffling attributes, i.e. preserve original file's attribute order. Is there any ContentHandler.features* responsible for that? I suspect

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread John Machin
On Dec 21, 6:48 am, Wojciech Gryc [EMAIL PROTECTED] wrote: Hi, I'm currently using Python to deal with a fairly large text file (800 MB), which I know has about 85,000 lines of text. I can confirm this because (1) I built the file myself, and (2) running a basic Java program to count lines

Using ctypes with lib not found via ldconfig

2007-12-20 Thread Cylops
I'd like to use ctypes for my Linux app, but the libraries i want to use it on aren't in a standard location, and can't be found via ldconfig. They aren't in any of the directories listed in /etc/ld.so.conf, and they won't be. Our IT dept. controls this, and won't make them normally accessible for

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread Wojciech Gryc
Hi, Python 2.5, on Windows XP. Actually, I think you may be right about \x1a -- there's a few lines that definitely have some strange character sequences, so this would make sense... Would you happen to know how I can actually fix this (e.g. replace the character)? Since Python doesn't see the

Re: Regex Matching on Readline()

2007-12-20 Thread John Machin
On Dec 21, 7:21 am, jwwest [EMAIL PROTECTED] wrote: On Dec 20, 2:13 pm, John Machin [EMAIL PROTECTED] wrote: On Dec 21, 6:50 am, jwwest [EMAIL PROTECTED] wrote: Anyone have any trouble pattern matching on lines returned by readline? Here's an example: string = Accounting - General

Re: Connecting to SQL database

2007-12-20 Thread bill ramsay
On Fri, 14 Dec 2007 23:35:00 -0300, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 14 Dec 2007 23:24:24 -0300, Unknown [EMAIL PROTECTED] escribió: I have successfully connected to SQL2000 and MSDEE databases in the past, however I have to move to SQL2005 and SQLEXPRESS databases now.

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread John Machin
On Dec 21, 7:41 am, Wojciech Gryc [EMAIL PROTECTED] wrote: Hi, Python 2.5, on Windows XP. Actually, I think you may be right about \x1a -- there's a few lines that definitely have some strange character sequences, so this would make sense... Would you happen to know how I can actually fix

Re: Passing by reference

2007-12-20 Thread MartinRinehart
... the first element of the list to which x refers is a reference to the new string and back outside foo, the first element of the list to which x refers will be a reference to the new string. Right? -- http://mail.python.org/mailman/listinfo/python-list

Re: Connecting to SQL database

2007-12-20 Thread kyosohma
On Dec 14, 8:24 pm, bill ramsay [EMAIL PROTECTED] wrote: Hi I have successfully connected to SQL2000 and MSDEE databases in the past, however I have to move to SQL2005 and SQLEXPRESS databases now. I've tried the following but with no luck [this is what i used in the earlier incarnation

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread Steven D'Aprano
[Fixing top-posting.] On Thu, 20 Dec 2007 12:41:44 -0800, Wojciech Gryc wrote: On Dec 20, 3:30 pm, John Machin [EMAIL PROTECTED] wrote: [snip] However, when I use Python's various methods -- readline(), readlines(), or xreadlines() and loop through the lines of the file, the line program

Re: Connecting to SQL database

2007-12-20 Thread kyosohma
On Dec 14, 8:24 pm, bill ramsay [EMAIL PROTECTED] wrote: Hi I have successfully connected to SQL2000 and MSDEE databases in the past, however I have to move to SQL2005 and SQLEXPRESS databases now. I've tried the following but with no luck [this is what i used in the earlier incarnation

Re: Using ctypes with lib not found via ldconfig

2007-12-20 Thread Jean-Paul Calderone
On 20 Dec 2007 20:36:20 GMT, Cylops [EMAIL PROTECTED] wrote: I'd like to use ctypes for my Linux app, but the libraries i want to use it on aren't in a standard location, and can't be found via ldconfig. They aren't in any of the directories listed in /etc/ld.so.conf, and they won't be. Our IT

Re: Hexadecimal list conversion

2007-12-20 Thread Gabriel Genellina
En Thu, 20 Dec 2007 12:51:33 -0300, Peter Otten [EMAIL PROTECTED] escribió: Mark T wrote: Gabriel Genellina [EMAIL PROTECTED] wrote in message If you got that from a file, I bet you read it using the wrong encoding. Try opening the file using codecs.open(filename, rb, encoding=utf-16-be)

wxPython FileDialog, select folder

2007-12-20 Thread SMALLp
How can i select folder either with wx.FileDialog or with any other. I managed to fine only how to open files but I need to select folder to get files from all sub folders. Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Is this a bug in int()?

2007-12-20 Thread MartinRinehart
int('0x', 16) 0 I'm working on a tokenizer and I'm thinking about returning a MALFORMED_NUMBER token (1.2E, .5E+) -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython FileDialog, select folder

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 3:19 PM, SMALLp [EMAIL PROTECTED] wrote: How can i select folder either with wx.FileDialog or with any other. I managed to fine only how to open files but I need to select folder to get files from all sub folders. There's a separate dialog, wx.DirDialog. --

Need to open an Url and display it in a window created using Python win extensions

2007-12-20 Thread shaik_saleem
I'm pretty new to Python and I've been searching all over the place to find a solution for this. I have a html page with some javascript in it and I need to load this page in my own window (which I will create using PythonWin). The reason for this is to have capability to control the window

Re: Using ctypes with lib not found via ldconfig

2007-12-20 Thread Sam
Hello, May be I misunderstand your problem, but is it not possible do link it as follow? import ctypes libgaak = ctypes.CDLL(/home/me/otherLibs/libgaak.so.6) Kind regards. Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing by reference

2007-12-20 Thread Michael Sparks
[EMAIL PROTECTED] wrote: ... the first element of the list to which x refers is a reference to the new string and back outside foo, the first element of the list to which x refers will be a reference to the new string. I'd rephrase that as: * Both the global context and the inside of foo

RE: xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread Brian Smith
I want prevent it from shuffling attributes, i.e. preserve original file's attribute order. Is there any ContentHandler.features* responsible for that? I suspect not. attrs is a dictionary which does not maintain order, and XML attributes are unordered to begin with. Is there any

Re: Is this a bug in int()?

2007-12-20 Thread Duncan Booth
[EMAIL PROTECTED] wrote under the subject line Is this a bug in int()?: int('0x', 16) 0 I think it is a general problem in the tokenizer, not just the 'int' constructor. The syntax for integers says: hexinteger ::= 0 (x | X) hexdigit+ but 0x appears to be accepted in source code as an

Re: Connecting to SQL database

2007-12-20 Thread thebjorn
On Dec 20, 10:01 pm, bill ramsay [EMAIL PROTECTED] wrote: On Fri, 14 Dec 2007 23:35:00 -0300, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 14 Dec 2007 23:24:24 -0300, Unknown [EMAIL PROTECTED] escribió: I have successfully connected to SQL2000 and MSDEE databases in the past,

  1   2   3   >