Re: Django for database driven web application is OK?

2007-10-03 Thread Bruno Desthuilliers
cuongvt a écrit :
> Hello 
> I'm new to both Django and Python. I'm mainly developing on PHP. 
> I tend to move to Django. But I want to confirm as below: 
> I heard that Django is mainly used for something like content management,
> CMS or something 
> like that and Rails is mainly for web applications. 
> So my question: is it true or not? 

Neither true nor false. A CMS *is* a web application. So this question 
doesn't make any sense.

Now it's true that Django was born mostly from CMS applications, and 
that it showed up in early versions. But the framework did evolved quite 
a lot since. FWIW, I did use it for a couple applications that have 
*nothing* todo with content management, and it was in the early versions !-)

> For rapid web application development, can I use Django to create intranet
> database web driven 
> application in my company for example: empoyees time management, goods
> import/export management, 
> salary management etc? 

Yes.

-- 
http://mail.python.org/mailman/listinfo/python-list


Having fun with python

2007-10-03 Thread Tzury
def loadResMap(self):
self.resMap = []
[[self.resMap.append(str('A2' + sim[0] + '/r' + str(x)))
for x in range(1, eval(sim[1])+1)]
for sim in [x.split(':')
for x in quickViews.smsResList.v.split(",")]]
'''
# Confused? Have this one:

data = quickViews.smsResList.v
sims, slots = [], data.split(",")
for slot in slots:
sims.append(slot.split(':'))
for sim in sims:
for x in range(1, eval(sim[1])+1):
self.resMap.append(str('A2' + sim[0] + '/r' +
str(x)))

# same functionality different approaches
# forloops vs. list comprehension
# redability vs. smartassicity
# AKA: You have read too many Lisp books
'''

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread Johny
On Oct 3, 7:51 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > a  certificate that is signed by OpenSSL's own CA( certification
> > authority), that is not recognized in the program's list of root CAs,
> > causes an exception to be raised.
>
> What is "the program"? What programming language is it written in?
> What library does it use to maintain a list of root CAs, and what
> code does it execute to find out that a certificate is not in this
> list?
>
> Are you sure this is related to Python at all?
Martin,
Thank you for your reply.

It looks like this

MyPythonProgram --->Proxy>Server
The  proxy is written in Java. I want to use that proxy to see what my
Python program sends to server.
The proxy uses its own certificate and this certificate must be
trusted, I think, otherwise I receive an error.

If I use
InternetBrowser --->Proxy>Server

browser asks me if the Proxy's certificate is trusted.If I reply  YES,
than communication continues( I think browser adds this certificate
among trusted ones)

So, can you help, please?
Thanks.
L.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List Question

2007-10-03 Thread Paul Hankin
On Oct 2, 11:09 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On Oct 2, 4:20 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> > On Oct 2, 10:06 pm, brad <[EMAIL PROTECTED]> wrote:
>
> > > How is this expressed in Python?
>
> > > If x is in y more than three times:
> > >  print x
>
> > > y is a Python list.
>
> > Or the slightly-too-flashy version:
> > if sum(1 for a in y if x == a) > 3:
> > print x
>
> As long as you are eschewing count for sum, don't forget that true is
> 1 and false is 0:
>
> if sum(x==a for a in y) > 3:
> print x

I like it!

--
Paul Hankin

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Django for database driven web application is OK?

2007-10-03 Thread Jarek Zgoda
cuongvt napisał(a):

> I'm new to both Django and Python. I'm mainly developing on PHP. 
> I tend to move to Django. But I want to confirm as below: 
> I heard that Django is mainly used for something like content management,
> CMS or something 
> like that and Rails is mainly for web applications. 
> So my question: is it true or not? 
> For rapid web application development, can I use Django to create intranet
> database web driven 
> application in my company for example: empoyees time management, goods
> import/export management, 
> salary management etc? 

No. Yes. I mean, Django is good in building CMS-like apps but is not a
framework for building CMS-like apps. For example, the largest community
site in Poland http://grono.net/ is built with Django. My company does
other interesting things in Django, completely unrelated to CMS/web
publishing.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: random keypress bounce in a terminal

2007-10-03 Thread István
Bjoern Schliessmann írta:
> István wrote:
>
>   
>> It works fine as long as I hit keys normally, but gives extra
>> characterts if I keep pressing some key, e.g. up or down arrow
>> keys. It runs on a Linux system. What's the wrong with it?
>> 
>
> Nothing. Linux VTs will generate multiple characters for special
> keys.
>   
I know it and I do handle it:
   ch = sys.stdin.read(1)
   if (ord(ch)==27):
chstr=ch
chstr+=sys.stdin.read(1)
chstr+=sys.stdin.read(1)
   else:
chstr=ch
Moreover, I would also state for others: the behavior of this code is 
independent of the keyboard repeating rate.
But what if it _seems_  to work differently...?
That's the reason of trying to make somebody just to see him/herself the 
symptom.
*   bfc.py 4863 bytes *
*  uni_getch.py 873 bytes *
*   demo1.brd 84311 bytes *
*   demo2.brd 84336 bytes 
http://www.evoran.hu/tmp/
*Please, check somebody and explain how is possible what is impossible
Istvan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread Gabriel Genellina
En Wed, 03 Oct 2007 04:32:04 -0300, Johny <[EMAIL PROTECTED]> escribi�:

> MyPythonProgram --->Proxy>Server
> The  proxy is written in Java. I want to use that proxy to see what my
> Python program sends to server.
> The proxy uses its own certificate and this certificate must be
> trusted, I think, otherwise I receive an error.
>
> If I use
> InternetBrowser --->Proxy>Server
>
> browser asks me if the Proxy's certificate is trusted.If I reply  YES,
> than communication continues( I think browser adds this certificate
> among trusted ones)

Which OS?
Windows itself manages certificate storage. Control Panel, Internet  
Options, Contents, Certificates. You can import your certificate there.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: I earn $36800 a month with google adsense

2007-10-03 Thread Gabriel Genellina
En Tue, 02 Oct 2007 15:22:57 -0300, Wildemar Wildenburger  
<[EMAIL PROTECTED]> escribi�:

> Dude, you, even as a spammer, can learn a lot from this group. As Diez
> pointed out, you will want to quote the site that you're spamvertising
> (Bastard!), so your pagerank rises.
> Pretty new to the biz, ain't ya?

You are charged of High Treason for voluntarily telling war secrets to the  
Enemy.
The above quoted text is enough evidence. The accused is found guilty and  
sentenced to lifelong exile from this group.
Sentence will be carried out next morning. No appeal is allowed.
Case closed.
Goodbye.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Having fun with python

2007-10-03 Thread Duncan Booth
Tzury <[EMAIL PROTECTED]> wrote:

> def loadResMap(self):
> self.resMap = []
> [[self.resMap.append(str('A2' + sim[0] + '/r' + str(x)))
> for x in range(1, eval(sim[1])+1)]
> for sim in [x.split(':')
> for x in quickViews.smsResList.v.split(",")]]
> '''
> # Confused? Have this one:
> 
> data = quickViews.smsResList.v
> sims, slots = [], data.split(",")
> for slot in slots:
> sims.append(slot.split(':'))
> for sim in sims:
> for x in range(1, eval(sim[1])+1):
> self.resMap.append(str('A2' + sim[0] + '/r' +
> str(x)))
> 
> # same functionality different approaches
> # forloops vs. list comprehension
> # redability vs. smartassicity
> # AKA: You have read too many Lisp books
> '''
> 
The first one is stupid because it build a list of None objects and then 
throws it away.

The second one goes too far avoiding all list comprehensions:

   sims = [ slot.split(':')
 for slot in quickViews.smsResList.v.split(',') ]

is perfectly manageable, although it looks like there should be a method 
'getSims' on quickviews or smsResList or something that returns the data 
in the correct (already split) format.

The 'eval' is almost certainly a mistake in both variants. Probably you 
just meant to call 'int'. Also a format string would be clearer:

   for a, b in sims:
  self.resMap.extend("A2%s/r%d" % (a, x+1)) for x in range(int(b)))

However, one point you have shown very clearly: the second one is much 
easier to tear apart and reassemble.
-- 
http://mail.python.org/mailman/listinfo/python-list


generating range of numbers

2007-10-03 Thread vimal
hi all,

 i am new to python.
 i just want to generate numbers in the form like:

1,2,4,8,16,32.to a maximum of 1024

using a range function

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Subprocesses on Windows

2007-10-03 Thread Tim Golden
Nachiket Joshi wrote:
> Well before I explain my problem, let me tell you all that 
> I am not a professional programmer and new to python too.

Welcome to the world of Python, home to professional and
non-professional programmers alike!

> I just write some scripts as and when required 

Same could be said of many of us.

> The problem is something like this. 
> I am trying to run nmap scan on my network and for 
> that I want to start multiple nmap instances (256 at once)
> togather and wait till those 256 are over before I start 
> next lot of 256 instances. 

My number one query is whether it's a great idea to
have *256* nmap instances running simultaneously.
But this is not my area, so maybe it's something people
commonly do. Howbeit, it's clear from your description
below that the problem is running *some number* of
simultaneous processes.

 > Well to test I have put in two
> nmap scans in my program and I have succeeded to start 
> both of them simultaneously (in fact one after another) by using 
> "subprocess module and Popen".  But the problem is when I run a 
> loop to start both of these nmap instances, they do start BUT 
> the script then exits to command prompt completing all the executions. 
> But this is not what I want. I want to wait till both of these nmap 
> processes are finished and then only exit from script (in fact exit 
> from that function or loop). Then only I would be able to call next 
> lot of IP Ranges to scan. I did try os.waitpid() but it gives 
> following error while running the program:

I admit I'm a bit confused both by the description and by the
code (not least because the code you're posting isn't
self-contained; it's not clear what the all-important
clas_c function is doing).

Assuming I have a (fake) nmap.py which looks like this:


import sys
print sys.argv


then your code (if I understand it) wants to do this, in concept:


import os, sys
import subprocess

TEMPLATE = "192.168.%d.%d"
for network in range (256):
   raw_input ("Network: %s - Press enter..." % (TEMPLATE % (network, 0)))

   running_processes = []
   for machine in range (256):
 # start an nmap process which does whatever and returns
 running_processes.append (
   subprocess.Popen (["python", "nmap.py", TEMPLATE % (network, machine)])
 )

   # wait until all 256 nmap processes have finished
   # before starting the next network
   while True:
 for process in running_processes:
   if process.poll () is None:
 break
 else:
   break



Have I understood correctly? If you're not sure what my code
is doing, try saving it to two files and running it to see
if it gives the result you want.

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


A Must Read!!!

2007-10-03 Thread [EMAIL PROTECTED]
I have found an excellent resource on Object Oriented Programming.


http://technical-talk.com/SoftDev/OOP/OOPBASICS.asp

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Bent C Dalager
In article <[EMAIL PROTECTED]>,
Frank Goenninger  <[EMAIL PROTECTED]> wrote:
>
>Well, I didn't start the discussion. So you should ask the OP about the 
>why. I jumped in when I came across the so often mentioned "hey, it's 
>all well defined" statement was brought in. I simply said that if that 
>"well-definedness" is against "common understanding" then I don't give 
>a damn about that clever definitions. Because I have to know that there 
>are such definitions - always also knowing that free is not really 
>free.

"Liberated" is a valid meaning of the word "free". The main problem is
that there aren't really any other words in the English language that
have the same meaning as the word "free" when it is wearing its
"liberated" hat. It is unfortunate that the word is overloaded with
multiple other meanings, one of which is so central in our modern
market oriented society that it tends to come to the forefront of
people's minds when the word is used. But that's just the way it is.
You work with the language you've got.

> It is such a good subject to discuss over and over and over 
>without ever reaching any conclusion or resolution because neither FSF 
>nor GNU nor the FREE as in FREE BEER defenders will change their mind. 

I am quite sure they would be overjoyed if someone were to come up
with a decent replacement for the word "free" so as to disambiguate
the term. A number of people have tried pretty hard, however, and
failed. If you fancy yourself an accomplished wordsmith, any
suggestions are sure to be welcome.

Cheers
Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
powered by emacs
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generating range of numbers

2007-10-03 Thread Andreas Tawn
>i just want to generate numbers in the form like:
>
>1,2,4,8,16,32.to a maximum of 1024
>using a range function

>>> a = [2**x for x in range(11)]
>>> a
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]

Cheers,

Andreas Tawn
Lead Technical Artist
Ubisoft Reflections

-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread David Kastrup
[EMAIL PROTECTED] (Bent C Dalager) writes:

> In article <[EMAIL PROTECTED]>,
> Frank Goenninger  <[EMAIL PROTECTED]> wrote:
>>
>>Well, I didn't start the discussion. So you should ask the OP about the 
>>why. I jumped in when I came across the so often mentioned "hey, it's 
>>all well defined" statement was brought in. I simply said that if that 
>>"well-definedness" is against "common understanding" then I don't give 
>>a damn about that clever definitions. Because I have to know that there 
>>are such definitions - always also knowing that free is not really 
>>free.
>
> "Liberated" is a valid meaning of the word "free".

No.  It is a valid meaning of the word "freed".

Xpost+Fup2 gnu.misc.discuss: this is not really relevant for most of
the touched Usenet groups.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Jorgen Bodde
Hi there,

Thank you for confirming this, I did manage a work around. When
reading back the XML file, I strip it off it's whitespaces before I
parse it. Then when writing it back no excessive whitespaces are
appended. My best guess is that toprettyxml is not intelligently
handling whitespaces that are already there, and bluntly appends more
whitespaces to it, making it grow exponentially.

This is the snippet;

f = open(filename, "rt")
for line in f:
s = line.strip(' \t\n')
if s:
xmlstr += s + ' ' # space needed for spanning text nodes

And then I simply use parseString instead of parse. But honestly, I
think it is a bug, because the XML standard also says that whitespaces
before normal text should be ignored, and I do not see it back as text
when I read the node, so why preserve it and mess up the formatting in
the end?

Regards,
- Jorgen




On 10/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Oct 2, 11:43 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I parse an XML file, replace a node with a new one (like updating
> > cache) and write it back. Every write, new spaces are added. For
> > example, first read - update - write cycle;
> >
> > 
> >  My First App
> > 
> >
> > Second cycle:
> >
> > 
> >  My First App
> > 
> >
> > Third cycle:
> >
> > 
> >My First App
> > 
> >
> > And this goes on. The node is one that is not touched in the XML, it
> > is simply written back after reading. I have the same with void spaces
> > in between the nodes, I managed to compensate that by stripping the
> > lines.
> >
> > I would like to use toprettyxml to make it user editable and viewable.
> > But this is really weird. How can I circumvent this behaviour?
> >
> > regards,
> > - Jorgen
>
> I had similar problems and ended up switching to the lxml package to
> solve the issue. I think you can do it with ElementTree too. Maybe
> somebody with more experience with the xml / minidom modules will show
> up soon.
>
> Mike
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generating range of numbers

2007-10-03 Thread Amit Khemka
On 10/3/07, vimal <[EMAIL PROTECTED]> wrote:
> hi all,
>
>  i am new to python.
>  i just want to generate numbers in the form like:
>
> 1,2,4,8,16,32.to a maximum of 1024
>
> using a range function

[2**i for i in range(11)]

This is a list comprehension, for more have a look at
http://docs.python.org/tut/node7.html#SECTION00714

Cheers,

-- 

Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Bent C Dalager
In article <[EMAIL PROTECTED]>, David Kastrup  <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Bent C Dalager) writes:
>
>> In article <[EMAIL PROTECTED]>,
>> Frank Goenninger  <[EMAIL PROTECTED]> wrote:
>>>
>>>Well, I didn't start the discussion. So you should ask the OP about the 
>>>why. I jumped in when I came across the so often mentioned "hey, it's 
>>>all well defined" statement was brought in. I simply said that if that 
>>>"well-definedness" is against "common understanding" then I don't give 
>>>a damn about that clever definitions. Because I have to know that there 
>>>are such definitions - always also knowing that free is not really 
>>>free.
>>
>> "Liberated" is a valid meaning of the word "free".
>
>No.  It is a valid meaning of the word "freed".

Only if you're being exceedingly pedantic and probably not even
then. Webster 1913 lists, among other meanings,

Free
(...)
"Liberated, by arriving at a certain age, from the control
of parents, guardian, or master."

The point presumably being that having been "liberated", you are now
"free".


As I do not read gnu.misc.discuss, I reinstated the previous bunch.
Apologies to those who may be annoyed at this.

Cheers
Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
powered by emacs
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generating range of numbers

2007-10-03 Thread Michael Bentley

On Oct 3, 2007, at 2:18 AM, vimal wrote:

>  i am new to python.
>  i just want to generate numbers in the form like:
>
> 1,2,4,8,16,32.to a maximum of 1024
>
> using a range function

I don't think it can be done with *only* a range function...

import math
[pow(2, x) for x in range(math.log(1024, 2) +1)]

hth,
Michael
---
Debugging is twice as hard as writing the code in the first place.   
Therefore, if you write the code as cleverly as possible, you are, by  
definition, not smart enough to debug it. --Brian W. Kernighan


-- 
http://mail.python.org/mailman/listinfo/python-list


Building VTK-5.0.3-1 with Python bindings (VS 8.0)

2007-10-03 Thread Anonymous
I am having problems with CMake.

I currently have the ff errors (paths not set - and I am not sure what 
to set them to):

TK_INCLUDE_PATH
TK_INTERNAL_PATH
TK_XLIB_PATH  (I don't know why this is reqd, since I'm running W2k)

Has anyone done this before or now how to fix these errors ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Paul Boddie
On 3 Okt, 11:30, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote:
>
> Thank you for confirming this, I did manage a work around. When
> reading back the XML file, I strip it off it's whitespaces before I
> parse it. Then when writing it back no excessive whitespaces are
> appended. My best guess is that toprettyxml is not intelligently
> handling whitespaces that are already there, and bluntly appends more
> whitespaces to it, making it grow exponentially.

This seems like a reasonable explanation without having looked at the
source code myself.

[...]

> And then I simply use parseString instead of parse. But honestly, I
> think it is a bug, because the XML standard also says that whitespaces
> before normal text should be ignored, and I do not see it back as text
> when I read the node, so why preserve it and mess up the formatting in
> the end?

Which part of the standard is this? Here's the XML 1.0 specification's
section on whitespace:

http://www.w3.org/TR/2006/REC-xml-20060816/#sec-white-space

It seems to me that applications (and the libraries which serve them)
can choose what to do unless xml:space is set to "preserve". It does
seem odd that the toprettyxml method chooses to respect existing
whitespace whilst also disrupting it by adding more, however.

Paul

-- 
http://mail.python.org/mailman/listinfo/python-list


interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Anonymous
I am trying something which appears (so far), that many other people 
have not yet tried before - since I can't find any useful related 
material despite several days of searching various sites/blogs etc.

I want to use VB6 as a front end for building a small GUI console that 
accepts python commands at the command line and executes them, returning 
any results to the VB6 window.

This requires several steps, but the one I am having most problem 
finding info on is the ff:

1. using/interacting the Python interpreter from VB6

Any pointers/demos etc are very welcome - and if this has already been 
done, please let me know, so I can learn from what someone else has done
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Robert
Kern wrote:

> Lawrence D'Oliveiro wrote:
>
>> In message <[EMAIL PROTECTED]>, Robert
>> Kern wrote:
>> 
>>> Not all of the modules in a package are imported by importing the
>>> top-level package.
>> 
>> You can't import packages, only modules.
>> 
>>> os.path is a particularly weird case because it is just an alias to the
>>> platform-specific path-handling module; os is not a package.
>> 
>> os is a module, os.path is a variable within that module. That's all
>> there is to it.
> 
> Yes, but os.path is also module. That's why I said it was a weird case.

You can't have modules within modules. os.path isn't an exception--see
below.

> In [1]: import os
> 
> In [2]: type(os.path)
> Out[2]: 

On my Gentoo system:

>>> import os
>>> os.path


It's just a variable that happens to point to the posixpath module.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Jorgen Bodde
Hi Paul,

> This seems like a reasonable explanation without having looked at the
> source code myself.

It's by thorough investigation ;-)

> Which part of the standard is this? Here's the XML 1.0 specification's
> section on whitespace:
>
> http://www.w3.org/TR/2006/REC-xml-20060816/#sec-white-space

Well 2.10 if I quote:


Such white space is typically not intended for inclusion in the
delivered version of the document. On the other hand, "significant"
white space that should be preserved in the delivered version is
common, for example in poetry and source code.


I interpret "significant" whitespaces as the ones between the words,
if whitespaces occur at the beginning of a line due to an indent like


 This is indented text


We can assume that the spaces in front of it are not significant
whitespaces. Because when I read the text node in python and it is not
included, I see no reason why it should be preserved. And if it is
preserved in the xml DOM, toprettyxml should first investigate how
many whitespaces are already there before adding more to indent the
text.

Also this happens. First the nodes are properly shown:


 ... 


 ... 


When writing back this sometimes happen (mind the blank lines):


 ... 



 ... 


And the next time, the spaces between the nodes is expanded again:


 ... 




 ... 


(etc) .. so when reading, modifying, writing XML files, the empty
blank lines will grow exponentially.

> It seems to me that applications (and the libraries which serve them)
> can choose what to do unless xml:space is set to "preserve". It does
> seem odd that the toprettyxml method chooses to respect existing
> whitespace whilst also disrupting it by adding more, however.

I would think (simplistic I'm sure) that if spaces are that important,
you can always use a CDATA tag which should treat the text inside as
raw data without any formatting and whitespace changes.

Should I file this as a bug to be solved? I have my workaround now,
but I read online that more people seem to have ran into this.

Regards,
- Jorgen
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steve
Holden wrote:

> You *can* import a package ...

You're right. I was misremembering the behaviour of PyCrypto, where
importing the upper-level packages do little more than give you a list of
what algorithms are available.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python 2.5 and 3gb switch

2007-10-03 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, neil wrote:

> The scene is very large requiring me to use a 3gb switch enabled version
> of Blender and of course boot into a 3gb XP.

Why not just use a proper 64-bit OS? Since Blender is also open-source,
there's no requirement that you be hobbled by Dimdows.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Ben Finney
Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes:

> On my Gentoo system:
> 
> >>> import os
> >>> os.path
> 
> 
> It's just a variable that happens to point to the posixpath module.

There's no "pointing" going on. It's another name bound to the same
object, of equal status to the 'posixpath' name.

Python doesn't have pointers, and even "variable" is a misleading term
in Python. Best to stick to "name" and "bound to".

-- 
 \"Crime is contagious ... if the government becomes a |
  `\lawbreaker, it breeds contempt for the law."  -- Justice Louis |
_o__) Brandeis |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Ryan Ginstrom
> On Behalf Of Anonymous
> This requires several steps, but the one I am having most 
> problem finding info on is the ff:
> 
> 1. using/interacting the Python interpreter from VB6

One way to do this might be by creating a COM server with Python, and having
VB feed it lines of text and then collect results of execution for display.

win32com has demos of COM servers.

--
Regards,
Ryan Ginstrom

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Anonymous


Ryan Ginstrom wrote:

>>On Behalf Of Anonymous
>>This requires several steps, but the one I am having most 
>>problem finding info on is the ff:
>>
>>1. using/interacting the Python interpreter from VB6
> 
> 
> One way to do this might be by creating a COM server with Python, and having
> VB feed it lines of text and then collect results of execution for display.
> 
> win32com has demos of COM servers.
> 
> --
> Regards,
> Ryan Ginstrom
> 

Hi Ryan, do you have a link to the resources you mentioned?. I did a 
search for win32com - and found this : 
http://python.net/crew/mhammond/win32/FAQ.html  (most of the links were 
either dead, or refrerred to using COM from within Python - i.e. the 
OTHER way round).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit :
> In message <[EMAIL PROTECTED]>, Robert
> Kern wrote:
> 
>> Lawrence D'Oliveiro wrote:
>>
>>> In message <[EMAIL PROTECTED]>, Robert
>>> Kern wrote:
>>>
 Not all of the modules in a package are imported by importing the
 top-level package.
>>> You can't import packages, only modules.
>>>
 os.path is a particularly weird case because it is just an alias to the
 platform-specific path-handling module; os is not a package.
>>> os is a module, os.path is a variable within that module. That's all
>>> there is to it.
>> Yes, but os.path is also module. That's why I said it was a weird case.
> 
> You can't have modules within modules. 

If you're talking about the filesystem representation (ie : .py files), 
you obviously can't have a file within a file, indeed.

When it comes to the internal runtime representation of modules in 
Python, then it's totally different - a module is just an object, that 
can of course be an attribute of another module object.

 >>> import os
 >>> type(os)

 >>> type(os.path)

 >>>

> os.path isn't an exception--see
> below.
> 
>> In [1]: import os
>>
>> In [2]: type(os.path)
>> Out[2]: 
> 
> On my Gentoo system:
> 
> >>> import os
> >>> os.path
> 
> 
> It's just a variable that happens to point to the posixpath module.

It's just a name bound to a module object.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A total bullshit (was : A Must Read!!!)

2007-10-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit :
> I have found an excellent resource on Object Oriented Programming.
> 
> 
(url snipped to protect the innocents)

Let's see:

"An object has methods, properties and events."

Hem...

"oriented programming probably existed before the concept of a class 
came into being but today the concept of a class is essential to object 
orientation."

Hem hem...

This is total bullshit.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Gabriel Genellina
En Wed, 03 Oct 2007 07:12:17 -0300, Lawrence D'Oliveiro  
<[EMAIL PROTECTED]> escribi�:

> In message <[EMAIL PROTECTED]>, Robert
> Kern wrote:
>
>> Lawrence D'Oliveiro wrote:
>>
>>> In message <[EMAIL PROTECTED]>,  
>>> Robert
>>> Kern wrote:
>>>
 Not all of the modules in a package are imported by importing the
 top-level package.
>>>
>>> You can't import packages, only modules.
>>>
 os.path is a particularly weird case because it is just an alias to  
 the
 platform-specific path-handling module; os is not a package.
>>>
>>> os is a module, os.path is a variable within that module. That's all
>>> there is to it.
>>
>> Yes, but os.path is also module. That's why I said it was a weird case.
>
> You can't have modules within modules. os.path isn't an exception--see
> below.
>
>> In [1]: import os
>>
>> In [2]: type(os.path)
>> Out[2]: 
>
> On my Gentoo system:
>
> >>> import os
> >>> os.path
> 
>
> It's just a variable that happens to point to the posixpath module.

A "module" is a certain type of Python objects, like ints, functions,  
exceptions and all else.
The easiest way to create a module is to load it from file, but some  
modules are already built into the interpreter, and you can even create a  
module from scratch.

py> import os
py> type(os)

py> type(os.path)

py> os

py> import sys
py> type(sys)

py> sys

py> ModuleType = type(os)
py> newmodule = ModuleType('newmodule')
py> newmodule.a = 3
py> newmodule

py> type(newmodule) is type(os.path)
True

"os" is a name that refers to the os module object. "os.path" means "the  
path attribute in the object referenced by the name os", that happens to  
be another module too.
os is not a package; os.path is set when the os module is imported,  
depending on the platform. It may be ntpath, posixpath, macpath, or  
whatever. On Windows:

py> import ntpath
py> os.path is ntpath
True
py> import macpath
py> import posixpath
py> macpath.sep
':'
py> ntpath.sep
'\\'

Apart from that, there is no magic involved, just plain attribute access  
like everywhere else.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Giles Brown
On 3 Oct, 11:07, Anonymous <[EMAIL PROTECTED]> wrote:
> I am trying something which appears (so far), that many other people
> have not yet tried before - since I can't find any useful related
> material despite several days of searching various sites/blogs etc.
>
> I want to use VB6 as a front end for building a small GUI console that
> accepts python commands at the command line and executes them, returning
> any results to the VB6 window.
>
> This requires several steps, but the one I am having most problem
> finding info on is the ff:
>
> 1. using/interacting the Python interpreter from VB6
>
> Any pointers/demos etc are very welcome - and if this has already been
> done, please let me know, so I can learn from what someone else has done

http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Microdom xml file

2007-10-03 Thread Raj kumar
Hi every one,
Can any one send me the sample code/links for
creating a XML file and adding a tag by using microdom in twisted python.
Thank you in advanced.

   
-
 Now you can chat without downloading messenger. Click here to know how.-- 
http://mail.python.org/mailman/listinfo/python-list

Re: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Gabriel Genellina
En Wed, 03 Oct 2007 07:53:15 -0300, Anonymous <[EMAIL PROTECTED]> escribi�:

> Ryan Ginstrom wrote:
>> One way to do this might be by creating a COM server with Python, and  
>> having
>> VB feed it lines of text and then collect results of execution for  
>> display.
>> win32com has demos of COM servers.
>
> Hi Ryan, do you have a link to the resources you mentioned?. I did a
> search for win32com - and found this :
> http://python.net/crew/mhammond/win32/FAQ.html  (most of the links were
> either dead, or refrerred to using COM from within Python - i.e. the
> OTHER way round).

win32com is part of the Python for Windows extensions by Mark Hammond:
https://sourceforge.net/projects/pywin32/

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: setuptools without unexpected downloads

2007-10-03 Thread Max Erickson
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
...
> This recent blog post contains step-by-step instructions on using
> free  tools to compile python extensions:  
> 
> -- 
...

The package available here:

http://www.develer.com/oss/GccWinBinaries

is quite a lot more straightforward. You do have to be okay with using 
GCC 4.1 though. As a bonus, it supports versions of python that link 
against several different versions of the Microsoft runtime, rather 
than just one.


max

-- 
http://mail.python.org/mailman/listinfo/python-list


enumerate overflow

2007-10-03 Thread crwe
Hello all,

in python2.4, i read lines from a file with

for lineNum, line in enumerate(f): ...

However, lineNum soon overflows and starts counting backwards. How do
i force enumerate to return long integer?

Cheers.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: interfacing Python interpreter with a VB6 frontend

2007-10-03 Thread Steve Holden
Anonymous wrote:
> 
> Ryan Ginstrom wrote:
> 
>>> On Behalf Of Anonymous
>>> This requires several steps, but the one I am having most 
>>> problem finding info on is the ff:
>>>
>>> 1. using/interacting the Python interpreter from VB6
>>
>> One way to do this might be by creating a COM server with Python, and having
>> VB feed it lines of text and then collect results of execution for display.
>>
>> win32com has demos of COM servers.
>>
>> --
>> Regards,
>> Ryan Ginstrom
>>
> 
> Hi Ryan, do you have a link to the resources you mentioned?. I did a 
> search for win32com - and found this : 
> http://python.net/crew/mhammond/win32/FAQ.html  (most of the links were 
> either dead, or refrerred to using COM from within Python - i.e. the 
> OTHER way round).

You might also want to pick up a copy of Hammond and Robinson's 
"Programming Win32 in Python", which discusses various ways of 
front-ending Python programs with VB interfaces.

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List Question

2007-10-03 Thread Bjoern Schliessmann
Pablo Ziliani wrote:

> 
> 
> I always use this full-featured, all-inclusive, rock-solid version
> (see the try/except block):
> 
> count = i = 0
> x = 1
> y = [1,2,3,4,5,1,2,3,4,1,2,1]
> try:
> while count < 3:
> if y[i] == x:
> count += 1
> i += 1
> except RuntimeError:
> pass
> except IndexError:
> pass
> else:
> print x
> 
> 

Wrong, this must be just

except:
pass

Regards&CNRE,


Björn

-- 
BOFH excuse #141:

disks spinning backwards - toggle the hemisphere jumper.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: random keypress bounce in a terminal

2007-10-03 Thread Bjoern Schliessmann
István wrote:
> Moreover, I would also state for others: the behavior of this code
> is independent of the keyboard repeating rate.

Sure, it's not multiple keypresses but a sequence generated by the
VT code in the kernel.

> But what if it _seems_  to work differently...?
> That's the reason of trying to make somebody just to see
> him/herself the symptom.
> *   bfc.py 4863 bytes *
> *  uni_getch.py 873 bytes *
> *   demo1.brd 84311 bytes *
> *   demo2.brd 84336 bytes 
> http://www.evoran.hu/tmp/
> *Please, check somebody and explain how is possible what is
> impossible Istvan

Check what? What's impossible?

Regards,


Björn

-- 
BOFH excuse #120:

we just switched to FDDI.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Jim
On Oct 3, 6:18 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote:
> Should I file this as a bug to be solved? I have my workaround now,
> but I read online that more people seem to have ran into this.
Perhaps it is not a bug in that it does not violate the standard.  But
I know that I have been annoyed by it any number of times.  I think it
is fair to say that it violates the principle of least surprise.

IMHO "Then a shot rang out.\nHe shouted."
should be pretty-printed as


  Then a shot rang out.
He shouted.


That is, I perceive that the "right" behavior is to not add white
space to the textual data.

No doubt this is a matter of taste and of intended audience (and maybe
there are complications that I don't see).  But let me urge you to
send the mataintainers something.

Jim Hefferon

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb:
> Hello all,
> 
> in python2.4, i read lines from a file with
> 
> for lineNum, line in enumerate(f): ...
> 
> However, lineNum soon overflows and starts counting backwards. How do
> i force enumerate to return long integer?

Most probably you can't, because it is a C-written function I presume.

But as python 2.4 has generators, it's ease to create an enumerate yourself:


def lenumerate(f):
 i = 0
 for line in f:
 yield i, line
 i += 1

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A total bullshit (was : A Must Read!!!)

2007-10-03 Thread Diez B. Roggisch
Bruno Desthuilliers schrieb:
> [EMAIL PROTECTED] a écrit :
>> I have found an excellent resource on Object Oriented Programming.
>>
>>
> (url snipped to protect the innocents)
> 
> Let's see:
> 
> "An object has methods, properties and events."
> 
> Hem...
> 
> "oriented programming probably existed before the concept of a class 
> came into being but today the concept of a class is essential to object 
> orientation."
> 
> Hem hem...
> 
> This is total bullshit.

"""
Polymorphism happens and we can’t avoid it despite its silly sounding 
name.  We might have a baseclass which represents a basic document and 
we might subclass this generate ‘invoices’.  A different subclass might 
generate ‘cheques’. They may both have a method called print but the 
implementation of ‘print’ could be entirely different for the two base 
classes even though the same name ‘print’ is used in each case.  That’s 
polymorphism
"""

Hilarious! I wasn't aware of the technical term "silly sounding name" ...

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread Martin v. Löwis
> It looks like this
> 
> MyPythonProgram --->Proxy>Server
> The  proxy is written in Java. I want to use that proxy to see what my
> Python program sends to server.
> The proxy uses its own certificate and this certificate must be
> trusted, I think, otherwise I receive an error.

What error do you receive precisely? Please copy it literally from
the terminal, don't rephrase it.

Regards,
Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Marc 'BlackJack' Rintsch
On Wed, 03 Oct 2007 12:18:45 +0200, Jorgen Bodde wrote:

>> Which part of the standard is this? Here's the XML 1.0 specification's
>> section on whitespace:
>>
>> http://www.w3.org/TR/2006/REC-xml-20060816/#sec-white-space
> 
> Well 2.10 if I quote:
> 
> 
> Such white space is typically not intended for inclusion in the
> delivered version of the document. On the other hand, "significant"
> white space that should be preserved in the delivered version is
> common, for example in poetry and source code.
> 
> 
> I interpret "significant" whitespaces as the ones between the words,
> if whitespaces occur at the beginning of a line due to an indent like

Significant whitespace is all whitespace in nodes that may contain text. 
You need a DTD or schema to decide this, that's why all pretty printing
without a DTD or schema is broken IMHO.  Because you then simply don't
know if it is safe to strip or add whitespace.

> 
>  This is indented text
> 
> 
> We can assume that the spaces in front of it are not significant
> whitespaces.

I can't.  You are just guessing.

> Because when I read the text node in python and it is not
> included, I see no reason why it should be preserved.

But it should be included.

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setuptools without unexpected downloads

2007-10-03 Thread kyosohma
On Oct 2, 11:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue, 02 Oct 2007 10:11:24 -0300, <[EMAIL PROTECTED]> escribi?:
>
> > Holden indicates that VS2003 is the current compiler used for the
> > official Python distribution. Do you know how to use that program to
> > compile an exe?
>
> Open the program, press F1 and read the documentation provided by its
> vendor, Microsoft.

Sheesh! MS Documentation would take weeks and weeks to read, let alone
analyze and grok. I was hoping to avoid that, but it was my next step
if I hadn't received an answer.

>
> > I'm assuming the line "python setup.py bdist_wininst"
> > isn't sufficient since it was an answer to my somewhat naive question.
>
> Why not? As F.L. said, if the setup.py is properly built, doing so should
> compile and link all the required modules.
> Note that it's not *required* to use Visual Studio to compile Python
> extensions; any decent compiler would do [provided it links against the
> same RTL as used by VS]

F.L. also said to use "the same compilers as used for the python.org
core distribution" if possible.

>
> This recent blog post contains step-by-step instructions on using free
> tools to compile python extensions:
> 
>
> --
> Gabriel Genellina

I'll check out your link as well as Max's though. I'm not averse to
doing it open source.

Mike

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using fractions instead of floats

2007-10-03 Thread Raymond L. Buvel
Neil Cerutti wrote:

>> Another guess could be that real numbers being closed under the
>> four arithmetic operations, there is no danger to accidentally
>> step into complex numbers. OTOH floats and rationals are two
>> (conflicting) ways of extending integers.
> 
> You would have to adopt a few simple conversion rules, a la
> Scheme. Inexact numbers are contagious, for example. It was
> pretty shocking for a Scheme programmer to see the gmpy package
> break that rule. ;)

There is another package that supports rationals.

http://pypi.python.org/pypi/clnum/1.2

One of the reasons I created this package is that I didn't like
implicit conversion of inexact numbers to exact numbers.  Instead
clnum either raises an exception (with Python floats and complex)
or converts the rational to a compatible inexact type (with mpf
and cmpf).

Other reasons for creating this package are gmpy doesn't support
complex numbers or the functions in the math and cmath modules.

However, gmpy does have many capabilities that are not in clnum so
you need to choose based on the type of problem you want to solve.

Ray Buvel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Tim Chase
>> in python2.4, i read lines from a file with
>>
>> for lineNum, line in enumerate(f): ...
>>
>> However, lineNum soon overflows and starts counting backwards. How do
>> i force enumerate to return long integer?
> 
> Most probably you can't, because it is a C-written function I presume.
> 
> But as python 2.4 has generators, it's ease to create an enumerate yourself:
> 
> 
> def lenumerate(f):
>  i = 0
>  for line in f:
>  yield i, line
>  i += 1


I'd consider this a bug:  either in the implementation of 
enumerate(), or in the documentation

http://docs.python.org/lib/built-in-funcs.html#l2h-24

which fails to mention such arbitrary limitations.  The 
documentation describes what you create as an lenumerate() function.

Most likely, if one doesn't want to change the implementation, 
one should update the documentation for enumerate() to include a 
caveat like xrange() has

http://docs.python.org/lib/built-in-funcs.html#l2h-80

"""
Note: xrange() is intended to be simple and fast. Implementations 
may impose restrictions to achieve this. The C implementation of 
Python restricts all arguments to native C longs ("short" Python 
integers), and also requires that the number of elements fit in a 
native C long.
"""

While yes, it's easy enough to create the above lenumerate 
generator (just as it's only slightly more work to create an 
lxrange function), it would be good if the docs let you know that 
you might need to create such a function

-tkc



-- 
http://mail.python.org/mailman/listinfo/python-list


Real time plot

2007-10-03 Thread Jean-Francois Canac
I am reading a large amount of data from a COM port (or from a file) at a
rate of 20 records per second. It is about positioning of a vehicle on a
race track. 

In each record we have time, position (lat and long) speed, course all from
GPS equipment. I would like to Produce a graph in real time with these
records to see the  vehicle moving on the track. The goal is to study the
vehicle performance and to always have its position, the application would
run around 24 hours.

 

I would like to write the application in Python and I am wondering which
plot interface would be the more appropriate, I have seen matplotlib, but I
do not know how to make real time applications with big amount of data. Is
hippodraw more suited to this use or an other interface?

Many thanks

jfc

-- 
http://mail.python.org/mailman/listinfo/python-list

gdbm objects not iterable?

2007-10-03 Thread Laszlo Nagy

  Hi All,

gdbm objects have a "firstkey" and a "nextkey" method. So if I want 
iterate through the keys (which I often do) then I have to do this:

def itergdbmkeys(gdbm_obj):
key = gdbm_obj.firstkey()
if key is None:
raise StopIteration
yield key
while True:
key = gdbm_obj.nextkey(key)
if key is None:
raise StopIteration
yield key

Then I can do this:

for key in itergdbmkeys(gdbm_obj):
process(key,gdbm_obj)

I wonder why we do not have a "next()" method, which could return an 
iterator instantly. I don't think that it would be harmful, but 
definitely it would be useful. Then we could do this:

for key in gdbm_obj:
process(key,obj)

I know that this is a very small change, but it can make gdbm objects 
look more like dictionaries.

Please make comments. :-)

   Laszlo

-- 
http://mail.python.org/mailman/listinfo/python-list


LoopingCall vs internet.TimerService (Twisted)

2007-10-03 Thread sapsi
Hi,
I guess this is not the most appropriate forum but i tried the twisted
forum  to not avail so here goes.

I have written a server which accepts connections from clients, takes
requests and adds them to a Queue (a python object of Queue.Queue).
Now i have two approaches

a) At startup, my server(a subclass of pb.Root)  runs a "dispatcher"
function using task.LoopingCall(dispatcher).start(0.1)
b)Create a separate subclass of internet.TimerService whose function
is dispatcher

[INFO: dispatcher has methods like obj.callRemote, addCallback and
addErrback]

I checked the source and it seems Loopingcall is implemented through
callLaters//Callbacks and TimerService has LoopingCall in it.

So which is better, neater, safer? loopingcall of timerservice? also
is it safe to do the calls mentioned in INFO within dispatcher?

Thank you for your time
Saptarshi

-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for volunteer to help debug SpamBayes problem

2007-10-03 Thread skip
We've had some reports of a UnicodeDecodeError in SpamBayes by people using
its IMAP filter.  I'm unable to reproduce it with other SpamBayes
applications I use and don't have a suitable IMAP setup in which to test it.
This problem is holding up the 1.1 release of SpamBayes.  If you always
wanted to give SpamBayes a try and have access to IMAP, this could be the
chance you've been waiting for.  Just reply to me ([EMAIL PROTECTED]) and I'll
help you get set up.

Thanks,

-- 
Skip Montanaro - [EMAIL PROTECTED] - http://www.webfast.com/~skip/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread Johny
On Oct 3, 2:17 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > It looks like this
>
> > MyPythonProgram --->Proxy>Server
> > The  proxy is written in Java. I want to use that proxy to see what my
> > Python program sends to server.
> > The proxy uses its own certificate and this certificate must be
> > trusted, I think, otherwise I receive an error.
>
> What error do you receive precisely? Please copy it literally from
> the terminal, don't rephrase it.
>
After I added certification, that the proxy uses, among those
Trusted Root Certification Authorities list,as
Gabriel described on Windows,

I receive
sslerror: (1, 'error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol')


What does it mean?
Thanks.
L

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread Martin v. Löwis
> After I added certification, that the proxy uses, among those
> Trusted Root Certification Authorities list,as
> Gabriel described on Windows,
> 
> I receive
> sslerror: (1, 'error:140770FC:SSL
> routines:SSL23_GET_SERVER_HELLO:unknown protocol')
> 
> 
> What does it mean?

Technically, it means that OpenSSL does not support the version of
the SSL protocol that the proxy uses.

Practically, it more likely means that the proxy does not use SSL
at all at the port you are connecting to.

What host/port are you connecting to?

Regards,
Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gdbm objects not iterable?

2007-10-03 Thread Steve Holden
Laszlo Nagy wrote:
>   Hi All,
> 
> gdbm objects have a "firstkey" and a "nextkey" method. So if I want 
> iterate through the keys (which I often do) then I have to do this:
> 
> def itergdbmkeys(gdbm_obj):
> key = gdbm_obj.firstkey()
> if key is None:
> raise StopIteration
> yield key
> while True:
> key = gdbm_obj.nextkey(key)
> if key is None:
> raise StopIteration
> yield key
> 
> Then I can do this:
> 
> for key in itergdbmkeys(gdbm_obj):
> process(key,gdbm_obj)
> 
> I wonder why we do not have a "next()" method, which could return an 
> iterator instantly. I don't think that it would be harmful, but 
> definitely it would be useful. Then we could do this:
> 
> for key in gdbm_obj:
> process(key,obj)
> 
> I know that this is a very small change, but it can make gdbm objects 
> look more like dictionaries.
> 
> Please make comments. :-)
> 
What you would need is a method to *create and return* a generator, and 
it's the generator that should have the next() method. Otherwise you 
can't have two independent iterations over the same gdbm object (and you 
don't have a way of ensuring iteration starts at the beginning).

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Tutor] data from excel spreadsheet to csv and manipulate

2007-10-03 Thread Shawn Milochik
On 10/3/07, sacha rook <[EMAIL PROTECTED]> wrote:
>
> Hi
>
>  can anyone help with the best way to tackle this?
>
>  I have a spreadsheet ms excel, that has a name column that I want to
> extract to csv and manipulate as follows.
>
>  The name column has data in this format
>
>  Name
>
>  Surname Firstname
>
>  after extracting and manipulating I want it to be as follows in three comma
> separated fields;
>
>
>  Firstname, Surname, Firstname Surname
>
>  So
>
>  Smith John
>
>  becomes
>
>  John, Smith, John Smith
>
>  I hope I have explained myself.
>
>  I want to use python to do all this if sensible, so what is the best
> approach?
>
>  Many thanks
>
>  S
>
> 
> Do you know a place like the back of your hand? Share local knowledge with
> BackOfMyHand.com
> ___
> Tutor maillist  -  [EMAIL PROTECTED]
> http://mail.python.org/mailman/listinfo/tutor
>
>


Here's the best approach:

1. Browse: http://python.org/doc/

2. Search Google.

3. Write code.

4. Post code to the group and ask for help with the pieces that aren't
working as you expect.

Have fun!

Shawn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Steve Holden
[EMAIL PROTECTED] wrote:
> Hello all,
> 
> in python2.4, i read lines from a file with
> 
> for lineNum, line in enumerate(f): ...
> 
> However, lineNum soon overflows and starts counting backwards. How do
> i force enumerate to return long integer?
> 
Just how "soon" exactly do you read sys.maxint lines from a file? I 
should have thought that it would take a significant amount of time to 
read 2,147,483,647 lines ...

But it is true that Python 2.5 uses an enumobject representation that 
limits the index to a (C) long:

typedef struct {
 PyObject_HEAD
 long  en_index;/* current index of enumeration */
 PyObject* en_sit;  /* secondary iterator of enumeration */
 PyObject* en_result;   /* result tuple  */
} enumobject;

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: logging module and trailing newlines

2007-10-03 Thread Russell Warren
Both are very good responses... thanks!  I had forgotten the ease of
"monkey-patching" in python and the Stream class is certainly cleaner
than the way I had been doing it.

On Oct 3, 3:15 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> Russell Warren wrote:
> > All I'm after is the ability to log things like...
>
> > Compiling 'shrubbery.c'...  [DONE]
>
> > where the "[DONE]" was added later in time than the "Compiling...", and
> > the output goes to both stdout and to a log file.  ie: I want to tee my
> > print statements and keep the ability to skip the trailing newline.  I had
> > rolled my own primitive version than decided to try the logging module for
> > kicks.
>
> > Anyone have a suggestion on how to get logging to work like this?  Or know
> > of a way to tee in Windows without forcing other users to install a tee
> > package?
>
> (1) Logging
>
> If you are too lazy to subclass you can monkey-patch:
>
> >>> import logging
> >>> def emit(self, record):
>
> ... msg = self.format(record)
> ... fs = "%s" if getattr(record, "continued", False) else "%s\n"
> ... self.stream.write(fs % msg)
> ... self.flush()
> ...>>> logging.StreamHandler.emit = emit
> >>> continued = dict(continued=True)
> >>> logging.error("Compiling... ", extra=continued); logging.error("[Done]")
>
> ERROR:root:Compiling... ERROR:root:[Done]
>
> (2) Teeing
>
> "Primitive", but should work:
>
> >>> class Stream(object):
>
> ... def __init__(self, *streams):
> ... self.streams = streams
> ... def write(self, s):
> ... for stream in self.streams:
> ... stream.write(s)
> ... def flush(self):
> ... for stream in self.streams:
> ... stream.flush()
> ...>>> import sys
> >>> stream = Stream(sys.stdout, sys.stderr)
> >>> print >> stream, "Compiling...",
>
> Compiling...Compiling...>>>
>
> I'd probably go with the latter.
>
> Peter


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: reliable unit test logging

2007-10-03 Thread Vyacheslav Maslov
Ben Finney wrote:
> Vyacheslav Maslov <[EMAIL PROTECTED]> writes:
> 
>> I understand your opinion
> 
> Hopefully you mean "explanation", not "opinion". I gave what appear to
> me to be facts, not opinion, about the definition of a unit test.
Yes, i meant "explanation".

I have one more question related to logging module, not unit test. I use 
FileHandler to append information to file log, in fact location of log 
file depends on some external factor and is calculated during 
initialization. Furthermore i want to use configuration file because it 
is comfortable way. So i need way to define in configuration file some 
variable which should evaluated during logging system initialization, i 
try following way:

[handler_hand02]
class=FileHandler
level=NOTSET
formatter=form01
args=(logFileDir+"myfile.log","a",)
logFileDir is defined in scope of module which call 
logging.config.fileConfig()

and it produces "name 'logFileDir' is not defined" exception. As i 
understand this happens because inside logging module variable 
logFileDir is not visible. How i can avoid this?

Thanks!



-- 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Tim Chase
>> for lineNum, line in enumerate(f): ...
>>
>> However, lineNum soon overflows and starts counting backwards. How do
>> i force enumerate to return long integer?
>>
> Just how "soon" exactly do you read sys.maxint lines from a file? I 
> should have thought that it would take a significant amount of time to 
> read 2,147,483,647 lines ...

A modestly (but not overwhelmingly) long time:

(defining our own xrange-ish generator that can handle things 
larger than longs)

 >>> def xxrange(x):
... i = 0
... while i < x:
... yield i
... i += 1
...
 >>> for i,j in enumerate(xxrange(2**33)): assert i==j
...
Traceback (most recent call last):
   File "", line 1, in ?
AssertionError


It took me about an 60-90 minutes to hit the assertion on a 
dual-core 2.8ghz machine under otherwise-light-load.  If 
batch-processing lengthy log files or other large data such as 
genetic data, it's entirely possible to hit this limit as the OP 
discovered.

-tkc



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gdbm objects not iterable?

2007-10-03 Thread Laszlo Nagy

>>
>> I know that this is a very small change, but it can make gdbm objects 
>> look more like dictionaries.
>>
>> Please make comments. :-)
>>
>> 
> What you would need is a method to *create and return* a generator, and 
> it's the generator that should have the next() method. Otherwise you 
> can't have two independent iterations over the same gdbm object (and you 
> don't have a way of ensuring iteration starts at the beginning).
>   
Yes, of course, you are right. I should have returned a newly created 
generator. Still I wonder why we do not have this? Would it be a good 
idea to make gdbm objects iterable by default?

Thanks,

   Laszlo

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Steve Holden
Tim Chase wrote:
>>> for lineNum, line in enumerate(f): ...
>>>
>>> However, lineNum soon overflows and starts counting backwards. How do
>>> i force enumerate to return long integer?
>>>
>> Just how "soon" exactly do you read sys.maxint lines from a file? I 
>> should have thought that it would take a significant amount of time to 
>> read 2,147,483,647 lines ...
> 
> A modestly (but not overwhelmingly) long time:
> 
> (defining our own xrange-ish generator that can handle things larger 
> than longs)
> 
>  >>> def xxrange(x):
> ... i = 0
> ... while i < x:
> ... yield i
> ... i += 1
> ...
>  >>> for i,j in enumerate(xxrange(2**33)): assert i==j
> ...
> Traceback (most recent call last):
>   File "", line 1, in ?
> AssertionError
> 
> 
> It took me about an 60-90 minutes to hit the assertion on a dual-core 
> 2.8ghz machine under otherwise-light-load.  If batch-processing lengthy 
> log files or other large data such as genetic data, it's entirely 
> possible to hit this limit as the OP discovered.
> 
I wouldn't dream of suggesting it's impossible. I just regard "soon" as 
less than an hour in commuter's terms, I suppose.

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Tutor] data from excel spreadsheet to csv and manipulate

2007-10-03 Thread Neal Becker
look at xlrd module and also csv module.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Tim Golden
Steve Holden wrote:
> I wouldn't dream of suggesting it's impossible. 
 > I just regard "soon" as less than an hour in
 > commuter's terms, I suppose.

Sadly, speaking as a Londoner, an hour is indeed
"soon" in commuter terms.

TJG

-- 
http://mail.python.org/mailman/listinfo/python-list


I/O error

2007-10-03 Thread MV
Hi all,

I recently started getting the following error:  *Can't save config file,
I/O error: file() constructor not accessible in restrictive mode
* The app I am using is called Nicotine+ ( www.nicotine-plus.org ).
According to the developper N+ does not use restrictive mode for anything.

Can anyone help me out with this one? Any help appreciated.

OffHand
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote:
>
> > PyGtk has poor cross platform support, a very large footprint (the
> > largest of all these libraries)
>
> It's larger than wxWidgets on top of Gtk?
>

No, but it's larger than wx on top of the native API, so when you
average it across all platforms it's quite a bit larger.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/2/07, bramble <[EMAIL PROTECTED]> wrote:
> On Oct 2, 11:07 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> >
> > PyGtk has poor cross platform support, a very large footprint (the
> > largest of all these libraries) as well as a complicated runtime
> > environment.
>
> What's complicated about it?
>

There's an enormous amount of dependencies and runtime configuration,
such as finding theme engines and handling preferences. There's
solutions for managing all of that of course, but it's still much more
overhead than dirt-simple Tk.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gdbm objects not iterable?

2007-10-03 Thread Steve Holden
[back on-list]
Laszlo Nagy wrote:
> 
>> Ir probably would be helpful to add the method, but it might be tricky 
>> to trap changes to the mapping as iteration proceeded: what kind of 
>> isolation would you implement?
> Probably I would do the same that Python does with dicts:
> 
>  >>> d = {1:'a',2:'b',2:'c'}
>  >>> for k in d:
> ... if d.has_key(k+1):
> ... del d[k+1]
> ... print k
> ...
> 1
> Traceback (most recent call last):
>  File "", line 1, in 
> RuntimeError: dictionary changed size during iteration
> 
>  >>> d = {1:'a',2:'b',2:'c'}
>  >>> for k in d:
> ... del d[k+1]
> ... d[k+100] = 'XXX'
> Traceback (most recent call last):
>  File "", line 2, in 
> KeyError: 102
> 
> E.g. I would not allow to change the keys of the gdbm object during 
> iteration. I'm not sure how to detect "end of iteration" though.
> 
> (Maybe I misunderstood your question.)
> 
All I meant was that it's essential to trap this condition.

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline
-- 
http://mail.python.org/mailman/listinfo/python-list


migrating to packages

2007-10-03 Thread Gerardo Herzig
Hi all. I have a single file with several classes, wich i want to 
separate into several packages.
The big file is named, say MYCLASES, and contains a class named 
A(object), and B(A).

We have been using this MYCLASES in the
from MYCLASES import B syntax, but i cant reproduce this syntax using 
packages. Im forced to write from PACKAGE.B import *, and if that means 
i have to touch so many files, that would really be a problem to me. 
There is (i cant find it yet) a place where i can read about that kind 
of package 'migration' situation?

Because i *really* want to keep the FROM PACKAGE import B syntax.

Thanks!
Gerardo
-- 
http://mail.python.org/mailman/listinfo/python-list


Duplicate content filter..

2007-10-03 Thread Abandoned
Hi..
I'm working a search engine project now. And i have a problem. My
problem is Duplicate Contents..
I can find the percentage of similarity between two pages but i have a
5 millions index and i search 5 million page contents  to find one
duplicate :(

I want to a idea for how can i find duplicate pages quickly and fast ?

Please help me, i'm sorry my bad english.
King regards..

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generating range of numbers

2007-10-03 Thread Wildemar Wildenburger
vimal wrote:
> hi all,
> 
>  i am new to python.
>  i just want to generate numbers in the form like:
> 
> 1,2,4,8,16,32.to a maximum of 1024
> 
> using a range function
> 
Homework?

/W
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Martin v. Löwis
> 
> Such white space is typically not intended for inclusion in the
> delivered version of the document. On the other hand, "significant"
> white space that should be preserved in the delivered version is
> common, for example in poetry and source code.
> 
> 
> I interpret "significant" whitespaces as the ones between the words,

This interpretation is incorrect. It's not really possible to tell what
whitespace is significant from looking just at the document; the
classification into "significant" and "insignificant" is up to the
application, not the XML processor.

There is also the concept of "ignorable" white space in SAX (and other
APIs); by this, white space in element content is meant. This is
supported by the XML recommendation with the sentence
"A  validating XML processor  MUST also inform the application which of
these characters constitute white space appearing in element content."
(you can only know if it's in element content if you validate)

> We can assume that the spaces in front of it are not significant
> whitespaces.

No, we cannot. Maybe your application can assume that; the XML
processor cannot. In fact, the XML recommend FORBIDS the XML processor
from stripping white space.

> (etc) .. so when reading, modifying, writing XML files, the empty
> blank lines will grow exponentially.

Not sure why you keep saying that growth is exponentially; I believe
it's linear (with the number of read-write-cycles), not exponential.

> I would think (simplistic I'm sure) that if spaces are that important,
> you can always use a CDATA tag which should treat the text inside as
> raw data without any formatting and whitespace changes.

That is definitely simplistic. CDATA has no significance on formatting.

> Should I file this as a bug to be solved? I have my workaround now,
> but I read online that more people seem to have ran into this.

Feel free to come up with a patch. It is questionable whether a bug
report will help; there is a good chance that it stays open for several
years.

Regards,
Martin
-- 
http://mail.python.org/mailman/listinfo/python-list


A question about subprocess

2007-10-03 Thread JD
Hi,

I want send my jobs over a whole bunch of machines (using ssh). The
jobs will need to be run in the following pattern:

(Machine A)   (Machine B)  (Machine C)

Job A1 Job B1Job C1

 Job A2   Job B2etc

 Job A3  etc

 etc

Jobs runing on machine A, B, C should be in parallel, however, for
each machine, jobs should run one after another.

How can I do it with the subprocess?


Thanks,

JD

-- 
http://mail.python.org/mailman/listinfo/python-list


spam kontrol

2007-10-03 Thread [EMAIL PROTECTED]
hii
ı think you know spam page is the most pest for net user.I want
distinguish spam page to usefull page
if you have a idea whit  this problem pleas share to me
thank you

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Grant Edwards
On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote:
> On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
>> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote:
>>
>> > PyGtk has poor cross platform support, a very large footprint (the
>> > largest of all these libraries)
>>
>> It's larger than wxWidgets on top of Gtk?
>
> No, but it's larger than wx on top of the native API,

A moot point for X11.

> so when you average it across all platforms it's quite a bit
> larger.

I guess that's one of the costs of portability.

-- 
Grant Edwards   grante Yow! CHUBBY CHECKER just
  at   had a CHICKEN SANDWICH in
   visi.comdowntown DULUTH!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Grant Edwards
On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote:
> On 10/2/07, bramble <[EMAIL PROTECTED]> wrote:
>> On Oct 2, 11:07 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> >
>> > PyGtk has poor cross platform support, a very large footprint (the
>> > largest of all these libraries) as well as a complicated runtime
>> > environment.
>>
>> What's complicated about it?
>>
>
> There's an enormous amount of dependencies and runtime configuration,
> such as finding theme engines and handling preferences. There's
> solutions for managing all of that of course, but it's still much more
> overhead than dirt-simple Tk.

You've got to admit that Tk "just works", although as a result
it looks ugly and foreign on all platforms.

-- 
Grant Edwards   grante Yow! So this is what it
  at   feels like to be potato
   visi.comsalad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Paul Rubin
Tim Chase <[EMAIL PROTECTED]> writes:
> I'd consider this a bug:  either in the implementation of enumerate(),
> or in the documentation
> 
> http://docs.python.org/lib/built-in-funcs.html#l2h-24

2.5 has a patch that causes enumerate() and count() to raise overflow
if the count wraps around, which is still bad but at least beats
having the number suddenly go negative.  See:

  http://bugs.python.org/issue1512504 and
  http://mail.python.org/pipermail/python-checkins/2007-February/058486.html

also:

  http://bugs.python.org/issue1326277

I hope in 3.0 there's a real fix, i.e. the count should promote to
long.  The rationale for leaving the bug in the library is just silly.
2**32 is not that big a number if we're talking about a language and
runtime system supposedly good for writing servers that stay up
continuously for years.
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: module confusion

2007-10-03 Thread wang frank

Hi, 
 
I am moving from Matlab to Python+numpy+scipy. In Matlab you can use function 
dec2bin, hex2dec, dec2hex bin2dec functions to convert decimal to binary and 
heximal etc. Before I try to implement my own function in Python, I want to 
know whether in Python such functionalities are already there.
 
Thanks
 
Frank
_
MSNミュージックとEMI Artistsが共同開催するオーディション SCHOOL OF SCHOOL
http://music.jp.msn.com/-- 
http://mail.python.org/mailman/listinfo/python-list

function to convert data into binary, hex and back.

2007-10-03 Thread wang frank




From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: module confusionDate: Wed, 3 
Oct 2007 17:14:19 +


Hi,  I am moving from Matlab to Python+numpy+scipy. In Matlab you can use 
function dec2bin, hex2dec, dec2hex bin2dec functions to convert decimal to 
binary and heximal etc. Before I try to implement my own function in Python, I 
want to know whether in Python such functionalities are already there. Thanks 
Frank

MSNミュージックとEMI Artistsが共同開催するオーディション SCHOOL OF SCHOOL http://music.jp.msn.com/ 
_
【MSNビデオ】超貴重!驚きの大物対談が実現。作家 村上龍が話題のあの人に迫る
http://video.msn.co.jp/rvr/default.htm-- 
http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread George Neuner
On Wed, 3 Oct 2007 09:36:40 + (UTC), [EMAIL PROTECTED] (Bent C
Dalager) wrote:

>In article <[EMAIL PROTECTED]>, David Kastrup  <[EMAIL PROTECTED]> wrote:
>>[EMAIL PROTECTED] (Bent C Dalager) writes:
>>
>>> In article <[EMAIL PROTECTED]>,
>>> Frank Goenninger  <[EMAIL PROTECTED]> wrote:

Well, I didn't start the discussion. So you should ask the OP about the 
why. I jumped in when I came across the so often mentioned "hey, it's 
all well defined" statement was brought in. I simply said that if that 
"well-definedness" is against "common understanding" then I don't give 
a damn about that clever definitions. Because I have to know that there 
are such definitions - always also knowing that free is not really 
free.
>>>
>>> "Liberated" is a valid meaning of the word "free".
>>
>>No.  It is a valid meaning of the word "freed".
>
>Only if you're being exceedingly pedantic and probably not even
>then. Webster 1913 lists, among other meanings,
>
>Free
>(...)
>"Liberated, by arriving at a certain age, from the control
>of parents, guardian, or master."
>
>The point presumably being that having been "liberated", you are now
>"free".

I don't think knowing the meaning of a word is being pedantic.
"Freed" is derived from "free" but has a different, though associated,
meaning.  Words have meaning despite the many attempts by Generation X
to assert otherwise.  Symbolism over substance has become the mantra
of the young.

The English language has degenerated significantly in the last 30
years.  People (marketers in particular) routinely coin ridiculous new
words and hope they will catch on.  I remember seeing a documentary
(circa 1990?) about changes in the English language.  One part of the
program was about the BBC news and one of its editors, whom the staff
called the "protector of language", who checked the pronunciation of
words by the news anchors.  The thing that struck me about this story
was the number of BBC newspeople who publicly admitted that they could
hardly wait for this man to retire so they could write and speak the
way they wanted rather than having to be "correct".

Dictionaries used to be the arbiters of the language - any word or
meaning of a word not found in the dictionary was considered a
colloquial (slang) use.  Since the 1980's, an entry in the dictionary
has become little more than evidence of popularity as the major
dictionaries (OED, Webster, Cambridge, etc.) will now consider any
word they can find used in print.

George
--
for email reply remove "/" from address
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Raymond Hettinger
[Paul Rubin]
> I hope in 3.0 there's a real fix, i.e. the count should promote to
> long.

In Py2.6, I will mostly likely put in an automatic promotion to long
for both enumerate() and count().  It took a while to figure-out how
to do this without killing the performance for normal cases (ones used
in real programs, not examples contrived to say, "omg, see what
*could* happen").


Raymond



-- 
http://mail.python.org/mailman/listinfo/python-list


Class design question

2007-10-03 Thread Adam Lanier
Relatively new to python development and I have a general question
regarding good class design.

Say I have a couple of classes:

Class Foo:
params = [ ]
__init__( self, param ):
...

Class Bar:
data = None
__init__( self, data ):
...

The class is going to be a wrapper around a list of Bars() (among other
things).  I want the ability to pass to the constructor of Foo either:
a string'baz'
a Bar objectBar( 'baz' )
a list of strings and/or bars ( 'baz', Bar( 'something else' ))


Am I going to have to use isinstance() to test the parameter to __init__
to see what type of data I'm passing in, i.e.,

Class Foo:
params = [ ]
__init__( self, param ):
if isinstance( param, list ):
for p in param:
addParam( p )
elif isinstance( param, str):
addParam( param )

addParam( self, param ):
if isinstance( param, Bar ):
self.params.add( param )
elif isinstance( param, str ):
self.params.add( Bar( param ))
else:
raise TypeError( "wrong type of input" )

Am I missing something here or is there a more Pythonic way to
accomplish this?

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: module confusion

2007-10-03 Thread wang frank

Sorry for the wrong title of this email. Please ignore this email. I have 
resend the question with correct title.
 
Thanks
 
frank


From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: module confusionDate: Wed, 3 
Oct 2007 17:14:19 +


Hi,  I am moving from Matlab to Python+numpy+scipy. In Matlab you can use 
function dec2bin, hex2dec, dec2hex bin2dec functions to convert decimal to 
binary and heximal etc. Before I try to implement my own function in Python, I 
want to know whether in Python such functionalities are already there. Thanks 
Frank

MSNミュージックとEMI Artistsが共同開催するオーディション SCHOOL OF SCHOOL http://music.jp.msn.com/ 
_
今話題になってる出来事や有名人をランキングで毎週発表「MSN 気になる言葉」
http://keyword.jp.msn.com/default.aspx-- 
http://mail.python.org/mailman/listinfo/python-list

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/3/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote:
> > On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> >> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote:
> >>
> >> > PyGtk has poor cross platform support, a very large footprint (the
> >> > largest of all these libraries)
> >>
> >> It's larger than wxWidgets on top of Gtk?
> >
> > No, but it's larger than wx on top of the native API,
>
> A moot point for X11.

wxWidgets actually does have a raw X11 implementation, although nobody
uses it so it's not well maintained. And since X11 is hardly the only
platform that anyone cares about, evaluating a potential addition to
the standard library across *all* platforms is important.

>
> > so when you average it across all platforms it's quite a bit
> > larger.
>
> I guess that's one of the costs of portability.
>

Eh? The point is that wxWidgets, the more portable toolkit, is
*smaller* than Gtk. It's not really related to portability as much as
design considerations. Gtk is designed and intended to be used as a
system library, in conjunction with many other system libraries and
lots of system-level configuration. It was never written with the goal
of being an application-level toolkit.
-- 
http://mail.python.org/mailman/listinfo/python-list


How can I access MySQL Version 4.1.22 from Python 2.2.3 ???

2007-10-03 Thread tavspamnofwd
Hi all,

I would like to use Python with MySQL to create a database backend for
my website. Therefore I look at the module MySQLdb.

However the hosting my organisation uses has:

Python 2.2.3 (#1, Dec 21 2006, 18:29:13)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)]

MySQL Version 4.1.22-standard-log


Some web surfing reveals:
MySQLdb 1.20 requires Python 2.3.4 so I would have to use MySQLdb
1.0.1

BUT MySQLdb 1.0.1 is compatible with MySQL-3.22, 3.23, and 4.0 ( * * *
not 4.1 or newer * * * ).

So there is no version of MySQLdb that works with my versions of
Python and MySQL???

Is this correct? Is there a different module I can use instead?

Please help me because the other option is to change the domain to a
windows server and use asp.net, which I would rather not do :)

Thanks in advance,
Tom

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: module confusion

2007-10-03 Thread Carsten Haese
On Wed, 2007-10-03 at 17:24 +, wang frank wrote:
> Sorry for the wrong title of this email. Please ignore this email. I
> have resend the question with correct title.

But it's still in the wrong thread. When asking a new question, you
should compose a new message instead of replying to an existing message.

-- 
Carsten Haese
http://informixdb.sourceforge.net


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: C Source Code Generator For Test Cases

2007-10-03 Thread gamename

> You might want to look at COG (http://www.nedbatchelder.com/code/
> cog/).  It might be helpful to you.  I really enjoy using it and keep
> finding things to use it with.

Thanks Mike.  I agree. COG looks really promising.

-T

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Robert Kern
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Robert
> Kern wrote:
> 
>> Lawrence D'Oliveiro wrote:
>>
>>> In message <[EMAIL PROTECTED]>, Robert
>>> Kern wrote:
>>>
 Not all of the modules in a package are imported by importing the
 top-level package.
>>> You can't import packages, only modules.
>>>
 os.path is a particularly weird case because it is just an alias to the
 platform-specific path-handling module; os is not a package.
>>> os is a module, os.path is a variable within that module. That's all
>>> there is to it.
>> Yes, but os.path is also module. That's why I said it was a weird case.
> 
> You can't have modules within modules. os.path isn't an exception--see
> below.
> 
>> In [1]: import os
>>
>> In [2]: type(os.path)
>> Out[2]: 
> 
> On my Gentoo system:
> 
> >>> import os
> >>> os.path
> 
> 
> It's just a variable that happens to point to the posixpath module.

I believe that is precisely what I was saying.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

-- 
http://mail.python.org/mailman/listinfo/python-list


python autoconf macro for building ming extension

2007-10-03 Thread Daniel Nogradi
It might be slightly off topic here but couldn't find a more suitable
place for this question:

I'm trying to build the python binding for ming -- http://ming.sf.net
-- but for some reason the python macro for autoconf -- python.m4 --
doesn't seem to detect my python installation correctly. The strange
thing is that it seemingly detects everything correctly, but a final
check still fails. I have the python 2.5 source distribution installed
to /usr/local the standard location.

Configuring ming fails with:

checking for python... /usr/local/bin/python
checking for python2.5... (cached) /usr/local/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/local/include/python2.5
checking for Python library path... -L/usr/local/lib/python2.5 -lpython2.5
checking for Python site-packages path... /usr/local/lib/python2.5/site-packages
checking python extra libraries... -lpthread -ldl -lutil
checking python extra linking flags... -Xlinker -export-dynamic
checking consistency of all components of python development environment... no
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  


and all variables above are correct. It apparently found

PYTHON_CPPFLAGS=-I/usr/local/include/python2.5
PYTHON_LDFLAGS=-L/usr/local/lib/python2.5 -lpython2.5
PYTHON_SITE_PKG=/usr/local/lib/python2.5/site-packages
PYTHON_EXTRA_LIBS=-lpthread -ldl -lutil
PYTHON_EXTRA_LDFLAGS=-Xlinker -export-dynamic

all correctly, yet the final check fails. I even tried configuring
with PYTHON_NOVERSIONCHECK and LDFLAGS=-L/usr/local/lib/python2.5 and
gave the above environment variables manually but still the same final
check fails.

Apparently it's not a ming but an autoconf issue. Anyone familiar with
python.m4?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: spam kontrol

2007-10-03 Thread George Sakkis
On Oct 3, 12:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> hii
> ý think you know spam page is the most pest for net user.

...closely followed in the second position by incoherent misspelled
posts in silly IM-speak.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: enumerate overflow

2007-10-03 Thread Paul Rubin
Raymond Hettinger <[EMAIL PROTECTED]> writes:
> In Py2.6, I will mostly likely put in an automatic promotion to long
> for both enumerate() and count().  It took a while to figure-out how
> to do this without killing the performance for normal cases (ones used
> in real programs, not examples contrived to say, "omg, see what
> *could* happen").

Great, this is good to hear.  I think it's ok if the enumeration slows
down after fixnum overflow is reached.  So it's just a matter of
replacing the overflow signal with consing up a long.  The fixnum case
would be the same as it is now.  To be fancy, the count could be
stored in two C ints (or a gcc long long) so it would go up to 64 bits
but I don't think it's worth it, especially for itertools.count which
should be able to take arbitrary (i.e. larger than 64 bits) initializers.

As for real programs, well, the Y2038 bug is slowly creeping up on us.
That's when Unix timestamps overflow a signed 32-bit counter.  It's
already caused an actual system failure, in 2006:

http://worsethanfailure.com/Articles/The_Harbinger_of_the_Epoch_.aspx

Really, the whole idea of int/long unification is so we can stop
worrying about "omg, that could happen".  We want to write programs
without special consideration or "omg" about those possibilities, and
still have them keep working smoothly if that DOES happen.  Just about
all of us these days have 100's of GB's or more of disk space on our
systems, and files with over 2**32 bytes or lines are not even
slightly unreasonable.  We shouldn't have to write special generators
to deal with them, the library should instead just do the right thing.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module confusion

2007-10-03 Thread Michael Spencer
+1 Subject line of the week (SLOTW)

rjcarr wrote:
> So my question is ... why are they [os.path and logging.handlers] different?

[A] wrote:
> Because you misspelled it. First, do a dir() on logging:

[B] wrote:
> No, he didn't... OP: logging is a package and logging.handlers is one module 
> in the package... os.path is a particularly weird case...

[C] wrote:
> You can't import packages, only modules.

[D] wrote:
> Oh come on, this is unnecessary nitpicking.

[E] wrote:
 > You *can* import a package, and a package is just a *little* different from a
 > module

[B] wrote:
> Yes, but os.path is also module. That's why I said it was a weird case.

[C] wrote:
> You can't have modules within modules. os.path isn't an exception...It's just
>  a variable that happens to point to the posixpath module.

[F] wrote:
> There's no "pointing" going on. It's another name bound to the same object,
> of equal status to the 'posixpath' name.

[G] wrote:
> a module is just an object, that can of course be an attribute of another
> module object

[H] wrote:
> os is not a package; os.path is set when the os module is imported

[C] wrote:
> You're right. I was misremembering the behaviour of PyCrypto

[J] wrote:
> In Matlab you can use function dec2bin, hex2dec, dec2hex bin2dec functions to
> convert decimal to binary and heximal etc.

[B] wrote:
> I believe that is precisely what I was saying.


with apologies to all concerned :-)

Michael





-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Bent C Dalager
In article <[EMAIL PROTECTED]>,
George Neuner   wrote:
>On Wed, 3 Oct 2007 09:36:40 + (UTC), [EMAIL PROTECTED] (Bent C
>Dalager) wrote:
>
>>
>>Only if you're being exceedingly pedantic and probably not even
>>then. Webster 1913 lists, among other meanings,
>>
>>Free
>>(...)
>>"Liberated, by arriving at a certain age, from the control
>>of parents, guardian, or master."
>>
>>The point presumably being that having been "liberated", you are now
>>"free".
>
> (...)
>
>The English language has degenerated significantly in the last 30
>years.
> (...)
>
>Dictionaries used to be the arbiters of the language - any word or
>meaning of a word not found in the dictionary was considered a
>colloquial (slang) use.  Since the 1980's, an entry in the dictionary
>has become little more than evidence of popularity as the major
>dictionaries (OED, Webster, Cambridge, etc.) will now consider any
>word they can find used in print.

Apparantly, you missed the part where I referred to the 1913 edition
of Webster. I have kept it in the quoted text above for your
convenience. I can assure you that 1913 is both more than 30 years ago
/and/ it is before 1980, in case that was in doubt.

Cheers
Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
powered by emacs
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread bramble
On Oct 3, 1:39 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On 10/3/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
>
> > On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote:
> > > On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> > >> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote:
>
> > >> > PyGtk has poor cross platform support, a very large footprint (the
> > >> > largest of all these libraries)
>
> > >> It's larger than wxWidgets on top of Gtk?
>
> > > No, but it's larger than wx on top of the native API,
>
> > A moot point for X11.
>
> wxWidgets actually does have a raw X11 implementation,

Wait though. If I want to use wxPython, my python code calls wxWidgets
code which calls gtk. So, it would seem simpler to remove 1 layer and
just call the gtk code directly via PyGTK.

>
> > > so when you average it across all platforms it's quite a bit
> > > larger.
>
> > I guess that's one of the costs of portability.
>
> Eh? The point is that wxWidgets, the more portable toolkit, is
> *smaller* than Gtk. It's not really related to portability as much as
> design considerations.

Isn't wxWidgets smaller that GTK+ simply because it's a wrapper and
doesn't do its own drawing?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread David Kastrup
[EMAIL PROTECTED] (Bent C Dalager) writes:

> In article <[EMAIL PROTECTED]>,
> George Neuner   wrote:
>>On Wed, 3 Oct 2007 09:36:40 + (UTC), [EMAIL PROTECTED] (Bent C
>>Dalager) wrote:
>>
>>>
>>>Only if you're being exceedingly pedantic and probably not even
>>>then. Webster 1913 lists, among other meanings,
>>>
>>>Free
>>>(...)
>>>"Liberated, by arriving at a certain age, from the control
>>>of parents, guardian, or master."
>>>
>>>The point presumably being that having been "liberated", you are now
>>>"free".

Not as much "been" liberated, but "turned" liberated.

>>Dictionaries used to be the arbiters of the language - any word or
>>meaning of a word not found in the dictionary was considered a
>>colloquial (slang) use.  Since the 1980's, an entry in the
>>dictionary has become little more than evidence of popularity as the
>>major dictionaries (OED, Webster, Cambridge, etc.) will now consider
>>any word they can find used in print.
>
> Apparantly, you missed the part where I referred to the 1913 edition
> of Webster. I have kept it in the quoted text above for your
> convenience. I can assure you that 1913 is both more than 30 years
> ago /and/ it is before 1980, in case that was in doubt.

But picking just a single word from a whole explanation of _one_
naming and declaring it as equivalent is not really being careful with
language at all.

And even when using a Thesaurus, it should be clear that the offered
alternatives are not supposed to or capable of capturing all nuances
of the keyword.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Class design question

2007-10-03 Thread George Sakkis
On Oct 3, 1:04 pm, Adam Lanier <[EMAIL PROTECTED]> wrote:
> Relatively new to python development and I have a general question
> regarding good class design.
>
> Say I have a couple of classes:
>
> Class Foo:
> params = [ ]
> __init__( self, param ):
> ...
>
> Class Bar:
> data = None
> __init__( self, data ):
> ...
>
> The class is going to be a wrapper around a list of Bars() (among other
> things).  I want the ability to pass to the constructor of Foo either:
> a string'baz'
> a Bar objectBar( 'baz' )
> a list of strings and/or bars ( 'baz', Bar( 'something else' ))
>
> Am I going to have to use isinstance() to test the parameter to __init__
> to see what type of data I'm passing in, i.e.,
>
> Class Foo:
> params = [ ]
> __init__( self, param ):
> if isinstance( param, list ):
> for p in param:
> addParam( p )
> elif isinstance( param, str):
> addParam( param )
>
> addParam( self, param ):
> if isinstance( param, Bar ):
> self.params.add( param )
> elif isinstance( param, str ):
> self.params.add( Bar( param ))
> else:
> raise TypeError( "wrong type of input" )
>
> Am I missing something here or is there a more Pythonic way to
> accomplish this?

I would use variable argument list for this; it's also consistent with
your example Foo( 'baz', Bar( 'something else' )), otherwise you need
to call it as Foo([ 'baz', Bar( 'something else' ) ])

# always inherit from object unless you have a good reason not to
class Foo(object):

# XXX this is a class instance, shared by all Foo instances;
# XXX probably not what you intended
params = [ ]

def __init__(self, *args):
# uncomment the following line for instance-specific params
# self.params = []
for arg in args:
if not isinstance(arg, Bar):
   # let the Bar constructor to do typechecking or whatnot
arg = Bar(arg)
self.params.add(arg)


HTH,
George

-- 
http://mail.python.org/mailman/listinfo/python-list


Convert on uppercase unaccentent unicode character

2007-10-03 Thread JBJ
Hi,
I'am very newbie in Python.
For the moment I'am trying to convert an unicode character to his uppercase
unaccented character.
By example with locale fr_FR:
a,A,à,À should return A
o,O,ô,Ô should return O
œ,Œ should return Œ
i,I,î,Î should return I
 
Have you some suggestions ?

Thank.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and SSL

2007-10-03 Thread John J. Lee
Johny <[EMAIL PROTECTED]> writes:

> On Oct 3, 2:17 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
>> > It looks like this
>>
>> > MyPythonProgram --->Proxy>Server

You want MyPythonProgram being to be proxied by Proxy, using the HTTP
CONNECT method? (CONNECT is a way of asking the proxy to just shovel
encrypted SSL traffic from client to server) Python's standard library
doesn't provide support for that.  While it's it's possible to do it,
httplib does not provide all the code to do it, and it's actually
quite awkward to do from e.g. urllib2.


>> > The  proxy is written in Java. I want to use that proxy to see what my
>> > Python program sends to server.

Does the proxy have support for behaving as a "man-in-the-middle",
then (by giving the proxy the private key)?  I think I've heard of
that being done for test purposes, but I don't know the details.
Seems rather odd.

An easier way is to print the traffic from your Python program.


[...]
> After I added certification, that the proxy uses, among those
> Trusted Root Certification Authorities list,as
> Gabriel described on Windows,
>
> I receive
> sslerror: (1, 'error:140770FC:SSL
> routines:SSL23_GET_SERVER_HELLO:unknown protocol')
>
>
> What does it mean?

It means that it's trying to interpret SSL traffic as if it were HTTP
traffic.  Look on ASPN Python Cookbook for a few recipes on HTTP
CONNECT (though ISTR I had to rework the one I looked at before it
worked for me).  Ask if you get stuck.


John
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/3/07, bramble <[EMAIL PROTECTED]> wrote:
> On Oct 3, 1:39 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> > On 10/3/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> >
> > > On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote:
> > > > On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> > > >> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote:
> >
> > > >> > PyGtk has poor cross platform support, a very large footprint (the
> > > >> > largest of all these libraries)
> >
> > > >> It's larger than wxWidgets on top of Gtk?
> >
> > > > No, but it's larger than wx on top of the native API,
> >
> > > A moot point for X11.
> >
> > wxWidgets actually does have a raw X11 implementation,
>
> Wait though. If I want to use wxPython, my python code calls wxWidgets
> code which calls gtk. So, it would seem simpler to remove 1 layer and
> just call the gtk code directly via PyGTK.
>

By the same argument, you could say that Gtk just calls xlib, so why
not write against xlib directly? More direct is not always simpler.
But the real reason, of course, is that wxWidgets is a platform
abstraction API, and Gtk isn't.

Anyway, this discussion isn't about the relative merits of wxWidgets
and PyGtk in general, but specifically for inclusion in the standard
library.

> >
> > > > so when you average it across all platforms it's quite a bit
> > > > larger.
> >
> > > I guess that's one of the costs of portability.
> >
> > Eh? The point is that wxWidgets, the more portable toolkit, is
> > *smaller* than Gtk. It's not really related to portability as much as
> > design considerations.
>
> Isn't wxWidgets smaller that GTK+ simply because it's a wrapper and
> doesn't do its own drawing?
>

Not really, no. Qt also does all of its own drawing and is a fraction
of the size of Gtk. The amount of code thats responsible for drawing
is minuscule.

> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Bent C Dalager
In article <[EMAIL PROTECTED]>, David Kastrup  <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Bent C Dalager) writes:
>
>Not as much "been" liberated, but "turned" liberated.

I expect that either way you split this hair, using "free" in the
sense of "possessing liberty" is still going to be quite reasonable.

>But picking just a single word from a whole explanation of _one_
>naming and declaring it as equivalent is not really being careful with
>language at all.

I have never claimed equivalence. What I have made claims about are
the properties of one of the meanings of a word. Specifically, my
claim is that "free" is a reasonable description of some one or some
thing that has been "liberated".

As an example, when a slave becomes a free man, this is not commonly
understood to mean that he now has a low or zero monetary cost.

>And even when using a Thesaurus, it should be clear that the offered
>alternatives are not supposed to or capable of capturing all nuances
>of the keyword.

I have never claimed to be providing a full definition of the word.
Indeed, I quite clearly conceded very early on that "free" is commonly
associated with what might otherwise be called "gratis" - that is
"free of charge".

My effort has been to point out that the word also has other meanings.

Cheers
Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
powered by emacs
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >