Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread Martin v. Löwis
John Reese wrote: > Morning. I've been running into an error message pertaining to SSL > that I don't understand, and I was hoping someone had some insight. > Gmail provides POP access over SSL on port 587, so I tried to use > poplib.POP_SSL, with the following results: [...] > socket.sslerror: (1

Re: How can I import a py script by its absolute path name?

2005-07-17 Thread J.Bijsterbosch
Hello James, "James Dennett" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > J.Bijsterbosch wrote: > [ snip ] > >>and didn't remember Windows uses path names which need special > >>treatment. > > > > Hmm, what you call special treatment comes from pythons deep underlying C > > and

I just wanna know about os.path module..

2005-07-17 Thread kimes
I've just started digging into how python works.. I found that other mudules are clearly declared like one file per a module.. But the only os.path doesn't have their own file.. ye I know is has actually depending on os like in my case posixpath.. What I'd love to know is.. when I call import os.

Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED]:~/doc$ telnet pop.gmail.com 587 > Trying 64.233.185.111... > Connected to pop.gmail.com. > Escape character is '^]'. > 220 mx.gmail.com ESMTP 13sm5173422wrl > > This rather looks like an unencrypted SMTP connection to me. Indeed, >

Re: I just wanna know about os.path module..

2005-07-17 Thread James
kimes wrote: > I've just started digging into how python works.. > I found that other mudules are clearly declared like one file per a > module.. > > But the only os.path doesn't have their own file.. > ye I know is has actually depending on os like in my case posixpath.. > > What I'd love to kno

Re: I just wanna know about os.path module..

2005-07-17 Thread Peter Otten
kimes wrote: > But the only os.path doesn't have their own file.. > ye I know is has actually depending on os like in my case posixpath.. > > What I'd love to know is.. > when I call import os.path.. > how happened under the hood? At first os - module, or package, it doesn't matter here - is imp

Ordering Products

2005-07-17 Thread Kay Schluehr
Here might be an interesting puzzle for people who like sorting algorithms ( and no I'm not a student anymore and the problem is not a students 'homework' but a particular question associated with a computer algebra system in Python I'm currently developing in my sparetime ). For motivation lets d

Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread Stephen Illingworth
John Reese wrote: > Morning. I've been running into an error message pertaining to SSL > that I don't understand, and I was hoping someone had some insight. > Gmail provides POP access over SSL on port 587, so I tried to use > poplib.POP_SSL, with the following results: [snip] > Any suggestions

Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread Stephen Illingworth
John Reese wrote: > Morning. I've been running into an error message pertaining to SSL > that I don't understand, and I was hoping someone had some insight. > Gmail provides POP access over SSL on port 587, so I tried to use > poplib.POP_SSL, with the following results: GMail uses port 995. -- h

Re: Filtering out non-readable characters

2005-07-17 Thread Peter Hansen
Steven D'Aprano wrote: > On Sat, 16 Jul 2005 16:42:58 -0400, Peter Hansen wrote: >>Come on, Steven. Don't tell us you didn't have access to a Python >>interpreter to check before you posted: > > Er, as I wrote in my post: > > "Steven > who is still using Python 2.3, and probably will be for qui

Re: Python vs. Access VBA

2005-07-17 Thread Ed Leafe
On Jul 15, 2005, at 11:19 PM, William Lodge wrote: > Finally, does anybody know of any Web sites having examples of > database apps > in Python? You might want to look at Dabo, which is a database application framework for Python. In about 30 seconds you can create an application that

Tuples in function argument lists

2005-07-17 Thread Steven D'Aprano
I'm trying to understand the use of tuples in function argument lists. I did this: >>> def tester(a, (b,c)): ... print a, b, c ... >>> tester(1, 2) Traceback (most recent call last): File "", line 1, in ? File "", line 1, in tester TypeError: unpack non-sequence That was obvious result.

Re: I just wanna know about os.path module..

2005-07-17 Thread gene tani
look at 'path' module too http://www.jorendorff.com/articles/python/path/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples in function argument lists

2005-07-17 Thread Robert Kern
Steven D'Aprano wrote: > I'm trying to understand the use of tuples in function argument lists. > > I did this: > def tester(a, (b,c)): > > ... print a, b, c > ... > tester(1, 2) > > Traceback (most recent call last): > File "", line 1, in ? > File "", line 1, in tester > Type

beginner question fibonacci

2005-07-17 Thread Joon
>>> # Fibonacci series: ... # the sum of two elements defines the next ... a, b = 0, 1 >>> while b < 10: ... print b ... a, b = b, a+b ... 1 1 2 3 5 8 >>> a, b = 0, 1 >>> while b < 10: print b a = b b = a+b 1 2 4 8 Why a, b = b, a+b isn't a =

Re: beginner question fibonacci

2005-07-17 Thread Robert Kern
Joon wrote: > > >>> # Fibonacci series: > ... # the sum of two elements defines the next > ... a, b = 0, 1 > >>> while b < 10: > ... print b > ... a, b = b, a+b > ... > 1 > 1 > 2 > 3 > 5 > 8 > > >>> a, b = 0, 1 > >>> while b < 10: > print b > a = b > b = a+b >

Re: beginner question fibonacci

2005-07-17 Thread Michael Hoffman
Joon wrote: > >>> a, b = 0, 1 > >>> while b < 10: > print b > a = b > b = a+b > > > 1 > 2 > 4 > 8 > > Why a, b = b, a+b isn't a = b; b = a+b ? Because you changed a before you added it to b. Let's call your existing a and b "a0" and "b0", and the next a and b "a1" and "b1".

Re: beginner question fibonacci

2005-07-17 Thread ralobao
The case is that Python in attribution commands solves first the right side, so he atributes the vars. So the a+b expression is executed first. Joon escreveu: > >>> # Fibonacci series: > ... # the sum of two elements defines the next > ... a, b = 0, 1 > >>> while b < 10: > ... print b > ..

Re: beginner question fibonacci

2005-07-17 Thread Joon
Yes, i see. Thank you very much for the fast help! -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh popen stalling on password redirect output?

2005-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Cantankerous Old Git <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> In general, it is good idea to use expect kind of tool to deal with >> interactive programs like ssh. You may try using pexpect >> (http://pexpect.sourceforge.net). >> > >I tried tha once

Re: Environment Variable

2005-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Sybren Stuvel <[EMAIL PROTECTED]> wrote: >tuxlover enlightened us with: >> No, the replies from Grant's and Sybren's do answer my question. > >It would be a lot more polite to actually thank the people helping >you. .

Re: Python vs. Access VBA

2005-07-17 Thread Chris Lambacher
If you are going to go with Python, don't include Access in the mix at all. If you want a small light-weight, serverless database back-end, you would be better to go with SQLite. Its cross platform and well proven. I think Firebird will give you that too, though I have never used it. Most peop

ConfigParser : overwrite ?

2005-07-17 Thread cantabile
Hi, I'm trying and updating an .ini file with ConfigParser but each time I call 'write', it appends the whole options another time to the file. For example : Here's the inital ini file [section1] foodir: %(dir)s/whatever dir: foo Here's my code : filename = ... config = ConfigParser.ConfigParser(

Re: ConfigParser : overwrite ?

2005-07-17 Thread Robert Kern
cantabile wrote: > Hi, I'm trying and updating an .ini file with ConfigParser but each time > I call 'write', it appends the whole options another time to the file. > For example : > Here's the inital ini file > > [section1] > foodir: %(dir)s/whatever > dir: foo > > Here's my code : > filename =

Re: ConfigParser : overwrite ?

2005-07-17 Thread cantabile
Robert Kern a écrit : > cantabile wrote: > >> Hi, I'm trying and updating an .ini file with ConfigParser but each time >> I call 'write', it appends the whole options another time to the file. >> For example : >> Here's the inital ini file >> >> [section1] >> foodir: %(dir)s/whatever >> dir: foo >

Re: I just wanna know about os.path module..

2005-07-17 Thread kimes
Thanks for all you guys help.. But Peter, You said 'At first os - module, or package, it doesn't matter here - is imported.' I'm still confused about that.. When I just call import os.path without calling import os.. In that case, you mean 'import os' is called implicitly? Why? and How? how pyt

Re: SSL problem... SSL23_GET_SERVER_HELLO:unknown protocol

2005-07-17 Thread John Reese
On Sun, 17 Jul 2005 11:05:06 +0100, Stephen Illingworth <[EMAIL PROTECTED]> wrote: > John Reese wrote: >> Morning. I've been running into an error message pertaining to SSL >> that I don't understand, and I was hoping someone had some insight. >> Gmail provides POP access over SSL on port 587, so

Re: Ordering Products

2005-07-17 Thread Ron Adam
Kay Schluehr wrote: > Here might be an interesting puzzle for people who like sorting > algorithms ( and no I'm not a student anymore and the problem is not a > students 'homework' but a particular question associated with a > computer algebra system in Python I'm currently developing in my > spare

Re: Python Programming Contest

2005-07-17 Thread John Hazen
* Brian Quinlan <[EMAIL PROTECTED]> [2005-07-15 02:08]: > > You can find the first problem here: > http://www.sweetapp.com/pycontest/contest1 I have one question about the problem. Is the cost we are to minimize the cost of arriving in the target city at all, or the cost of arriving at the targe

Re: Filtering out non-readable characters

2005-07-17 Thread Steven Bethard
Bengt Richter wrote: > Thanks for the nudge. Actually, I know about generator expressions, but > at some point I must have misinterpreted some bug in my code to mean > that join in particular didn't like generator expression arguments, > and wanted lists. I suspect this is bug 905389 [1]: >>> de

What is your favorite Python web framework?

2005-07-17 Thread Admin
I am doing some research for a Python framework to build web applications. I have discarted Zope because from what I've read, the learning curve is too steep, and it takes more time to build applications in general with Zope. I have kept the following: - PyWork - http://pywork.sourceforge.ne

Re: What is your favorite Python web framework?

2005-07-17 Thread Sybren Stuvel
Admin enlightened us with: > But I'd like to know your opinion on what you think is best. The > Python framework I'll use will be to build an e-commerce > application looking like Amazon.com I'm greatly in favour of Cheetah. Also see http://www.unrealtower.org/mycheetah. I need to put up way mor

Re: What is your favorite Python web framework?

2005-07-17 Thread Admin
On Sun, 17 Jul 2005 19:15:49 -0300, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > http://www.unrealtower.org/mycheetah "Error 404 while looking up your page AND when looking for a suitable 404 page. Sorry! No such file /var/www/www.unrealtower.org/compiled/error404.py" I can't

Re: Python Programming Contest

2005-07-17 Thread John Machin
John Hazen wrote: > * Brian Quinlan <[EMAIL PROTECTED]> [2005-07-15 02:08]: > >>You can find the first problem here: >>http://www.sweetapp.com/pycontest/contest1 > > > I have one question about the problem. Is the cost we are to minimize > the cost of arriving in the target city at all, or the

Re: What is your favorite Python web framework?

2005-07-17 Thread Luis M. Gonzalez
I really like Karrigell ( http://karrigell.sourceforge.net ). It is, IMHO, the most pythonic framework because all you need to know is the python language. You don't need to learn any template or special language, you only use plain and regular python. It also gives you a lot of freedom when choosi

Re: Ordering Products

2005-07-17 Thread Diez B.Roggisch
Kay Schluehr gmx.net> writes: > Now lets drop the assumption that a and b commute. More general: let be > M a set of expressions and X a subset of M where each element of X > commutes with each element of M: how can a product with factors in M be > evaluated/simplified under the condition of addi

Re: Filtering out non-readable characters

2005-07-17 Thread Raymond Hettinger
[George Sakkis] > It's only obvious in the sense that _after_ you see this idiom, you can go > back to the docs and > realize it's not doing something special; OTOH if you haven't seen it, it's > not at all the obvious > solution to "how do I get the first 256 characters". So IMO it should be >

stdin/stdout fileno() always returning -1 from windows service

2005-07-17 Thread chuck
I have found that sys.stdin.fileno() and sys.stdout.fileno() always return -1 when executed from within a win32 service written using the win32 extensions for Python. Anyone have experience with this or know why? -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiently Split A List of Tuples

2005-07-17 Thread Raymond Hettinger
> Variant of Paul's example: > > a = ((1,2), (3, 4), (5, 6), (7, 8), (9, 10)) > zip(*a) > > or > > [list(t) for t in zip(*a)] if you need lists instead of tuples. [Peter Hansen] > (I believe this is something Guido considers an "abuse of *args", but I > just consider it an elegant use of zip() co

Re: What is your favorite Python web framework?

2005-07-17 Thread Philippe C. Martin
http://cheetahtemplate.org/ Admin wrote: > On Sun, 17 Jul 2005 19:15:49 -0300, Sybren Stuvel > <[EMAIL PROTECTED]> wrote: > >> http://www.unrealtower.org/mycheetah > > "Error 404 while looking up your page AND when looking for a suitable 404 > page. Sorry! > No such file /var/www/www.unrealt

Re: Efficiently Split A List of Tuples

2005-07-17 Thread Raymond Hettinger
[Richard] > I know I can use a 'for' loop and create two new lists > using 'newList1.append(x)', etc. Is there an efficient way > to create these two new lists without using a slow for loop? If trying to optimize before writing and timing code, then at least validate your assumptions. In Python,

Re: Parsing html :: output to comma delimited

2005-07-17 Thread samuels
Thanks for the replies, I'll post here when/if I get it finally working. So, now I know how to extract the links for the big page, and extract the text from the individual page. Really what I need to find out is how run the script on each individual page automatically, and get the output in comm

list implementation

2005-07-17 Thread sj
I believe the type "list" is implemented as an array of pointers. Thus, random access is an O(1) operation while insertion/deletion is an O(n) operation. That said, I have the following questions: 1. Am I correct in saying the above? 2. Implementing list as an array is part of language specifica

list implementation

2005-07-17 Thread sj
I believe the type "list" is implemented as an array of pointers. Thus, random access is an O(1) operation while insertion/deletion is an O(n) operation. That said, I have the following questions: 1. Am I correct in saying the above? 2. Implementing list as an array is part of language specifica

Re: list implementation

2005-07-17 Thread Terry Reedy
"sj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I believe the type "list" is implemented as an array of pointers. A Python list is sematically/behaviorally defined as a mutable extensible sequence of references to Python objects. For the CPython reference implementation, the

Re: Who uses input()? [was Re: question on "input"]

2005-07-17 Thread Stephen Thorne
On 15/07/05, Terry Hancock <[EMAIL PROTECTED]> wrote: > On Thursday 14 July 2005 07:00 am, Michael Hoffman wrote: > > Devan L wrote: > > > Use raw_input instead. It returns a string of whatever was typed. Input > > > expects a valid python expression. > > > > Who actually uses this? It's equivalent

Re: Ordering Products

2005-07-17 Thread Kay Schluehr
Diez B.Roggisch wrote: > Kay Schluehr gmx.net> writes: > > > Now lets drop the assumption that a and b commute. More general: let be > > M a set of expressions and X a subset of M where each element of X > > commutes with each element of M: how can a product with factors in M be > > evaluated/simp

Re: Who uses input()? [was Re: question on "input"]

2005-07-17 Thread Nathan Pinno
I use input() all the time. I know many people say it ain't safe, but whose going to use it to crash their own comp? Only an insane person would, or a criminal trying to cover his/her tracks. Sorry if I waded into the debate, but this debate originated from one of my posts. Nathan Pinno

Re: Ordering Products

2005-07-17 Thread Kay Schluehr
Ron Adam wrote: > Kay Schluehr wrote: > > Here might be an interesting puzzle for people who like sorting > > algorithms ( and no I'm not a student anymore and the problem is not a > > students 'homework' but a particular question associated with a > > computer algebra system in Python I'm curren

Re: list implementation

2005-07-17 Thread Raymond Hettinger
[sj] > I believe the type "list" is implemented as an array of pointers. Yes. > Thus, random access is an O(1) operation while insertion/deletion is an > O(n) operation. Yes. > 2. Implementing list as an array is part of language specification or > implementation-dependent? Implementation de

Re: Efficiently Split A List of Tuples

2005-07-17 Thread Ron Adam
Raymond Hettinger wrote: >>Variant of Paul's example: >> >>a = ((1,2), (3, 4), (5, 6), (7, 8), (9, 10)) >>zip(*a) >> >>or >> >>[list(t) for t in zip(*a)] if you need lists instead of tuples. > > > > [Peter Hansen] > >>(I believe this is something Guido considers an "abuse of *args", but I >>jus