Re: number of different lines in a file

2006-05-19 Thread Terry Hancock
Fredrik Lundh wrote: a for loop inside square brackets is a list comprehension, and the result is a list. if you use a list comprehension inside a function call, the full list is built *before* the function is called. in this case, this would mean that the entire file would be read into

how to make bibus with win32com into a exe file

2006-05-19 Thread oyster
Hi, everyone. http://bibus-biblio.sourceforge.net/ is a bibliographic and reference management software, which runs on windows/linux thru wxwidget. On windows, it uses win32com to insert reference into winword automatically. I have installed all the modules, and can launch and use bibus in my

open file with whitespaces

2006-05-19 Thread mardif
Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now, I MUST open this file with os.spawn(os.P_WAIT , because I must wait the user cancel the explorer window, ok? And

Re: noob import question

2006-05-19 Thread bruno at modulix
PA wrote: On May 19, 2006, at 15:33, Diez B. Roggisch wrote: And it seems as if you have some JAVA-background, putting one class in one file called the same as the class. Don't do that, it's a stupid restriction in JAVA and should be avoided in PYTHON. Restrictive or not, what's so

Re: import woe

2006-05-19 Thread Terry Hancock
vaibhav wrote: 4. add the root folder to your sys.path so your jar.py file should have the following entries from sys import path path.append('../../../ROOT') note: i prefer relative paths Interesting that that works. I guess you could create a limited form of Zope acquisition type

CLAIM YOUR TWO FREE UNIVERSAL STUDIOS TICKETS!

2006-05-19 Thread SODIA17
-- http://mail.python.org/mailman/listinfo/python-list

Re: WTF? Printing unicode strings

2006-05-19 Thread John Salerno
Fredrik Lundh wrote: Ron Garret wrote: u'\xbd' u'\xbd' print _ Traceback (most recent call last): File stdin, line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in position 0: ordinal not in range(128) so stdout on your machine is ascii, and you don't

SIGILL importing random

2006-05-19 Thread Mathias Waack
Hi all, I've embedded python into an older application and created some extensions to interact with the old data structures. Everythings works like a charm - beside a simple import random. During import the whole process crashes with a SIGILL. I've found some older mails describing just the same

Re: memory error with zipfile module

2006-05-19 Thread bruno at modulix
[EMAIL PROTECTED] wrote: Take a look at the pywin32 extension, which I believe has some lower level memory allocation and file capabilities that might help you in this situation. But then the solution would not be portable, which would be a shame since the zlib module (on which ZipFile relies

Re: memory error with zipfile module

2006-05-19 Thread Sion Arrowsmith
Hari Sekhon [EMAIL PROTECTED] wrote: import zipfile zip=zipfile.ZipFile('d:\somepath\cdimage.zip') zip.namelist() ['someimage.iso'] [ ... ] B) content=zip.read('someimage.iso') Traceback (most recent call last): File stdin, line 1, in ? File D:\u\Python24\lib\zipfile.py, line 357, in read

Re: open file with whitespaces

2006-05-19 Thread Christophe
mardif a écrit : Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now, I MUST open this file with os.spawn(os.P_WAIT , because I must wait the user cancel the

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread John Salerno
softwindow wrote: the re module is too large and difficult to study i need a detaild introduction. I don't know what your experience has been so far, but I have almost no programming experience beyond what I've taught myself, and I found the re module very easy to understand after reading

Re: open file with whitespaces

2006-05-19 Thread bruno at modulix
mardif wrote: Hi guys. I've a very big big big problem: ot I think a lot of people in the world would not find it so big wrt/ their own situation... /ot I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now,

Re: open file with whitespaces

2006-05-19 Thread Claudio Grondi
Christophe wrote: mardif a écrit : Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now, I MUST open this file with os.spawn(os.P_WAIT , because I must wait

Re: Encode exception for chinese text

2006-05-19 Thread Martin v. Löwis
John Machin wrote: 1. *By definition*, you can encode *any* Unicode string into utf-8. Proves nothing. 2. \u00a0 [no-break space] has no equivalent in gb2312, nor in the later gbk alias cp936. It does have an equivalent in the latest Chinese encoding, gb18030. Also, *by definition*, though

Strange Memory Leaks

2006-05-19 Thread rodmc
I have written an application which seems to work fine most of the time and takes up about 26k when run. However when the PC (Windows 2k) is put to sleep/locked and the application is left to run it starts eating up memory, indeed about 400mb was the recent record. Is there any automated way of

Re: open file with whitespaces

2006-05-19 Thread mardif
OK OK GUYS I've found the solution: ( effectly, a friend of mine has found the solution ) import os os.spawnl(os.P_WAIT, c:\programmi\internet explorer\iexplore.exe,'C:\Documents and Settings\michele\Desktop\ciccio.html','C:\Documents and Settings\michele\Desktop\ciccio.html') The secret

Re: Script to make Windows XP-readable ZIP file

2006-05-19 Thread Larry Bates
pac wrote: I'm preparing to distribute a Windows XP Python program and some ancillary files, and I wanted to put everything in a .ZIP archive. It proved to be inordinately difficult and I thought I would post my solution here. Is there a better one? Suppose you have a set of files in a

Re: open file with whitespaces

2006-05-19 Thread Fredrik Lundh
mardif wrote: Now, I MUST open this file with os.spawn(os.P_WAIT , because I must wait the user cancel the explorer window, ok? note that backslashes in string literals have special meaning in Python; to make sure a backslash in the string literal really ends up as a backslash in the

Re: Python Install

2006-05-19 Thread D
Thanks guys - I will give it another go! -- http://mail.python.org/mailman/listinfo/python-list

Exception style (was: calling python functions using variables)

2006-05-19 Thread Cameron Laird
In article [EMAIL PROTECTED], Grant Edwards [EMAIL PROTECTED] wrote: On 2006-05-19, bruno at modulix [EMAIL PROTECTED] wrote: Either deal with the resulting NameError exception (EAFP[0]) try: getattr(commands, VARIABLE)() except NameError: print sys.stderr, Unknown command, VARIABLE

Re: memory error with zipfile module

2006-05-19 Thread Sion Arrowsmith
bruno at modulix [EMAIL PROTECTED] wrote: http://mail.zope.org/pipermail/zope/2004-October/153882.html MemoryError is raised by Python when an underlying (OS-level) allocation fails. (...) Normally this would mean that you were out of even virtual memory (swap), but it could also be a symptom of

Re: Python - Web Display Technology

2006-05-19 Thread Florian Diesch
bruno at modulix [EMAIL PROTECTED] wrote: SamFeltus wrote: I am trying to figure out why so little web development in Python uses Flash as a display technology. It seems most Python applications choose HTML/CSS/JS as the display technology, yet Flash is a far more powerful and elegant

Re: Feature request: sorting a list slice

2006-05-19 Thread Harold Fellermann
Fredrik Lundh wrote: George Sakkis wrote: It would be useful if list.sort() accepted two more optional parameters +1 useful for what? what's the use case ? Actually, I was in need of such a construct only few weeks ago. The task was to organize playlists of an mp3 player. I wanted to

Re: number of different lines in a file

2006-05-19 Thread Ben Stroud
It never occured to me to use the Python dict/set approach. Now I wonder if it would've worked better somehow. Of course my file was 26,000 X larger than the one in this problem, and definitely would not fit in memory. I suspect that there were as many as a million duplicates for some

Re: the tostring and XML methods in ElementTree

2006-05-19 Thread George Sakkis
Stefan Behnel wrote: George Sakkis wrote: Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I wanted to see what would happen if one used the results of a tostring method as input into the XML method. What I observed is this: a) beforeCtag.text is of type type 'str' b)

Re: Proposal for new operators to python that add syntactic sugar for hierarcical data.

2006-05-19 Thread Ian Bicking
glomde wrote: i I would like to extend python so that you could create hiercical tree structures (XML, HTML etc) easier and that resulting code would be more readable than how you write today with packages like elementtree and xist. I dont want to replace the packages but the packages could

Re: Exception style (was: calling python functions using variables)

2006-05-19 Thread Fredrik Lundh
Cameron Laird wrote: Guys, I try--I try *hard*--to accept the BetterToAskForgiveness gospel, but this situation illustrates the discomfort I consistently feel: how do I know that the NameError means VARIABLE didn't resolve, rather than that it did, but that evaluation of commands.VARIABLE()

Re: Subprocess or Process or OMG!!

2006-05-19 Thread rh0dium
ROTFLMAO - Thanks --- I meant has anyone done the wrapper approach before!! Not has anyone used the code.. hahah nice!! subprocess also has the wait object. I think I like this better than popen2 (which I have used in the past) for a number of reasons but primarily it's simplicity. Having said

Re: Exception style (was: calling python functions using variables)

2006-05-19 Thread Richie Hindle
[Cameron] try: getattr(commands, VARIABLE)() except NameError: print sys.stderr, Unknown command, VARIABLE this situation illustrates the discomfort I consistently feel: how do I know that the NameError means VARIABLE didn't resolve, rather than that it did, but that evaluation

Re: Reference Counts

2006-05-19 Thread Tim Peters
[raghu, on Heiko Wundram's test program: import sys x = {} i = 0 def test(): global x, i x[i] = test i += 1 del x[i-1] # Properly clean up x. for j in xrange(1): print Before, j, :, sys.gettotalrefcount() test() print After, j, :, sys.gettotalrefcount() ] Hmm... I

Re: Python sqlite and regex.

2006-05-19 Thread Matt Good
SQLite3 already has a REGEXP function, so you don't need to create your own. As Dan mentioned you also have a problem in your expression: 'aa.[0-9]) You need a closing quote on the expression, and you need to match the close paren with an open paren, or remove it. Also, in case you weren't

Re: Any pointers/advice to help learn CPython source?

2006-05-19 Thread sébastien
There is also an interesting pep which describe the front-end http://www.python.org/dev/peps/pep-0339/ It doesn't explain the whole things, but it gives few hints where to start to read the code. BTW, the main difficulty is that there are fat C files and you should ask yourself what do you want

Re: Complex evaluation bug

2006-05-19 Thread Paul McGuire
Christophe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip Oups, I was too fast to read what was written. I though you only changed one of the terms ( str - repr ). You'll note that repr and str produce the exact same result for complex. And also, I'm not sure using eval

Re: number of different lines in a file

2006-05-19 Thread Tim Chase
I actually had this problem a couple of weeks ago when I discovered that my son's .Xsession file was 26 GB and had filled the disk partition (!). Apparently some games he was playing were spewing out a lot of errors, and I wanted to find out which ones were at fault. Basically, uniq

Re: Python - Web Display Technology

2006-05-19 Thread Sybren Stuvel
Florian Diesch enlightened us with: - Flash is a proprietary technology requiring a proprietary plugin. There seem to be at least two free implementations: But the website of OP together with the websites of many other people are incompatible with those, since they require the latest and

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread PoD
On Fri, 19 May 2006 10:04:15 +0200, Christophe wrote: PoD a écrit : Maybe what Python should do (but never will given the obsession with using spaces) is only allow one level of indentation increase per block so that def foo(): TABTABreturn 'bar' would return a syntax error Which

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Peter Decker
On 19 May 2006 07:18:03 GMT, Duncan Booth [EMAIL PROTECTED] Can you point at any significant body of publically visible Python code which uses tabs exclusively? All of the Python projects I've ever been involved with use spaces only as a convention (although as I pointed out in my previous

Re: Getting URL's

2006-05-19 Thread Paul McGuire
softwindow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] it is difficult to get all URL's in a page snip Is this really so hard?: - from pyparsing import Literal,Suppress,CharsNotIn,CaselessLiteral,\ Word,dblQuotedString,alphanums,SkipTo,makeHTMLTags import

Re: how could I get all email address in a html page?

2006-05-19 Thread Paul McGuire
dongdong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] how could I get all email address in a html page? Have any modle can do this? like the htmldata.urlextract . ...a spammer is born... -- http://mail.python.org/mailman/listinfo/python-list

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread Paul McGuire
softwindow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] the re module is too large and difficult to study i need a detaild introduction. Sorry, but your post just sounds too much like it's in the I'm too lazy to figure this out for myself, just spoon-feed me the answer category.

Re: WTF? Printing unicode strings

2006-05-19 Thread Robert Kern
John Salerno wrote: AFAIK, I'm all ASCII (at least, I never made explicit changes to the default Python install), so how am I able to print out the character? Because sys.stdout.encoding isn't determined by your Python configuration, but your terminal's. -- Robert Kern I have come to

Re: python vs perl lines of code

2006-05-19 Thread Edward Elliott
Terry Hancock wrote: Edward Elliott wrote: For inquiries into real-world code, it's enough to believe that I'm not lying So I don't make assumptions about people without some kind of evidence. There *are* plenty of bad guys out there, so one learns both to have a thick skin and to rely on

Re: Python sqlite and regex.

2006-05-19 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Good wrote: SQLite3 already has a REGEXP function, so you don't need to create your own. [...] Yes, but SQLite does not include a regular expression engine, and thus according to the SQLite docs you need to register a REGEXP function in order

Re: Quoting relevant material for response (was: Re: python vs perl lines of code)

2006-05-19 Thread Michael Tobis
OT, sort of, but... [EMAIL PROTECTED] wrote: If that quoting mechanism is available on the web interface and I haven't found it - I'd love to know how to use it. Click show options and THEN hit reply. It's a bit counterintuitive, but the entire message to which you reply is then shown. It is

Re: number of different lines in a file

2006-05-19 Thread Kaz Kylheku
Bill Pursell wrote: Have you tried cat file | sort | uniq | wc -l ? The standard input file descriptor of sort can be attached directly to a file. You don't need a file catenating process in order to feed it: sort file | uniq | wc -l Sort has the uniq functionality built in: sort -u

The use of PyW32_BEGIN_ALLOW_THREADS and PyW32_END_ALLOW_THREADS

2006-05-19 Thread sam
The foowing code lifted from Mark Hammond Pywin32 code shows and example of calling the Windows Kernel32 GetTickCount(),using PyW32_BEGIN_ALLOW_THREADS and PYW32_END_ALLOW_THREADS. My Code does not use this,but uses SetThreadAffinityMask(GetCurrentThread(),1). My questions are: 1) What is

Re: [silly] Does the python mascot have a name ?

2006-05-19 Thread John D Salt
Mel Wilson [EMAIL PROTECTED] wrote in news:_s2bg.8867$aa4.296233 @news20.bellglobal.com: [Snips] Just reinforces the central truth. The mascot doesn't *have* a name. Most things don't. Most things don't have names? I'll believe you if you can give me a list of ten things that don't have

Re: number of different lines in a file

2006-05-19 Thread Kaz Kylheku
Bill Pursell wrote: Have you tried cat file | sort | uniq | wc -l ? The standard input file descriptor of sort can be attached directly to a file. You don't need a file catenating process in order to feed it: sort file | uniq | wc -l And sort also takes a filename argument: sort file |

Re: WTF? Printing unicode strings

2006-05-19 Thread skip
Robert Because sys.stdout.encoding isn't determined by your Python Robert configuration, but your terminal's. Learn something every day. I take it 646 is an alias for ascii (or vice versa)? % python Python 2.4.2 (#1, Feb 23 2006, 12:48:31) [GCC 3.4.1] on sunos5 Type

how to suppress the source code echo output by warnings.warn(x)?

2006-05-19 Thread funkyj
I've been googling around trying to find the answer to this question but all I've managed to turn up is a 2 year old post of someone else asking the same question (no answer though).

[ANNOUNCE] ipplib : python IPP and CUPS API

2006-05-19 Thread Jerome Alet
Hi there, I'm pleased to announce a new project of mine, named ipplib, which offers IPP requests parsing and/or building, and (basic) support for the CUPS' API. This project is written in 100% Python, and is available under the terms of the GNU GPL. It's very young, although the parsing code is

Re: WTF? Printing unicode strings

2006-05-19 Thread John Salerno
[EMAIL PROTECTED] wrote: Robert Because sys.stdout.encoding isn't determined by your Python Robert configuration, but your terminal's. Learn something every day. I take it 646 is an alias for ascii (or vice versa)? Hmm, not that this helps me any :) import sys

Re: newb: comapring two strings

2006-05-19 Thread Paul McGuire
John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In that case, the problem can be solved in O(n) time by a simple loop which counts the number of differences and notes the position of the first (if any) difference. Any full-distance Levenshtein method that does no

Decimal and Exponentiation

2006-05-19 Thread elventear
Hi, I am the in the need to do some numerical calculations that involve real numbers that are larger than what the native float can handle. I've tried to use Decimal, but I've found one main obstacle that I don't know how to sort. I need to do exponentiation with real exponents, but it seems

Re: how to read a list from python in C?

2006-05-19 Thread skip
lialie The list has a random length. lialie Do you mean to do it in this way? lialie use PyTuple_Size(args), in a loop lialie use PyTuple_GetItem(args, i) lialie or lialie use PyArg_VaParse? Sketch (that means off-the-top-of-my-head, untested, 99.9% guaranteed incorrect

Re: WTF? Printing unicode strings

2006-05-19 Thread skip
John Hmm, not that this helps me any :) import sys sys.stdout.encoding John 'cp1252' Sure it does. You can print Unicode objects which map to cp1252. I assume that means you're on Windows or that for some perverse reason you have your Mac's Terminal window set to cp1252.

Re: Python sqlite and regex.

2006-05-19 Thread Paul McGuire
Gerhard Häring [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Good wrote: SQLite3 already has a REGEXP function, so you don't need to create your own. [...] Yes, but SQLite does not include a regular expression engine, and

Re: WTF? Printing unicode strings

2006-05-19 Thread John Salerno
[EMAIL PROTECTED] wrote: John Hmm, not that this helps me any :) import sys sys.stdout.encoding John 'cp1252' Sure it does. You can print Unicode objects which map to cp1252. I assume that means you're on Windows or that for some perverse reason you have your Mac's

Re: Python sqlite and regex.

2006-05-19 Thread Paul McGuire
Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] where '*' matches one or more characters, and '?' matches any single oops, I meant '*' matches zero or more characters. In many applications, these tests are sufficient for most user queries. And this eliminates the

Daily python url archives

2006-05-19 Thread Bobert
Hi, Do you know by chance if someone has archives from the daily python url feed (http://www.pythonware.com/daily/rss2.xml) ? An archive of the last 3 or 6 months would be most useful to me. Many thanks in advance, Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: how to read a list from python in C?

2006-05-19 Thread Lialie
Thanks for your reply. yes, I pass a list as an argument to the function in C. The list has a random length. Do you mean to do it in this way? use PyTuple_Size(args), in a loop use PyTuple_GetItem(args, i) or use PyArg_VaParse? Best Regards --

Re: Python sqlite and regex.

2006-05-19 Thread John Salerno
Paul McGuire wrote: Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] where '*' matches one or more characters, and '?' matches any single oops, I meant '*' matches zero or more characters. '?' also matches 0 characters --

combining a C# GUI with Python code?

2006-05-19 Thread John Salerno
Is it possible to construct a C# form (using Visual Studio) but write only Python code for the events? Is there some way to tell your program to run Python whenever code is run, since it will be all Python code (e.g. for button presses, etc.)? I know it's sort of silly, and it makes your

Re: how to suppress the source code echo output by warnings.warn(x)?

2006-05-19 Thread Peter Otten
funkyj wrote: I've been googling around trying to find the answer to this question but all I've managed to turn up is a 2 year old post of someone else asking the same question (no answer though). jh In the following jh jh import warnings jh warnings.warn('change me') jh jh The warning

Re: memory error with zipfile module

2006-05-19 Thread bruno at modulix
Sion Arrowsmith wrote: Hari Sekhon [EMAIL PROTECTED] wrote: (snip) The python zipfile module is obviously broken... This isn't at all obvious to me. zipfile.read() does not seem to take full advantage of zlib's decompressobj's features. This could perhaps be improved (left as an exercice to

Re: Python sqlite and regex.

2006-05-19 Thread Paul McGuire
John Salerno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paul McGuire wrote: Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] where '*' matches one or more characters, and '?' matches any single oops, I meant '*' matches zero or more characters.

Re: Exception style

2006-05-19 Thread bruno at modulix
Fredrik Lundh wrote: Cameron Laird wrote: Guys, I try--I try *hard*--to accept the BetterToAskForgiveness gospel, but this situation illustrates the discomfort I consistently feel: how do I know that the NameError means VARIABLE didn't resolve, rather than that it did, but that evaluation of

Re: combining a C# GUI with Python code?

2006-05-19 Thread Luis M. González
First of all, you should be thinking about ironpython instead of cpython. This way you can forget about c# and do it all in (iron)python. I don't know its current state, but Microsoft is working in a Visual Studio - Ironpython integration. For more info:

Re: newb: comapring two strings

2006-05-19 Thread bearophileHUGS
I think a way to solve the problem may be: 1) create a little Python script to separate the original words in many files, each one containing only words of the same length. Every filename can contain the relative word length. 2) write a little C program with two nested loops, that scans all the

Re: WTF? Printing unicode strings

2006-05-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: Robert Because sys.stdout.encoding isn't determined by your Python Robert configuration, but your terminal's. Learn something every day. I take it 646 is an alias for ascii (or vice versa)? % python Python 2.4.2 (#1, Feb 23 2006, 12:48:31)

Re: Proposal for new operators to python that add syntactic sugar for hierarcical data.

2006-05-19 Thread bruno at modulix
Ian Bicking wrote: glomde wrote: i I would like to extend python so that you could create hiercical tree structures (XML, HTML etc) easier and that resulting code would be more readable than how you write today with packages like elementtree and xist. I dont want to replace the packages but the

Re: newb: comapring two strings

2006-05-19 Thread bearophileHUGS
I have suggested C because if the words are all of the same length then you have 3^2 = 90 000 000 000 pairs to test. Sorry, you have (n*(n-1))/2 pairs to test (~ 45 000 000 000). bearophile -- http://mail.python.org/mailman/listinfo/python-list

Why does the _winreg module start with an underscore

2006-05-19 Thread 3c273
Does it signify something? Just curious. Louis -- http://mail.python.org/mailman/listinfo/python-list

Re: newb: comapring two strings

2006-05-19 Thread Paul Rubin
[EMAIL PROTECTED] writes: I have suggested C because if the words are all of the same length then you have 3^2 = 90 000 000 000 pairs to test. Sorry, you have (n*(n-1))/2 pairs to test (~ 45 000 000 000). Still terrible. Use a better algorithm! --

Re: combining a C# GUI with Python code?

2006-05-19 Thread Luis M. González
Now that I think about it, I'm not sure if Visual Studio can create GUIs with ironpython already. I guess that at this moment, its integration is as a text editor only (I may be wrong though). I almost forgot it, but someone was working in a little tool that converts C# forms into python classes

Re: combining a C# GUI with Python code?

2006-05-19 Thread John Salerno
Luis M. González wrote: Now that I think about it, I'm not sure if Visual Studio can create GUIs with ironpython already. I guess that at this moment, its integration is as a text editor only (I may be wrong though). I almost forgot it, but someone was working in a little tool that converts

Re: Python sqlite and regex.

2006-05-19 Thread Dan Sommers
On Fri, 19 May 2006 17:44:45 GMT, Paul McGuire [EMAIL PROTECTED] wrote: Gerhard Häring [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The REGEXP operator is a special syntax for the regexp() user function. No regexp() user function is defined by default and so use of the REGEXP

Re: number of different lines in a file

2006-05-19 Thread Paddy
If the log has a lot of repeated lines in its original state then running uniq twice, once up front to reduce what needs to be sorted, might be quicker? uniq log_file | sort| uniq | wc -l - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Request for comments on python distributed technologies

2006-05-19 Thread Carl J. Van Arsdall
Hey everyone, another question for the list. In particular i'm looking for comments on some of the distributed technologies supported in python. Specifically, I'm looking at XML-RPC, RPyC, CORBA, and Twisted. Before you offer any comments let me talk about what i'm doing a little bit.

Re: Python sqlite and regex.

2006-05-19 Thread Paul McGuire
Dan Sommers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 19 May 2006 17:44:45 GMT, Paul McGuire [EMAIL PROTECTED] wrote: Gerhard Häring [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The REGEXP operator is a special syntax for the regexp() user

Re: number of different lines in a file

2006-05-19 Thread Paul McGuire
Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If the log has a lot of repeated lines in its original state then running uniq twice, once up front to reduce what needs to be sorted, might be quicker? uniq log_file | sort| uniq | wc -l - Pad. Why would the second running

Re: combining a C# GUI with Python code?

2006-05-19 Thread gangesmaster
see http://interpython.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

bitstream

2006-05-19 Thread gangesmaster
anyone has a good bit-stream reader and writer? (before i go to write my own) i.e. f = open(..) b = BitStream(f) b.write(10010010) b.read(5) # 10010 or something like that? -tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: number of different lines in a file

2006-05-19 Thread Grant Edwards
On 2006-05-19, Kaz Kylheku [EMAIL PROTECTED] wrote: There should be one huge utility which can do it all in a single address space. Sure, as long as it can do all of everything you'll ever need to do, you're set! It would be the One True Program. Isnt' that what Emacs is supposed to be? --

Re: number of different lines in a file

2006-05-19 Thread Grant Edwards
On 2006-05-19, Paul McGuire [EMAIL PROTECTED] wrote: If the log has a lot of repeated lines in its original state then running uniq twice, once up front to reduce what needs to be sorted, might be quicker? uniq log_file | sort| uniq | wc -l - Pad. Why would the second running of uniq

Re: Request for comments on python distributed technologies

2006-05-19 Thread Paul McGuire
Carl J. Van Arsdall [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey everyone, another question for the list. In particular i'm looking for comments on some of the distributed technologies supported in python. Specifically, I'm looking at XML-RPC, RPyC, CORBA, and Twisted. What

altering an object as you iterate over it?

2006-05-19 Thread John Salerno
What is the best way of altering something (in my case, a file) while you are iterating over it? I've tried this before by accident and got an error, naturally. I'm trying to read the lines of a file and remove all the blank ones. One solution I tried is to open the file and use readlines(),

Modifying a variable in a non-global outer scope?

2006-05-19 Thread Edward C. Jones
#! /usr/bin/env python When I run the following program I get the error message: UnboundLocalError: local variable 'x' referenced before assignment Can inner change the value of a variable defined in outer? Where is this explained in the docs? def outer(): def inner(): x = x + 1

Re: Why does the _winreg module start with an underscore

2006-05-19 Thread Erik Max Francis
3c273 wrote: Does it signify something? Just curious. Dear quasar, Typically an identifier starting with an underscore signifies something that is not intended to be exposed as part of a public API. In other words, it's an implementation detail in whatever you're using and as such you

Re: number of different lines in a file

2006-05-19 Thread Kaz Kylheku
Paddy wrote: If the log has a lot of repeated lines in its original state then running uniq twice, once up front to reduce what needs to be sorted, might be quicker? Having the uniq and sort steps integrated in a single piece of software allows for the most optimization opportunities. The

Re: Feature request: sorting a list slice

2006-05-19 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 19:27 schrieb George Sakkis: It would be useful if list.sort() accepted two more optional parameters, start and stop, so that you can sort a slice in place. I've just submitted: http://sourceforge.net/tracker/index.php?func=detailaid=1491804group_id=5470atid=305470

Re: number of different lines in a file

2006-05-19 Thread Paul McGuire
Kaz Kylheku [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paddy wrote: ...if you are lucky enough to have a zero copy pipe implementation whcih allows data to go from the writer's buffer directly to the reader's one without intermediate kernel buffering. I love it when you talk

Re: number of different lines in a file

2006-05-19 Thread Paul McGuire
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why would the second running of uniq remove any additional lines that weren't removed in the first pass? Because uniq only removes _adjacent_ identical lines. Thanks, guess my *nix ignorance is showing (this doesn't

Re: Modifying a variable in a non-global outer scope?

2006-05-19 Thread bruno at modulix
Edward C. Jones wrote: #! /usr/bin/env python When I run the following program I get the error message: UnboundLocalError: local variable 'x' referenced before assignment Can inner change the value of a variable defined in outer? Not this way Where is this explained in the docs?

Re: altering an object as you iterate over it?

2006-05-19 Thread John Salerno
John Salerno wrote: What is the best way of altering something (in my case, a file) while you are iterating over it? I've tried this before by accident and got an error, naturally. I'm trying to read the lines of a file and remove all the blank ones. One solution I tried is to open the

[ANNOUNCE] Thirty-first release of PythonCAD now available

2006-05-19 Thread Art Haas
Hi. I'm pleased to announce the thirty-first development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually

Re: altering an object as you iterate over it?

2006-05-19 Thread bruno at modulix
John Salerno wrote: What is the best way of altering something (in my case, a file) while you are iterating over it? I've tried this before by accident and got an error, naturally. I'm trying to read the lines of a file and remove all the blank ones. One solution I tried is to open the file

Re: [silly] Does the python mascot have a name ?

2006-05-19 Thread Mel Wilson
John D Salt wrote: Mel Wilson [EMAIL PROTECTED] wrote in news:_s2bg.8867$aa4.296233 @news20.bellglobal.com: [Snips] Just reinforces the central truth. The mascot doesn't *have* a name. Most things don't. Most things don't have names? I'll believe you if you can give me a list of

Re: Why does the _winreg module start with an underscore

2006-05-19 Thread Fredrik Lundh
3c273 wrote: Does it signify something? Just curious. from the module documentation: This module exposes a very low-level interface to the Windows registry; it is expected that in the future a new winreg module will be created offering a higher-level interface to

<    1   2   3   4   >