Re: linux console command line history

2010-07-21 Thread kak...@gmail.com
On Jul 21, 9:03 am, Michele Simionato wrote: > On Jul 20, 11:38 pm, "kak...@gmail.com" wrote: > > > Hi to all, > > I 'm writing a linux console app with sockets. It's basically a client > > app that fires commands in a server. > > For example: > > $log user 55 > > $sessions list > > $server list

Re: How to treat the first or last item differently

2010-07-21 Thread Peter Otten
Terry Reedy wrote: > It makes sense to separate last detection from item processing so last > detection can be put in a library module and reused. Here's an extension of your idea that puts the detection of both the first and the last item into a generator: def mark_first(items): items = it

Re: Exposing buffer interface for non-extension types?

2010-07-21 Thread Stefan Behnel
Ken Watford, 21.07.2010 03:04: >>> Currently, I can expose the NumPy array interface (using either >>> __array_interface__ or __array_struct__) for any class, extension or >>> otherwise. But I can't find any reference to python-side interfacing >>> for PEP 3118. SWIG makes an extension module for

source install of python2.7 and rpm install of cx_Oracle collision

2010-07-21 Thread Jim Qiu
Hi all, I make installed python 2.7 from source, and also installed the RPM version of cx_Oracle for python 2.7. But ldd tells me : #ldd cx_Oracle.so libpython2.7.so.1.0 => not found I find out that only libpython2.7.a generated when I install python2.7, who can tell me what

SQLalchemy+py2exe+pymssql error

2010-07-21 Thread Massi
Hi everyone, I'm trying to build an executable with py2exe. My script uses SQLalchemy and pymssql with python 2.6. Here is my setup file: from distutils.core import setup import py2exe manifest = """ myProgram """ setup(name="MyProg", windows=

Re: Exposing buffer interface for non-extension types?

2010-07-21 Thread Antoine Pitrou
On Tue, 20 Jul 2010 18:09:22 -0400 Ken Watford wrote: > Is there any way to expose the PEP 3118 buffer interface for objects > that aren't extension types? > > Currently, I can expose the NumPy array interface (using either > __array_interface__ or __array_struct__) for any class, extension or >

Re: source install of python2.7 and rpm install of cx_Oracle collision

2010-07-21 Thread Daniel Fetchinson
> I make installed python 2.7 from source, and also installed the RPM version > of cx_Oracle for python 2.7. > > But ldd tells me : > #ldd cx_Oracle.so > libpython2.7.so.1.0 => not found > > I find out that only libpython2.7.a generated when I install python2.7, who > can tell

Sorting a list created from a parsed xml message

2010-07-21 Thread kak...@gmail.com
Hi pythonistas, >From the subject of my message it's clear that i get an xml message from a socket, i parse it and the result is a list like the one that follows: ID_Col 4 Serverak ip OFFLINE 29 Server and2ip OFFLINE 5 Proxy l34e

Re: Sorting a list created from a parsed xml message

2010-07-21 Thread Stefan Behnel
kak...@gmail.com, 21.07.2010 14:36: From the subject of my message it's clear that i get an xml message from a socket, Not at all, but now that you say it... i parse it and the result is a list like the one that follows: ID_Col 4 Serverak ip OFFLINE 29

Re: Sorting a list created from a parsed xml message

2010-07-21 Thread kak...@gmail.com
On Jul 21, 8:58 am, Stefan Behnel wrote: > kak...@gmail.com, 21.07.2010 14:36: > > > From the subject of my message it's clear that i get an xml message > > from a socket, > > Not at all, but now that you say it... > > > > > i parse it and the result is a list like the one that > > follows: > > ID

detect endianness of a binary with python

2010-07-21 Thread Holger brunck
Hi all, I use python 2.5 and I am looking for a possibility to determine a file type. Especially the endianness of a file is needed for me. Is there a way to detect this easily in python? Something like the "file" utility for linux would be very helpfull. Any help is appreciated. Best regards Hol

An ODBC interface for Python 3?

2010-07-21 Thread Neil Cerutti
A quick web search yielded no current support for the ODBC interface for Python 3. I'd like to get a simple "tracer bullet" up and running ASAP. I need to connect to an MSSQL database from Windows XP/2000, using an ODBC interface. Is this a case where I'll need to go back to Python 2.6? -- Neil

Re: Sorting a list created from a parsed xml message

2010-07-21 Thread kak...@gmail.com
On Jul 21, 9:04 am, "kak...@gmail.com" wrote: > On Jul 21, 8:58 am, Stefan Behnel wrote: > > > > > kak...@gmail.com, 21.07.2010 14:36: > > > > From the subject of my message it's clear that i get an xml message > > > from a socket, > > > Not at all, but now that you say it... > > > > i parse it a

Re: Sorting a list created from a parsed xml message

2010-07-21 Thread Stefan Behnel
kak...@gmail.com, 21.07.2010 15:38: On Jul 21, 9:04 am, "kak...@gmail.com" wrote: On Jul 21, 8:58 am, Stefan Behnel wrote: kak...@gmail.com, 21.07.2010 14:36: From the subject of my message it's clear that i get an xml message from a socket, Not at all, but now that you say it...

Re: An ODBC interface for Python 3?

2010-07-21 Thread Tim Golden
On 21/07/2010 2:15 PM, Neil Cerutti wrote: A quick web search yielded no current support for the ODBC interface for Python 3. I'd like to get a simple "tracer bullet" up and running ASAP. I need to connect to an MSSQL database from Windows XP/2000, using an ODBC interface. Is this a case where

Re: An ODBC interface for Python 3?

2010-07-21 Thread Neil Cerutti
On 2010-07-21, Tim Golden wrote: > On 21/07/2010 2:15 PM, Neil Cerutti wrote: >> A quick web search yielded no current support for the ODBC >> interface for Python 3. >> >> I'd like to get a simple "tracer bullet" up and running ASAP. I >> need to connect to an MSSQL database from Windows XP/2000,

Re: detect endianness of a binary with python

2010-07-21 Thread Grant Edwards
On 2010-07-21, Holger brunck wrote: > I use python 2.5 and I am looking for a possibility to determine a > file type. Especially the endianness of a file is needed for me. Is > there a way to detect this easily in python? Only if you already know what's going to be in the file. > Something like

Re: detect endianness of a binary with python

2010-07-21 Thread Michael Torrie
On 07/21/2010 08:02 AM, Grant Edwards wrote: > On 2010-07-21, Holger brunck wrote: > >> I use python 2.5 and I am looking for a possibility to determine a >> file type. Especially the endianness of a file is needed for me. Is >> there a way to detect this easily in python? > > Only if you alread

ANN: blist 1.2.0

2010-07-21 Thread Daniel Stutzbach
The blist package contains several container types to supplement those built-in to Python. These types closely mirror the built-in types' methods, so the learning curve is close to zero. The package includes: - blist: a list type with O(log n) insertions, deletes, and slices and other performanc

Multiline regex

2010-07-21 Thread Brandon Harris
I'm trying to read in and parse an ascii type file that contains information that can span several lines. Example: createNode animCurveTU -n "test:master_globalSmooth"; setAttr ".tan" 9; setAttr -s 4 ".ktv[0:3]" 101 0 163 0 169 0 201 0; setAttr -s 4 ".kit[3]" 10; setAttr -s 4 ".kot

Re: Multiline regex

2010-07-21 Thread Rodrick Brown
Slurp the entire file into a string and pick out the fields you need. Sent from my iPhone 4. On Jul 21, 2010, at 10:42 AM, Brandon Harris wrote: > I'm trying to read in and parse an ascii type file that contains information > that can span several lines. > Example: > > createNode animCurveTU

Re: Multiline regex

2010-07-21 Thread Brandon Harris
what do you mean by slurp the entire file? I'm trying to use regular expressions because line by line parsing will be too slow. And example file would have somewhere in the realm of 6 million lines of code. Brandon L. Harris Rodrick Brown wrote: Slurp the entire file into a string and pick o

Re: Multiline regex

2010-07-21 Thread Eknath Venkataramani
On Wed, Jul 21, 2010 at 8:12 PM, Brandon Harris wrote: > I'm trying to read in and parse an ascii type file that contains > information that can span several lines. > Do you have to use only regex? If not, I'd certainly suggest 'pyparsing'. It's a pleasure to use and very easy on the eye too, if

Re: Multiline regex

2010-07-21 Thread Brandon Harris
At the moment I'm trying to stick with built in python modules to create tools for a much larger pipeline on multiple OSes. Brandon L. Harris Eknath Venkataramani wrote: On Wed, Jul 21, 2010 at 8:12 PM, Brandon Harris mailto:brandon.har...@reelfx.com>> wrote: I'm trying to read in an

RE: Multiline regex

2010-07-21 Thread Andreas Tawn
> I'm trying to read in and parse an ascii type file that contains > information that can span several lines. > Example: > > createNode animCurveTU -n "test:master_globalSmooth"; > setAttr ".tan" 9; > setAttr -s 4 ".ktv[0:3]" 101 0 163 0 169 0 201 0; > setAttr -s 4 ".kit[3]" 10; >

Re: Multiline regex

2010-07-21 Thread Peter Otten
Brandon Harris wrote: > I'm trying to read in and parse an ascii type file that contains > information that can span several lines. > Example: > > createNode animCurveTU -n "test:master_globalSmooth"; > setAttr ".tan" 9; > setAttr -s 4 ".ktv[0:3]" 101 0 163 0 169 0 201 0; > setAttr -

Re: Accumulate function in python

2010-07-21 Thread John Nagle
On 7/19/2010 9:56 AM, dhruvbird wrote: On Jul 19, 9:12 pm, Brian Victor wrote: dhruvbird wrote: Having offered this, I don't recall ever seeing reduce used in real python code, and explicit iteration is almost always preferred. Yes, even I have noticed that reduce is a tad under-used funct

Re: detect endianness of a binary with python

2010-07-21 Thread Holger brunck
>> Something like the "file" utility for linux would be very helpfull. >> >> Any help is appreciated. >You're going to have to describe in detail what's in the file before >anybody can help. We are creating inside our buildsystem for an embedded system a cram filesystem image. Later on inside o

Re: ANN: blist 1.2.0

2010-07-21 Thread Antoine Pitrou
On Wed, 21 Jul 2010 09:47:08 -0500 Daniel Stutzbach wrote: > > What's new? > --- > > - blist.sort() is now *substantially* faster than list.sort() when using int > or float keys (O(n) vs. O(n log n)) Are you using some kind of radix sort? Could it be contributed back into the standard l

Re: RE: Multiline regex

2010-07-21 Thread Brandon Harris
I could make it that simple, but that is also incredibly slow and on a file with several million lines, it takes somewhere in the league of half an hour to grab all the data. I need this to grab data from many many file and return the data quickly. Brandon L. Harris Andreas Tawn wrote: I'm

RE: RE: Multiline regex

2010-07-21 Thread Andreas Tawn
> I could make it that simple, but that is also incredibly slow and on a > file with several million lines, it takes somewhere in the league of > half an hour to grab all the data. I need this to grab data from many > many file and return the data quickly. > > Brandon L. Harris That's surprising.

Re: Multiline regex

2010-07-21 Thread Brandon Harris
Could it be that there isn't just that type of data in the file? there are many different types, that is just one that I'm trying to grab. Brandon L. Harris Andreas Tawn wrote: I could make it that simple, but that is also incredibly slow and on a file with several million lines, it takes som

Re: ANN: blist 1.2.0

2010-07-21 Thread Daniel Stutzbach
On Wed, Jul 21, 2010 at 10:32 AM, Antoine Pitrou wrote: > Are you using some kind of radix sort? > Could it be contributed back into the standard list type? Yes and yes. I have a few mostly-complete patches on the tracker that I need to polish off, as well as several easy-to-fix bugs that I nee

RE: Multiline regex

2010-07-21 Thread Andreas Tawn
>>> I could make it that simple, but that is also incredibly slow and on >>> a file with several million lines, it takes somewhere in the league of >>> half an hour to grab all the data. I need this to grab data from >>> many many file and return the data quickly. >>> >>> Brandon L. Harris >>> >> T

Re: Multiline regex

2010-07-21 Thread Jeremy Sanders
Brandon Harris wrote: > I'm trying to read in and parse an ascii type file that contains > information that can span several lines. > Example: What about something like this (you need re.MULTILINE): In [16]: re.findall('^([^ ].*\n([ ].*\n)+)', a, re.MULTILINE) Out[16]: [('createNode animCurveTU

Re: convert time to UTC seconds since epoch

2010-07-21 Thread Steve Allen
On Jul 20, 6:57 pm, Chris Rebert wrote: [regarding trust of POSIX vis a vis leap seconds] > I'm not saying they necessarily should, but they're standardized and > the `time` module is based on POSIX/Unix-ish assumptions; not > following POSIX would be inconsistent and problematic. > Breaking stand

Inconsistency in the format docstring (2.7).

2010-07-21 Thread jmfauth
Small inconsistency in the format.__doc__ >>> sys.version 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] >>> ''.format.__doc__ S.format(*args, **kwargs) -> unicode >>> type('{}'.format(999)) >>> type('{}'.format('abcé')) -- http://mail.python.org/mailman/listinfo/python-li

Re: detect endianness of a binary with python

2010-07-21 Thread Thomas Jollans
On 07/21/2010 05:29 PM, Holger brunck wrote: > >>> Something like the "file" utility for linux would be very helpfull. >>> >>> Any help is appreciated. > >> You're going to have to describe in detail what's in the file before >> anybody can help. > > We are creating inside our buildsystem for an

Re: detect endianness of a binary with python

2010-07-21 Thread MRAB
Thomas Jollans wrote: On 07/21/2010 05:29 PM, Holger brunck wrote: Something like the "file" utility for linux would be very helpfull. Any help is appreciated. You're going to have to describe in detail what's in the file before anybody can help. We are creating inside our buildsystem for an

Re: Pydev 1.6.0 Released

2010-07-21 Thread Дамјан Георгиевски
> Pydev 1.6.0 has been released > > Details on Pydev: http://pydev.org > Details on its development: http://pydev.blogspot.com The supposed feature to start a console in which the contents of the current editor window are automatically "exec"ed /available still doesn't work for me. I'm talking

Hey RACIST and INcompetent FBI/CIA Bustards where is the ANTHRAX MAILER ??? Where are the 4 blackboxes, where are the 5 dancing israelis and what is the status of FORENSIC evidence and trace of NANO

2010-07-21 Thread nanothermite911fbibustards
Hey RACIST and INcompetent FBI/CIA Bustards where is the ANTHRAX MAILER ??? Where are the 4 blackboxes, where are the 5 dancing israelis and what is the status of FORENSIC evidence and trace of NANO THERMITE in WTC dust ? The FAT per DIEM FBI bustards use our TAX PAYER MONEY and INCOMPETENCE is U

Re: urllib2 test fails (2.7, linux)

2010-07-21 Thread guandalino
On 20 Lug, 21:24, Terry Reedy wrote: Hi Terry, thanks for your reply. > > == > > ERROR: test_file (__main__.HandlerTests) > > -- > > Traceback (most recent call

Re: ANN: blist 1.2.0

2010-07-21 Thread Terry Reedy
On 7/21/2010 12:15 PM, Daniel Stutzbach wrote: Here's a performance comparison of sorting with blist versus 3.1's list: http://stutzbachenterprises.com/performance-blist/sort-random-list Question related to possible addition of radix sort to lists: These tests use random numbers with a consta

Re: Inconsistency in the format docstring (2.7).

2010-07-21 Thread Terry Reedy
On 7/21/2010 2:13 PM, jmfauth wrote: Small inconsistency in the format.__doc__ sys.version 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] ''.format.__doc__ S.format(*args, **kwargs) -> unicode type('{}'.format(999)) type('{}'.format('abcé')) Thank you for repor

Re: ANN: blist 1.2.0

2010-07-21 Thread Daniel Stutzbach
On Wed, Jul 21, 2010 at 5:27 PM, Terry Reedy wrote: > These tests use random numbers with a constant, relatively high density of > 25%, which is favorable to radix sort. What if you do the same test with a > constant range of, say, 10 (1 billion) or even a trillion or > quadrillion. Or ho

Re: urllib2 test fails (2.7, linux)

2010-07-21 Thread Terry Reedy
On 7/21/2010 5:06 PM, guandalino wrote: On 20 Lug, 21:24, Terry Reedy wrote: Hi Terry, thanks for your reply. == ERROR: test_file (__main__.HandlerTests) --

Re: [ann] Hatta 1.4.0 wiki engine released

2010-07-21 Thread James Mills
On Wed, Jul 21, 2010 at 6:01 PM, Radomir Dopieralski wrote: > I'm proud to announce release 1.4.0 of Hatta wiki engine. Congrats. cheers James -- -- James Mills -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey RACIST and INcompetent FBI/CIA Bustards where is the ANTHRAX MAILER ??? Where are the 4 blackboxes, where are the 5 dancing israelis and what is the status of FORENSIC evidence and trace of

2010-07-21 Thread spudnik
thermite is not what you think, it is; it's primary use is for dismantling steel frameworks, piece by piece, just as they were welded -- see the report by MIT's Head Welder. thus: there, you've hit upon the self-same absurdity of Newton's "theory" of corpuscles, vis-a-vu waves of light in the non-

Re: Multiline regex

2010-07-21 Thread Steven D'Aprano
On Wed, 21 Jul 2010 10:06:14 -0500, Brandon Harris wrote: > what do you mean by slurp the entire file? I'm trying to use regular > expressions because line by line parsing will be too slow. And example > file would have somewhere in the realm of 6 million lines of code. And you think trying to r

Re: detect endianness of a binary with python

2010-07-21 Thread Grant Edwards
On 2010-07-21, Thomas Jollans wrote: >> It would be possible to execute ret = os.system("file | >> grep "little endian") and evaluate the return code. But I don't like >> to evaluate a piped system command. If there is an way without using >> the os.system command this would be great. > > Files

Did class inheritance from "dict" work in early Python?

2010-07-21 Thread John Nagle
Did class inheritance from "dict" work in early Python? Or did that only start working when "new objects" came in? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Did class inheritance from "dict" work in early Python?

2010-07-21 Thread Stephen Hansen
On 7/21/10 7:45 PM, John Nagle wrote: >Did class inheritance from "dict" work in early Python? Or did > that only start working when "new objects" came in? The latter, that's why UserDict (and UserList) was added. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ix

Re: Did class inheritance from "dict" work in early Python?

2010-07-21 Thread Steven D'Aprano
On Wed, 21 Jul 2010 19:45:24 -0700, John Nagle wrote: > Did class inheritance from "dict" work in early Python? Or did that > only start working when "new objects" came in? Only with the introduction of new-style classes and "object" in version 2.2. http://www.python.org/download/releases/2.2.

Re: please come and help to defend against ISLAM , bring physicists to refute their calculation on speed of light and wormholes

2010-07-21 Thread nanothermite911fbibustards
On Jul 21, 9:23 pm, nanothermite911fbibustards wrote: > http://www.speed-light.info/angels_speed_of_light.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey RACIST and INcompetent FBI/CIA Bustards where is the ANTHRAX MAILER ??? Where are the 4 blackboxes, where are the 5 dancing israelis and what is the status of FORENSIC evidence and trace of

2010-07-21 Thread nanothermite911fbibustards
On Jul 21, 4:31 pm, spudnik wrote: > thermite is not what you think, it is; > it's primary use is for dismantling steel frameworks, > piece by piece, just as they were welded -- > see the report by MIT's Head Welder. > > thus: > there, you've hit upon the self-same absurdity > of Newton's "theory"

how to prevent the "extended call syntax" (*) from expanding a string into a list of characters

2010-07-21 Thread fulv
I get the following error: File "", line 1, in ? File "/Users/fulvio/plone/seiu_new/buildout/eggs/z3c.saconfig-0.11- py2.4.egg/z3c/saconfig/utility.py", line 164, in __call__ _ENGINES[self._key] = engine = sqlalchemy.create_engine( File "/Users/fulvio/plone/seiu_new/buildout/eggs/SQLAlch

Unzip File un Python 5.5

2010-07-21 Thread Girish
Hello All, I am using Python 2.5. How do I extract all the files and directories in a zip file? Thanks in advance.. -Girish -- http://mail.python.org/mailman/listinfo/python-list

Re: Unzip File un Python 5.5

2010-07-21 Thread nopsidy
hi, hope this helps. http://www.google.com/search?hl=en&q=unzip+file+in+python -- http://mail.python.org/mailman/listinfo/python-list

Re: how to prevent the "extended call syntax" (*) from expanding a string into a list of characters

2010-07-21 Thread James Mills
On Thu, Jul 22, 2010 at 4:26 PM, fulv wrote: >  args = (connection_string) Replace this with: args = (connection_string,) NOTE: The trailing , (comma) indicating that this _is_ a tuple. cheers James -- -- James Mills -- -- "Problems are solved by method" -- http://mail.python.org/mailman/li