ANN: HarvestMan 1.4.5 a2

2005-07-22 Thread Anand
I am glad to announce that the second alpha release of HarvestMan 1.4.5 version is available for download. The first alpha of version 1.4.5 was released on May 27 2005. HarvestMan [http://harvestman.freezope.org] is a multithreaded web crawler program written entirely in Python. It has many

SCF 1.2b1 released

2005-07-22 Thread Philippe C. Martin
I am very please to announce the release of SCF 1.2b1 a Smart Card development system designed in Python: Two major features are being introduced: 1) Support for BasicCard DES/3/DES/AES secure messaging (Beta release 1) . 2) COM Support: access the power of SCF from Visual Basic or your

PyGTK or wxPython (not a flame war) on Windows

2005-07-22 Thread TPJ
GUI's etc: PyGtk on Windows (...) So if someone develops mainly for X and just wants to make sure that it is not impossible to run on Windows, you can use PyGTK. (...), July 2nd, 1999 pyGTK on Windows (...) can i use pyGTK under Windows??? It's probably doable (...) but not worthy in my

Re: PEP on path module for standard library

2005-07-22 Thread mkent
I really love Jason's 'path' module. Sadly, I've encountered a serious problem with using it. When you try to 'freeze' an application module, and Jason's 'path' module is present in any of the directories that are looked at by freeze's module finder (your app doesn't have to import it), freeze

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-22 Thread Sybren Stuvel
TPJ enlightened us with: I'd like to choose PyGTK (because of its rich documentation), but I'm not sure if PyGTK is stable on Windows... For now I know that wxPython runs well on Windows. Don't forget that wxPython looks like Mac on a Mac. That's important too :) Sybren -- The problem with

Re: wxPython Fedora Core 4

2005-07-22 Thread Christophe Lambin
linuxfreak [EMAIL PROTECTED] wrote: Has anyone installed wxPython on Fedora Core 4. Apparently it need the libstdc++.so.5 file while Fedora installs the newer libstdc++.so.6 file. I tried installing the libstdc rpm from fedora core 3 You can install compat-libstdc++-33 (part of FC4), which

Re: PEP on path module for standard library

2005-07-22 Thread Stefan Rank
on 22.07.2005 00:21 Michael Hoffman said the following: Reinhold Birkenfeld wrote: John Roth wrote: Why did Guido want a PEP? He said, Whoa! Do we really need a completely different mechanism for doing the same stuff we can already do? The path module seems mostly useful for folks coming

Re: Detecting computers on network

2005-07-22 Thread Sybren Stuvel
linuxfreak enlightened us with: How about sending an ICMP echo packet to your broadcast address and checking which hosts send a reply Won't work on all boxes. Windows boxes ignore broadcast pings, for example. I'd go for a call to nmap -sP instead, and filter it's output. Sybren -- The

Re: wxPython Fedora Core 4

2005-07-22 Thread Sybren Stuvel
linuxfreak enlightened us with: Has anyone installed wxPython on Fedora Core 4. Apparently it need the libstdc++.so.5 file while Fedora installs the newer libstdc++.so.6 [...] Fedora does not allow multiple versions of the same file. Try Ubuntu Linux, which does allow having libstdc++.so.5

Re: Centering text in a wx.ListBox w/ wxPython

2005-07-22 Thread Franz Steinhaeusler
On 26 Jun 2005 22:34:31 -0700, fo [EMAIL PROTECTED] wrote: How do I center each item in the ListBox widget? Hm, I don't think, this is possilble. Also, is it possible to change the color of the selected item? right now it uses the OSes color. I would like it to be consistant on every

Re: Help with regexp please

2005-07-22 Thread Felix Collins
Christopher Subich wrote: Scott David Daniels wrote: Thanks to you both. Wow! what a quick response! string.rsplit('.',1)[0] Clever Python! ;-) Sorry, I mainly code in C so I'm not very Pythonic in my thinking. Thanks again... Felix -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning histogram-like data for items in a list

2005-07-22 Thread David Isaac
Ric Deez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a list: L1 = [1,1,1,2,2,3] How can I easily turn this into a list of tuples where the first element is the list element and the second is the number of times it occurs in the list (I think that this is referred to as a

Re: Software needed

2005-07-22 Thread David Isaac
niXin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Can anyone direct me to where I can find free software to do the following: Document Management Software --- 1. Written in PHP or Python 2. scanning feature - where I can scan a document

wxPython Fedora Core 4

2005-07-22 Thread linuxfreak
Hi guys, Has anyone installed wxPython on Fedora Core 4. Apparently it need the libstdc++.so.5 file while Fedora installs the newer libstdc++.so.6 file. I tried installing the libstdc rpm from fedora core 3 which would have installed the required file but Fedora does not allow multiple versions

Re: PEP on path module for standard library

2005-07-22 Thread Andrew Dalke
Michael Hoffman wrote: Having path descend from str/unicode is extremely useful since I can then pass a path object to any function someone else wrote without having to worry about whether they were checking for basestring. I think there is a widely used pattern of accepting either a

Re: Help with regexp please

2005-07-22 Thread Christopher Subich
Scott David Daniels wrote: Felix Collins wrote: I have an outline number system like 1 1.2 1.2.3 I want to parse an outline number and return the parent. Seems to me regex is not the way to go: def parent(string): return string[: string.rindex('.')] Absolutely, regex is the

Re: Detecting computers on network

2005-07-22 Thread linuxfreak
How about sending an ICMP echo packet to your broadcast address and checking which hosts send a reply -- http://mail.python.org/mailman/listinfo/python-list

Re: How to limit the uploading file size in python?

2005-07-22 Thread Tim Roberts
praba kar [EMAIL PROTECTED] wrote: In Php we can limit the uploading file size by php.ini configuration file. But In python what way we can limit the file uploading size. kindly let me know. Unlike PHP, Python is a general-purpose language that is not targetted specifically at the web, so

Re: Stupid question: Making scripts python-scripts

2005-07-22 Thread bruno modulix
Jan Danielsson wrote: Hello all, How do I make a python script actually a _python_ in unix:ish environments? I know about adding: #!/bin/sh ..as the first row in a shell script, but when I installed python on a NetBSD system, I didn't get a python executable; only a python2.4

Re: Difference between and '

2005-07-22 Thread Michael Hoffman
Steven D'Aprano wrote: Michael Hoffman wrote: John Machin wrote: [EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? ord(') - ord('') 5 Very zen. But unfortunately incorrect, since the original poster didn't ask for the difference

Re: Web-Forms

2005-07-22 Thread Fuzzyman
Mike Meyer wrote: Mathias Waack [EMAIL PROTECTED] writes: Hi, I need to access some information from a web site which are only accessible through a form. Thus for each bucket of data you have to fill out the form, submit it and wait for an answer. Very easy - if you don't have to

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Stefan Rank wrote: on 22.07.2005 00:21 Michael Hoffman said the following: Any Java hackers here want to tell us of the wonders of the Java Path class? no such thing exists. there is only the `File` class that incorporates a little bit of the `path` functionality and some of the python

Re: wxPythin installation woes

2005-07-22 Thread Martin Franklin
linuxfreak wrote: Hi all, Was working with python 2.3 in a fedora core 3 machine. I upgraded it to Fedora Core 4 with a clean install. So now I have python 2.4 installed. But when I try to install wxPython for python 2.4 using an rpm file i downloaded from the wxpython web site i get

Re: Lots of pdf files

2005-07-22 Thread Richie Hindle
[Duncan] a mere $29.90, except it is GPL'd so I'm not sure what the money is for Tech support [...] free forever for registered users. But I've often wondered whether you could charge for mass-market GPL software simply because your ordinary punter doesn't know what the GPL is, and doesn't

Re: is this pythonic?

2005-07-22 Thread Caleb Hattingh
Terry Yes, I must agree with you that it is something I should know. I do try to keep with things but there are always some things that slip through the cracks, like enumerate, in this case. That is why I am extremely grateful the for the activity, generosity and pure knowledge on this

Re: Difference between and '

2005-07-22 Thread John Machin
[EMAIL PROTECTED] wrote: Hi, Can someone tell me the difference between single quote and double quote? ord(') - ord('') 5 or ask a meaningful question ... -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Reinhold Birkenfeld wrote: FYI: I modified the path module a bit so that it fits many of the suggestions from python-dev, and put the result in the Python CVS tree under nondist/sandbox/path. Most prominent change is that it doesn't inherit from str/unicode anymore. I found this distinction

Re: PEP on path module for standard library

2005-07-22 Thread Reinhold Birkenfeld
Michael Hoffman wrote: Reinhold Birkenfeld wrote: FYI: I modified the path module a bit so that it fits many of the suggestions from python-dev, and put the result in the Python CVS tree under nondist/sandbox/path. Most prominent change is that it doesn't inherit from str/unicode anymore.

Re: PEP on path module for standard library

2005-07-22 Thread Reinhold Birkenfeld
Michael Hoffman wrote: [EMAIL PROTECTED] wrote: I really love Jason's 'path' module. Sadly, I've encountered a serious problem with using it. When you try to 'freeze' an application module, and Jason's 'path' module is present in any of the directories that are looked at by freeze's module

Re: PEP on path module for standard library

2005-07-22 Thread Reinhold Birkenfeld
John Roth wrote: Michael Hoffman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Many of you are familiar with Jason Orendorff's path module http://www.jorendorff.com/articles/python/path/, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the Python

dictionary that discards old items

2005-07-22 Thread Will McGugan
Hi folks, I need a collection class that behaves like a dictionary but when it reaches 'n' items it discards the oldest item so that the length never goes above 'n'. (Its for caching search results) I have a vague memory of a module that does this, but I cant remember where I read about it.

Re: dictionary that discards old items

2005-07-22 Thread Michael Hoffman
Will McGugan wrote: I need a collection class that behaves like a dictionary but when it reaches 'n' items it discards the oldest item so that the length never goes above 'n'. (Its for caching search results) I have a vague memory of a module that does this, but I cant remember where I

Re: Couple quick questions from a Python Noob

2005-07-22 Thread digitalsubjunctive
Thanks you to. Oh, and it is .pyw, you're right. -- http://mail.python.org/mailman/listinfo/python-list

problem with string

2005-07-22 Thread Tzanko Tzanev
hi :) I need some help for this script I have cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = '' for record in result: mp3id = record[0] mp3_title = record[1] mp3_artist = record[2]

Re: goto

2005-07-22 Thread Mike Meyer
Rocco Moretti [EMAIL PROTECTED] writes: My favorite infinte loop with while is: i = 0 while i 20: do_process(i) Note the prominent *lack* of any change to i here? Oh, for: from i = 0 invariant 0 = i = 20 variant 21 - i until i 19 loop

Re: Generating images with text in them

2005-07-22 Thread Mike Meyer
[EMAIL PROTECTED] (phil hunt) writes: On Thu, 21 Jul 2005 02:44:03 -0500, Terry Hancock [EMAIL PROTECTED] wrote: While bitmap font files are not copyrightable, there are license issues with most of the nicer fonts you are probably talking about. Oh? I can understand them being copyrighted; but

Re: Returning histogram-like data for items in a list

2005-07-22 Thread Michael Hoffman
Ric Deez wrote: Hi there, I have a list: L1 = [1,1,1,2,2,3] How can I easily turn this into a list of tuples where the first element is the list element and the second is the number of times it occurs in the list (I think that this is referred to as a histogram): i.e.: L2 =

Re: problem with string

2005-07-22 Thread John Machin
Tzanko Tzanev wrote: hi :) I need some help for this script I have cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = '' for record in result: mp3id = record[0] mp3_title =

Re: Returning histogram-like data for items in a list

2005-07-22 Thread George Sakkis
Michael Hoffman [EMAIL PROTECTED] wrote: Ric Deez wrote: Hi there, I have a list: L1 = [1,1,1,2,2,3] How can I easily turn this into a list of tuples where the first element is the list element and the second is the number of times it occurs in the list (I think that this is

Re: Stupid question: Making scripts python-scripts

2005-07-22 Thread Mike Meyer
Bill Mill [EMAIL PROTECTED] writes: On 7/21/05, Jan Danielsson [EMAIL PROTECTED] wrote: Hello all, How do I make a python script actually a _python_ in unix:ish environments? I know about adding: #!/bin/sh ..as the first row in a shell script, but when I installed python on a

Re: PEP on path module for standard library

2005-07-22 Thread Neil Hodgson
Reinhold Birkenfeld: And it is much more Pythonic in my eyes. Though that word may be inaccurate when it comes from someone else that Guido, I feel that endless chains of '[os.path.join(os.path.join(z, a), x) for x in os.path.listdir(os.path.join(z, a) if os.path.isfile(os.path.join(

Returning histogram-like data for items in a list

2005-07-22 Thread Ric Deez
Hi there, I have a list: L1 = [1,1,1,2,2,3] How can I easily turn this into a list of tuples where the first element is the list element and the second is the number of times it occurs in the list (I think that this is referred to as a histogram): i.e.: L2 = [(1,3),(2,2),(3,1)] I was doing

Re: PEP on path module for standard library

2005-07-22 Thread George Sakkis
John Roth [EMAIL PROTECTED] wrote: Reinhold Birkenfeld [EMAIL PROTECTED] wrote He said, Whoa! Do we really need a completely different mechanism for doing the same stuff we can already do? The path module seems mostly useful for folks coming from Java who are used to the Java Path

Re: problem with string

2005-07-22 Thread Bruno Desthuilliers
Tzanko Tzanev a écrit : hi :) I need some help for this script I have please take care of indentation when posting code. cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = ''

Re: Returning histogram-like data for items in a list

2005-07-22 Thread jeethu_rao
Adding to George's reply, if you want slightly more performance, you can avoid the exception with something like def hist(seq): h = {} for i in seq: h[i] = h.get(i,0)+1 return h.items() Jeethu Rao -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between and '

2005-07-22 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? One has double the fun. -- Erik Max Francis [EMAIL PROTECTED] http://www.alcyone.com/max/ San Jose, CA, USA 37 20 N 121 53 W AIM erikmaxfrancis Forgive your enemies, but never forget

Help with regexp please

2005-07-22 Thread Felix Collins
Hi, I'm not a regexp expert and had a bit of trouble with the following search. I have an outline number system like 1 1.2 1.2.3 1.3 2 3 3.1 etc. I want to parse an outline number and return the parent. So for example... parent(1.2.3.4) returns 1.2.3 The only way I can figure is to do

Re: dictionary that discards old items

2005-07-22 Thread Raymond Hettinger
[Will McGugan] I need a collection class that behaves like a dictionary but when it reaches 'n' items it discards the oldest item so that the length never goes above 'n'. (Its for caching search results) import collections class Cache(dict): def __init__(self, n, *args, **kwds):

Re: Help with regexp please

2005-07-22 Thread Scott David Daniels
Felix Collins wrote: Hi, I'm not a regexp expert and had a bit of trouble with the following search. I have an outline number system like 1 1.2 1.2.3 I want to parse an outline number and return the parent. Seems to me regex is not the way to go: def parent(string): return

Re: PEP on path module for standard library

2005-07-22 Thread Duncan Booth
George Sakkis wrote: Read literally, this says (at least to me) I don't want to fix it because I don't think it's broke. Or rather I prefer a single existing mediocre solution than two solutions (even if the second was better). Except that he is open to persuasion, so the PEP has to

Re: problem with string

2005-07-22 Thread Michael Hoffman
Tzanko Tzanev wrote: #but there is an error in playlist_txt += mp3id + mp3_title + mp3_artist It'd be a lot easier to help if you'd say what the error was. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Duncan Booth wrote: You should need an explicit call to convert a path to a string and that forces you when passing the path to something that requires a string to think whether you wanted the string relative, absolute, UNC, uri etc. Egad. I'm not sure if that will really make people's

Re: RegUnloadkey access denied

2005-07-22 Thread future_retro
I've worked out that I can open and close the key fine if I don't open a subkey. I've tried adding flush and close statements after opening the key and still get access denied when trying to unload. -- http://mail.python.org/mailman/listinfo/python-list

Re: httplib/HTTPS Post Problem

2005-07-22 Thread michaelparkin
Thanks for the replies, Andreas and Peter. Andreas Kostyrka wrote: snip Just a curious guess: Are you behind a proxy? If so, it's a known and never fixed bug from Python 1.5 times ;) No, I'm not behind a proxy - the server is on the same PC as my client (while I'm testing!). You might also

Multithreaded class with queues

2005-07-22 Thread Antal Rutz
Hi! I wrote a little class to make multihreading easier. It's based on one of aahz's threading example scripts. What it does: It spawns up number of CollectorThreads and one ProcessThread. The CollectorThreads listen on one queue (inputqueue), read, process the data (with colfunc), put the

Re: PEP on path module for standard library

2005-07-22 Thread Thomas Heller
[EMAIL PROTECTED] writes: I really love Jason's 'path' module. Sadly, I've encountered a serious problem with using it. When you try to 'freeze' an application module, and Jason's 'path' module is present in any of the directories that are looked at by freeze's module finder (your app

Re: Web-Forms

2005-07-22 Thread Michele Simionato
Use twill:http://www.idyll.org/~t/www-tools/twill.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting computers on network

2005-07-22 Thread Peter Tillotson
You could use a sniffer in promiscuous mode. pypcap -- or something like. This will record every packet seen by your network card. Whether is will work depends on whether you are on a true braodcast network. if a box is on and completely inactive you'll never see it, but most boxes do

Get directory from http web site

2005-07-22 Thread rock69
Hi all :) I was wondering if there's some neat and easy way to get the entire contents of a directory at a specific web url address. I have the following link: http://www.infomedia.it/immagini/riviste/covers/cp and as you can see it's just a list containing all the files (images) that I need.

Web frame systems vs. pure Python

2005-07-22 Thread Lad
I am thinking about a new project and I do not know if I should use Python with HTML code only or use a web frame such as Cherry or a similar ( which one then??) and a template system. Can you please explain what I will get / lose if I use a web frame system? Thanks a lot La. --

Re: dictionary that discards old items

2005-07-22 Thread Tim Williams (gmail)
On 7/21/05, Michael Hoffman [EMAIL PROTECTED] wrote: Will McGugan wrote: I need a collection class that behaves like a dictionary but when it reaches 'n' items it discards the oldest item so that the length never goes above 'n'. (Its for caching search results) I have a vague memory

Re: RegUnloadkey access denied

2005-07-22 Thread future_retro
solved it! I need to close the key first import ntsecuritycon import win32security import win32api import _winreg import win32con flags = ntsecuritycon.TOKEN_ADJUST_PRIVILEGES | ntsecuritycon.TOKEN_QUERY htoken = win32security.OpenProcessToken(win32api.GetCurrentProcess(), flags) Loadid =

find a specified dictionary in a list

2005-07-22 Thread Odd-R.
I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same form, and all the oids are distinct. If I have an oid and the list, how is the simplest way of getting the dictionary that holds this oid? Thanks in

Re: PEP on path module for standard library

2005-07-22 Thread Harald Armin Massa
When you try to 'freeze' an application module, and Jason's 'path' module is present in any of the directories that are looked at by freeze's module finder (your app doesn't have to import it), freeze goes into an infinite loop of imports, eventually getting a 'maximum recursion depth' exception.

Re: Cursor navigation

2005-07-22 Thread TA
Andy Dustman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is untrue: cursor.scroll() is an optional DB-API 2.0 extension. http://www.python.org/peps/pep-0249.html MySQLdb supports this, but I do not know about your case. Yes 'cursor.scroll()' is optional and pySqlite

Re: PEP on path module for standard library

2005-07-22 Thread Harald Armin Massa
Having path descend from str/unicode is extremely useful since I can then pass a path object to any function someone else wrote without having to worry about whether they were checking for basestring. I use path.py from Jason to encapsulate a lot of the windows plattform specialities of path

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same form, and all the oids are distinct. If I have an oid and the list, how is the simplest way of getting the dictionary that holds this

Re: Web frame systems vs. pure Python

2005-07-22 Thread Rob Cowie
I don't know what your project is, but a web framework might make your system more scalable and maintainable if it gets larger. They often provide useful mechanisms for maintaining state and persistance. Template systems IMHO should be considered separately from App frameworks (although they may

Separation of Code in CGI App

2005-07-22 Thread Rob Cowie
Hi, I need to create a planner/calendar system using python cgi scripts. It is my first CGI app (beyond a few tutorial examples). I wish to separate the code according to function. For instance, the code to handle the DB connection, SQL querying, HTML form variable retrieval, rendering of HTML

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-07-22 Thread Dean N. Williams
Hi Jason, I downloaded your new Cygwin from http://cygwin.com and tried to build install Python/CDAT again. It appears to have built properly, but when I try to execute, it receive a sock error. How do I get around this problem? When I built Cygwin, I instructed it to install

Re: wxPython Fedora Core 4

2005-07-22 Thread Sybren Stuvel
Christophe Lambin enlightened us with: However, since your wxPython package wasn't built for FC4, you may run into other problems. That should be solved by recompiling the wxPython RPMs. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Get directory from http web site

2005-07-22 Thread Sybren Stuvel
rock69 enlightened us with: I was wondering if there's some neat and easy way to get the entire contents of a directory at a specific web url address. [...] Is it possible to retrieve this list (not the physical files) and have it stored in a variable of type list or something? Check out the

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
John Machin wrote: Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same form, and all the oids are distinct. If I have an oid and the list, how is the simplest way of getting the

Python on a public library computer

2005-07-22 Thread Anton Vredegoor
This is about how to start a Python interpreter on a very locked down library computer. Some time ago I started a thread about it.(Google won't let me reply to older topics so I'm starting a new topic with the same title) A few days ago I found a Jython console applet that can be run from a

Re: find a specified dictionary in a list

2005-07-22 Thread Odd-R.
On 2005-07-22, John Machin [EMAIL PROTECTED] wrote: Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same form, and all the oids are distinct. If I have an oid and the list, how is the

Re: Difference between and '

2005-07-22 Thread Peter Hansen
Steven D'Aprano wrote: It may shock some people to learn that difference in the sense of mathematical subtraction is not the only meaning of the word, but there it is. One wouldn't, I hope, misunderstand What is the difference between spaghetti marinara and spaghetti pescatora? and attempt

ANN: Spyce 2.0.3

2005-07-22 Thread Jonathan Ellis
Spyce 2.0.3 released Spyce is a python web application server, combining features of popular frameworks such as ASP.NET and JSP with Pythonic elegance. Spyce may be deployed as a standalone server, proxied behind Apache, under mod_python, FastCGI, or CGI. Spyce 2.0 includes features unique to

Re: find a specified dictionary in a list

2005-07-22 Thread John Machin
Odd-R. Hogstad wrote (in private e-mail, with scarcely private contents): In comp.lang.python, you wrote: Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same

Re: Python on a public library computer

2005-07-22 Thread Sybren Stuvel
Anton Vredegoor enlightened us with: Some time ago I started a thread about it.(Google won't let me reply to older topics so I'm starting a new topic with the same title) Why not use a proper Usenet client? A few days ago I found a Jython console applet that can be run from a webpage: Nice!

tuple to string?

2005-07-22 Thread Francois De Serres
hiho, what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to the string 'spam'? TIA, Francois -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on a public library computer

2005-07-22 Thread Robert Kern
Sybren Stuvel wrote: Anton Vredegoor enlightened us with: Some time ago I started a thread about it.(Google won't let me reply to older topics so I'm starting a new topic with the same title) Why not use a proper Usenet client? Because he's on a public computer without one installed? --

Re: Difference between and '

2005-07-22 Thread François Pinard
[EMAIL PROTECTED] Can someone tell me the difference between single quote and double quote? There is no strong reason to use one and avoid the other. Yet, while representing strings, Python itself has a _preference_ for single quotes. Programmers can put this duality to good use, by adopting

command line argument passing

2005-07-22 Thread Hayri ERDENER
hi to all, is it possible in python to pass arguments by using command prompt in windows 2000 and XP ? for example: sourceCode.py factorial 4 gives me the factorial of 4 namely 24. best regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between and '

2005-07-22 Thread François Pinard
[Robert Kern] One habit that seems to crop up, though, is that I will use '' for internal strings and for strings that will eventually get seen by the user. Don't ask me why. One sure thing is that it would help, later, if you ever want to internationalise a Python program. Not that it

Re: tuple to string?

2005-07-22 Thread Jason Drew
''.join((chr(e) for e in (0x73, 0x70, 0x61, 0x6D))) -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple to string?

2005-07-22 Thread Robert Kern
Francois De Serres wrote: hiho, what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to the string 'spam'? In [1]: t = (0x73, 0x70, 0x61, 0x6D) In [2]: ''.join(chr(x) for x in t) Out[2]: 'spam' -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows

Re: PEP on path module for standard library

2005-07-22 Thread Peter Hansen
Duncan Booth wrote: Personally I think the concept of a specific path type is a good one, but subclassing string just cries out to me as the wrong thing to do. In other words, to me a path represents something in a filesystem, the fact that it has one, or indeed several string

Re: tuple to string?

2005-07-22 Thread Peter Hansen
Francois De Serres wrote: hiho, what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to the string 'spam'? mytuple = (0x73, 0x70, 0x61, 0x6D) ''.join(chr(v) for v in mytuple) 'spam' -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple to string?

2005-07-22 Thread deelan
Francois De Serres wrote: hiho, what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to the string 'spam'? one way is to use a list expression: ''.join([chr(c) for c in (0x73, 0x70, 0x61, 0x6D)]) 'spam' another is to use map: ''.join(map(chr, (0x73, 0x70, 0x61,

Re: command line argument passing

2005-07-22 Thread Peter Hansen
Hayri ERDENER wrote: hi to all, is it possible in python to pass arguments by using command prompt in windows 2000 and XP ? for example: sourceCode.py factorial 4 gives me the factorial of 4 namely 24. Yes, the arguments are available as a list in sys.argv . Remember that you need to

Re: command line argument passing

2005-07-22 Thread gene tani
just remember: sys.argv[0] == script name http://www.artima.com/weblogs/viewpost.jsp?thread=4829 -- http://mail.python.org/mailman/listinfo/python-list

Re: command line argument passing

2005-07-22 Thread Dennis Benzinger
Hayri ERDENER schrieb: hi to all, is it possible in python to pass arguments by using command prompt in windows 2000 and XP ? for example: sourceCode.py factorial 4 gives me the factorial of 4 namely 24. best regards import sys print sys.argv Or use the optparse module. Docs:

broken links

2005-07-22 Thread rbt
How can I find broken links (links that point to files that do not exist) in a directory and remove them using Python? I'm working on RHEL4 Thanks, rbt -- http://mail.python.org/mailman/listinfo/python-list

Re: find a specified dictionary in a list

2005-07-22 Thread Christopher Subich
Odd-R. wrote: On 2005-07-22, John Machin [EMAIL PROTECTED] wrote: Odd-R. wrote: I have this list: [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}] All the dictionaries of this list are of the same form, and all the oids are distinct. If I have an oid and

is this possible?

2005-07-22 Thread scrimp
Is it possible to print a PDF file using python without having acrobat reader installed on the machine?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between and '

2005-07-22 Thread John Machin
Peter Hansen wrote: Steven D'Aprano wrote: It may shock some people to learn that difference in the sense of mathematical subtraction is not the only meaning of the word, but there it is. One wouldn't, I hope, misunderstand What is the difference between spaghetti marinara and spaghetti

Re: broken links

2005-07-22 Thread rbt
I found it: os.path.exists(path) On Fri, 2005-07-22 at 09:22 -0400, rbt wrote: How can I find broken links (links that point to files that do not exist) in a directory and remove them using Python? I'm working on RHEL4 Thanks, rbt -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary that discards old items

2005-07-22 Thread Michael Hoffman
Will McGugan wrote: You want a Least Recently Used, or LRU, cache. Here's one: Thanks. I found the one I saw originally in the Python Cookbook. Only they call it a FIFO cache. A FIFO cache is different, as gene tani points out. You need to consider which one it is you want. -- Michael

time.time() under load between two machines

2005-07-22 Thread kwharrigan
I am working on some code using python and a distributed system. Some particular message is sent on one machine (with a timestamp logged) and after the message is received, a timestamp is made. I am having problems with negative latencies happening under intense CPU load. There is ntp sync

Re: time.time() under load between two machines

2005-07-22 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: I am working on some code using python and a distributed system. Some particular message is sent on one machine (with a timestamp logged) and after the message is received, a timestamp is made. I am having problems with negative latencies happening under intense CPU

  1   2   3   >