Re: Wrapping classes

2005-09-22 Thread Peter Hansen
Jeremy Sanders wrote: > Is it possible to implement some sort of "lazy" creation of objects only > when the object is used, but behaving in the same way as the object? > > For instance: > > class Foo: > def __init__(self, val): > """This is really slow.""" > self.num = val > > # this d

Re: in-memory db? gadfly?

2005-09-22 Thread Peter Hansen
chris wrote: > I'm looking for a completely in-memory sql db. I have seen gadfly, but > its startup method seems to require a directory for the on-disk file > storage. I have a script and I want to create a database/tables in the > script, insert some data (not much), and execute some queries, al

Re: Alternatives to Stackless Python?

2005-09-22 Thread Peter Hansen
[EMAIL PROTECTED] wrote: >>I found LGT http://lgt.berlios.de/ but it didn't seem as if the >>NanoThreads module had the same capabilites as stackless. > > What specific capabilities of Stackless are you looking for, that are > missing from NanoThreads? While I can't speak for the OP, isn't it the

Re: File processing

2005-09-23 Thread Peter Hansen
Gopal wrote: > Hello, > > I'm Gopal. I'm looking for a solution to the following problem: > > I need to create a text file config.txt having some parameters. I'm > thinking of going with this format by having "Param Name - value". Note > that the value is a string/number; something like this: >

Re: Productivity and economics at software development

2005-09-23 Thread Peter Hansen
Adriano Monteiro wrote: > I'm making a little research project about programming languages e > their respective IDEs. The goal is to trace each language silhouettes, > where it fits better, their goods/bads and the costs of developing in > this language. You say this as though each language ha

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Peter Hansen
Collin Winter wrote: > On 9/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>__builtins__ is a CPython implementation detail. why not just let it >>be an implementation detail, and refrain from using it? it's not that >>hard, really. > Given, but I fail to see why it can't be a consistent imple

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Peter Hansen
Collin Winter wrote: > The difference between __builtins__ and the other __*__ names is that > while the others shouldn't be used without understanding their > purpose, the consensus on __builtins__ seems to be that it shouldn't > be used at all. > > ... at the very > least, users should be expli

Re: Can I compile Python for the web?

2005-09-23 Thread Peter Hansen
Charles wrote: > I'm doing some investigations on the Python language. > I'd like to know if it is possible to compile Python code made for the > web (an online database for instance), and to run it using mod_python. > How is it possible? I think it would be very fast to execute the code > if

Re: Productivity and economics at software development

2005-09-23 Thread Peter Hansen
Paul Rubin wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>If you focus on IDEs, your research will have pre-selected only >>certain kinds of programmers and teams, and will not necessarily >>include the best ones. > > It wouldn't have occurred to m

Re: parsing a date

2005-09-24 Thread Peter Hansen
Kalle Anke wrote: > On Fri, 23 Sep 2005 23:01:18 +0200, Larry Bates wrote: > >>but I'm not sure it is "better". I guess it depends >>on what you want to do with them after parsing. > > Sorry, I should have been clearer. I want to parse the date and create a > 'date object' that is a part of lar

Re: parsing a date

2005-09-24 Thread Peter Hansen
Kalle Anke wrote: > Better (in this case) = > > + Being "pythonic" > > + Avoiding going through a second representation (the tuple) > if there is some way to create a date object directly. I think the plainest and simplest approach would be to create a well-named function which does the

Re: Determine type of a socket

2005-09-26 Thread Peter Hansen
Tor Erik Sønvisen wrote: > How can I determine the type of a socket (TCP or UDP) object? In what context? Do you have some code that gets passed a socket object but it could have been created with either SOCK_STREAM or SOCK_DGRAM? And you want a way of determining by looking just at the object

Re: Determine type of a socket

2005-09-26 Thread Peter Hansen
Reinhold Birkenfeld wrote: > Peter Hansen wrote: >>Tor Erik Sønvisen wrote: >>>How can I determine the type of a socket (TCP or UDP) object? >>Let's see... what looks good here? >> >> >>> u._sock >> >> >>> t._sock >> &

Re: The ^ operator

2005-09-26 Thread Peter Hansen
Tuvas wrote: > What exactly does the ^ operator do? I've seen, for example, that > 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are > not equal, and if they are equal, outputs 0, or what? Thanks! It performs an "exclusive-OR" (XOR) operation on the binary data corresponding to

Re: @staticmethod, backward compatibility?

2005-09-27 Thread Peter Hansen
Neal Becker wrote: > How can I write code to take advantage of new decorator syntax, while > allowing backward compatibility? > > I almost want a preprocessor. > > #if PYTHON_VERSION >= 2.4 > @staticmethod > ... > > Since python < 2.4 will just choke on @staticmethod, how can I do this? It seem

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Peter Hansen
Berthold Höllmann wrote: > As I understand it, ctypes is not really a solution. The code is about > data handling and FE analysis. It has not GUI component. I'm not sure > how well ctypes works with Numeric arrays, but I'm sure ctypes does > not work on Linux and Solaris, but my code has to. Neith

Re: Overhead of individual python apps

2005-09-28 Thread Peter Hansen
Fredrik Lundh wrote: > (for python, the "private" memory use is usually ~1.5 megabytes for a "empty" > 2.4 > process, and some of that will only occupy space in the paging file... for > firefox with > a simple page loaded into a single tab, the private space is ~10 megabytes) I believe a relati

Re: import problems in packages

2005-09-28 Thread Peter Hansen
Stéphane Ninin wrote: > Traceback (most recent call last): > File "main.py", line 8, in ? > main() > File "main.py", line 5, in main > handler = HandlerFactory().makeHandler(command) > File "c:\ROOT\Handlers\HandlerFactory.py", line 6, in HandlerFactory > import Handlers.Default.H

Re: Rollover/wraparound time of time.clock() under win32?

2005-09-28 Thread Peter Hansen
Russell Warren wrote: > Does anyone know how long it takes for time.clock() to roll over under > win32? > > I'm aware that it uses QueryPerformanceCounter under win32... when I've > used this in the past (other languages) it is a great high-res 64-bit > performance counter that doesn't roll-over f

Re: A quick c.l.p netiquette question

2005-09-29 Thread Peter Hansen
Peter Corbett wrote: > I've written a program to illustrate a few... syntactic issues with > Python. It's 158 <80 character lines long. > > About how short should a program be to be postable to this newsgroup - > in other words, at what length should you stick it on a web page and > post a link?

Re: converting Word to MediaWiki

2005-09-29 Thread Peter Hansen
Jeff Schwab wrote: > ChiTownBob wrote: > >> Perl just sucks, as all good Python hackers know! > > > I disagree. Perl has saved my butt more times than I care to count. > Python certainly has its advantages, but I won't be giving up Perl any > time soon. Are the two necessarily in conflict?

Re: A quick c.l.p netiquette question

2005-09-29 Thread Peter Hansen
Fredrik Lundh wrote: > Peter Hansen wrote: >>Does it really have to be 158 lines to demonstrate these few issues? I >>for one almost never take the time to dig through 158 lines of someone >>else's code, partly on the assumption that almost any interesting issue >

Re: Where to find python c-sources

2005-09-29 Thread Peter Hansen
Dave Benjamin wrote: > Tor Erik Sønvisen wrote: >> I need to browse the socket-module source-code. I believe it's >> contained in the file socketmodule.c, but I can't locate this file... >> Where should I look? > > You can browse the Python CVS tree here: > http://cvs.sourceforge.net/viewcvs.py/

Re: Help with syntax warnings

2005-09-29 Thread Peter Hansen
Ivan Shevanski wrote: > Here's a noob question for everyone (I'm not sure if my first message > got through, is had a "suspicious header" so sorry for double post is > so), is there a way to turn off syntax warnings or just make them not > visible? Not sure... what's a "syntax warning"? Python

Re: Help with syntax warnings

2005-09-30 Thread Peter Hansen
Robert Kern wrote: > Peter Hansen wrote: >>Not sure... what's a "syntax warning"? > > In [1]: SyntaxWarning? > Type: classobj > String Form:exceptions.SyntaxWarning > Namespace: Python builtin > Docstring: > Base class for

Re: RELEASED Python 2.4.2 (final)

2005-09-30 Thread Peter Hansen
Martin v. Löwis wrote: > Trent Mick wrote: > >>It is possible that the python.org installer didn't overwrite the >>"python24.dll" in the system directory (C:\WINDOWS\system32). Try doing >>this: > > > Even though this is apparently what happened, I'm puzzled as to why it > happened: shouldn't th

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread Peter Hansen
Gerrit Holl wrote: > True. However, most mail to this mailinglist has less than 0.001 spam > probability. As you can see, this one had 0.048 - a vast score, almost > enough to put it in my unsure box. It seems to be just not hammy enough. > It's interesting to see that no none of the foul language

Re: Moronicity Xha Lee, Jargonizer

2005-09-30 Thread Peter Hansen
Kay Schluehr wrote: > By the way I noticed also a few reasonable non-troll postings of Xah > without any response in the forum. Not even Xahs posting strategy is > coherent. Really? Every one I've noticed has actually had a response, and a reasonably civil one at that. Usually from Steve Holden

Re: what does 0 mean in MyApp(0)

2005-10-02 Thread Peter Hansen
Alex wrote: > Thanks for the replies. It seems that I have three options > 1. app=MyApp() > 2. app=MyApp(0) > 3. app=MyApp('myfile.txt') I just want to emphasize the part of vincent's reply in which he points out that using the keyword arguments makes this more readable. If more examples and act

Re: Where to find python c-sources

2005-10-03 Thread Peter Hansen
27;t equate that with being dumb - just dumb luck :-) > > Message-ID: <[EMAIL PROTECTED]> > > After all Peter Hansen suggested the search terms "python socketmodule.c" > rather than just "socketmodule.c" > > Message-ID: <[EMAIL PROTECTED]> >

Re: how do you pronounce wxpython

2005-10-10 Thread Peter Hansen
Peter wrote: > Although the wxPyWiki seems to be pronounced wix-pee-wi-kee (as it says > on the front page) so maybe it is pronounced wix-Python... you never > know... That's _definitely_ how it's pronounced. Here. Where I am. When I'm speaking. If, however, we're near Mike Fletcher and he's

Re: Python's Performance

2005-10-10 Thread Peter Hansen
Harald Armin Massa wrote: > """ > What is Python? > > Python is an interpreted, interactive, object-oriented programming > language. It is often compared to Tcl, Perl, Scheme or Java. > """ > taken from > http://www.python.org/doc/Summary.html > > maybe someone could update that??? Maybe we shou

Re: Python reliability

2005-10-10 Thread Peter Hansen
Ville Voipio wrote: > I am not building a redundant system with independent > instruments voting. At this point I am trying to minimize > the false alarms. This is why I want to know if Python > is reliable enough to be used in this application. > > By the postings I have seen in this thread it se

Re: Send password over TCP connection

2005-10-10 Thread Peter Hansen
dcrespo wrote: > Two copies of the password: one on the client, the other on the server. [snip] > I think it is a very good solution, Isn't it? Ignoring all the other issues, any solution which actually requires the password to be stored on the server is a bad solution. Administrators should no

Re: Library functions

2005-10-10 Thread Peter Hansen
Tuvas wrote: > How exactly do you do that? Just to get some kind of an idea, perhaps > you could share bits of code? Thanks! Did you check out the ctypes web site before asking? See http://starship.python.net/crew/theller/ctypes/ and at least read through the helpful tutorial before asking ques

Re: Why asci-only symbols?

2005-10-10 Thread Peter Hansen
Mike Meyer wrote: > Out of random curiosity, is there a PEP/thread/? that explains why > Python symbols are restricted to 7-bit ascii? And of equally random curiosity :-), what alternative(s) can you suggest would have been appropriate? (I note that Unicode, for example, dates from around the t

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-10 Thread Peter Hansen
Sebastian Bassi wrote: > I don't understand why there is a new expression, if this could be > accomplished with: > > if C: > X > else: > Y > > What is the advantage with the new expression? It actually is an expression, whereas your example shows a statement (so "this" could _not_ be accompli

Re: Python's Performance

2005-10-11 Thread Peter Hansen
Steve Holden wrote: > And we definitely need "agile" in there. Bugger, I'll go out and come in > again ... Used in the same breath as the word "bugger", I'm not sure the phrase "go out and come in again" is entirely appropriate for a family forum. ;-) But I'm also not sure I ought to post that

Re: Send password over TCP connection

2005-10-11 Thread Peter Hansen
Laszlo Zsolt Nagy wrote: > Peter Hansen wrote: >> Ignoring all the other issues, any solution which actually requires >> the password to be stored on the server is a bad solution. >> Administrators should not have access to user passwords, and in >> addition use

Re: Python's Performance

2005-10-11 Thread Peter Hansen
Peter Hansen wrote: > But I'm also not sure I ought to post that to the group, so I'll spare > them and just inflict the thought on you! Or, maybe I'll just fail to trim the newsgroup line and accidentally post to the group anyway. Yes, that's just what I'l

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-12 Thread Peter Hansen
Dave Hansen wrote: > So lose the "if." > >R = C then A else B It would be nice (in my opinion) if this were the way it was going to be. Having one of the two results come first makes that result seem somehow of primary importance, while the conditional (which in my mind is far more import

Re: Python reliability

2005-10-12 Thread Peter Hansen
John Waycott wrote: > I wrote a simple Python program that acts as a buffer between a > transaction network and a database server, writing the transaction logs > to a file that the database reads the next day for billing. The simple > design decoupled the database from network so it wasn't stres

Re: Send password over TCP connection

2005-10-12 Thread Peter Hansen
dcrespo wrote: > then, what you proppose? I'll assume that question was for me, in response to my comment that one should never store passwords in the clear. Do you know how any other system manages to do this? Linux, for example (assuming a properly configured system)? The passwords aren't s

Re: slots? SLOTS?

2005-10-12 Thread Peter Hansen
tin gherdanarra wrote: > what is a "slot" in python? Google for "site:docs.python.org slots": http://www.google.ca/search?q=site%3Adocs.python.org+slots First hit... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Bad magic no. in python zipfile

2005-10-12 Thread Peter Hansen
[EMAIL PROTECTED] wrote: \> I'm able to create a new zipfile with the module's ZipFile class and > add files to it. After closing the file, I'm able to view the contents > of it with WinZip. I can also confirm that it is a python zip file by > using the is_zipfile() method. All good so far. How

Re: Well written open source Python apps

2005-10-13 Thread Peter Hansen
Ben wrote: > Could anyone suggest an open source project that has particularly well > written Python? I am especially looking for code that people would > describe as "very Python-ic". (Not trying to start any kind of war - > just wanted some good examples of a well written Python app to read.)

Re: 1-liner to iterate over infinite sequence of integers?

2005-10-13 Thread Peter Hansen
Erik Max Francis wrote: > The negative integers are being descriminated against! I demand justice! > > def integers(): > yield 0 > x = 1 > while True: > yield x > yield -x > x += 1 > > ... which is also not a bad demonstration of ho

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-14 Thread Peter Hansen
Christian Stapfer wrote: > 0.0. ... and add an item to your SendTo folder that allows > you to have Windows Explorer open a terminal window with its > current directory set to the currently displayed folder > (= "Open terminal here"). Or install the "Command Prompt Here" gadget that MS produces, w

Re: Accessing Parallel Port in Python Error : Priviledged Instruction

2005-10-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > When I use Pyparallel to access the parallel port in WinXP with Python > I get an error saying that this is a priviledged instruction > > Any clue ? Here's a clue: please always cut and paste the *entire actual* traceback when you report a Python error. If it's not a

Re: How to get a raised exception from other thread

2005-10-15 Thread Peter Hansen
dcrespo wrote: > How can I get a raised exception from other thread that is in an > imported module? Define what "get" means for your purposes. It appears that you mean you want to catch the exception, but in the thread which launched the other thread in the first place. If that's true, please

Re: How to get a raised exception from other thread

2005-10-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I also need an answer to this problem. What _is_ the problem? We're still waiting for a clear description from the OP as to what the problem really is. How would you describe what _your_ problem is? > I'm using windows. Throwing an > exception in thread B from t

Re: How to get a raised exception from other thread

2005-10-16 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Nevermind. I found a better solution. I used shared memory to create > a keep-alive flag. I then use the select function with a specified > timeout, and recheck the keep-alive flag after each timeout. As Dennis points out, your original attempt was destined to fail be

Re: How to get a raised exception from other thread

2005-10-17 Thread Peter Hansen
dcrespo wrote: >>Define what "get" means for your purposes. It appears that you mean you >>want to catch the exception, but in the thread which launched the other >>thread in the first place. If that's true, please show where you would >>expect to catch this exception, given that when you start t

Re: unittest of file-reading function

2005-10-18 Thread Peter Hansen
Helge Stenstroem wrote: > Say I have a function > > def f(filename): > result = openFileAndProcessContents(filename) > return result > > Can that function be unit tested without having a real file as input? > Something along the lines of > > import unittest > class tests(unittest.TestCas

Re: Dealing with Excel

2005-10-18 Thread Peter Hansen
Robert Hicks wrote: > No, I have to format fields and everything sad to say. Another poster > up the chain of this posting gave me the nudge in the direction I > needed. Doesn't Excel also support (in addition to binary .xls and simple text .csv files) an XML format, which allows full access to f

Re: write a loopin one line; process file paths

2005-10-18 Thread Peter Hansen
Xah Lee wrote: > If you think i have a point, ... You have neither that, nor a clue. (Newsgroups line trimmed to reduce the effects of cross-posting trolls.) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a raised exception from other thread

2005-10-18 Thread Peter Hansen
dcrespo wrote: >>Before, after, or during the .start() call, or somewhere else? > I'd like to catch *just after* the .start() call. Excellent. That makes it pretty easy then, since even though you are spawning a thread to do the work, your main thread isn't expected to continue processing in pa

Re: How to get a raised exception from other thread

2005-10-21 Thread Peter Hansen
dcrespo wrote: > Ok, sorry about the above question. I solved it adding this to the main > thread: > > try: > SrvrTCP = module.ThreadedTCPServer(ip,port) > SrvrTCP.start() > except Exception, description: > MsgBox(self,"TCPServer > Error:\n\n"+str(description),title="TCPServer",style=w

Re: Converting 2bit hex representation to integer ?

2005-10-21 Thread Peter Hansen
Madhusudan Singh wrote: > I just tried > > n=str(x) > print struct.unpack("b",n) > > I get (51,) > > What is the deal with the parenthesis > and the comma ? If you really don't know what the parentheses and comma mean in the above output, I would suggest that you need to go back a step and wa

Re: Python vs Ruby

2005-10-21 Thread Peter Hansen
Bryan wrote: > Dave Cook wrote: >> Cale? You mean Python has more ruffage? > > i think you mean "kale" not "cale". nothing like a hot bowl of tofu > kale soup while reading the recipes in the "python cookbook". Well, if he's going to talk about "ruffage" instead of "roughage", perhaps he real

Re: C replacement for Queue module

2005-10-22 Thread Peter Hansen
Jonathan Ellis wrote: > I'm working on an application that makes heavy use of Queue objects in > a multithreaded environment. > > By "heavy" I mean "millions of calls to put and get, constituting ~20% > of the app's run time." The profiler thinks that a significant amount > of time is spent in th

Re: Listening for keypress in the background

2005-10-22 Thread Peter Hansen
Mathias Dahl wrote: > I have created a small Python program that is running on my desktop. > > How can I make it listen for a certain keypress (say, Windows-key + > space) in a controlled fashion even when it is not the program having > focus? > > I need to do this running under GNOME in Mandrake

Re: Listening for keypress in the background

2005-10-23 Thread Peter Hansen
Mathias Dahl wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>>How can I make it listen for a certain keypress (say, Windows-key + >>>space) in a controlled fashion even when it is not the program having >>>focus? >>> >>>I need to do this ru

Re: C replacement for Queue module

2005-10-23 Thread Peter Hansen
Jason Lai wrote: > As far as Queues go, the adding/popping is apparently done with deque > which are implemented in C. The Queue class pretty much just provides > blocking operations and is otherwise a very thin layer around deque. As > far as primitives go, only threading.Lock is written in C and

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-23 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > i get the following error message when i use py2exe on my application: > > The following modules appear to be missing > ['_ssl', 'ext.IsDOMString', 'ext.SplitQName'] > > I've installed PyXML-0.8.4.win32-py2.4.exe. My version of python is 2.4 > I've checked in the pyxml

Re: wxpython - passing arg to wx.app OnInit

2005-10-23 Thread Peter Hansen
Stuart McGraw wrote: > I have a wxPython app, conventionally structured > with a Application class derived from wx.App. > My problem is that the app accepts a command > line argument that must be acted upon within the > OnInit() method of the Application class. How do > I pass it cleanly from main

Re: How to separate directory list and file list?

2005-10-23 Thread Peter Hansen
Gonnasi wrote: > With >>glob.glob("*") > or >>os.listdir(cwd) > > I can get a combined file list with directory list, but I just wanna a > bare file list, no directory list. How to get it? Using Jason Orendorff's path module, it's just this: >>> from path import path >>> path('.').files() # r

Re: bsddb version?

2005-10-23 Thread Peter Hansen
leasun wrote: > Anybody knows which version bsddb is released with py2.3 and py2.4? Is this what you wanted? Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 >>> import bsddb >>> bsddb.__version__ '4.3.0' I'll leave it up to you to do the work to find out what it is

Re: wxpython - passing arg to wx.app OnInit

2005-10-23 Thread Peter Hansen
Stuart McGraw wrote: > I simplied the my code for posting. In my real program, the > thing being passed is not a command line argument per se, > but the result of signifigant processing dependent on the > command line argument. I do not want to repeat that > processing in the wx.App method. > W

Re: testing '192.168.1.4' is in '192.168.1.0/24' ?

2005-10-23 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Is there standard library modules handling this ? currently I need to > turn it into a long integer and do the shift and compare. A little Googling turned up this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440560 -Peter -- http://mail.python.org/mailman/

Re: testing '192.168.1.4' is in '192.168.1.0/24' ?

2005-10-24 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > thanks, that is basically what I am doing and since it is a recipe, I > would assume there is no standard library module for it. Well, since a Google search for "site:docs.python.org subnet" turns up nothing, one would assume not, but it would be hard to prove it withou

Re: output from external commands

2005-10-24 Thread Peter Hansen
Mike Meyer wrote: > darren kirby <[EMAIL PROTECTED]> writes: > >>If all you want is filenames this will work: >> >import glob >files = ["%s" % f for f in glob.glob("*")] > > > What's the point of doing "%s" % f? How is this different from just > file = [f for f in glob.glob("*")]? Answe

Re: Tricky Areas in Python

2005-10-24 Thread Peter Hansen
beza1e1 wrote: > well, list comprehension is Python 2.4 and 2.3 is the standard in many > OSes, so it is possibly not the most portable solution You're probably remembering "generator expressions", which were added in Python 2.4 and aren't available in earlier versions. They fit in a similar pl

Re: python cgi script not understood as html

2005-10-24 Thread Peter Hansen
Philippe C. Martin wrote: > The following code outputs the actual HTML text to the browser, not the > interpreted text. > > html_ok = """ > Content-Type: text/html\n > "http://www.w3.org/TR/html4/loose.dtd";>\n HTTP header lines must end with \r\n, not just with \n. Not sure this is the soluti

Re: Tricky Areas in Python

2005-10-25 Thread Peter Hansen
Tim Roberts wrote: > "PyPK" <[EMAIL PROTECTED]> wrote: >>What possible tricky areas/questions could be asked in Python based >>Technical Interviews? > > What's the point of asking "tricky" questions? Aren't you really more > interested in what applications they have worked on and whether they wer

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Peter Hansen
Joerg Schuster wrote: > I just want to use more than 100 capturing groups. If someone told me > that it is very unlikely for Python to get rid of the said limitation, > I would recode part of my program in C++ using pcre. It is very unlikely for Python to get rid of the said limitation. -Peter -

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-25 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > unfortunately the result from py2exe won't run eventhough the original > script runs without problems. The trouble is I'm at a loss as to where > to start looking! Is there no exception traceback printed? Or some other error when you run the .exe? It would be very unu

Re: Execute C code through Python

2005-10-25 Thread Peter Hansen
Ernesto wrote: > So i generated the .exe file "myFile.exe" > > This is a Windows - text based application. Right now, when I run: > > import subprocess > subprocess.call("myFile") > > the application starts in its own console window. Is there a way for > it to run inside the python interface?

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Peter Hansen
Joerg Schuster wrote: > So what? Search in http://docs.python.org/lib/re-syntax.html for "99" and read the following sentence carefully. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-26 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Hi, > > yes of course the traceback could be helpfull so here it is... > > Traceback (most recent call last): > File "App1.py", line 6, in ? > File "Frame1.pyc", line 16, in ? > File "brain.pyc", line 4, in ? > File "xml\dom\ext\reader\__init__.pyc", line 20, in

Re: help with sending data out the parallel port

2005-10-27 Thread Peter Hansen
David wrote: > I'm wondering if python is capable of fairly precise timing and also sending > data out the parallel port. > > For example ; making a 7.5 KHz square wave come out of one of the data pins > on the printer port. > > I've tried to help myself with this one but searching in the "Python

Re: Counting Threads

2005-10-27 Thread Peter Hansen
David Poundall wrote: > Just sorted (its always the way when you post isn't it) > > But the count isn't doint what I expected. I was after a increment > after every time the class was used ireespective of instance. I have no idea what that last sentence above means... > Instead > I get a coun

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > if name not in expected_form1_kwargs: > raise ValueError, "Unrecognized keyword" + name > elif name in expected_form1_kwargs not in kwargs.keys(): > kwargs.update(name=None) Do you mean this instead? elif name in expected_fo

Re: Message about not deleted folders using Inno Setup

2005-10-30 Thread Peter Hansen
Martin wrote: >I would like to place a message in an uninstaller window which will > inform the user that some folders haven't been deleted. Is that possible > using > Inno Setup? Probably, but this newsgroup is for discussion of Python. Unless you have some kind of Python angle to your que

Re: Xah's edu corner: the Journey of Foreign Characters thru Internet

2005-11-02 Thread Peter Hansen
Mike Meyer wrote: > Xah Leh is incompetent, but > apparently well-intentioned. In your view is that ("well-intentioned") an established fact at this point? I was still waiting for conclusive evidence. So far the evidence appears rather strongly in favour of a verdict of true trollism, which

Re: Flat file, Python accessible database?

2005-11-02 Thread Peter Hansen
Karlo Lozovina wrote: > [EMAIL PROTECTED] (=?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=) wrote in > news:[EMAIL PROTECTED]: > >>If you need it to be SQL-like, SQLite seems to be the right thing. > > Tried that one, but had some problems setting things up. On the other > hand, BerkeleyDB + Pybsddb work

Re: callback for ctypes

2005-11-02 Thread Peter Hansen
David Wahler wrote: > Also, I can't find any references for this "QImage Camera". Could you > post some additional information? Trying "Qimaging" instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing Modules

2005-11-02 Thread Peter Hansen
Walter Brunswick wrote: > What is the best way to import all modules in a directory > (and possibly a subdirectory/subdirectories), possibly including > conditionals, such as regexes? The "best" was, as always, depends on what your use case is. Why do you want to do this? What will you do wi

Re: Importing Modules

2005-11-02 Thread Peter Hansen
Walter Brunswick wrote: > The purpose is rather irrelevant. The purpose of something is not only relevant but essential when someone asks for the "best" way to do it. For example, without knowing anything of your purpose, I could simply say that writing a module with a series of import stateme

Re: Py2Exe produced "binary" shows terminal screen on execution

2005-11-02 Thread Peter Hansen
Thomas W wrote: > I've produced a "binary" version of a python-script using Py2Exe and > when run on WinXP it shows a terminal window for a brief moment then > the window disappears. How can I avoid this? I want the script to run > without being visible at all. You probably used the "console" opti

Re: Flat file, Python accessible database?

2005-11-02 Thread Peter Hansen
Steve Holden wrote: > My experience on Cygwin was that I had to install sqlite before pySqlite > worked. So although the Windows install of Pysqlite bundles a .pyd that includes the statically linked sqlite library, other platforms do not? I agree that would represent a potentially annoying

Re: reading internet data to generate random numbers.

2005-11-02 Thread Peter Hansen
Levi Campbell wrote: > Hi, I'm working on a random number generator using the internet as a > way to gather entropy, I have two questions. > > 1. is there a way to capture the internet stream? What specifically do you mean by the term "internet stream" here? Generally speaking, the internet is n

Re: Hexadecimal Conversion in Python

2005-11-02 Thread Peter Hansen
DaBeef wrote: > I have been coding for 5 years. This is a proprietary protocol, so it > is difficult converting. I did this in java but was just able to > convert a stream. What exactly did you do in Java to get the results you want? Python's library is certainly *not* "limited" in this area,

Re: how to write a blog system with Python

2005-11-02 Thread Peter Hansen
ice wrote: > I am a fresh here , and I have no idea of it. > Do you have any comments? Why do you want to write your own system? There are already lots of blog programs written in Python which you could just use, or customize. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: reading internet data to generate random numbers.

2005-11-03 Thread Peter Hansen
Steven D'Aprano wrote: > On Thu, 03 Nov 2005 15:51:30 +, Grant Edwards wrote: >> >>I've never heard of anybody using the data as source of >>entropy. > > Me neither, but the original poster did ask how to read every nth byte > of "the Internet stream", so I assumed he had something like that

Re: Can Anyone Help me on this

2005-11-03 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > i m trying to reverse the order in which the > strings are stored in list > > then pop it into another list > > what m i doin worng?? > > here's the code: > > list1 = [] > list2 = [] > list1.extend('123456789') How about this instead (Python 2.4 or later): list2 = l

Re: reading internet data to generate random numbers.

2005-11-03 Thread Peter Hansen
Steven D'Aprano wrote: > On Thu, 03 Nov 2005 16:40:43 -0500, Peter Hansen wrote: >>Steven D'Aprano wrote: >> >>>On Thu, 03 Nov 2005 15:51:30 +, Grant Edwards wrote: >>> >>>>I've never heard of anybody using the data as source of >&

Re: putting an Icon in "My Computer"

2005-11-03 Thread Peter Hansen
yaipa wrote: > I've been asked by my boss to put an Icon in WinXP's "My Computer" for > a utility we use around the shop. My tool of choice is of course > Python and therefore what I am using to attempt my given task. I have > no trouble putting Icons in the WinXP Toolbar using Python, but have >

Re: how to call basic browser functions?

2005-11-04 Thread Peter Hansen
BLElliott wrote: > I think this is a very basic question, so feel free to direct me to a > FAQ or other resource to go and get myself educated, if that's the best > answer. > > Can I perform web browser functions from a script, for example, doing > file downloads, if I can construct the file UR

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Peter Hansen
Jeffrey Schwab wrote: > Xah Lee wrote: > >> i've read the official Python tutorial 8 months ago, have spent 30 >> minutes with Python 3 times a week since, have 14 years of computing >> experience, 8 years in mathematical computing and 4 years in unix admin >> and perl > > I can wiggle my ears.

  1   2   3   4   5   6   7   8   9   10   >