Re: Request for recommendations: shared database without a server

2006-10-05 Thread EP
Larry Bates wrote:

> So what is going to be holding the "network drive" if it isn't a server?
> And what is MySQL running on?


The network drives are on a filer (a NAS array, I believe).  The filer
will not execute any code, it just serves data by whatever protocols
(example: CIFS, NFS) it is set up for.

I have MySQL running on my client machine for development, populating
itself from csv files out on another network drive which a perl cgi
script updates.  Thick in kludge, I am.


> Isn't it 'odd' that you can expect people to install MS Access but not
> some other program?


Odd and frustrating, but MS Access is "normal".


> I had to use only "existing" database tools, and the data wasn't
> too large or too complicated I would use ODBC to dBase file which
> is built into all versions of Windows that I'm aware of.  I think
> you would find that it would work for small number of users.  With
> some good planning you should also be able to architect application
> so that you can even change the underlying database later without
> too much heartburn.


Interesting idea.


thanks

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


Request for recommendations: shared database without a server

2006-10-05 Thread EP
I need to build a fairly simple application that will reside on remote
storage, not on a server, and I am looking for any best practices and
approaches that have worked for others.  I believe py2exe may be part
of the solution.  Here's what I need to build:

--  A database application on a network drive
--  A variety of users will access the database application at various
times
--  All computing is done on the client machines (Windows XP), as there
is no server
--  I'll not be able to install a database program, or Python, on the
client machines

While this seems just the sort of application servers were designed
for, the absence of a server is a firm constraint (no technological
reason, just an arbitrary wall of infinite height)

I currently have some of the required database tables populated in
MySQL, but I can migrate them as long as I have SQL capabilities in the
new database.

Can I get there with MySQL?  Or do I need to pair a pure python
approach (including the database) with py2exe?  Has anyone achieved
this with a db framework like Dabo?  Or is there another, entirely
different and better approach?


The common wisdom around the halls is to just use MS Access, because
apparently everyone has that on their client machines, or can be
asked/expected to install it.  That's not my preference, but I need to
forget my biases, be pragmatic and get the application done.

Thanks for any advice


EP

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


Middle matching - any Python library functions (besides re)?

2006-08-27 Thread EP
Hi,

I'm a bit green in this area and wonder to what extent there may be
some existing Python tools (or if I have to scratch my head real hard
for an appropriate algorithm... )  I'd hate to build an inferior
solution to that someone has painstakingly built before me.

I have some files which may have had the same origin, but some may have
had some cruft added to the front, and some may have had some cruft
added to the back; thus they may be of slightly different lengths, but
if they had the same origin, there will be a matching pattern of bytes
in the middle, though it may be offset relative to each other.  I want
to find which files have in common with which other files the same
pattern of origin within them.  The cruft portions should be a small %
of the overall file lengths.

Given that I am looking for matches of all files against all other
files (of similar length) is there a better bet than using re.search?
The initial application concerns files in the 1,000's, and I could use
a good solution for a number of files in the 100,000's.

TIA for bearing with my ignorance of the clear solution I'm surely
blind to...

EP

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


Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread EP

This inquiry may either turn out to be about the suitability of the
SHA-1 (160 bit digest) for file identification, the sha function in
Python ... or about some error in my script.  Any insight appreciated
in advance.

I am trying to reduce duplicate files in storage at home - I have a
large number files (e.g. MP3s) which have been stored on disk multiple
times under different names or on different paths.  The using
applications will search down from the top path and find the files - so
I do not need to worry about keeping track of paths.

All seemed to be working until I examined my log files and found files
with the same SHA digest had different sizes according to
os.stat(fpath).st_size .  This is on Windows XP.

-  Am I expecting too much of SHA-1?
-  Is it that the os.stat data on Windows cannot be trusted?
-  Or perhaps there is a silly error in my code I should have seen?

Thanks

- Eric

-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

Log file extract:

Dup:  noPath:  F:\music\mp3s\01125.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  01125.mp3Size:
63006
Dup:  YESPath:  F:\music\mp3s\0791.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0791.mp3Size:
50068
Dup:  YESPath:  F:\music\mp3s\12136.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  12136.mp3Size:
51827
Dup:  YESPath:  F:\music\mp3s\11137.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  11137.mp3Size:
56417
Dup:  YESPath:  F:\music\mp3s\0991.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0991.mp3Size:
59043
Dup:  YESPath:  F:\music\mp3s\0591.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0591.mp3Size:
59162
Dup:  YESPath:  F:\music\mp3s\10140.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  10140.mp3Size:
59545
Dup:  YESPath:  F:\music\mp3s\0491.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0491.mp3Size:
63101
Dup:  YESPath:  F:\music\mp3s\0392.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0392.mp3Size:
63252
Dup:  YESPath:  F:\music\mp3s\0891.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0891.mp3Size:
65808
Dup:  YESPath:  F:\music\mp3s\0691.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0691.mp3Size:
67050
Dup:  YESPath:  F:\music\mp3s\0294.mp3Hash:
00b3acb529aae11df186ced8424cb189f062fa48Name:  0294.mp3Size:
67710


Code:

# Dedup_inplace.py
# vers .02
# Python 2.4.1

# Create a dictionary consisting of hash:path
# Look for 2nd same hash and delete path

testpath=r"F:\music\mp3s"
logpath=r"C:\testlog6.txt"

import os, sha

def hashit(pth):
"""Takes a file path and returns a SHA hash of its string"""
fs=open(pth,'r').read()
sh=sha.new(fs).hexdigest()
return sh

def logData(d={}, logfile="c://filename999.txt", separator="\n"):
"""Takes a dictionary of values and writes them to the provided
file path"""
logstring=separator.join([str(key)+":  "+d[key] for key in
d.keys()])+"\n"
f=open(logfile,'a')
f.write(logstring)
f.close()
return

def walker(topPath):
fDict={}
logDict={}
limit=1000
freed_space=0
for root, dirs, files in os.walk(topPath):
for name in files:
fpath=os.path.join(root,name)
fsize=os.stat(fpath).st_size
fkey=hashit(fpath)
logDict["Name"]=name
logDict["Path"]=fpath
logDict["Hash"]=fkey
logDict["Size"]=str(fsize)
if fkey not in fDict.keys():
fDict[fkey]=fpath
logDict["Dup"]="no"
else:
#os.remove(fpath)  --uncomment only when script
proven
logDict["Dup"]="YES"
freed_space+=fsize
logData(logDict, logpath, "\t")
items=len(fDict.keys())
print "Dict entry:  ",items,
print "Cum freed space:  ",freed_space
if items > limit:
break
if items > limit:
break

def emptyNests(topPath):
"""Walks downward from the given path and deletes any empty
directories"""
for root, dirs, files in os.walk(topPath):
for d in dirs:
dpath=os.path.join(root,d)
if len(os.listdir(dpath))==0:
print "deleting:  ", dpath
os.rmdir(dpath)
   
walker(testpath)
emptyNests(testpath)

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


Re: proposed Python logo

2006-04-22 Thread EP
Michael Yanowitz wrote:

>   How about having something from Monty Python in the logo rather
>than something snakelike. Python was named after Monty Python and not
>the snake. Snakes also don't appear friendly to me.
>

I think the new logo, while professionally done (bravo!) is 
unmemmorable.  And why such fat snakes?  Snakes are not generally 
thought of as friendly (whereas Pythoin the langauge is); they are not 
even warm-blooded, and I've always thought the snake a misfit for the 
language... though the old snake was at least cute.

I think something along the "flying sheep" motif would be memorable - 
after all, many of us remember it from MP.

And something like that much better represents the change in thinking 
most programmers must undergo to embrace the language.  "Help, I'm 
falling --- I can't find any braces!"

To some extent Python is "something completely different".

EP


calling it Python and then having a flying sheep as a logo - the 
apparent contradiction might be a good mental reset for those 
approaching the language.  just my two cents
-- 
http://mail.python.org/mailman/listinfo/python-list


Site err? - modpython - django?

2006-04-01 Thread EP
Hi

i am gettng slow response from thssite en wonder if problem with gil? or 
django bug.  is this coded in modpython and to many instances?  i need 
to select web teknology en maybe python en zope is too old to handle 
high volume of download objs.  what cas problem? thks for your help.   
http://www2.sqlonrails.org/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.5 licensing: stop this change

2006-04-01 Thread EP
>
>
>Hmmm... after due consideration (and reading the announcmement
>properly), I support this license change in full.
>
>  
>


If I could read past the first paragraph do you think I would really 
hang onto this newsgroup asking stupid questions?!

The personal harm caused readers of this announcement should entitle 
each reader to a free beer (or for those with bad hearts, a 
nitroglycerin pill) at the expense of the perpetrator - though I imagine 
the PSF team of lawyers retained for license enforcement may take up the 
case on his side - money talks.


- As an aside, I should mention that I have countered the announced 
licensing change with a patent application for the use of 3, 4, or 5 
spaces as an indent for purposes of establishing a code block. I have 
written a tidy little program that will count indent spaces in all 
Python programs and expect to negotiate royalty settlements on a per 
space basis ($.0001 per space proposed).  Anyone who prefers to avoid a 
call from my legal team can simply send me their source code for royalty 
calculation, and provide a credit card or bank account number.  Thanks.

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


Re: Obtaining the remote ip address

2006-03-28 Thread EP
While on the subject of network identity, does anyone have a scheme to 
get the MAC address of the end device?  I've never come up with a way to 
do it, but I haven't had it proven to me that it is impossible (yet).


Justin Ezequiel wrote:

>os.environ['REMOTE_ADDR']
>os.environ['REMOTE_HOST']
>
>  
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Class attributes newbie question (before I join a cargocult)

2006-03-12 Thread EP
Thanks.  Argh.  I've failed to find the behavoir I need to understand.
More coffee and re-reading my code.  Thanks!

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


Re: remote module importing (urlimport)

2006-02-25 Thread EP
ajones wrote:

>What plans do you have for security in this? I would think that in
>order to trust this over the network you would at least need a
>certificate identifying the server as well as some method of verifying
>package contents.
>
>Either way, cool stuff.
>
>  
>
I think this is an interesting project.

What if every module could be registered (at Python.org, for example) 
with a unique URI, a hash digest, and optionally a list of one or more 
source code sources (URLs)?  Each module registered would have to have a 
unique name, but that is probably a good thing anyway.

Then before loading a module the urlimport code could query something like

"http://Python.org/cheeseshop/moduleNS/%s"; %moduleName

 From whence would be returned a short text file, something like:

ThisModuleName
HashNumber
["http://source1/ThisModuleName.txt";, 
"http://source2/funnydirectory/structure/ThisModuleName.txt";...]

urlimport could then query the sources given, or any other known 
repositories, until it found a module of matching digest.


What if you needed to use a certain version of a module for 
compatibility?  Then would module names like "ThisModuleName_2.71" 
become necessary?

I wonder if the ripples of setting something like this up offend 
Pythonic thinking... and if the utility of having this sort of 
functionality would be worth risking some offense.

I guess this stuff has all been done before and Python has good reasons 
for not pursuing it, but I wonder what those reasons are.


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


Re: new wooden door step - fixing and finishing

2006-02-23 Thread EP
jkn wrote:

>Hi all
>I'm considering having a go at replacing the wooden door step to
>our back door. The original is loose and rotting.
>
>I'm sure some of this will be clearer when I remove the (metal) door
>frame - how is such a step fixed? Vertical frame fixings?
>
>Also, any suggestions for treating/finishing such an item, subject to
>heavy use, to prevent future rot? I was wondering about treating it
>wilth liberal amounts of Teak Oil or similar...
>
>Thanks
>Jon N
>
>  
>
Jon,

Wood rots so no matter how you build it you are going to find yourself 
arm deep in the framing wiedling nails and wood shims in the future.  
The important thing is that you develop a proper level of documentation 
and incorporate it right into your new steps.  If the original builder 
had done this you would not now be asking these questions.

Good working documentation can be easily achieved by writing comments 
right onto the workings beneath the steps, however these comments need 
to be meaningful; an over abundance of obvious comments ("Nail goes 
here!") will actually make future rework harder.

If you have practiced proper documentation on your other projects, 
you'll do fine when you employ it here building your new steps.  Don't 
even think about teak oil until you have documented a well designed 
framework.  And remember, you're working in wood, you are going to need 
to tweak things here and there in the future

I might also recommend an object oriented approach, but I guess that's 
obvious.

Happy hammering!


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


Re: How can I determine an HTTPMessage ?

2006-01-11 Thread EP
if you bought him a beer in the future he would owe you less than a
beer today due to the time value of beer (which is, amazingly, much
greater than the time value of money)  If he buys you a beer today, you
will need to go back to the future, and we must all hope this equation
converges on an cross-time equilibrium when dealing only in integer
beers.  ("call me XAH!")

...

in case the OP was looking for HTTP codes, there is a list here (among
many other places)  http://paradigmb.com/httpCodes.txt.

now the OP may ask "How do I determine the HTTP response code when I am
using the urllib2 module such as in the following code:  ..."

but we will wait for that question (I propose) so as not to force the
OP into serious future-beer debt.

EP

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


Accessing Windows file metadata?

2006-01-11 Thread EP
I'm looking for a method by which to access Windows files metadata and
have not been able to find anything in the standard modules or via
Google - what is the standard approach?

Shamefully I really do not understand Windows file system - e.g. is
properties metadata attached to the file?if I change that metadata
do I change the file's hash?  how is the metadata structured?  or is
the "properties" metadata simply derived upon access?

Either way, is there a module or method to access this metadata (I'd
hope there was a metadata dictionary for each file, but that may be a
sign I've been spoiled by Python) ?


EP

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


Re: Microsoft IronPython?

2006-01-05 Thread EP
Luis M. González wrote:

>Will Microsoft hurt Python?
>  
>
I think it is naive to ignore the fact that Microsoft could hurt Python, 
though there may be nothing anyone can do.

>How? 
>
- create a more prevalent version of "Python" that is less Pythonic or 
undermines some of the principles of the language, basically usurping 
Python as we conceive it in the process;
- create an incompatible version, so that Python "portability" is 
dependent upon the programmer porting his code to two separate versions 
("JavaScript" comes to mind);
- create a poor implementation of Python so that programmers try the MS 
version first, find it lacking, and decide Python is a poor language... 
tarnishing the reputation of the language and its adoption...

I'm sure there are more ways MS (or any powerful entity developing 
another version of Python) could hurt Python.  You have to look beyond 
the freedom of the individual to choose to the context that individual 
operates within.

Defenses?  Maybe enforcing a trademark of "Python" as a programming 
language name - if it is registered and enforceable - clearly 
"IronPython plays on the Python" name (Pepsi wouldn't be allowed to sell 
IronCoke, would they? without Coca Cola's permission...)

>If sometime in the future, MS decides to modify the language by
>creating something different, you'll have the choice to decide whether
>you like it or not.
>Nobody will steal Python, it is free and it will always be.
>What's more, if you decide that you want to use Python on .Net and you
>don't ike the official Microsoft release, you can fork it (the code is
>freely available) and you can call it "MyGroovyNewLanguage" if you
>want.
>
>Right now there are other languages based and inspired in Python (Boo
>for example) that run on .Net and Mono, and they are useful and have an
>enthusiast comunity behind them. It's good to have many choices and
>it's good to be free to choose.
>
I'm not too worried, but the rich and powerful can always do more with 
freedom than the average person; sometimes at the expense of the average 
person.

>Although it's also very good to have a main implementation, lead by its
>creator, who will always take care that there will be a pure and
>legitimate Python for those who like it just the way it is.
>
>Luis
>

Alot of very smart and/or good folks have worked to make Python the neat 
language it is, and hopefully a "main", excellent version of Python will 
always have this.

And if the whole world goes .Net, well, Python won't be left out 
entirely, it appears.

I'd agree that meanwhile there's little reason to panic - whatever the 
future brings, it seems panicking does little good, except for arms 
merchants and sellers of duct tape and flashlight batteries.


Anyway, the next Microsoft is Google.

And they have Guido already.


[tongue in cheek!]


[ADVERTISEMENT]
Python Emergency Supplies Sold Here
- List Comprehensions - $12.99 per bracket
- Import this - a collectors item - on Sale today! - $95.99
- Namespaces (quantities limited) - call for quote!
[/]


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


Re: Guido at Google

2005-12-22 Thread EP
rbt wrote:

>Luis M. González wrote:
>  
>
>>>Java => Sun
>>>.Net => Microsoft
>>>C# => Microsoft
>>>Linux => too many big name IT companies to mention
>>>Python =>  ?
>>>  
>>>
>>I know at least one company responsible for a linux distro (Cannonical
>>- Ubuntu), which encourages and even pays programmers for developing
>>applications in Python.
>>His founder, Mark Shuttleworth, is a python fan.
>>
>>
>
>Aren't most all intelligent people Python fans?
>
>  
>
Sure, but I am not under the illusion that intelligent people control 
the fate of the world

>Python is so unbarbaric or one might say 'refined', yet it can be 
>applied in a practical manner to all sorts of things. It's like having 
>James Bond as your very own personal body guard ;)
>  
>
The truth becomes evident:  Guido did not invent Python, Q did!

Or is Guido Q?

Reminds me of a story I heard about Guido- he was working at the PSU and
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Guido at Google

2005-12-22 Thread EP
[EMAIL PROTECTED] wrote:

>Anand wrote:
>  
>
>>This is very good news. I wish Guido all the best!
>>
>>I wonder if this has got to do something with Microsoft developing
>>IronPython. Incidentellay it is reaching a 1.0 release pretty soon.
>>Perhaps Google has some cards up their sleeve. What other best way to
>>counter this than to hire the big fish himself ? :-)
>>
>>
>I wonder how high a particular programming language is in the prioirty
>of either organisations of such size ?
>
>  
>

I do not know how badly Google needs a particular programming language 
Python, but in that I believe the IT world at large could really use 
Python, more Python, both as it exists and as it might evolve to be, I 
would like to mention that Python, the language, could really use a high 
profile industry champion.

Java => Sun
.Net => Microsoft
C# => Microsoft
Linux => too many big name IT companies to mention
Python =>  ?


These kind of alliances may not improve the bytecode, but they sure 
influence what programmers get to use day in and day out.

Congrats, Guido.  Thanks for Python and may your future at Google be bright.


EP



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


Re: Python as Guido Intended

2005-11-25 Thread EP

> Should the priority be to enable python's philosophy or should
> it be the priority to limit python to only allow it's philosophy.
> 
> One groups seems to think that python's spirit is not broken
> by allowing things that seem counter to it, as long as people
> can without much trouble, work within that spirit.
> 
> An other group seems to think that any allowance to disgress
> from python's spirit is an assault on it.

This seems to assume a background philosophy of TMTOWTDI

versus 

YWKTMTOWTDIBIPFCEMS = "".join(["Yes we know","TMTOWTDI","But in Python fewer 
choices equals more simplicity")


"There should be one-- and preferably only one --obvious way to do it."

"Although that way may not be obvious at first unless you're Dutch."


Maybe what makes Python most different is its philosophy; I would not argue it 
is the ultimate philosophy --- I could not embrace a government which held such 
views --- it is nothing like Democratic --- but the people in Pythonia tend to 
be fairly nice, and the tax rate is outstandingly low.  Of course that's silly, 
Python is a tool, not a country.  Python's philosophy, however, seems to run 
counter to adding a phillips head, flat head, and hex head screwdriver blade to 
its hammer.

In life and society I hope we embrace a great multiplicity of perspectives and 
lifestyles.  This, however, is not that.

What is the philosophy?  I'm not the one to answer that, but I do use "import 
this" for reference, and it seems to answer some of the points in this thread:

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>> 


EP

"Criminy, I didn't realize that drat ternary operator was going to creep in.  
Ugh.  Drat, drat, drat!"

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


Re: __new__

2005-11-05 Thread EP
James Stroud  The quote implies that when I call carol, b.__init__ should be called. 
> However, this does not seem to be the case (see code below). What am I 
> not 
> understanding? Shouldn't the interpreter call b.__init__ when b is 
> returned 
> from carol.__new__?
> 
> James
> 
> py> class bob(object):
> ...   def __init__(self):
> ... print self.x
> ...   x = 2
> ...
> py> class carol(object):
> ...   def __new__(cls):
> ... return b
> ...
> py> b=bob()
> py> b.x
> 2
> py> c = carol()   # should print "2"
> py> c
> <__main__.bob object at 0x404333cc>
> 


It seems to produce the output you expected for me (Python 2.4.1 on Windows 
XP), but this has nothing to do with "carol".  How are bob and carol related?

Code:

class bob(object):
def __init__(self):
print self.x
x = 2

class carol(object):
def __new__(cls):
return b
b=bob()
print b.x
c = carol()
c

Output:

>>> 
2
2


This code produces the same output:

class bob(object):
def __init__(self):
print self.x
x = 2
##class carol(object):
##def __new__(cls):
##return b
b=bob()
print b.x
##c = carol()
##c


I am interested in the underlying subject but think your code was mispasted 
into the e-mail...

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


Re: Microsoft Hatred FAQ

2005-10-27 Thread EP
Was this a test of Godwin's Law?

Hitler wasn't mentioned explicitly, but he was certainly implied in the
initial post.

So we learn:

Hitler must be _explicitly_ mentioned to invoke Godwin's Law

(or)

Xah Lee is immune from the central laws of the universe


Personally I suspect Xah Lee is a bot and that is why the Laws of the
Universe do not apply to him.

A "troll bot" I say.  An AI program whose logic simply works on the
minimal basic principles required to generate conflict.  Response
capabilities are still alpha, but will augment the basic conflict
generating capabilities in future releases.

It's currently considered "Freeware" but tastes nothing like free beer.


EP

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


Re: Double replace or single re.sub?

2005-10-27 Thread EP
How does Python execute something like the following

oldPhrase="My dog has fleas on his knees"
newPhrase=oldPhrase.replace("fleas",
"wrinkles").replace("knees","face")

Does it do two iterations of the replace method on the initial and then
an intermediate string (my guess) -- or does it compile to something
more efficient (I doubt it, unless it's Christmas in Pythonville... but
I thought I'd query)

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


Re: CSV like file format featured recently in Daily Python URL?

2005-10-08 Thread EP
> From: Alex Willmer <[EMAIL PROTECTED]> inquired

> I'm trying to track down the name of a file format and python module,
> that was featured in the Daily Python URL some time in the last month 
> or
> two.
> 
> The format was ASCII with a multiline header defining types for the
> comma seperated column data below. It may have had the capability to
> store multiple tables in one file. There was news on the homepage that
> an alternate 'no data here' syntax was also supported.
> 
> An example file had vaguely this structure:
> 
> columnname as datatype
> columnname as datatype
> columnname as datatype
> columnname as datatype
> 
> data,data,data,data
> data,"other data",data,data
> data,data,"",data


Was it something like ARFF?  http://www.cs.waikato.ac.nz/~ml/weka/arff.html

Google "ARFF Python":  http://www.google.com/search?q=arff+python

-

   % 1. Title: Iris Plants Database
   % 
   % 2. Sources:
   %  (a) Creator: R.A. Fisher
   %  (b) Donor: Michael Marshall ([EMAIL PROTECTED])
   %  (c) Date: July, 1988
   % 
   @RELATION iris

   @ATTRIBUTE sepallength  NUMERIC
   @ATTRIBUTE sepalwidth   NUMERIC
   @ATTRIBUTE petallength  NUMERIC
   @ATTRIBUTE petalwidth   NUMERIC
   @ATTRIBUTE class{Iris-setosa,Iris-versicolor,Iris-virginica}
  

The Data of the ARFF file looks like the following:

   @DATA
   5.1,3.5,1.4,0.2,Iris-setosa
   4.9,3.0,1.4,0.2,Iris-setosa
   4.7,3.2,1.3,0.2,Iris-setosa
   4.6,3.1,1.5,0.2,Iris-setosa
   5.0,3.6,1.4,0.2,Iris-setosa
   5.4,3.9,1.7,0.4,Iris-setosa
   4.6,3.4,1.4,0.3,Iris-setosa
   5.0,3.4,1.5,0.2,Iris-setosa
   4.4,2.9,1.4,0.2,Iris-setosa
   4.9,3.1,1.5,0.1,Iris-setosa
  

Lines that begin with a % are comments. The @RELATION, @ATTRIBUTE and @DATA 
declarations are case insensitive. 

-

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


Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread EP

> I thought there must be something special when you named a VAR with '_'
> the first character. Maybe it's just a programming style and I had
> thought too much...

Perhaps you are thinking of the use of double leading underscore names within 
class declarations or system defined names with underscores?  

e.g.  __somePrivateVar

e.g. __init__


"""
9.6 Private Variables 
There is limited support for class-private identifiers. Any identifier of the 
form __spam (at least two leading underscores, at most one trailing underscore) 
is textually replaced with _classname__spam, where classname is the current 
class name with leading underscore(s) stripped. This mangling is done without 
regard to the syntactic position of the identifier, so it can be used to define 
class-private instance and class variables, methods, variables stored in 
globals, and even variables stored in instances. private to this class on 
instances of other classes. Truncation may occur when the mangled name would be 
longer than 255 characters. Outside classes, or when the class name consists of 
only underscores, no mangling occurs. 

Name mangling is intended to give classes an easy way to define ``private'' 
instance variables and methods, without having to worry about instance 
variables defined by derived classes, or mucking with instance variables by 
code outside the class. Note that the mangling rules are designed mostly to 
avoid accidents; it still is possible for a determined soul to access or modify 
a variable that is considered private. This can even be useful in special 
circumstances, such as in the debugger, and that's one reason why this loophole 
is not closed. (Buglet: derivation of a class with the same name as the base 
class makes use of private variables of the base class possible.) 

Notice that code passed to exec, eval() or evalfile() does not consider the 
classname of the invoking class to be the current class; this is similar to the 
effect of the global statement, the effect of which is likewise restricted to 
code that is byte-compiled together. The same restriction applies to getattr(), 
setattr() and delattr(), as well as when referencing __dict__ directly. """



"""
2.3.2 Reserved classes of identifiers 
Certain classes of identifiers (besides keywords) have special meanings. These 
classes are identified by the patterns of leading and trailing underscore 
characters: 


_* 
Not imported by "from module import *". The special identifier "_" is used in 
the interactive interpreter to store the result of the last evaluation; it is 
stored in the __builtin__ module. When not in interactive mode, "_" has no 
special meaning and is not defined. See section 6.12, ``The import statement.'' 
Note: The name "_" is often used in conjunction with internationalization; 
refer to the documentation for the gettext module for more information on this 
convention. 


__*__ 
System-defined names. These names are defined by the interpreter and it's 
implementation (including the standard library); applications should not expect 
to define additional names using this convention. The set of names of this 
class defined by Python may be extended in future versions. See section 3.3, 
``Special method names.'' 

__* 
Class-private names. Names in this category, when used within the context of a 
class definition, are re-written to use a mangled form to help avoid name 
clashes between ``private'' attributes of base and derived classes. See section 
5.2.1, ``Identifiers (Names).'' 






"""

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


Re: Python doc problems example: gzip module

2005-09-01 Thread EP
"Xah Lee" <[EMAIL PROTECTED]> wrote:

> today i need to  decompress

> since i'm familiar with 

  what the fuck


> Fuck the  

> I just need to decompress 

 that fucking doc 
 whatever fuck 



Is it just me or, do you suppose, with so much unnecessary "f" word, this is 
not a post at all, but a cleverly encoded message to fellow unsavory 
characters.  The "f"'s are just enough to thwart (ahem,lesser!) intellects from 
critically analyzing the text.  And as far as I can tell, there was no real 
content in the post.

Could the position of the f words be the key to the encrypted message?

I need to enlist the help of smarter minds to decode the message - I have zero 
experience in this, but I am sure there are minds bright enough on this list to 
crack the XL posts.


Here's all I could get going, trying to see if there was something in the name 
itself (but clearly the below is kindergarten level, at best)


>>> eName="xahlee"
>>> def fName(name="", offset=0, p=1):
newName="".join([chr(ord(c)+ offset  -(26*((ord(c)+offset)>122))) for c 
in name])
if p==1:
print newName
return newName

>>> for i in range(0,26):
nn=fName(name,i)


xahlee
ybimff
zcjngg
adkohh
belpii
cfmqjj
dgnrkk
ehosll
fiptmm
gjqunn
hkrvoo
ilswpp
jmtxqq
knuyrr
lovzss
mpwatt
nqxbuu
orycvv
pszdww
qtaexx
rubfyy
svcgzz
twdhaa
uxeibb
vyfjcc
wzgkdd

Certainly this one caught my eye ("rubfyy") - Ruby with the f-you acronym 
inside it!


Sorry, folks, its been a long week and I need to decompress.



EP



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


Re: Python -- (just) a successful experiment?

2005-08-10 Thread EP
Robert Kern <[EMAIL PROTECTED]>

> Michael Hudson wrote:
> > Michael Hudson <[EMAIL PROTECTED]> writes:
> > 
> >>Robert Kern <[EMAIL PROTECTED]> writes:
> >>
> >>>What I'm trying to say is that posting to c.l.py is absolutely
> >>>ineffective in achieving that goal. Code attracts people that like
> >>>to code. Tedious, repetitive c.l.py threads attract people that like
> >>>to write tedious, repetitive c.l.py threads.
> >>
> >>+1 QOTW, though I may be too late
> > 
> > Not only was I late, I was unoriginal!  Oh well.
> 
> That's okay, so was the quote!


it's a great quote

but did this tedious, repetitive c.l.py thread not attract several people who 
like to code?

[inserting a smiley here :-) and dropping this thread because - yes, there are 
things I want to code and - no, there are not enough hours in the day]

cheers


EP/op

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


Re: Python -- (just) a successful experiment?

2005-08-08 Thread EP
"Kay Schluehr" wrote:

> I already see the headline: PEEP is the answer - PSF votes for software
> patents. All ideas are written down by volunteers in great detail they
> just have to be coded. Due to intellectual property rights PSF becomes
> one of the richest organizations in the world. Guido van Rossum,
> chairman of PSF and mighty governor of California recommends an
> invasion into Iran: "we cannot accept that they didn't payed us for a
> PEEP describing a steering mechism for a nuclear power station to be
> written in Python. They are dangerous. They didn't have our
> commitment." Mr. van Rossum also commented the unfriendly takeover of
> the former software giant Microsoft that was immediately renamed into
> "Snakeoil Corp." succinctly: "They had a platform we were interested
> in".
> 
> Yes, the Python experiment was (not just) successfull.


(Aside) Karl, I do not think K is taking the matter seriously, even though our 
very survival against an axis of eval is at stake.  Send some of your goons 
around to keep an eye on Schluehr - K may not be of, by, or for the PEEPle - 
and besides, I just don't like that attitude.

I know, I know, Barbara says K's just a bitwise, but I've seen those weak types 
before.

Sure makes me wish for my days of youth when we had the real James Baud, 0x007.

But I assert, I will one day free this world of unlicensed coders and other 
rogue inventors and innovators who have no respect for the traditional logic 
that has always been my goto.



(Seriously)  Certainly we do not want to go too far or you would not hear even 
a little PEEP out of me.

But sometimes a rugged individual can be even more rugged and more individual 
if said individual has the support of friends by which to vet ideas and, by 
absorbing counterpoint, to develop one's own thoughts even further.


And it is kind of nice when you have two teams drilling a mountain tunnel from 
opposite sides to have an effective way to line up efforts.


EP
"yes, my brain is Swiss cheese tonight"

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


Re: Python -- (just) a successful experiment?

2005-08-08 Thread EP
Robert Kern <[EMAIL PROTECTED]> wrote:

> Which is exactly why I said at the beginning that people shouldn't 
> bother with this thread and should instead just get to work.
> 


Robert, you are probably right, but I think how we get to work is important as 
well.

What I posted was a little intellectually thin, but it would be nice to stir 
the collective energy toward some common (and useful) objectives.  I think that 
something more than a superior language specification is required for a 
language to get a firm foothold in the IT world (and that is something I would 
personally like for Python.)

It seems there are people very capable and willing to develop the good 
applications/tools/frameworks on top of Python, but too many of those projects 
do not gain critical mass; rather we have dozens of competing applications and 
frameworks that never blossom to their full potential.  I'd love to see a 
little consensus on what "goodies" should be developed atop the language; what 
standards, principles, and API/hooks those goodies should provide; and then a 
collaborative effort to get there.  Projects with a broader buy-in have a 
greater chance of achieving their potential.

It does seem that perhaps some ground was gained with the WSGI effort.  I 
understand Django [http://www.djangoproject.com/], a RoR alternative based on 
the WSGI spec, already has some buzz though "the cat got out of the bag a bit 
early" and Django is "not officially launched just yet."

It makes sense to ask one's fellow developers and Python users what a new open 
source development should look and act like if one wants to develop something 
great.  Open source code denotes sharing, but we should add teamwork and 
community involvement in the code as connotations if we want our open source to 
reach its potential.


What are the top 5 developments, aside from specification and implementation 
details of the language itself, which Python still needs for greater success in 
the day to day IT world?




EriPy pyDerson





P.S.  In terms of a more concrete suggestion, I propose the Python community 
form an intervention team who are ready to fly in and intercede any time a 
developer, whose brilliance has been expended in their heroic coding effort, 
goes to name their new module, package, or application with a "py" other than 
to the right of the dot.




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


Re: The ONLY thing that prevents me from using Python

2005-08-05 Thread EP
Mike Meyer writes:

> 
> The only way ISPs will find out that Python is popular is if potential
> customers tell them they need it. So if they say no, be *sure* and
> tell them you won't be using them because of that.


I think this is an issue of critical mass, but I know minds the like of this 
group will immediate see that something as general as critical mass can be 
further reduced.

Point being, all one needs is critical mass at a given point to overcome the 
inertia at that point.

By overcoming inertia, and getting change at that point, if that point is 
visible to other major points, you can change thought on the larger scale.




Personally, my current needs are sub collocation or dedicated server.  In 
respect of a good ISP (though I may be breaking all usenet etiquette by 
mentioning a specific hosting company), I have been treated well by Zettai.net 
(Zope, Plone, Python + the usual other  languages) -- and I get a lot of value 
there.  I have no desire to move.  Good people, and nice hosting if you like 
Unix.

However, I would really like to see Python hosting part of the normal 
competitive hosting landscape, at least for the reasons mentioned --- sometimes 
we do not get to pick the host.  What percent of the commercial hosting servers 
will my (Python) code run on?  It is a small number, I think.


So, if this issue were going to get some attention from some Pythonistas, what 
are the 2,3 or 5 hosting companies we would most like to see Python hosting 
offered by?  And what are their e-mail addresses?


I would certainly nominate GoDaddy.com ([EMAIL PROTECTED]), who haves done a 
tremendous job on domain name registration, and may end up with a very large 
footprint in the (recently launched) hosting business.  Python should 
definitely run on their servers (filers?).  For the betterment of mankind.


Anyway, just a thought.

EP

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


Re: IronPython 0.9 Released

2005-08-05 Thread EP
> I've got both 1.1 and 2.0 on this machine... Note that the
> warning applies to /language/: as in English or French... You can not
> install French if you have an English version installed.
> 


yes, my apologies to all things Iron and or Python.

"language" and "version" can be confusing if one stays up late without coffee, 
or perhaps if one has not been debugging their English code properly.


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


Re: IronPython 0.9 Released

2005-08-04 Thread EP
Oops.  Nevermind.

[like the old Saturday Night Live]



> Original Message
> From: "EP" <[EMAIL PROTECTED]>
> To: python-list@python.org
> Date: Thu, Aug-4-2005 10:09 PM
> Subject: Re: IronPython 0.9 Released
>
> "Luis M. Gonzalez" Announced:
> 
> > IronPython 0.9 Released(8/2/2005 10:28:41 AM)
> > 
> > 
> http://www.microsoft.com/downloads/details.aspx?familyid=cf5ae627-5df1-4f8a-ba8b-d64f0676f43f&displaylang=en
> > 
> 
> MS website says:
> 
> """System Requirements
> 
> *  Supported Operating Systems: Windows Server 2003; Windows XP
> 
> You must install the .NET Framework Version 2.0 Redistributable Package 
> Beta 2 prior to installing IronPython."""
> 
> 
> And
> 
> 
> """Important: You cannot install two different language versions of the 
> .NET Framework on the same machine. Attempting to install a second 
> language version of the .NET Framework will cause the following error to 
> appear: "Setup cannot install Microsoft .NET Framework because another 
> version of the product is already installed." If you are targeting a 
> non-English platform or if you wish to view .NET Framework resources in a 
> different language, you must download the appropriate language version 
> of the .NET Framework language pack."""
> 
> 
> So, one has to uninstall their stable .NET Framework to install a beta 
> .NET Framework to try out a beta release of a new Python?  Would this 
> not be of concern to folks who actually build ontop of .NET (and want to 
> be sure their current code / applications / tools work)?
> 
> It is really all or none with MS, isn't it?  If the 
> language/application is not ready for prime time, why would someone commit to 
> beta code 
> and a beta framework upon which other applications depend?
> 
> 
> I may have the wrong perspective on all this, but it really befuddles 
> me.
> 
> 
> [Bring on PyPy]
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 
> 

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


Re: IronPython 0.9 Released

2005-08-04 Thread EP
"Luis M. Gonzalez" Announced:

> IronPython 0.9 Released(8/2/2005 10:28:41 AM)
> 
> http://www.microsoft.com/downloads/details.aspx?familyid=cf5ae627-5df1-4f8a-ba8b-d64f0676f43f&displaylang=en
> 

MS website says:

"""System Requirements

*  Supported Operating Systems: Windows Server 2003; Windows XP

You must install the .NET Framework Version 2.0 Redistributable Package Beta 2 
prior to installing IronPython."""


And


"""Important: You cannot install two different language versions of the .NET 
Framework on the same machine. Attempting to install a second language version 
of the .NET Framework will cause the following error to appear: "Setup cannot 
install Microsoft .NET Framework because another version of the product is 
already installed." If you are targeting a non-English platform or if you wish 
to view .NET Framework resources in a different language, you must download the 
appropriate language version of the .NET Framework language pack."""


So, one has to uninstall their stable .NET Framework to install a beta .NET 
Framework to try out a beta release of a new Python?  Would this not be of 
concern to folks who actually build ontop of .NET (and want to be sure their 
current code / applications / tools work)?

It is really all or none with MS, isn't it?  If the language/application is not 
ready for prime time, why would someone commit to beta code and a beta 
framework upon which other applications depend?


I may have the wrong perspective on all this, but it really befuddles me.


[Bring on PyPy]


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


Re: Dabo in 30 seconds?

2005-08-04 Thread EP

> But it would be a nice enhancement to add the option for auto-emailing 
> in case
> of trouble.
> 

I like still like e-mail notices (it has a nice format we are used to as we use 
to communicate other things, and you can parse the text easily)... but I 
wonder: given the spam / virus induced sensitivity to mail servers, does it 
make more sense to send a text message to a db on the developer's server?

Has anyone got some open source code to do something like that handy?


/EP

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


Re: Dabo in 30 seconds?

2005-08-02 Thread EP
Jorge Godoy opined:

> > We can find several problems, almost all of them can be solved with 
> > the admin's creativity.  


In response to which Cliff Wells posted an interpreter session:

> >>> import creativity
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named creativity
> >>>
> 
> Nope.  Not included with Python.  Can't be used.


Does anyone remember where all the modules in The Path originated from?  
Joesusedgui modules mingle with the standard library on my machine, and as long 
as the import statements work, maybe it doesn't matter.  Which, again, is 
Python?

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
***

IDLE 1.1.1  
>>> import creativity
>>> creativity.whatis()
Creativity is everywhere, even more so in the abysss

>>> 




cheers

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


Dabo in 30 seconds?

2005-07-30 Thread EP
Ed Leafe wrote in response to the "Python vs. Access VBA" thread:

>   You might want to look at Dabo, which is a database application 
> framework for Python. In about 30 seconds you can create an application 
> that queries a database, displays the results, and allows for 
> editing/updating/inserting/deleting records.


This is a nice pitch.  Can you provide simple, example code that does this?

As a non-professional programmer (I write to create my own business tools, and 
for the enjoyment, but no one pays for my code) the ability to generate quick 
db apps like this would constitute a real win, even if the 30 seconds is a 
"Guido 30 seconds" and it takes me 5 minutes (which might underestimate Guido 
by some magnitudes).

We're becoming so rich with competing frameworks that, not having the time to 
evaluate them, I have no single framework in my toolbox I am fluent with.  Dabo 
seems like it might be worth my scarce time to learn; if I can really create a 
db app in "30 seconds", then I will probably do so, and get deeper into Dabo as 
I use it.  Might become a "Dabo Guy".  :-)

I suspect there may be others in my shoes, both inside and outside the Python 
community.  If I tell such a person "Oh, you have the choice of many database 
application frameworks in Python" such a person's eyes would glass open; if I 
show them "30 seconds" of clean simple code that does as you say, such a 
framework might not only get more widespread adoption, Python could gain wider 
adoption as well.

Best regards,

Eric





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


Re: Python-cgi or Perl-cgi script doubt

2005-07-29 Thread EP
Prabahar wrote:

>I want to know difference between
> Python-cgi and Perl-cgi and also I want
> to which one is efficient from the performance.


The difference between a cgi program written in Perl and a cgi program written 
in Python is the choice of programming language.  Both work quite well.  You 
probably want to use whichever programming language you like best, and that can 
only be discovered from writing programs in both.

In terms of "efficient"  (efficiency) , are you talking about how much memory 
the program uses, how fast the program executes, or how much time it takes to 
write and debug the program?  There are differences between the two in these 
regards, but I do not have any reliable information that quantifies those 
differences, and the differences are likely to vary greatly depending on the 
nature and length of the program, and how efficiently written the code is.

I think, generally, if you really like programming in Perl, there is probably 
no reason not to use it (at least for typical/short cgi programs) - it has been 
the default choice for years; conversely, if you really like programming in 
Python, you will probably be happy to tackle any challenges associated with 
using it for cgi.


Notes:
Perl cgi execution is generally offered by all hosts that offer cgi; Python cgi 
execution is offered by fewer hosts (but some of those hosts are really great).

With either language, if execution "performance" is a concern, you may want to 
use something along the lines of mod_python or mod_perl which embed a 
persistent interpreter in your web server. This lets you avoid the overhead of 
starting an external interpreter and avoids the penalty of Perl/Python start-up 
time, giving faster time to execution.

Was this at all the information you were looking for?  Why do I think you may 
have intended a very technical question?  If so, you may have to be a little 
more specific about the sort of differences you are interested in understanding.


Eric


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


Re: removing list comprehensions in Python 3.0

2005-07-10 Thread EP

> Well, I want to offer a more radical proposal: why not free squared
> braces from the burden of representing lists at all? It should be
> sufficient to write
> 
> >>> list()
> list()
> 



>From a visual comprehenison point of view, I would assert that the square form 
>[] is much easier on the eyes than the subtler curved forms (e.g. "{" and "(").

Burdened with old eyes, small fonts, and an old, inflexible mind (;-), one of 
Python features near and dear to me are lists, [], and list comprehensions, but 
perhaps a more important point for 3.0 would be that there is a seamless 
consistency across the language (e.g.  [list(), dict(), tuple()] or [ [], {}, 
() ] rather than [list(), {}, ()]) thus reflecting a cohesiveness both in 
underlying approach and symbology.  

Even old guys can adjust to something new that is good and clean.

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


Re: Python choice of database

2005-06-21 Thread EP
Oren suggested:

> How about using the filesystem as a database? For the number of records
> you describe it may work surprisingly well. A bonus is that the
> database is easy to manage manually.

I tried this for one application under the Windows OS and it worked fine...

until my records (text - maybe 50KB average) unexpectedly blossomed into the 
10,000-1,000,000 ranges.  If I or someone else (who innocently doesn't know 
better) opens up one of the directories with ~150,000 files in it, the 
machine's personality gets a little ugly (it seems buggy but is just very busy; 
no crashing).  Under 10,000 files per directory seems to work just fine, though.

For less expansive (and more structured) data, cPickle is a favorite.

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


Re: Dealing with marketing types...

2005-06-09 Thread EP
flyingfred0 wrote:

> A small software team (developers, leads and even the manager when he's 
> had time) has been using (wx)Python/PostgreSQL for over 2 years and 
> developed a successful 1.0 release of a client/server product.
> 
> A marketing/product manager has brought in additional management and 
> "architecture" experts to propose moving the entire thing to a Java 
> (application server) platform for the next release.  They want a 
> "scalable, enterprise solution" (though they don't really know what 
> that means) and are going crazy throwing around the Java buzzwords (not to 
> mention XML).


Marketing needs a compelling story to tell the customer: why _this_ technology? 
 Java and XML are cheap buzz words to throw around (but not too much buzz left 
anymore!)  What they need is a story, not a bunch of buzz words, but that story 
needs to fit into the customers' world view, it needs to mean something to the 
customer.

It's possible that Python/PostgreSQL is a technology combination that 
represents a winning story, at least in the right marketplaces.  Possibly the 
development team is more technically savvy than the marketers ;-), so try to 
gently help them understand why the Python/PostgreSQL story is strong.

Faster incremental development of releases ("Customer, no long waits for the 
new features you want like you have with Java apps.  Ou development is fast and 
agile like your requirements!") might be the kind of perspective that helps 
your cause.  Give the marketing guys "stories" about why the current product 
implementation is good from a marketing perspective - how (wx)Python/PostgreSQL 
will make the product unique and noticeable and easier to sell than another 
Java/XML client server app.

I think that's about the best you can do.

good luck!


Eric
(Psuedo-marketing-type)

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


Re: urllib2 pinger : insight as to use, cause of hang-up?

2005-06-05 Thread EP
"Mahesh" advised:
>
> Timing it out will probably solve it.
> 


Thanks.

Follow-on question regarding implementing a timeout for use by urllib2.  I am 
guessing the simplest way to do this is via socket.setdefaulttimeout(), but I 
am not sure if this sets a global parameter, and if so, whether it might be 
reset via instantiations of urllib, urllib2, httplib, etc.  I assume socket and 
the timeout parameter is in the global namespace and that I can just reset it 
at will for application to all the socket module 'users'.  Is that right?

(TIA)


[experimenting]

>>> import urllib2plus
>>> urllib2plus.setSocketTimeOut(1)
>>> urllib2plus.urlopen('http://zomething.com')

Traceback (most recent call last):
  File "", line 1, in -toplevel-
urllib2plus.urlopen('http://zomething.com')
  File "C:\Python24\lib\urllib2plus.py", line 130, in urlopen
return _opener.open(url, data)
  File "C:\Python24\lib\urllib2plus.py", line 361, in open
response = self._open(req, data)
  File "C:\Python24\lib\urllib2plus.py", line 379, in _open
'_open', req)
  File "C:\Python24\lib\urllib2plus.py", line 340, in _call_chain
result = func(*args)
  File "C:\Python24\lib\urllib2plus.py", line 1024, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python24\lib\urllib2plus.py", line 999, in do_open
raise URLError(err)
URLError: 

>>> urllib2plus.setSocketTimeOut(10)
>>> urllib2plus.urlopen('http://zomething.com')
>

>>> import socket
>>> socket.setdefaulttimeout(0)
>>> urllib2plus.urlopen('http://zomething.com')
Traceback (most recent call last):
  File "", line 1, in -toplevel-
urllib2plus.urlopen('http://zomething.com')
  File "C:\Python24\lib\urllib2plus.py", line 130, in urlopen
return _opener.open(url, data)
  File "C:\Python24\lib\urllib2plus.py", line 361, in open
response = self._open(req, data)
  File "C:\Python24\lib\urllib2plus.py", line 379, in _open
'_open', req)
  File "C:\Python24\lib\urllib2plus.py", line 340, in _call_chain
result = func(*args)
  File "C:\Python24\lib\urllib2plus.py", line 1024, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python24\lib\urllib2plus.py", line 999, in do_open
raise URLError(err)
URLError: 
>>> socket.setdefaulttimeout(1)
>>> urllib2plus.urlopen('http://zomething.com')
>

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


urllib2 pinger : insight as to use, cause of hang-up?

2005-06-05 Thread EP
Hello patient and tolerant Pythonistas,

Iterating through a long list of arbitrary (and possibly syntactically flawed) 
urls with a urllib2 pinging function I get a hang up.  No exception is raised, 
however (according to Windows Task Manager) python.exe stops using any CPU 
time, neither increasing nor decreasing the memory it uses, and the script does 
not progress (permanently stalled, it seems).  As an example, the below 
function has been stuck on url number 364 for ~40 minutes.

Does this simply indicate the need for a time-out function, or could there be 
something else going on (error in my usage) I've overlooked?

If it requires a time-out control, is there a way to implement that without 
using separate threads?  Any best practice recommendations?

Here's my function:

--
def testLinks2(urlList=[]):
import urllib2
goodLinks=[]
badLinks=[]
user_agent = 'mySpider Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
print len(urlList), " links to test"
count=0
for url in urlList:
count+=1
print count,
try:
request = urllib2.Request(url)
request.add_header('User-Agent', user_agent)
handle = urllib2.urlopen(request)
goodLinks.append(url)
except urllib2.HTTPError, e:
badLinks.append({url:e.code})
print e.code,":  ",url
except:
print "unknown error:  ",url
badLinks.append({url:"unknown error"})
print len(goodLinks)," working links found"
return goodLinks, badLinks

good, bad=testLinks2(linkList)
--

Thannks in advance for your thoughts.



Eric Pederson

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


Re: the problem with cgi

2005-05-29 Thread EP
> Has anyone seen that problem with running a python cgi script in a
> server?
> It takes you to myspace.com/redmartian or something. Anyway, does
> anyone know when this problem will be fixed?


Xah Lee is working on it.

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


Re: html tags and python

2005-03-26 Thread EP
 
>  
> January
> February
> March
> April
> May
> June
> July
> August
> September
> October
> November
> December
> 
> 
> The thing is:
> I also want the user to choose a date
> I will make this with another dropdownbox.
> But if the first month is selected, then there should be 31 days in the 
> days
> dropdownbox, if the second month is selected there should be 28 days in 
> the
> dropdownbow.


Python is great, but I'd suggest trying this with JavaScript and the DOM 
(Document Object Model).  In fact you may be able to Google-up a JavaScript 
script that does what you want.  JavaScript executes on the client machine, 
which is perfect for that aspect of your application.

The general idea would be to have the script redefine the option values for 
days upon selection of the year and month.  The DOM lets you access those 
s at run time very easily.

JavaScript is not as robust a programming language as Python, but it is handy 
for executing certain functionality within a browser interface, and because it 
works within the browser and can access the DOM, there is an element of instant 
gratification.

Then... about the time you start to try to build a real application with 
JavaScript, it will start to drive you mad... and you will have a new, greater 
affection for Python.

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


Re: PyGoogle featured on Google Code

2005-03-17 Thread EP
[EMAIL PROTECTED] reported:

> Google has started a site Google Code http://code.google.com/ to
> showcase Open Source software, and the first featured project is
> PyGoogle, a Python module wrapper for the Google Web APIs. Also
> mentioned is goopy/functional, a library that brings functional
> language attributes to Python.


I saw that.  Nice for those who want Python to be marketed - I think this is 
huge PR.  Python isn't mentioned as an also ran after Java, C++ and Perl, etc.; 
Python is a headliner.   Add the fact that Google publishes a functional 
programming library for Python, and it is clear the world's leading search 
engine places real working value on and trust in Python.


Even so, IT and business application departments throughout lalaland are still 
awash in VBA, Word Macros, and Perl programs no one still around really 
understands...


EP of Lalacentral


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


Re: About Databases...

2005-03-12 Thread EP
[EMAIL PROTECTED] wrote:

> Hello NG,

Hello!

> 
>I am still quite a newbie with Python (I intensely use wxPython, 
> anyway).
> I would like to know what are, in your opinions, the best/faster 
> databases
> that I could use in Python (and, of course, I should be able to "link" 
> everything
> with a wxPython GUI)? Specifically, I work on Reservoir Simulation, and
> usually I have to store a discrete/huge amount of data (it depends on 
> the
> oil field). As you may have understood, I know almost NOTHING about 
> databases
> ;-)


"... use in Python..."

If you have vast amounts of data you will probably benefit by hooking into a 
RDBMS (aka relational database) that is "outside" Python.  This is easy to do 
in Python if you use a module which already exists for that purpose.

Dedicated RDBMS can perform operations very fast - they are specialized for 
that purpose - however, we can make them run quite slow if we use them poorly, 
especially on large amounts of data.  There is a lot of piece-meal information 
online about how to best use databases (either specific RDBMS or in general) 
but some theorectical background helps as well.  I have "Database Design Using 
Entity-Relationship Diagrams" on my shelf.  Also, I think Dobbs had one or more 
articles about (mis)using databases recently.

With RDBMS you have another language to learn: SQL.

At the risk of being stoned, let me say that SQL is like talking pidgin, which 
is not to imply you can get away with speaking it imprecisely.

[side note, look up programming language namesake "LUA" here:  
http://www.extreme-hawaii.com/pidgin/vocab/ to understand why it may not be 
more popular with hackers in Hawaii]

A nominal starting point might be to install MySQL (a relational database which 
is open source "free", fast, and very widely used on the Internet) and use the 
MySQLDB in Python to access it.  From there you can decide if you need more or 
less of something.

In my experience MySQL is fast and can handle very large datasets, but there 
seem to be plenty of other good database options.  Oracle seems to be the 
dominant commercial RDBMS, and may be a good choice if you are offered the 
option of using it.  The Oracle universe is very commercial, however - it's big 
business.

There are database approaches you could take directly within Python, including 
storing your data (in binary or text form) as files under your OS.  However 
with that approach you will lose or have to re-create a relational query 
system, and I have reservations that the file access is going to be as 
optimized (speed wise).

BTW, AFAIK, Python or any RDBMS is going to ride on top of your OS, which means 
that if you are trying to do very, very large data transactions at high speeds, 
the OS can be the pacing code.  If you ever find yourself backed up against 
that wall, there are commercial systems (OS) designed to provide greater data 
access speed (that is a simple, data access purposed OS, so that you do not 
need to run on Unix/Linux/__ix or on Windows or on another 
multi-purpose-higher-overhead OS).



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


Re: Appeal for python developers

2005-03-06 Thread EP
Grant Edwards <[EMAIL PROTECTED]> diagnosed

> 
> Troll.
> 


I first checked my calendar to make sure it wasn't April 1, but some folks just 
can't wait, can they.

And another thought:  all this use of alphanumeric characters --- aren't we 
obfuscating the pure binariness we should all know and love if we want to be 
one with the CPU?

010010100111010101110011011101100110101001100110101101101001011011100110011100100110011001100110110001101011011100110011



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


Re: mxCGIPython binaries for Python 2.3.5

2005-02-14 Thread EP


> Original Message
> From: Oleg Broytmann <[EMAIL PROTECTED]>

> 
>http://www.egenix.com/files/python/mxCGIPython.html
> 
> > doesn't involve downloading & unpacking a file.
> 
>It is unpackable, ready-to-run python binary.
> 
> PS. I am neither author nor maintainer, I only provide binaries for
> some platforms...


I'm unschooled in non-Windows binaries.  Does this mean it may be possible to 
download this package onto a (for example) SunOS system, unpack and have Python 
up and running?  That would be sweet...

[frustrated trying to compile Python on a system I do not own...]





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


Re: python code with indention

2005-02-08 Thread EP

> Original Message
> From: "Xah Lee" <[EMAIL PROTECTED]>

> is it possible to write python code without any indentation?

Perhaps our zen-like response to this question should have been:

>>>pass


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


Re: Python versus Perl ?

2005-02-06 Thread EP
[EMAIL PROTECTED] asked

> 3. Perl is installed on our system and a lot of other systems.
> You don't have to make sys admins go out of there way to make it
> available. It's usualy allready there. I also did a search of job
> postings on a popular website. 108 jobs where listed that require
> knowledge of Perl, only 17 listed required Python. Becomeing more
> familiar with Perl might then be usefull for ones resume ?

Python is trivial to install on one's workstation or PC, if it isn't already 
there.  Getting Python on the company's servers can require some IT latitude or 
buy-in.



I've begun to view the availability of Python on company servers as a measure 
of an IT organization's fitness.  

Perl was (probably) the right language at the right time at least for cgi work 
and text processing in the early days of the web, when there was a sudden 
increase in the need for such work.  And Perl "works", especially as you become 
familiar with it and some of the non-obvious ways it works.  Learning Perl is 
an investment and many folks becomes Perl people - why would you switch from 
anything you've put that much time into?

And so a vast number of people and orgnizations remain in the cave, unwilling 
to risk going outside, unwilling to believe life could be better out there in 
the unknown.  Congrats for being the rare person who takes a look.  (That 
strange feeling you may get is from something we call "sunshine" and, on 
balance, I think you'll find it is a very nice thing.)
 

>  If Python is better than Perl, I'm curious how really significant
> those advantages are ?

I'd say the advantages are significant if you develop anything complex, or like 
to think about the software you develop in clean abstractions.  I'd say knowing 
Python probably does not lead to a higher salary, but that the software 
engineers attracted to Python tend to be the cream of the crop and are worth 
more money.


[Disclaimer: Python also attracts some who are not cream of the crop software 
engineers but rather see things - applications, large or small - that ought to 
be done, and are looking for the most efficient way of getting there.  Anyone 
can write some Python succssfully, but not everyone is capable of contributing 
to PyPy.  Python is a great tool for each.]



Recommendation: Python requires little investment.  Play in it.  Read (briefly) 
about the aspects that seem interesting.  Try writing a small progam in it.  
There are very very few cases where anyone is going to require you to use 
Python; it's a personal decision, and the people that use Python do so because 
they want to, not because someone required them to.


cheers/

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


Re: OT: why are LAMP sites slow?

2005-02-05 Thread EP

> > The server is slow to respond to requests.  Browser rendering is
> > independent of the server architecture and "slow to be fetched from
> > the server" sounds like it means low network speed.  I'm talking 
> about
> > the very familiar experience of clicking a link and then waiting,
> > waiting, waiting for the page to load.  You rarely see that happen
> > with Ebay or Google.  It happens all the time with Wikipedia.
> 
> This has a lot to do with the latency and speed of the connecting
> network. Sites like Ebay, Google, and Amazon are connected
> to internet backbone nodes (for speed) and are cached throughout
> the network using things like Akami (to reduce latency)...


Akami for services, or better yet, cacheing hardware such as NetCache.  
Frequently requested data doesn't even have to come from the server 
disks/database - it's sent from the NetCache.

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


Re: OT: why are LAMP sites slow?

2005-02-04 Thread EP
Tim Daneliuk <[EMAIL PROTECTED]> commented:

> This has a lot to do with the latency and speed of the connecting
> network. Sites like Ebay, Google, and Amazon are connected
> to internet backbone nodes (for speed) and are cached throughout
> the network using things like Akami (to reduce latency)...


I agree, the problem is not always the software.  :-)  I think Akami reduces 
the network latency experienced; also, one may have multiple servers and load 
balance the traffic, and local NetCaches can speed traffic by reducing the load 
on the server (the most requested data is cached upstream from the server).  

I understand that web queries are very clustered (though I've not seen data to 
confirm this): we may all be making individual queries (googling about 
decorators?), but the queries are not as different as we might imagine.  
Hardware caching helps with that.

A good "enterprise" web site will have infrastructure on it's side beyond what 
an economical-minded non-commercial site is likely to invest in.

Transactional (secure) processing is a different animal, I think (but I would 
also think it is a very small percent of the overall web traffic).


No worries, Apache may run faster when it's written in PyPy.  :-)  I guess that 
statement shows I am a bit biased in thought process.






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


Re: variable declaration

2005-01-30 Thread EP
> Original Message
> From: [EMAIL PROTECTED] (Alexander Zatvornitskiy)

>
> Hello All!
> 
> I'am novice in python, and I find one very bad thing (from my point of 
> view) in
> language. There is no keyword or syntax to declare variable, like 'var' 
> in
> Pascal, or special syntax in C. It can cause very ugly errors,like 
> this:
> 
> epsilon=0
> S=0
> while epsilon<10:
>   S=S+epsilon
>   epselon=epsilon+1
> print S
> 
> It will print zero, and it is not easy to find such a bug!


Hmmm.  I am surely an expert in writing buggy code, but I can not say I make 
this error in Python.  Why is that?

I'm not sure, but a couple things that may help me miss making this mistake in 
practice may be (somewhat informal in my case) unit testing - I test for 
correct results for at least a few cases.

It may also help that with Python I can code at a somewhat higher conceptual 
level, or maybe it is just the syntax that helps avoid these problems:

>>>  for epsilon in range (0,10):
 S=S+epsilon
  
>>> for epsilon in range (0,10):
S=S+epselon

Traceback (most recent call last):
  File "", line 2, in ?
S=S+epselon
NameError: name 'epselon' is not defined


It may seem like jumping off a cliff, but the improvement in readability (the 
variable declarations being visual clutter) makes it much easier for me to see 
my code, and any typos in it.

It seems it would be simple enough to have one's code, or another script, 
automatically print out a sorted list of the variables - which would make the 
error you note obvious.  But I haven't needed this, yet at least.

You might like Python and find the lack of variable declaration checking not a 
problem.  It's worth a shot.



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


Re: File objects? - under the hood question

2005-01-23 Thread EP
 
> My brain-teaser:  What I'd like to do is read the last ~2K of a large 
> number of large files on arbitrary servers across the net, without 
> having to read each file from the beginning (which would be slow and 
> resource inefficient)...
> 

Proper googling would have revealed that HTTP 1.1 includes a Range Request.  My 
bad.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Before I reinvent the wheel (and make it a little squarer than it has to be) 
has anyone seen a "cookbook" recipe for adding the HTTP 1.1 range request to a 
urllib urlopener (or something similar)?

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


Re: The Industry choice

2005-01-05 Thread EP
Bulba! <[EMAIL PROTECTED]> wrote:


> Frankly, I find such models to be built on over-stretched analogies
> to physics - how _exactly_ is gravity supposed to be an analogy
> equivalent to economic "forces"? Sure such model can be built - but
> is it adequate in explaining real-world phenomenons? Analogy
> tends to be the weakest form of reasoning. I'd be wary of making
> such analogies.


Apparently the Gravity Model is still of some interest, if recent citations are 
an indication.  I'm not an expert, but all the economic models I was taught 
were also grounded in math, not just analogy.

gravity models:  http://faculty.washington.edu/krumme/systems/gravity.html
some empirical studies:  http://www.hec.unil.ch/mbrulhar/Empirtrade/#gravity



> Models like this probably tend to be built by French engineers from
> this joke:
> 
> The American and French engineers work together on some 
> product (that would look strange nowadays but it's not impossible 
> in principle). 
> 
> The Americans show the French engineers a working prototype.
> 
> The French engineers scratch their heads and ask warily:
> 
> "OK, it works in practice; but will it work in theory?"
> 


Yeah, I hate it when people try to understand things.


cheers

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


RE: Python evolution: Unease

2005-01-05 Thread EP
Roman wrote:

> Maybe OP doesn't yet fully comprehend the ways of Python universe?



> > Don't misinterpret this response. I know it was a rambling. But 
> *maybe* you
> > have something to contribute to Python development, even good ideas 
> only and
> > no work.
> >
> > .Facundo


Am I selling Snake Oil?

Here's my observation, which must be taken with the grain of salt that I am 
simply not a smart nor seasoned enough programmer to understand some of the 
considerations for the new language features.  It's over my head - there, I 
said it.

What I do have is a "forest" instead of an "in the trees" perspective, and from 
a forest view I see a lot of defensiveness about Python's hypothetical 
shortcomings.  No one needs be defensive, Python is an amazing programming 
language, and everyone involved with its development, evolution, support and 
codebase ought to feel quite good about it.

So there should be a lot of clapping each other on the shoulder and the 
clinking of beer bottles in toasts.  

The next morning we get up, we ought to look at our bed mate and think over 
some coffee whether this is someone who will be our lifelong friend, or if we 
want it to be much more than that.  Because taking it to the next level, to 
it's ultimate potential, is not a linear exercise and requires non-linear 
thinking, strategy, and execution (and no doubt greater commitment.)

It would not be ground breaking for me to assert that undertakings reach 
plateaus as they grow in magnitude and scope.  A company, for example, must 
re-invent itself several times on the way to greatness from the couple folks 
gathered around the kitchen table, and this is not just at low levels.  
Companies reach plateaus, for example, around points like $1 billion in annual 
revenue -- to keep growing and get to, let's say, $5 billion, they have to 
re-invent themselves with a new and greater vision.  

It would be easy to miss this with our heads buried in code, or with our minds 
occupied with either the defense of Python or a debate about what a "concept" 
is.  [tongue in cheek]

I use Python everyday; I've liked it from the first five minutes, and I like it 
more all the time.  I hope it is always maintained because it would be a shame 
to ever lose such a powerful and joyful tool.

I also think Python affords a view of what might be great things in the 
distance, but perhaps the journey required to get there is more like crossing 
an ocean than simply walking down the road.  Not knowing how to cross the ocean 
doesn't mean there isn't milk and honey on the other side, nor that the journey 
should be written off; but there is no guarantee that Python is the right 
vehicle to get us there, and if it is it may need to grow organic gills.

I'm of two minds, that (1) Python is perfect as is and (2) that "it" needs 
radical (non-linear) improvements in development environment, documentation, 
and execution speed to reach its potential in terms of application and 
acceptance.  Where and how far the community wants to take Python would be 
something to figure out before debating what needs to be changed about it, if 
there is a desire to take it to a potential on a new level.


Python: it tastes so good it makes you hungrier.



Eric Pederson
- - - - - - - - - - - - - - 
Perfect indifference and assuming one perceives the "real world" are the 
essential lies against the natural universe - a "leftist"
- - - - - - - - - - - - - - 

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


Re: Python mascot proposal

2004-12-16 Thread EP
 
> It's a great marketing idea. There was a thread recently on Python-dev
> that started with a message from Guido, where he talks about a
> seemingly persistent perception that exists in the specialized press
> regarding Python as a flexible, nice, but generally slow (or slower
> than the alternatives) language. 


Perception of the press: Python is "flexible, nice, but generally slow"

Well, the snake mascot as drawn is, of course, very flexible, appears to be 
friendly, and is, well, just how fast is a big snake, esp. a python?  It'll get 
there, slithering along, but it doesn't really conjure up a "beaming" between 
two galaxies in a nanosecond image.

I like Monty (the snake), but perhaps there are liabilities arising from having 
a mascot (what is the mascot for C++?)

Of course all those speed comparisons on the web don't help either.



EP

"Fast enough is only fast enough for today, not for tomorrow's possibilities.  
Network speeds will increase by a magnitude, ahead of processing power - then 
code execution speed will be a limiting factor."

Oh, and while I'm wishing for the Moon, can I have a builtin Prolog/logic 
object.  ;-)

hey, Python is better than I deserve: mucho thanks to Guido and the core 
Pythonistas...

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


RE: Python mascot proposal

2004-12-14 Thread EP
[EMAIL PROTECTED] wrote:
>
> Here are my suggestions:
...
> 4. A "larch"
> 
...
> Anybody know what a larch looks like?
> 


Right!  Well, some rather good pictures of the Larch on this website (my, 
stunning, the larch looks, eh?!)

http://www.neuroinformatik.ruhr-uni-bochum.de/PEOPLE/bolder/montypython/larch1.html

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