Re: urllib2: handle an error (302)

2007-09-11 Thread Antoni Villalonga
2007/9/11, O.R.Senthil Kumaran: > > When urllib2 libs visit a URL with 302 error follow the location > > automatically. I need to get the location in order to get the full > > URL (not relative URL) parsing html code. > > urllib2 automatically handles the 302 redirection. What you get as the end

Re: Car-ac-systems

2007-09-11 Thread Dave Hansen
On Sep 11, 12:42 pm, Zentrader <[EMAIL PROTECTED]> wrote: > > What is it about "please do not top-post" that you have difficulty > understanding? Or do "MVP"s feel that their time is so much more > valuable than anyone else's that they are free to ignore the norms? > > Who made this the norm? htt

Re: Best way to do attribute docstrings?

2007-09-11 Thread Ken Kuhlman
Thanks for the response! It was just the kick I needed to realize that I was letting my frustration get the best of me and that I was going down a dead-end. I blame the fact that I was coding on little sleep :-) I went with the solution of giving a naming convention to the docstrings and relyin

Re: Python Database Apps

2007-09-11 Thread Tom Brown
On Monday 10 September 2007 19:52, [EMAIL PROTECTED] wrote: > Kindof a poll, kindof curiosity... > > What is your favorite python - database combination? I'm looking to > make an app that has a local DB and a server side DB. I'm looking at > python and sqlite local side and sql server side. > > A

Re: Python Database Apps

2007-09-11 Thread Jonathan Gardner
On Sep 11, 1:07 pm, Tom Brown <[EMAIL PROTECTED]> wrote: > > I have had a lot of good luck with PostgreSQL. It is easy to install and use. > It is also very stable. It maybe overkill for a client side database. The > psycopg package makes interfacing to PostgreSQL very easy and there is a > package

Compiler Python

2007-09-11 Thread anton a
Hello Someone knows since as I can obtain the information detailed about the compiler of Python? (Table of tokens, lists of productions of the syntactic one , semantic restrictions...) Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Database Apps

2007-09-11 Thread Jonathan Gardner
On Sep 11, 1:39 pm, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > > For client-side apps, managing a PostgreSQL installation might be > asking too much. But for a web site or web service, I absolutely > recommend it. I should mention that I wrote a medical billing software app (client side--PyQt)

Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
I have done what I wanted, but I think there must be a much better way. Given two timestamps in the following format, I just want to figure out how far apart they are (in days, seconds, whatever). Format: -MM-DD_MM:SS Example: 2007-09-11_16:41 It seems to me that to do what I want, I need

Re: Car-ac-systems

2007-09-11 Thread J. Clifford Dyer
On Tue, Sep 11, 2007 at 07:50:33PM +0100, John Timney (MVP) wrote regarding Re: Car-ac-systems: > > "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Tue, 11 Sep 2007 17:42:53 +, Zentrader wrote: > > > >> > >> What is it about "please do not top

Python.org mirror

2007-09-11 Thread Stream Service || Mark Scholten
Dear sir, madam, Stream Service would be happy to provide a free mirror for python.org. We also host nl.php.net for free and we are happy to support more opensource websites with free hosting. Could you inform me about the options to become an officiel python.org mirror? With kind regards, Met

Re: creating really big lists

2007-09-11 Thread Bruno Desthuilliers
Dr Mephesto a écrit : > On Sep 8, 8:06 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>Dr Mephesto a écrit : >> >> >>>Hi! >> >>>I would like to create a pretty big list of lists; a list 3,000,000 >>>long, each entry containing 5 empty lists. My application will append >>>data each of the

Re: Compiler Python

2007-09-11 Thread Bjoern Schliessmann
anton a wrote: > Someone knows since as I can obtain the information detailed about > the compiler of Python? (Table of tokens, lists of productions of > the syntactic one , semantic restrictions...) I'm not really about the syntax of your question, but I'd try looking at the source code. Regards

Re: Car-ac-systems

2007-09-11 Thread John J. Lee
"John Timney (MVP)" <[EMAIL PROTECTED]> writes: [...] > I like top posted threads, its my preferred response method - and actually [...] http://en.wikipedia.org/wiki/Apostrophe#English_language_usage John -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Grant Edwards
On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote: > I have done what I wanted, but I think there must be a much better way. See the strptime() function in either the time or the datetime modules: http://docs.python.org/lib/module-time.html http://docs.python.org/lib/module-datetime.html

Re: Py2.5.1 on Ubuntu AMD X2, unicode problems

2007-09-11 Thread Martin v. Löwis
> I'm building 2.5.1 from source, using the ubuntu(7.0.4)-provided gcc > 4.1.2. Something must be terribly wrong with your system if you have to go through such hassles. It should build out of the box, and does for me on Debian. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-l

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Bruno Desthuilliers
Shawn Milochik a écrit : > I have done what I wanted, but I think there must be a much better way. > > Given two timestamps in the following format, I just want to figure > out how far apart they are (in days, seconds, whatever). > > Format: > > -MM-DD_MM:SS > > Example: > 2007-09-11_16:41

Re: Compiler Python

2007-09-11 Thread Martin v. Löwis
> Someone knows since as I can obtain the information detailed about the > compiler of Python? (Table of tokens, lists of productions of the > syntactic one , semantic restrictions...) The EBNF grammar is in Grammar/Grammar; this also implies the list of tokens. Another list of tokens in Include/t

Re: Compiler Python

2007-09-11 Thread Bruno Desthuilliers
Bjoern Schliessmann a écrit : > anton a wrote: > >>Someone knows since as I can obtain the information detailed about >>the compiler of Python? (Table of tokens, lists of productions of >>the syntactic one , semantic restrictions...) > > > I'm not really about the syntax of your question, lol !

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote: > > > I have done what I wanted, but I think there must be a much better way. > > See the strptime() function in either the time or the datetime > modules: > > http://docs.python.org/lib/

Re: Python Database Apps

2007-09-11 Thread Ivo
[EMAIL PROTECTED] wrote: > Kindof a poll, kindof curiosity... > > What is your favorite python - database combination? I'm looking to > make an app that has a local DB and a server side DB. I'm looking at > python and sqlite local side and sql server side. > > Any suggestions > > Darien >

Re: Python Database Apps

2007-09-11 Thread David
> It would help to get a feel of what is the most popular combination > for people to develop their apps. It's gonna be a desktop app. The > database engine is going to be the critical component. I like sqlite > so that I don't need a database server on the client side. It would > help though i

Re: Python Database Apps

2007-09-11 Thread Bruno Desthuilliers
Tom Brown a écrit : > On Monday 10 September 2007 19:52, [EMAIL PROTECTED] wrote: > >>Kindof a poll, kindof curiosity... >> >>What is your favorite python - database combination? I'm looking to >>make an app that has a local DB and a server side DB. I'm looking at >>python and sqlite local side

Re: Python.org mirror

2007-09-11 Thread Terry Reedy
|Could you inform me about the options to become an officiel python.org mirror? The main python.org site maintainers do not necessarily read this group/list. If no response here, try [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Database Apps

2007-09-11 Thread Harry George
Tom Brown <[EMAIL PROTECTED]> writes: > On Monday 10 September 2007 19:52, [EMAIL PROTECTED] wrote: >> Kindof a poll, kindof curiosity... >> >> What is your favorite python - database combination? I'm looking to >> make an app that has a local DB and a server side DB. I'm looking at >> python an

Re: Python Database Apps

2007-09-11 Thread Steve Holden
Harry George wrote: > Tom Brown <[EMAIL PROTECTED]> writes: > >> On Monday 10 September 2007 19:52, [EMAIL PROTECTED] wrote: >>> Kindof a poll, kindof curiosity... >>> >>> What is your favorite python - database combination? I'm looking to >>> make an app that has a local DB and a server side DB.

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Steve Holden
Shawn Milochik wrote: > On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote: >> >>> I have done what I wanted, but I think there must be a much better way. >> See the strptime() function in either the time or the datetime >> modules: >> >>

Re: Python.org mirror

2007-09-11 Thread Stream Service || Mark Scholten
Hello, Thank you for the information, I will also contact them. With kind regards, Met vriendelijke groet, Mark Scholten Stream Service Web: http://www.streamservice.nl/ E-mail: [EMAIL PROTECTED] NOC: http://www.mynoc.eu/ NOC e-mail: [EMAIL PROTECTED] Tel.: +31 (0)642 40 86 02 Fax: +31 (0)20 20

Re: Python.org mirror

2007-09-11 Thread Steve Holden
Stream Service || Mark Scholten wrote: > Dear sir, madam, > > Stream Service would be happy to provide a free mirror for python.org. > We also host nl.php.net for free and we are happy to support more > opensource websites with free hosting. > > Could you inform me about the options to become

Re: Need a KDE app, where to find a coder?

2007-09-11 Thread Dotan Cohen
On 11/09/2007, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Dotan Cohen schrieb: > > I need an application, and I'd like it to be written in Python with QT > > as I am a KDE user. I simply don't have the time to code it myself, as > > I've been trying to find the time for half a year now. > > > >

Re: Enum class with ToString functionality

2007-09-11 Thread Steven D'Aprano
On Mon, 10 Sep 2007 18:03:11 -0700, TheFlyingDutchman wrote: >> I'd like to know if the Cheeseshop package 'enum' is useful to you. Any >> constructive feedback would be appreciated. >> >> http://cheeseshop.python.org/pypi/enum/> > > Looking at the documentation it looks excellent. But I don'

Re: Speed of Python

2007-09-11 Thread Dick Moores
At 09:42 AM 9/7/2007, wang frank wrote: >Are there any way to speed it up? How about psyco? Dick Moores XP, Python 2.5.1, editor is Ulipad -- http://mail.python.org/mailman/listinfo/python-list

common/static code

2007-09-11 Thread brien colwell
hey all, I have a slew of functions that are shared across several scripts. What's the best way to factor them out into a single location? many thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Problem

2007-09-11 Thread Wiseman
Hi, OK - it works in WindowsXP. I installed "enchant" on my SuSE 10.0 (using YAST). The enchant Suse package looks like a general Linux package, not a Python specific. Running the program in Python I am getting the same error message from the line: "import enchant". ImportError: No module nam

Twisted Life version 1.0.0 (stable) released

2007-09-11 Thread Paul Reiners
Version 1.0.0 of Twisted Life has just been released. Twisted Life is a video game that uses a variant of Conway's Life cellular automaton as its universe. In Twisted Life, you try to navigate to the center of the Twisted Life universe without colliding into any of the malevolent, evil Life forms

Re: How to insert in a string @ a index

2007-09-11 Thread Karthik Gurusamy
On Sep 8, 11:02 am, [EMAIL PROTECTED] wrote: > Hi; > > I'm trying to insert XYZ before a keyword in a string. The first and > the last occurence of hello in the string t1 (t1="hello world hello. > hello \nwhy world hello") are keywords. So after the insertion of XYZ > in this string, the result sho

__getattr__ and static vs. instantiated

2007-09-11 Thread tvaughan
Hi, Let's say I have: class Persistable(object): __attrs__ = {} def __getattr__(self, name): if name in self.__attrs__: return self.__attrs__[name]['value'] else: return Object.__getattr__(self, name

Re: common/static code

2007-09-11 Thread Steve Holden
brien colwell wrote: > hey all, > > I have a slew of functions that are shared across several scripts. > What's the best way to factor them out into a single location? > > many thanks > Define the functions in a module (e.g. myModule.py) then import them as from myModule inport fun1, fun2, fu

Re: Help With PyParsing of output from win32pdhutil.ShowAllProcesses()

2007-09-11 Thread Steve
Hi All, I did a lot of digging into the code in the module, win32pdhutil, and decided to create some custom methods. added to : import win32pdhutil def ShowAllProcessesAsList(): object = find_pdh_counter_localized_name("Process") items, instances = win32pdh.EnumObjectItems(None,None,

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
> > I suppose really oneDay should be a global (i.e. outside the function > definition). Apart from that it would be hard to improve on: obvious, > easy to read, in short - pythonic. > > Are you concerned about daylight savings? That could certainly introduce > a whole new level of complexity into

wx module?

2007-09-11 Thread Dotan Cohen
Where can I find a wx module for Python? I'm trying to run taskcoach, but I cannot find this package. Thanks. [EMAIL PROTECTED]:~/Desktop/todo-manager-0.75.1/todo-manager-0.75.1$ taskcoach.py Traceback (most recent call last): File "/usr/bin/taskcoach.py", line 24, in import wx ImportError:

Re: wx module?

2007-09-11 Thread Dotan Cohen
False alarm, found it, sorry... -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.5 problems

2007-09-11 Thread Brian
Was not specific about my process. Yes, I did use the 'formal' windoze uninstall using Add/Remove Programs. I ran the same code and idle at work (XP Pro/SP2/Python 2.4) with no problems. My next step is to install python 2.5 at work. My Linux partition has Python 2.4, and I do not use idle on

Re: cpython list __str__ method for floats

2007-09-11 Thread [david]
Bjoern Schliessmann wrote: > [david] wrote: >> returns poorly formatted values: > > Please explain. > >> >>>str(13.3) >> '13.3' >> >>>str([13.3]) >> '[13.301]' > > This is quite a FAQ. > > str of a float returns the float, rounded to decimal precision. > > str of a list returns a

Re: function to do dynamic import?

2007-09-11 Thread bambam
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sep 10, 10:52 pm, "bambam" <[EMAIL PROTECTED]> wrote: >> import works in the main section of the module, but does >> not work as I hoped when run inside a function. >> >> That is, the modules import correctly, but are not visible to

Re: "Variable variable name" or "variable lvalue"

2007-09-11 Thread inmmike
On Aug 19, 1:10 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Aug 15, 1:42 pm, mfglinux <[EMAIL PROTECTED]> wrote: > > >> Hello to everybody > > >> I would like to know how to declare in python a "variable name" that > >> it is in turn a variable > >> In bash shell I

Re: function to do dynamic import?

2007-09-11 Thread bambam
"J. Cliff Dyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > bambam wrote: >> import works in the main section of the module, but does >> not work as I hoped when run inside a function. >> >> That is, the modules import correctly, but are not visible to >> the enclosing (global)

Get Only the Last Items in a Traceback

2007-09-11 Thread [EMAIL PROTECTED]
I'm running code via the "exec in context" statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python interactive interpreter does, but only show the part of the traceback relating to the code sent to exec. For e

Re: function to do dynamic import?

2007-09-11 Thread bambam
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > bambam wrote: >> import works in the main section of the module, but does >> not work as I hoped when run inside a function. >> >> That is, the modules import correctly, but are not visible to >> the enclosing (global) s

Get the complete command line as-is

2007-09-11 Thread wangzq
Hello, I'm passing command line parameters to my browser, I need to pass the complete command line as-is, for example: test.py "abc def" xyz If I use ' '.join(sys.argv[1:]), then the double quotes around "abc def" is gone, but I need to pass the complete command line ("abc def" xyz) to the brows

Re: "Variable variable name" or "variable lvalue"

2007-09-11 Thread Roberto Bonvallet
On Aug 15, 4:19 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > If you want to simplify things somewhat you can merge the two loops into > one: > > numbers = [12.5, 25, 12.5] > accu = Material(numbers[0]) > for x in numbers[1:]: > accu += Material(x) > period = Slab(accu) Bett

Re: function to do dynamic import?

2007-09-11 Thread Steve Holden
bambam wrote: [...] > def gim(self): > for gamel in self.gamel_list: > __import__(gamel['file']) > > Works as hoped for. I did a web search for 'dynamic import' and > the only examples I found used exec. > > Thanks > Cool. You're getting there! regards Steve -- Steve Holden

Re: Get the complete command line as-is

2007-09-11 Thread Steve Holden
wangzq wrote: > Hello, > > I'm passing command line parameters to my browser, I need to pass the > complete command line as-is, for example: > > test.py "abc def" xyz > > If I use ' '.join(sys.argv[1:]), then the double quotes around "abc > def" is gone, but I need to pass the complete command l

Python 3K or Python 2.9?

2007-09-11 Thread TheFlyingDutchman
Python user and advocate Bruce Eckel is disappointed with the additions (or lack of additions) in Python 3: http://www.artima.com/weblogs/viewpost.jsp?thread=214112 -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> wrote: > Hello, > > I'm passing command line parameters to my browser, I need to pass the > complete command line as-is, for example: > > test.py "abc def" xyz > > If I use ' '.join(sys.argv[1:]), then the double quotes around "abc > def" is gone, but

Re: need scsh in a wikip article

2007-09-11 Thread Xah Lee
On Sep 11, Xah Lee wrote: i was browsinghttp://en.wikipedia.org/wiki/Comparison_of_computer_shells quite fucking ridiculous that it contains Python shell and Ruby shell, and, there's no mentioning of scsh. Fuck the schemer morons. someone please add scsh there. -- 2007-09-11, A

Re: Python 3K or Python 2.9?

2007-09-11 Thread Paul Rubin
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > Python user and advocate Bruce Eckel is disappointed with the > additions (or lack of additions) in Python 3: > > http://www.artima.com/weblogs/viewpost.jsp?thread=214112 That article is pretty weak. -- http://mail.python.org/mailman/listinfo/pytho

Basic GUI

2007-09-11 Thread Don Hanlen
I'm writing a simple GUI that: ..gets info via telnet protocol (and sends) ..gets info via http (and sends) ..gets user-info from (currently) ...Tkinter Text windoze ...Tkinter buttons and such ..displays info in various Tkinter windoze ...graphic AND text...

Re: Python 3K or Python 2.9?

2007-09-11 Thread Ben Finney
Paul Rubin writes: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > Python user and advocate Bruce Eckel is disappointed with the > > additions (or lack of additions) in Python 3: > > > > http://www.artima.com/weblogs/viewpost.jsp?thread=214112 > > That article is p

2 daemons write to a single file /w python file IO

2007-09-11 Thread Andrey
HI i have a newbie question about the file() function. I have 2 daemons running on my linux box. 1 will record the IDs to a file - logs.txt other 1 will open this file, read the IDs, and then "Clean up the file" -logs.txt Since these 2 daemons will run every 2-5mins, I think this will crash, is

Generating HTML

2007-09-11 Thread Sebastian Bassi
Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. Best, SB. -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso B

Re: Basic GUI

2007-09-11 Thread Michele Simionato
On Sep 11, 11:54 pm, Don Hanlen <[EMAIL PROTECTED]> wrote: > I could solve my problems with the following psuedo-code made into > real code: > > import blah > > t = blah.fork(runthisprogram.py) > > #OK still in main > t.sendinfo(info) > info = t.receiveinfo() > > #

Re: Python 3K or Python 2.9?

2007-09-11 Thread Graham Dumpleton
On Sep 12, 2:14 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Paul Rubin writes: > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > Python user and advocate Bruce Eckel is disappointed with the > > > additions (or lack of additions) in Python 3: > > > >http://www.artim

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:33 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm passing command line parameters to my browser, I need to pass the > > complete command line as-is, for example: > > > test.py "abc def" xyz > > > If I use

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > It seems that \" will retain the quote marks but then the spaces get > gobbled. > > But if you replace the spaces with another character: > > python.exe test.py \"abc#def\"#123 > > then: > > import sys > commandLine = "".join(sys.argv[1:]) > > prints commandLine.replace('#',' ') > > gives: >

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > python.exe test.py "\"abc def\" 123" > > import sys > commandLine = "".join(sys.argv[1:]) > > print commandLine > > gives: > > "abc def" 123 With the surrounding quotes you actually only need: commandLine = sys.argv[1] -- http://mail.python.org/mailman/listinfo/python-list

Re: Minor documentation bug

2007-09-11 Thread Frank Millman
On Sep 11, 4:55 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > I spotted a minor bug in the documentation to SimpleXMLRPCServer. It > > does not seem worth getting a login to the bugtracker just to enter > > this, so if it is confirmed as a bug perhaps someone would be so kind

Re: 2 daemons write to a single file /w python file IO

2007-09-11 Thread Evan Klitzke
On Tue, 2007-09-11 at 21:17 -0700, Andrey wrote: > HI > > i have a newbie question about the file() function. > I have 2 daemons running on my linux box. > > 1 will record the IDs to a file - logs.txt > other 1 will open this file, read the IDs, and then "Clean up the > file" -logs.txt > > Sinc

<    1   2