Geodetic functions library GeoDLL 32 Bit and 64 Bit

2012-08-28 Thread Fred
Hi developers,

who develops programs with geodetic functionality like world-wide coordinate 
transformations or distance calculations, can use geodetic functions of my 
GeoDLL. The Dynamic Link Library can easily be used with most of the modern 
programming languages like C, C++, C#, Basic, Delphi, Pascal, Java, Fortran, 
Visual-Objects and others to add geodetic functionality to own applications. 
For many programming languages ​appropriate Interfaces are available.

GeoDLL supports 2D and 3D coordinate transformation, geodetic datum shift and 
reference system convertion with Helmert, Molodenski and NTv2 (e.g. BeTA2007, 
AT_GIS_GRID, CHENYX06), meridian strip changing, user defined coordinate and 
reference systems, distance calculation, Digital Elevation Model, INSPIRE 
support, Direct / Inverse Solutions and a lot of other geodetic functions. 

The DLL is very fast, save and compact because of forceful development in C++ 
with Microsoft Visual Studio 2010. The geodetic functions of the current 
version 12.35 are available in 32bit and 64bit architecture. All functions are 
prepared for multithreading and server operating.

You find a free downloadable test version on 
http://www.killetsoft.de/p_gdlb_e.htm
Notes about the NTv2 support can be found here: 
http://www.killetsoft.de/p_gdln_e.htm
Report on the quality of the coordinate transformations: 
http://www.killetsoft.de/t_1005_e.htm 

Fred
Email: info_at_killetsoft.de
-- 
http://mail.python.org/mailman/listinfo/python-list


Geodetic functions library GeoDLL 32 Bit and 64 Bit

2011-07-20 Thread Fred
Hi developers,

who develops programs with geodetic functionality like world-wide coordinate 
transformations or distance calculations, can work with the latest version of 
my GeoDLL. The Dynamic Link Library can easily be used with any programming 
language to add geodetic functionality to own applications. 

GeoDLL supports 2D and 3D coordinate transformation, geodetic datum shift and 
reference system convertion, meridian strip changing, user defined coordinate 
and reference systems, distance calculation, Digital Elevation Model, NTv2 
handling, Direct / Inverse Solutions and a lot of other geodetic functions. 

The DLL has become very fast and save by forceful development in C++ with 
Microsoft Visual Studio 2010. The geodetic functions of the new version 12.05 
now are available in 32bit and 64bit architecture. 

You find a downloadable test version on http://www.killetsoft.de/p_gdla_e.htm.
-- 
http://mail.python.org/mailman/listinfo/python-list


Indexing strings

2005-03-04 Thread Fred
Hi everybody

I am searching for a possibility, to find out, what the index for a
certain lettyer in a string is.
My example:

for x in text:
   if x == ' ':
  list = text[:  # There I need the index of the space the
program found during the loop...

Is there and possibility to find the index of the space???
Thanks for any help!
Fred
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Indexing strings

2005-03-04 Thread Fred
> Use the index method, e.g.: text.index(' ').
> What exactly do you want to do?

That was exactely what I was searching for. I needed a program, that
chopped up a string into its words and then saves them into a list. I
think I got this done...
Thanks for the help
-- 
http://mail.python.org/mailman/listinfo/python-list


File call error message (double backslash)

2005-03-08 Thread Fred
Hi
I am writing on an application, that is supposed to read a file into a
single string:
My program though, when I run it, gives me an error, that the called
file is non existent
'C:\ \Documents and Settings\ \Fred\ \My Documents\ \School\ \Bio'
Is it normal that python adds the  space and extra backslash? Because
if I print the path of the called file before the open command, it
normally prints it with only one backslash.
Is there any possiblity of surpressing this?
I am using Python 2.3.5 with Pywin built 163 on Windows.
Thanks for all help
-- 
http://mail.python.org/mailman/listinfo/python-list


'Browse' button for *.txt file?

2005-03-10 Thread Fred
Hi
I am searching for a module, that would allow me to call files by
using a 'browse' button. Is there any uniform module for browsing
files, or is there a special module for *.txt files?
Thanks
Fred
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 'Browse' button for *.txt file?

2005-03-10 Thread Fred
Sorry if my choice of words is not very clear to you, but as english
is not my first language, I put it this way because of a lack of
better words.
I will try it differently:
What I meant is that I am searching for a module, that would allow me
to select a file by not using a typed path, but by choosing it like a
file in the normal windows exploer, where all the folders and
subfolders are listed. (I still don't know the word for this
method...)
And I meant open and read data from files, again 'lack of better words'.
I am using Windows XP, Python 2.3.5 with win32all extension.
Sorry for the trouble this caused!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 'Browse' button for *.txt file?

2005-03-11 Thread Fred
Sweet.Thanks for the URLs!!
And for all the other help and good guessing
-- 
http://mail.python.org/mailman/listinfo/python-list


ImportError: No module name MySQLdb

2006-01-25 Thread Fred
I hope someone can help me with the below problem...

Thanks,
Fred

My enviroment:
--
Slackware Linux 10.2
Python 2.4.2
MySql version 4.1.14
MySql-Python 1.2.0

What I am trying to do:
---
Using MySQL, Python, My-Sql-Python module and CGI create a simple
database that can be accesed with a webpage.

Everything worked great up to this error when trying to load the
webpage:
"ImportError: No module name MySQLdb"

Note that I do NOT get the error when running the script normally from
Python.

I have read much but can not seem to nail the problem down, I am
thinking a path error.

This script works perfect when launched from the command line:
--
#!/usr/bin/python
import MySQLdb
import cgi
host = '192.168.0.112'
db = 'phone'

db=MySQLdb.connect(host = '192.168.0.112', db = 'phone')
cursor=db.cursor()
cursor.execute("Select * from phone")
result = cursor.fetchall()
for record in result:
  print record[0],record[1],record[2]


I created a webpage with this code:








The webpage "submit" button loads the below script:
If I try the below I get the "ImportError: No module name MySQLdb"
in my Apache error log file
-
#mysqld_script_test.py
#!/usr/bin/python

import MySQLdb
import cgi
print "Content-Type: text/html\n"

host = '192.168.0.112'
db = 'phone'

db=MySQLdb.connect(host = '192.168.0.112', db = 'phone')
cursor=db.cursor()
cursor.execute("Select * from phone")
result = cursor.fetchall()
for record in result:
  print record[0],record[1],record[2]

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
Re-reading my message I noticed a stupid error, not effecting my
problem but annoying, I assigned variables and then did not use them,
then included import cgi for my regular script. This is how the command
line script should look:

 #!/usr/bin/python
import MySQLdb

db=MySQLdb.connect(host = '192.168.0.112', db = 'phone')
cursor=db.cursor()
cursor.execute("Select * from phone")
result = cursor.fetchall()
for record in result:
  print record[0],record[1],record[2]

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
This is the result of print sys.path:

>>> print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages']

MySQLdb lives here but is not in the path:
/usr/local/lib/python2.4/site-packages/MySQLdb

Everything is running on the same machine here in my house, everything
was installed and is launched as root.

Thanks.
Fred

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
Here is the complete error from my Apache error log:

Traceback (most recent call last):
  File "/var/www/cgi-bin/mysqld_script_test.py", line 7, in ?
import MySQLdb
ImportError: No module named MySQLdb
[Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed header
from script. Bad header=['/var/www/cgi-bin', '/usr/lib:
/var/www/cgi-bin/mysqld_script_test.py

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
>From what I can tell everything seems right. Here are the results of
the sys.path:

>>> print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages']

MySQLdb lives here: /usr/local/lib/python2.4/site-packages/MySQLdb but
is not in the path

I installed and am trying to run everything as root, and it is all on
the same computer right here with me.

If I can ever get this simplistic problem solved maybe you guys can
help me to get Zope running, it is not cooperating either... :-)

Fred

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
Magnus Lycka wrote:
> Fred wrote:
> > Slackware Linux 10.2
>
> Heh, Slackware was my first Linux distro. Version
> 2.2 I think. 1993 maybe?

I have been using Slackware since 1995, version 3.0 kernel 1.2.13

> Some suggestions:

> Finally, the cgitb module is pretty useful. I
> suggest that you look it up:
> http://docs.python.org/lib/module-cgitb.html

Will check it out... I bet this is something really simple and possibly
related to my use of Slackware, although hours of searching has not
produced an answer..

Fred

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
I have discovered the possible problem (I can't check this until later
when I am home)

I think when I upgraded to Python 2.4.2 it created my problem.

Below is what is going on:

Default Slackware 10.2 install - 2.4.1 installed into
/usr/lib/python2.4
Python 2.4.1 upgraded to 2.4.2
Upgrade downloaded from Python.org compiled and installed - 2.4.2
installed into /usr/local/lib/python2.4

Bin files are in: /usr/bin/python and /usr/local/bin/python

MySQLdb instatlled after the 2.4.2 upgrade works fine at the command
line

I am betting that when I launch the script from the webpage it is
looking for /usr/bin/python

I should be able to make a symlink in /usr/bin/python -->
/usr/local/bin/python

And of course change  #!/usr/bin/python to  #!/usr/local/bin/python in
the script

What do you think?
Fred

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


Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
Fixed...

All I did was change #!/usr/bin/python to #!/usr/local/bin/python

The page loaded right up it was loading Python ver 2.4.1 rather
than 2.4.2 where the MySQL db module was installed...

I knew it would be something easy... I learned something so it was
worth it...

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


MYSql, CGI web page search code not working

2006-01-28 Thread Fred
OK,

I can now successfully enter data into my MySQL database through my CGI
web page. I can click a button and retrieve all the records, but I can
not seem to get the search code to work.

Below is the web page code and then my Python script. When I click my
search button it just gives me all the records

I know this line is executing: cursor.execute("Select * from phone
where name = name order by name")

Because I played with the "order by" but it seems to ignore my where
clause.

No matter what I type in the form text box (or even if I leave it
blank) I get all the records.

I can hard code this line to: cursor.execute("Select * from phone where
name = 'Fred' order by name")

and it returns the one record corectly.

Any ideas?

Fred

--

 Enter the name to find:



--

#!/usr/local/bin/python
print "Content-Type: text/html\n"
import MySQLdb
import cgi

db=MySQLdb.connect(host = 'localhost', db = 'phone')
cursor=db.cursor()
cursor.execute("Select * from phone where name = name order by name")

result = cursor.fetchall()
for record in result:
   print ''
   print record[0]
   print '--'
   print record[1]
   print '--'
   print record[2]
   print '--'
   print record[3]
   print ''

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


Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
print MySQLdb.paramstyle returns: format

I found one example like this:

cursor.execute('''Select * from phone where name=%s order by
name''',(name))

But I get this in my Apache error log:
NameError: name 'name' is not defined

Like my last problem I posted, I am sure it is something very simple
that I am missing!!
Fred

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


Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Yeah, I already tried that (except you have a , after name.

Your code produces the same error:

 NameError: name 'name' is not defined

I know I am close!! Just missing some small thing...

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


Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Thanks Kirk! That worked perfect! And makes perfect since now that I
see it...

Now that I have the main pieces working I can start expanding from
here!

Fred

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


Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
OK one more... how would I do a "LIKE" instead of a = in this code?

 cursor.execute("Select * from phone where name=%s order by name",
 (form['name'].value,))

Right off I think:

 cursor.execute("Select * from phone where name like %%s% order by
name",
 (form['name'].value,))

But it blows up...

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


Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Perfect again Kirk! Now I will study all this so I actually understand
what is happening..

Thanks!

Fred

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


Geodetic software development

2007-12-26 Thread Fred
Dear software developer,

GeoDLL supports the development of geodetic software on various
platforms by providing geodetic functions. GeoDLL contains precise
functions of the themes 2D and 3D coordinate transformation, geodetic
datum shift and reference system conversion, meridian strip changing,
user defined coordinate and reference systems, distance calculation,
Digital Elevation Model and map function.

GeoDLL enables the program developer to perform professional grade
coordinate transformations:

The current and many historical Coordinate and Reference Systems of
all States of the European Union (EU) including the eastern extension
from April 2004 and other European Systems.
The US- and Canadian State Plane Coordinate Systems (SPCS) on NAD27
and NAD83 and other Coordinate and Reference Systems of the North
American Continent.
The Coordinate and Reference Systems of the Australian Continent.
A lot of Coordinate and Reference Systems of other Continents.
All world-wide used Coordinate and Reference Systems.
The German Coordinate and Reference Systems of the old and new Federal
States, the 40 Prussian Soldner Land Registers, the German Lagestatus
and exact Reference Systems of the Federal States of Germany.
User-defined coordinates systems, local reference systems and earth
ellipsoids can be defined on base of the earth half axis and seven
transformation parameters (Helmert) or three transformation parameters
(Molodenski).

GeoDLL comes with extensive documentation and works as DLL file with
many commonly used programming languages or it can be used as C++ or
CA-VO source code. The functions of GeoDLL are multithreading ready.
The DLL is written with the programming language C++. Thus a very fast
performance, a compact code and a high running stability are reached.

Clother information you can find on the site 
http://www.killetsoft.de/p_gdla_e.htm.

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


[no subject]

2008-12-05 Thread Fred

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


RE: Diagramming code

2012-07-16 Thread Sells, Fred
You leave many relevant questions unanswered.

1. Is the original developer/team available or have you been left with
the code and little or no doc's?

2. How big is big in terms of the number of files/modules in the
project?  

3. Is there a reasonable structure to the project in terms of
directories and a meaningful hierarchy

4. Does the project currently work and you just have to maintain/enhance
it or was it "abandoned" by the original team in an unknown state and
you have to save a sinking ship?

5. Are you an experienced Python programmer or a beginner.

6. Is the original code "pythonic" (i.e. clean and simple with brief,
well organized methods) or do you have functions over 50 lines of code
with multiple nested control statements and meaningless variable names?

7. Is there any documentation that defines what it should do and how it
should do it.  i.e. how do you know when it's working?

These issues are not really Python specific, but if you've been given a
"broken" project that has 200 poorly organized modules and little or no
documentation and no access to the original team, a good first step
would be to update your resume ;)

OK then, let me ask, how do you guys learn/understand large projects ?

hamilton

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

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


RE: Object Models - decoupling data access - good examples ?

2012-08-07 Thread Sells, Fred
Given that "the customer is always right": In the past I've dealt with this 
situation by creating one or more "query" classes and one or more edit classes. 
 I found it easier to separate these.

I would then create basic methods like EditStaff.add_empooyee(**kwargs)  inside 
of which I would drop into (in my case) MySQLdb.  In retrospect, I'm not sure 
that the generick use of **kwargs was a good solution in that it masked what I 
was passing in, requiring me to go back to the calling code when debugging.  
OTOH it allowed me to be pretting generic by using
Sql = sql_template % kwargs

On the query side. I would convert the returned list of dictionaries to a list 
of objects using something like

Class DBrecord:
Def __init__(self, **kwargs):
Self.__dict__.update(kwargs)

So that I did not have to use the record['fieldname'] syntax but could use 
record.fieldname.

I would describe myself as more of a survivalist programmer, lacking some of 
the sophisticated techniques of others on the mailing list so take that into 
account.

Fred.

-Original Message-
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Saturday, August 04, 2012 11:26 PM
To: [email protected]
Subject: Re: Object Models - decoupling data access - good examples ?

 
> 
> Just out of curiosity, why do you eschew ORMs?
> 
Good question !

I'm not anti-ORM (in fact in many circs I'm quite pro-ORM) but for some time 
I've been working with a client who doesn't want ORMs used (they do have quite 
good reasons for this although probably not as good as they think). 

I was interested to know, given that was the case, how you might - in Python, 
go about structuring an app which didn't use an ORM but which did use a RDBMS 
fairly intensively.

I take your point about having "rolled my own ORM" - lol - but I can assure you 
what's in that 'bardb' is a pretty thin layer over the SQL and nothing like 
the, pretty amazing, functionality of, for instance, SQLAlchemy.



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

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


RE: New in Python , Need a Mentor

2013-01-02 Thread Sells, Fred
The need for a "python-aware" editor is the commonly held opinion, although the 
debate about which editor is endless.  I use Eclipse + PyDev only because I 
found it first and like it.

The only suggestion I would offer is to separate the business logic completely 
from the HTML request/response handler.  It makes it much easier to debug.  

Other than that, ditto to everyone else's response.

Fred.



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


derived class name in python 2.6/2.7

2013-01-30 Thread Sells, Fred
This is simple, but I just cannot find it after quite a bit of searching

I have this basic design

class  A:
def __init__(self):
print 'I am an instance of ', self.__class__.name

class B(A):
pass


X = B
I would like this to print "I am an instance of B"  but I keep getting A.  Can 
someone help me out here.

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


RE: Overlayong PDF Files

2012-05-02 Thread Sells, Fred
Assuming your form has actual PDF data entry fields.  I export the form to a 
.fdf file, run a little script to replace fieldnames with %(fieldname)s  and 
save this as a staic template.  At run time I'll merge the template with a 
python dictionary using the % operator and shell down to pdftk to merge the two 
files and create a filled in PDF.  This way you don't have to worry about exact 
placement of data.

I have been looking for an api that would let me do this without the .fdf step, 
but to no avail.


-Original Message-
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Adam Tauno Williams
Sent: Thursday, April 26, 2012 8:25 AM
To: [email protected]
Subject: Re: Overlayong PDF Files

On Wed, 2012-04-25 at 13:36 -0500, Greg Lindstrom wrote:
> I would like to take an existing pdf file which has the image of a 
> health care claim and overlay the image with claim data (insured name, 
> address, procedures, etc.).  I'm pretty good with reportlab -- in 
> fact, I've created a form close to the CMS 1500 (with NPI), but it's 
> not close enough for scanning.  I'd like to read in the "official"
> form and add my data.  Is this possible?

I 'overlay' PDF documents  using pypdf.

Example


--
Adam Tauno Williams 
System Administrator, OpenGroupware Developer, LPI / CNA Fingerprint 8C08 209A 
FBE3 C41A DD2F A270 2D17 8FA4 D95E D383
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Refactor/Rewrite Perl code in Python

2011-07-25 Thread Sells, Fred
Sometimes it's worth asking Why?

I assume there would be no need to rewrite if the existing code did most
of what was needed.  It may be easier to ask the customer what he really
wants rather than to re-engineer a crappy solution to an obsolete
problem.

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


reading zipfile; problem using raw buffer

2011-07-26 Thread Sells, Fred
I'm tring to unzip a buffer that is uploaded to django/python.  I can
unzip the file in batch mode just fine, but when I get the buffer I get
a "BadZipfile exception.  I wrote this snippet to try to isolate the
issue but I don't understand what's going on.  I'm guessing that I'm
losing some header/trailer somewhere?

def unittestZipfile(filename):
buffer = ''
f = open(filename)
for i in range(22):
block = f.read()
if len(block) == 0: 
break
else:
buffer += block

print len(buffer)
tmp = open('tmp.zip', 'w')
tmp.write(buffer)
tmp.close()
zf = zipfile.ZipFile('tmp.zip')
print dir(zf)
for name in zf.namelist():
print name
print zf.read(name)

2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
Traceback (most recent call last):
  File
"C:\all\projects\AccMDS30Server\mds30\app\uploaders\xmitzipfile.py",
line 162, in 
unittestZipfile('wk1live7.8to7.11.zip')
  File
"C:\all\projects\AccMDS30Server\mds30\app\uploaders\xmitzipfile.py",
line 146, in unittestZipfile
print zf.read(name)
  File "C:\alltools\python26\lib\zipfile.py", line 837, in read
return self.open(name, "r", pwd).read()
  File "C:\alltools\python26\lib\zipfile.py", line 867, in open
raise BadZipfile, "Bad magic number for file header"
zipfile.BadZipfile: Bad magic number for file header

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


RE: reading zipfile; problem using raw buffer

2011-07-26 Thread Sells, Fred
Thanks all,  adding the 'rb' and 'wb' solved that test case.

The reason I read the file "the hard way" is that I'm testing why I
cannot unzip a buffer passed in a file upload using django.

While not actually using a file, pointing out the need for the binary
option gave me the clue I needed to upload the file

All is good and moving on to the next crisis ;)

Fred.


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


RE: Selecting unique values

2011-07-26 Thread Sells, Fred
The set module or function (depends on which python version) will do
this if you make each record a tuple.

-Original Message-
From: [email protected]
[mailto:[email protected]] On
Behalf Of Peter Otten
Sent: Tuesday, July 26, 2011 5:04 AM
To: [email protected]
Subject: Re: Selecting unique values

Kumar Mainali wrote:

> I have a dataset with occurrence records of multiple species. I need
to
> get rid of multiple listings of the same occurrence point for a
species
> (as you see below in red and blue typeface). How do I create a dataset
> only with unique set of longitude and latitude for each species?
Thanks in
> advance.
> 
> Species_name Longitude Latitude
> Abies concolor -106.601 35.868
> Abies concolor -106.493 35.9682
> Abies concolor -106.489 35.892
> Abies concolor -106.496 35.8542
> Accipiter cooperi -119.688 34.4339
> Accipiter cooperi -119.792 34.5069
> Accipiter cooperi -118.797 34.2581
> Accipiter cooperi -77.38333 39.68333
> Accipiter cooperi -77.38333 39.68333
> Accipiter cooperi -75.99153 40.65
> Accipiter cooperi -75.99153 40.65

>>> def uniquify(items):
... seen = set()
... for item in items:
... if item not in seen:
... seen.add(item)
... yield item
...
>>> import sys
>>> sys.stdout.writelines(uniquify(open("species.txt")))
Species_name Longitude Latitude
Abies concolor -106.601 35.868
Abies concolor -106.493 35.9682
Abies concolor -106.489 35.892
Abies concolor -106.496 35.8542
Accipiter cooperi -119.688 34.4339
Accipiter cooperi -119.792 34.5069
Accipiter cooperi -118.797 34.2581
Accipiter cooperi -77.38333 39.68333
Accipiter cooperi -75.99153 40.65

If you need to massage the lines a bit:

>>> def uniquify(items, key=None):
... seen = set()
... for item in items:
... if key is None:
... keyval = item
... else:
... keyval = key(item)
... if keyval not in seen:
... seen.add(keyval)
... yield item
...

Unique latitudes:

>>> sys.stdout.writelines(uniquify(open("species.txt"), key=lambda s: 
s.rsplit(None, 1)[-1]))
Species_name Longitude Latitude
Abies concolor -106.601 35.868
Abies concolor -106.493 35.9682
Abies concolor -106.489 35.892
Abies concolor -106.496 35.8542
Accipiter cooperi -119.688 34.4339
Accipiter cooperi -119.792 34.5069
Accipiter cooperi -118.797 34.2581
Accipiter cooperi -77.38333 39.68333
Accipiter cooperi -75.99153 40.65

Unique species names:

>>> sys.stdout.writelines(uniquify(open("species.txt"), key=lambda s: 
s.rsplit(None, 2)[0]))
Species_name Longitude Latitude
Abies concolor -106.601 35.868
Accipiter cooperi -119.688 34.4339

Bonus: open() is not the built-in here:

>>> from StringIO import StringIO
>>> def open(filename):  
... return StringIO("""Species_name Longitude Latitude
... Abies concolor -106.601 35.868
... Abies concolor -106.493 35.9682   
... Abies concolor -106.489 35.892
... Abies concolor -106.496 35.8542   
... Accipiter cooperi -119.688 34.4339
... Accipiter cooperi -119.792 34.5069
... Accipiter cooperi -118.797 34.2581
... Accipiter cooperi -77.38333 39.68333  
... Accipiter cooperi -77.38333 39.68333  
... Accipiter cooperi -75.99153 40.65 
... Accipiter cooperi -75.99153 40.65 
... """)  
...   


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

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


RE: Community Involvement

2011-08-05 Thread Sells, Fred
After the completion of most training courses, the students are not yet
ready to make a meaningful contribution to the community.  

 

Yet your goal of getting them involved in the community is worthwhile.
I would think learning to use the community as a resource to solve a
problem that is not based on the standard modules would be a good one.

 

I liked the recipe suggestion as well, but I think you would need to
post a list of  items to choose and remove the item when the recipe has
been posted.  Otherwise you could get a gazillion examples of sorting a
dictionary...

 

Just my 2 cents FWIW

 

Fred Sells

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


Advice on how to get started with 2D-plotting ?

2011-09-06 Thread Fred Pacquier
Hi,

I'm a Python long-timer, but I've never had to use tools like Matplotlib & 
others before.

Now, for my work, I would need to learn the basics fast, for a one-time 
quick-n-dirty job.

This involves a graphic comparison of RFC1918 IP subnets allocation across 
several networks.

The idea is to draw parallel lines, with segments (subnets) coloured green, 
yellow or red depending on the conflicts between the networks.

What would be the simplest/fastest way of getting this done ?
(the graphic parts, the IP stuff I know how to handle)

Alternately, if someone knows of a ready-made and accessible tool that does 
just that, I'm all ears :-)

TIA,
fp
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Advice on how to get started with 2D-plotting ?

2011-09-07 Thread Fred Pacquier
Wow, what an impressive turnout !

Thanks a lot, rantingrick, CM and Herbert, for the fast answers, useful 
tips and especially the sample code !

Beats starting from a blank page, with a big stick, and will certainly set 
me on my way much faster...

networkx does seem a bit over the top for my simple goal, but both the Tk 
(I always forget Tk !) and Matplotlib approaches seem to fit the KISS 
principle just fine... on to the tinkering now :-)

Again, thanks to all !
fp
-- 
http://mail.python.org/mailman/listinfo/python-list


OT: Code Examples

2011-02-28 Thread Fred Marshall
I'm interested in developing Python-based programs, including an 
engineering app. ... re-writing from Fortran and C versions.  One of the 
objectives would to be make reasonable use of the available structure 
(objects, etc.).  So, I'd like to read a couple of good, simple 
scientific-oriented programs that do that kind of thing.


Looking for links, etc.

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


Re: OT: Code Examples

2011-02-28 Thread Fred Marshall

On 2/28/2011 8:14 AM, n00m wrote:

On Feb 28, 6:03 pm, Fred Marshall
wrote:



The best place for you to start: http://numpy.scipy.org/

Numpy manual: http://www.tramy.us/numpybook.pdf


OK Thanks!

Fred

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


Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Fred Pacquier
Robert  said :

> Is there a push to one toolkit or the other?

If you are just now getting started, I would honestly suggest you save a 
whole lot of time and dive straight into PyQt. I've tried most 'em over the 
years (including some now discontinued), and in my experience Qt is way 
above the rest, especially as far as consistency and productivity are 
concerned. The Python bindings are very mature and well maintained, and go 
a long way attenuating the evil C++ roots.

I havent tried Nokia's equivalent (PySide). I'm not sure what its fate will 
turn out, given the company's change of heart and Microsoft honeymoon. At 
least PyQt is't going anywhere soon.

YMMV, of course :)
-- 
http://mail.python.org/mailman/listinfo/python-list


newbie needs help with cookielib

2011-05-04 Thread Sells, Fred
I'm using Python 2.4 and 2.7 for different apps.  I'm happy with a
solution for either one.

I've got to talk to a url that uses a session cookie.  I only need to
set this when I'm developing/debugging so I don't need a robust
production solution and I'm somewhat confused by the docs on cookielib.
I can use urllib2 without cookielib just fine, but need the cookie to
add some security.

I'm normally using Firefox 4.0 to login to the server and get the
cookie.  After that I need some way to set the same cookie in my python
script.  I can do this by editing my code, since I only need it while
defeloping from my test W7 box.


I was hoping to find something like

...set_cookie('mycookiename', 'myvalue', 'mydomain.org')

I've googled this most of the morning and found everything but what I
need, or I just don't understand the basic concept.  Any pointers would
be greatly appreciated.  One of my false starts looks like this. But I
get a 

...
  File "C:\alltools\python26\lib\urllib2.py", line 518, in
http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Access Deinied

def test1():
cj = cookielib.MozillaCookieJar()
cj.load('C:/Users/myname/Desktop/cookies.txt')
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
r = opener.open("http://daffyduck.mydomain.org/wsgi/myapp.wsgi";)   
print r.read() 
return

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


Geodetic Development Kit

2021-05-04 Thread Fred Killet
Dear software developers,

here I post a hint for people who develop programs with geodetic functionality 
like coordinate transformations, datum shifts or distance calculations. For 
this you can easily include ready for use geodetic functions from my Geodetic 
Development Kit GeoDLL. The Dynamic Link Library can be used with almost all 
modern programming languages like C, C++, C#, Basic, Delphi, Pascal, Java, 
Fortran, xSharp, MS-Office and so on. Examples and interfaces are available for 
many programming languages.

GeoDLL is a professional Geodetic Development Kit or Geodetic Function Library 
for worldwide 2D and 3D coordinate transformations and datum shifts with 
highest accuracy. Also: Helmert and Molodensky parameters, NTv2, HARN, INSPIRE, 
EPSG, elevation model (DEM), distance and time zone calculation, meridian 
convergence and much more. GeoDLL is available as 32bit and 64bit DLL and as C 
/ C++ source code. 

The DLL is very fast, secure and compact thanks to the consistent development 
in C / C++ with Microsoft Visual Studio. The geodetic functions are available 
in 32bit and 64bit architecture. All functions are prepared for multithreading 
and server operating.

You find a free downloadable test version on 
https://www.killetsoft.de/p_gdla_e.htm
Notes about the NTv2 support can be found here: 
https://www.killetsoft.de/t_ntv2_e.htm
Report on the quality of the coordinate transformations: 
https://www.killetsoft.de/t_1705_e.htm 

Best regards and stay healthy!
Fred

Email: https://www.killetsoft.de/email.htm?lan=e&btr=News

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


Recommended courses/materials for Python/Django course...

2016-06-15 Thread Fred Stluka
   Python programmers,

   Any Python and/or Django courses/materials to recommend?

   I may be teaching a Python/Django class soon.  My client may be
   willing to jumpstart by buying existing course materials (lecture
   slides, notes, homeworks, labs, reference links, any other materials).
   We'll certainly be happy to make use of any free materials.

   Do you have any Python and/or Django courses/materials to
   recommend?

   I've taken a quick look and found:
   - Main web sites:
 - [1]http://python.org
 - [2]https://djangoproject.com (excellent docs and tutorial!)
   - Free courses:
 - [3]https://developers.google.com/edu/python
   - Free/paid courses:
 - [4]http://learnpythonthehardway.org/book
   - Books
 - 2 Scoops of Django
   - Paid courses:
 - Coursera
 - Codecademy
 - Khan Academy
 - Udacity
 - edX
 - Alison
 - Lynda
 - NewCircle.com

   Any advice?  Thanks!
   --Fred

   --

   Fred Stluka -- [5]mailto:[email protected] -- [6]http://bristle.com/~fred/
   Bristle Software, Inc -- [7]http://bristle.com -- Glad to be of service!
   Open Source: Without walls and fences, we need no Windows or Gates.

   --

References

   Visible links
   1. http://python.org/
   2. https://djangoproject.com/
   3. https://developers.google.com/edu/python
   4. http://learnpythonthehardway.org/book
   5. mailto:[email protected]
   6. http://bristle.com/~fred/
   7. http://bristle.com/
-- 
https://mail.python.org/mailman/listinfo/python-list


Won't Uninstall

2019-09-20 Thread Fred Vincent
Python 3.7.4 won’t uninstall, I have tried doing what I can such as going to 
the control panel and uninstalling the program there, but that did not work. 
Since I am unable to delete it I am unable to download a different version of 
python. How do I fix this and fully uninstall python?

Sent from Mail for Windows 10

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


RE: Is Python worth it??

2005-11-15 Thread Sells, Fred
I second what others have said about the tutorials.  I have not read "how to
think like a ..." but from other posting here I have reservations about it
as a starting point.

-Original Message-
From: Simon Brunning [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 15, 2005 4:42 AM
To: john boy
Cc: [email protected]
Subject: Re: Is Python worth it??


On 14/11/05, john boy <[EMAIL PROTECTED]> wrote:
> I have started out trying to learn Python for my first programming
language.
>  I am starting off with the book "how to think like a computer scientist."
> I spend about 4-5 hrs a day trying to learn this stuff.  It is certainly
no
> easy task.  I've been at it for about 1-2 weeks now and have a very
> elementary picture of how Python works.  I am teaching myself from home
and
> only recieve help from this forum.  Can anybody give me a timeframe as to
> how long it usually takes to pick something like this up, so I can maybe
> figure out a way to pace myself?  I can dedicate a good amount of time to
it
> everyday.  Any advice on what is the best way to learn Python?  I am a
> fairly educated individual with a natural sciences degree (forestry), so I
> also have a decent math background.  Are there any constraints
> mathematically or logic "wise" that would prevent me from building a firm
> grasp of this language?

Keep at it.

Everyone is different, so don't worry about how long it takes you vs.
how long others might take. If you have no programming background,
there's a lot to learn. Using Python is a good choice, I think, 'cos
it gets a lot of extranious crud that many other languages insist on
out of your way, but there's still a lot to learn.

The best way to learn? Go through the tutorials - but if you get an
idea for a mini-project of your own, don't be afraid to dive off and
give it a go. Try to solve you own problems for a while, 'cos that's a
valuable skill, but don't get to the point of frustration. Ask for
help here or on the tutor mailing list[1].

And have fun.

[1] http://mail.python.org/mailman/listinfo/tutor

--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: HTML generation vs PSP vs Templating Engines

2005-11-16 Thread Sells, Fred
If this is your first try, use cgi, cgitb and html % dictionary as suggested
in this thread.  If your db is mysql, you can actually use os.popen() (or
equivalent) to run a  'mysql -html -e "select * from yaddayadda" to return
html.  you can make that look prettier with css.
here's a quick and dirty I just did.
===snip=
===
#!/usr/bin/python
import os, string, sys, time, cgi, cgitb
cgitb.enable(display=1)
import ezcgi
HTML = """

   table {cell-padding:2; cell-spacing:2; font-family:Arial;}
   th { background-color: lightblue; cell-padding:5; cell-spacing:5;}
   td { background-color: lightgray; padding:5; spacing:5;
font-size:mediumm;}

Snapshot of Administrative Bed Holds



Current Administrative Bed Holds at all
Facilities
%s

%s

Copyright (C) 1996-2005, Adventist Care Centers, Inc.  For Internal Use
Only
http://acc.sunbelt.org";>Home|
http://acc.sunbelt.org/rwb?P001=logout";>Logout
"""

COMMAND = ['mysql --host=acaredb --user=acare --password=acare -D census -H
-e ', 
   '"SELECT facility,wrb Room,description Reason,startdate, note
Explanation',
   'FROM admin_bed_holds h, abhreasons r '
   'WHERE h.reason=r.id   ',
   ' ORDER BY facility;"']
COMMAND = ' '.join(COMMAND)

def select_holds():
x = os.popen(COMMAND)
table = x.read(6000)
return HTML % ('', table)

def execute():
if ezcgi.is_authenticated():
print ezcgi.HTML_CONTENT_TYPE
print select_holds()
else: 
ezcgi.authenticate_user()

if __name__=='__main__':
#print ezcgi.PLAIN_CONTENT_TYPE
#print COMMAND
execute()
===snip=
=
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 11:32 AM
To: [email protected]
Subject: HTML generation vs PSP vs Templating Engines


Hello everybody,

I am in the process of writing my very first web application in Python,
and I need a way to
generate dynamic HTML pages with data from a database.  I have to say I
am overwhelmed
by the plethora of different frameworks, templating engines, HTML
generation tools etc that
exist. After some thought I decided to leave the various frameworks
aside for the
time being and use mod_python.publisher along with some means of
generating HTML on
the fly.
Could someone that has used all the different ways mentioned above for
dynamic HTML
content, suggest what the pros and cons of the different methods are?

  Thank you very much in advance

  Panos

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

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


Auto Install Linux Rpm's

2005-11-16 Thread Sells, Fred
We would like to use Python to automatically deploy new rpm's (assuming we
first edit a file to require a new version).  I've just starting looking a
the rpm module.  I can build this from scratch, but was wondering if anyone
is/has solved some or all of this problem or could point me to some
"goodies" that would help.  

tia

Fred

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Developing Commercial Applications in Python

2005-01-03 Thread Sells, Fred
At Sunrise Software International, we build commercial applications for
Cabletron and the Florida DMV.  This was ~10 years ago; so no useful docs
available, but we had no problems with license.

-Original Message-
From: Richards Noah (IFR LIT MET) [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:20 PM
To: [email protected]
Subject: Re: Developing Commercial Applications in Python


> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hello All,
> > I am trying to convince my client to use Python in his new product. He
> > is worried about the license issues. Can somebody there to point me any
> > good commercial applications developed using python ?. The licence
> > clearly says Python can be used for commercial applications. Is there
> > any other implications like that of GPL to make the source open ?
> > Thanks for any help.
> > eeykay
> >
"It's me" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Shaw-PTI (www.pti-us.com) uses Python in their software.   See:
> http://www.pti-us.com/pti/news/index.cfm and search "2004 PSS/E User Group
> Meeting"
>

Begging your pardon, but a better resource would be the brochure available
(http://www.pti-us.com/PTI/company/brochures/PSSE.pdf).  It appears that the
program was probably (originally) written in C/C++ (using MFC for the GUI),
and now employs Python for adding modules and scripting support.  Very
interesting stuff :)


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

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


RE: a question

2005-01-19 Thread Sells, Fred
I would use something like
cmd = '%s/mos user wmarch, ' % mosbin
cmd += 'cd /fa/wm/%s/%s, ' % (jaar, filetype)
cmd += ...
which reveals that you don't have enough args to satisfy all the %s's

-Original Message-
From: Nader Emami [mailto:[EMAIL PROTECTED]
--snip--
I have a long command in Unix and I have to use os.system(cmd) 
statement. I do the following:

cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, chmod 644 
%s' % (mosbin, jaar, filetype, filetype)
 status = os.system(cmd)


This is not very clear, and I have to break this long line in two 
segment by means of the next character '\' :
cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s, \
chmod 644 %s' % (mosbin, jaar, filetype, filetype)

But in this case I get a syntax error! I don't know how I can solve this 
problem. Could somebody tell me about this?

With regards,
Nader


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


Re: advice needed for simple python web app

2005-02-04 Thread Fred Pacquier
"Dan Perl" <[EMAIL PROTECTED]> said :

> This is exactly the kind of summary that I think should be in a 
> WebProgrammingShootOut (see another one of my postings in this thread)
> but I failed to find such a summary.  Thanks, Brian!  Anyone can add
> to the list? 

I myself am also into (very) simple web apps and hence simple, easy-to-
learn web frameworks.

CherryPy is a very nice kit, still simple enough but already (IMO) 
somewhat on the powerful, batteries-included side for a beginner -- and, 
as you noted, a bit under-documented at the moment.

There are a couple of others that will get you started without too much 
effort (in part because simplicity is one of their design points) and 
without limiting you too much either : Karrigell by Pierre Quentel and 
Snakelets by Irmen de Jong.

They're somewhat similar in scope and concept : it will be mostly a 
matter of which one 'fits your brain' best. Myself I settled on 
Snakelets, not least because it has some of the better docs out there.
 
> BTW, there are other people who seem to have been also confused by the
> wide spectrum of choices for this problem: 

That's an old debate in the Python world, yes. The "one true way to do 
it" motto of the language itself doesn't apply to its web frameworks :)

See the recent "Ruby on Rails" threads for a discussion of whether this 
is good or bad...

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Running Python interpreter in Emacs

2005-06-27 Thread Sells, Fred
It works for me in W2000; I have an ancient .emacs file that someone gave me
that I use on each new system, wheter unix or windows and have never had a
problem.  It usually has to be installed at C:/ to work, unless you
understand emacs better than I.  I've inserted the file ".emacs" below, for
those who have attachment blocking.  I make no guarantees, nor do I
understand it, I just use it:
-snip---
---
(setq initial-major-mode 'c-mode)
(setq text-mode-hook 'turn-on-auto-fill)
(setq-default indent-tabs-mode nil)
(global-set-key "\C-z" 'narten-suspend-emacs)
(global-set-key "\C-_" 'help-command)
(setq help-char 31)
(define-key global-map "\C-h" 'backward-delete-char-untabify)
(global-set-key "\C-x\C-e" 'compile)
(global-set-key "\C-x1" 'my-delete-other-windows)
(setq manual-program "man")
(setq manual-formatted-dir-prefix (list "/usr/man/cat"
"/usr/local/X11R4/man"))
(setq manual-formatted-dirlist (list
"/usr/man/cat1" "/usr/man/cat2" "/usr/man/cat3" "/usr/man/cat4"
"/usr/man/cat5" "/usr/man/cat6" "/usr/man/cat7" "/usr/man/cat8"
"/usr/man/catl" "/usr/man/catn" "/usr/local/X11R4/man/catn"
"/usr/local/X11R4/man/cat3" ))
(global-set-key "\em" 'manual-entry)
(global-set-key "\eg" 'goto-line)
(global-set-key "\C-xb" 'my-switch-to-buffer)
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key "\C-q" 'electric-buffer-list)
(global-set-key "\C-x\C-b" 'buffer-menu)
(global-set-key "\C-x\C-y" 'cd)
(global-set-key "\es" 'shell)
(global-set-key "\C-xd" 'display-filename)
(global-set-key "\C-i" 'narten-do-a-tab)
(global-set-key "\C-x\C-b" 'buffer-menu)
(global-set-key "\C-_\C-_" 'help-for-help)
(global-set-key "\C-_\C-a" 'apropos)
(global-unset-key "\C-_\C-c")
(global-unset-key "\C-_\C-d")
(global-unset-key "\C-_\C-n")
(global-unset-key "\C-_\C-w")
(defun my-delete-other-windows ()
  (interactive)
  (delete-other-windows)
  (recenter))
(defun narten-suspend-emacs ()
  (interactive)
  (save-all-buffers)
  (suspend-emacs))
(defun narten-do-a-tab ()
  (interactive)
  (cond ((looking-at "^") 
 (progn (delete-horizontal-space)
(indent-relative)))
((looking-at "[ \t]*")
 (tab-to-tab-stop)))
  (let ((beg (point)))
(re-search-backward "[^ \t]")
(tabify (point) beg))
  (re-search-forward "[ \t]+"))
(defun display-filename ()
  (interactive)
  (message buffer-file-name))
(defun save-all-buffers ()
  (interactive)
  (save-some-buffers 1)
  (message "done!"))
(defun my-switch-to-buffer () 
  "switch to buffer, using completion to prevent bogus buffer names from
being given"
  (interactive)
  (switch-to-buffer (read-buffer "Switch to buffer: " (other-buffer) "t")))
;;;
;;; GNUS stuff
;;;
(setq gnus-nntp-server "astro")
(setq gnus-your-domain "sunrise.com")
(setq gnus-your-organization "Sunrise Software International")

(setq display-time-day-and-date t)
(setq display-time-no-load t)
(setq display-newmail-beep t)
(display-time)
;;(setq-default tab-width 4 )fred

(put 'narrow-to-region 'disabled nil)


(put 'narrow-to-page 'disabled nil)

(put 'insert-file 'disabled nil)

(autoload 'python-mode "python-mode" "" t)
(setq auto-mode-alist
  (cons '("\\.py$" . python-mode) auto-mode-alist))
;;(my-delete-other-windows)
;;(electric-buffer-list)

;;(cond (window-system
;;   (setq hilit-mode-enable-list  '(not text-mode)
;; hilit-background-mode   'light
;; hilit-inhibit-hooks nil
;; hilit-inhibit-rebinding nil)
;;
;;   (require 'hilit19)
;;   ))

;;
;; Hilit stuff
;;
;;(cond (window-system
;;   (setq hilit-mode-enable-list  '(not text-mode)
;; hilit-background-mode   'light
;; hilit-inhibit-hooks nil
;; hilit-inhibit-rebinding nil)
;;
;;   (require 'hilit19)
;;   ))
;;(require 'paren)

(setq-default transient-mark-mode t)

;;(electric-buffer-menu-mode)
(my-delete-other-windows)
snip
ends--




-Original Message-
From: Rex Eastbourne [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 26, 2005 2:49 PM
To: [email protected]
Subject: Re: Running Python interpreter in Emacs


I went to My Computer | P

Re: What are the other options against Zope?

2005-07-03 Thread Some Fred
On Sun, 03 Jul 2005 19:38:28 -0500, phil <[EMAIL PROTECTED]>
wrote:
>Anyway, thanks Terry, I still don't know what Zope is but I need to
>accept that it's just a toolkit and I'm not gonna know until
>I dig in and as long as my web needs are simple, I probably won't.

Actually, I found playing with CherryPy (http://www.cherrypy.org) an
easier way to "get" Zope than digging into Zope directly. It also took
me a good while to understand what an "application server" was, for
that matter.

AFAIK, Zope can be summed up as...

- a server application that uses an object-oriented database (ZODB) to
store items (static or dynamic HTML pages, images, scripts, etc.) as
an alternative to storing data in either a SQL database and/or a
filesystem (although Zope can connect to a SQL database, if need be)

- the use of an OO-database makes it possible to map URLs to scripts
(like it's done when mapping URLs to script pages in the filesystem),
with some added benefits

- a major benefit of the ZODB is "acquisition"
(http://www.zope.org/Members/Amos/WhatIsAcquisition), ie. if an object
is not found in the "directory" pointed to in the URL, ZODB will
search for it by going up the tree all the way to the root, and either
return the object if any is found along the way, or a 404. This makes
it possible, for instance, to locate objects common to different
sections of your site at the root of the site

- scripts are mostly written in Python, since Zope is written partly
in Python, and partly in C, although Zope also supports scripts in
Perl. If you like, you can also write scripts à la PHP, ie. include
code in HTML pages, using two templating languages: DTML is the older
one, and ZPT is the more recent one.

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


RE: I am a Java Programmer

2005-07-06 Thread Sells, Fred
It takes great courage to turn from the dark side; let the pforce be with
you.

Also, go to Borders, get the python books and a Latte and figure out if one
of
the many books is written in a style that you like.

-Original Message-
From: bruno modulix [mailto:[EMAIL PROTECTED]
Sent: Monday, July 04, 2005 5:52 AM
To: [email protected]
Subject: Re: I am a Java Programmer


[EMAIL PROTECTED] wrote:
> I am a java programmer 
Too bad :(

> and I want to learn Python 
So there's still hope !-)

> Please help me.
1/ download and install Python
2/ go thru the 'dive into Python' and 'Thinking in Python' free books
3/ post here when you're in doubt or in trouble...

And don't forget: Python is *not* Java !-)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: How do you program in Python?

2005-07-06 Thread Sells, Fred
I'm old school and have been very happy with emacs (on windows) and the
python extensions.  I just edit my file and hit control-C twice and it runs.
I'm also using eclipse with PyDev and it's ok, but sluggish.

-Original Message-
From: anthonyberet [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 03, 2005 12:35 PM
To: [email protected]
Subject: How do you program in Python?


My question isn't as all-encompassing as the subject would suggest...

I am almost a Python newbie, but I have discovered that I don't get 
along with IDLE, as i can't work out how to run and rerun a routine 
without undue messing about.

What I would really like is something like an old-style BASIC 
interpreter, in which I could list, modify and test-run sections of 
code, to see the effects of tweaks, without having to save it each time, 
or re-typing it over and over (I haven't even worked out how to cut and 
paste effectively in the IDLE environment).

I see lots of alternate IDEs etc, but which would allow me the simple 
interface that I have described? - I really don't know about IDEs in 
general, and I suspect I would be out of my depth with one of those.

Thanks, and feel free to mock ;)
-- 
http://mail.python.org/mailman/listinfo/python-list

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Yet Another Python Web Programming Question

2005-07-12 Thread Sells, Fred
FWIW there's  "dos2unix" program that fixes this on most systems.

-Original Message-
From: Bill Mill [mailto:[EMAIL PROTECTED]
Sent: Monday, July 11, 2005 11:55 AM
To: Daniel Bickett
Cc: [email protected]
Subject: Re: Yet Another Python Web Programming Question


> Python using CGI, for example, was enough for him until he started
> getting 500 errors that he wasn't sure how to fix.

A common error is that python cgi files need line endings to be in
unix text file format, not windows text file format (\n instead of
\r\n) [1]. Why this is, I don't know, but it causes a lot of errors
for windows folks. I'm a frequent linux/windows switcher, and it's
caused me no end of troubles - if you're getting "premature end of
script headers" in your apache error logs, this may be your problem.

Peace
Bill Mill
bill.mill at gmail.com
-- 
http://mail.python.org/mailman/listinfo/python-list

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


2.3 or 2.4 on linux

2005-08-04 Thread Sells, Fred
We are in the process of standardizing ~10 Linux servers on Lineox 4.x,
which is a variant of RedHat Enterprise server I'm told.  Part of that
process is to standardize python.

The baseline install includes python 2.3 which is adequate, but I would like
to standardize on 2.4.1, because it is the latest and greatest and has a few
modules that would be nice to have.   I installed python 2.4.1 ok, creating
a python24 directory alongside the pyhton23 directory.  The problems started
when I tried to install MySQLdb.

My problem is that all the rpm installs seem to impact the 2.3 that's there.
When I check the 2.3 site-packages directory, I find alot of goodies like 

Alchemist.py  kudzu.pyrpmdb
authconfigmodule.sorpmmodule.so  CacheBlackBox.py  libusermodule.so
_snackmodule.so
  mod_python  snack.py  CompatMysqldb.py  mx
CompatMysqldb.pyc MySQLdb   FileBlackBox.py   _mysql_exceptions.py
URLBlackBox.py
  ForgeBlackBox.py  _mysql.so xf86config.py ForgeBlackBox.pyo
pyalchemist_python.py
   _xmlplus
ixf86configmodule.so 

I assume some system tools must use them, even if I don't.  I don't know if
I can just copy all this into the 2.4 site-packages (deleting .pyc and .pyo)
and get what I need.

I'm not a sysadmin hotshot, and our sysadmin is not a python hotshot, so
between us we can really screw up a system.  We would really like to stick
with either apt-get or rpm installs to keep our sysadmin issues under
control.  Has anyone hit this wall already and found a reasonable solution?.

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


FW: python oldie, SWIG newbie needs help

2005-08-16 Thread Sells, Fred


-Original Message-
From: Sells, Fred 
Sent: Tuesday, August 16, 2005 5:09 PM
To: [email protected]
Subject: python oldie, SWIG newbie needs help 


I've been trying all day to get a simple SWIG generated interface to a
simple (but ugly) piece of c++ code provided to us by the gov't.  I've tried
google, and every variation on the examples I can think of.  I'm really
under the gun to get this working and would appreciate someone showing me
the error of my ways.  We're running python 2.3 redhat 9 and gcc

although the code is c++, it does not use classes and the only function I
need to access is "RugCacl".

My typical error messages are shown below and the files attached.  I've
tried SWIG with and without --shadow.  If my last line of the .i file is
%include rug520.cpp, I don't get an error on import, but the RugCalc
function is undefined.

$ python rug520.py
Traceback (most recent call last):
  File "rug520.py", line 5, in ?
import _rug520
ImportError: /home/frsells/dll/_rug520.so: undefined symbol: RugCalc


part of the c++ code is below; the whole file was bigger than the mail
handler would accept.

#include "rug520.h"
#include 
#include 
#include 
#include 
#define LINUX

char masItemVal[108][5];

void LoadValue( char * sMdsRecord, int location, int length, char *
masItemValue ) 
{  
   for ( int i=0; i

build.sh
Description: Binary data


rug520.h
Description: Binary data


rug520.i
Description: Binary data
-- 
http://mail.python.org/mailman/listinfo/python-list

RE: Coin-operated kiosk written in python -- need some help...

2005-08-18 Thread Sells, Fred
I've done a similar app, but it keeps a gui up awaiting a timeclock punch.
You need to tackle this in phases:
1. what os and get the gui to start at bootup.
2. start a separate thread that reads/blocks on the coin.

you need more specific questions to get better help

-Original Message-
From: Jon Monteleone [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 18, 2005 11:15 AM
To: [email protected]
Subject: Coin-operated kiosk written in python -- need some help...


Greetings,
I posted a few days back and didnt get much of a response, so I figured I
would post again
with more detail. I am running gnome under fedora core 4.

I want a kid to be able to drop a quarter into a coin slot and get 15
minutes of time on
an account that has "restricted" Internet access via the firefox web
browser.  We are
experimenting with different ways to allow kids to safely surf the web
during school hours
while recovering some of the cost for bandwidth.  I have written a python
program that
detects the coin drop and adds 15 minutes to a gui written in tkinter. The
gui contains 2
buttons and the usage time.  I need a way for my gui to display from machine
bootup until
shutdown and through multiple logins and logouts of the web browsing
account.  I am
familiar with kiosk setups but I dont know how to code my python program to
display its
gui at the login screen and continue running through multiple sessions of
users logging
into and out of the internet acct.

I thought making my kiosk program a daemon would work, but I cant get the
gui to display
at the login screen and then there is the problem of having the press of a
button on my
gui enter username and password information.

Basically, I envision the following sequence of events...
1) Machine is turned on and boots up
2) My kiosk is started (maybe as a daemon)
3) The daemon uses Tkinter to display its gui with the buttons and time
4) User drops coins and time on gui is incremented
5) User presses the start button
6) My program logs the user into the Internet account
7) Secure firefox is started
8) My program starts counting down the time on the gui
9) When the time reaches 0, the user is logged out
When the user presses stop on my gui, they are logged out
 The user can drop more coins at any time during the session to prolong
the session
10) Timer resets to 0 awaiting the next customer to drop coins

Any help on how to display my gui and log into an account using python would
be much
appreciated.
Cheers -Jon

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


---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Fred Pacquier
"Adriaan Renting" <[EMAIL PROTECTED]> said :

> And about the French language: Try to find some french radio broadcast
> on the internet or something like that, and see if you can understand
> it. I find reading/writing/speaking French is o.k., but understanding
> native speakers can be very hard. I have a lot easier time
> understanding for example italians speaking French. 

This is a general case, and it goes both ways : we French usually 
communicate much more easily with italians (or whatever) speaking english 
than with native anglo-american speakers. Anyway, source code (esp. python) 
is the modern esperanto/volapük :-)

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-08 Thread Fred Pacquier
Peter Hansen <[EMAIL PROTECTED]> said :

> I can't let that pass. :-)  I believe it was well established in posts
> a few years ago that while the programming-language equivalent of 
> Esperanto is clearly Python, "Volapuke" was most definitely
> reincarnated as *Perl*.

Sorry -- I've been reading c.l.py daily for quite some time, but I must 
have skipped that particular thread :-)
Of volapük I know only the name, so if that was the consensus here, then 
it's certainly true...

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Big development in the GUI realm

2005-02-08 Thread Fred Pacquier
Robert Kern <[EMAIL PROTECTED]> said :

>> that's Hanlon, not Heinlein.  to be on the safe side, I won't attempt
>> to attribute your mistake to anything.
> 
> Fair enough. The only time I've seen it in dead-tree print was in 
> Heinlein's _Time Enough For Love_, unattributed to anyone else. 
> Googlespace seems to be not entirely sure whether "Hanlon" is real or
> is a corruption of "Heinlein". Googling for quote attributions is a
> tricky proposition at best, though.
 
I don't know who Mr Hanlon is, but I've previously seen it attributed to 
Napoleon Buonaparte. Never been able to verify that either, though.

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: low-end persistence strategies?

2005-02-16 Thread Fred Pacquier
KirbyBase sounds like something that could fit the bill.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web framework

2005-03-09 Thread Fred Pacquier
"Gianluca Sartori" <[EMAIL PROTECTED]> said :

> Hi guys,
> What web framework do you suggest to develop with? I had a look both at
> Nevow and Quixote. These seemes to be the most appreciated by the
> community. Anyway, I had no luck looking for a complete and coherent
> documentation.

Snakelets is nice, clean, simple to get started, and well documented. 
Karrigell is about in the same league. CherryPy is a step above (all IMO of 
course).

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lisp-likeness

2005-03-15 Thread Fred Gilham


> (defun addn (n)
>   (lambda (x)
> (+ x n)))
> 
> And Lisp's "macro language" isn't involved at all here.


(macroexpand-1 '(lambda (x) (+ x n))) => #'(LAMBDA (X) (+ X N))

Also, #' is a read-macro.  Fully expanded the #'(lambda expression
would be

(function (lambda (x) (+ x n)))

Then there's the "defun" macro . . . .

 :-)

-- 
Fred Gilham[EMAIL PROTECTED]
A common sense interpretation of the facts suggests that a
superintellect has monkeyed with physics, as well as with chemistry
and biology, and that there are no blind forces worth speaking about
in nature. --- Fred Hoyle
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I need to create the table and I want to edit its content from www level.

2004-12-06 Thread Fred Pacquier
[EMAIL PROTECTED] (Rootshell) said :

> I need to create the table and I want to edit its content from www
> level.
> 
> Here is some example:
> 
> http://www.rootshell.be/~flash44
> 
> There is a table.
> Is there possibilty to edit the content using  command?
> 
> Could you show me the way how to do it?
> 
> My vision is:
> User has its login and password. When he logs in the table space opens
> and he can edit the content.
> 
> I need a few lines of code for example or url with similar idea.
> 
> Best regards.
> 
> Rootshell.

This may give you some ideas :
http://www.cwareco.com/download/tabla.html

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: datetime

2004-12-16 Thread Fred Pacquier
Chris <[EMAIL PROTECTED]> said :

> Okay, I searched www.python.org for a date handler and found datetime. 
> http://www.python.org/dev/doc/devel/lib/module-datetime.html  However, 
> whenever I try to import datetime, I get a No module named datetime 
> error.  What am I missing?

The module documentation says "New in version 2.3".
Is that what you're running ?

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: gridbaglayout

2004-12-24 Thread Sells, Fred
gridbag is a pain.  google for tablelayout which is easier (to me)

-Original Message-
From: Diez B. Roggisch [mailto:[EMAIL PROTECTED]
Sent: Monday, December 20, 2004 1:17 PM
To: [email protected]
Subject: Re: gridbaglayout


[EMAIL PROTECTED] wrote:

> Friends - I have tried to do abolute positioning using gridbaglayout,
> but am having no success in jython. One book I have been referencing
> says that it only works with JPanels. Could someone post a snippet of
> code that works for a button? I am so close so just a hint would help.

Google for java-examples and translat to jython. Ist straight forward.
-- 
Regards,

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

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


Re: Python for a 10-14 years old?

2005-03-24 Thread Fred Pacquier
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> said :

> At the age of nine at school, two guys from a French computer-making
> company named as "Loup" (in french) or "Lupo" (in Italian), can't
> remember which --if either is correct--, came and gave us a demo of one
> of their models.

OT/trivia : if it was between mid-eighties and early nineties, the company 
could be "Goupil" (ancien french for "Fox").

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for a 10-14 years old?

2005-03-28 Thread Fred Pacquier
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> said :

>>OT/trivia : if it was between mid-eighties and early nineties, the
>>company could be "Goupil" (ancien french for "Fox").
> 
> Exactly! That was it... it was October or November 1981, though (early
> eighties).

Oh... probably a "G2" model then, with a 68000 CPU from pre-IBM-PC days..
(http://www.silicium.org/france/goupil/goupil2.htm)

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


Need Help: Server to pass py objects

2005-03-29 Thread Sells, Fred
I have a legacy system with data stored in binary files on a remote server.
I need to access and modify the content of those files from a webserver
running on a different host.  (All Linux)

I would like to install a server on the legacy host that would use my python
code to translate between the legacy files and Python Objects that represent
the subset of data I care about, then pass those Python objects back and
forth to my webserver, which would then manage the http I/F to various
clients.

My organization prefers to use open source software.

Can anyone suggest some products to research further?
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Need Help: Server to pass py objects-THANKS

2005-03-30 Thread Sells, Fred
Thanks to all who responded. Although overwhelmed by the hits from a Google
search initially, it looks like pyro is a good choice for my needs.

-Original Message-
From: Ken Godee [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 29, 2005 3:45 PM
To: [email protected]
Subject: Re: Need Help: Server to pass py objects


 >I have a legacy system with data stored in binary files on a remote 
 >server.
 >I need to access and modify the content of those files from a webserver
 >running on a different host.  (All Linux)
 >
 >I would like to install a server on the legacy host that would use my 
 >python
 >code to translate between the legacy files and Python Objects that 
 >represent
 >the subset of data I care about, then pass those Python objects back >and
 >forth to my webserver, which would then manage the http I/F to various
 >clients.
 >
 >My organization prefers to use open source software.
 >
 >Can anyone suggest some products to research further?



Take a look here

http://pyro.sourceforge.net/
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Equivalent string.find method for a list of strings

2005-04-09 Thread Sells, Fred
linenums = [i for i in range(len(lines)) if lines[i].find(searchstring) >=0]

-Original Message-
From: Joshua Ginsberg [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 4:12 PM
To: [EMAIL PROTECTED]
Subject: Re: Equivalent string.find method for a list of strings


try:

filter(lambda x: lines[x].find(searchstring) != -1, range(len(lines)))

That will return a list with the indices of every line containing a hit 
for your search string.

-jag


Joshua Ginsberg -- [EMAIL PROTECTED]
Brainstorm Internet Network Operations
970-247-1442 x131
On Apr 8, 2005, at 1:52 PM, Jeremy Conlin wrote:

> Joshua Ginsberg wrote:
>
>> Try:
>>
>> filter(lambda x: x.find(searchstring) != -1, lines)
>>
> I really like this option, but what I want to  know where in the file 
> this line exists (i.e. line 42).  Can  I somehow access this line and 
> the lines immediately following?
> Thanks,
> Jeremy
>
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: PPC OSX vs. x86 Linux

2005-04-09 Thread Sells, Fred
I'm no expert on internals, but I seem to recall that in the past, the
string module could be implemented in either C or Python and I think there
is a strop module that is related to all this.  Could it be that on the Mac,
your string processing is using interpreted Python byte code while linux
uses c?

-Original Message-
From: Joshua Ginsberg [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 1:03 PM
To: [EMAIL PROTECTED]
Subject: PPC OSX vs. x86 Linux


Hello --

I writing some python code to do some analysis of my mail logs. I took 
a 10,000 line snippet from them (the files are about 5-6 million 
usually) to test my code with. I'm developing it on a Powerbook G4 
1.2GHz with 1.25GB of RAM and the Apple distributed Python* and I 
tested my code on the 10,000 line snippet. It took 2 minutes and 10 
seconds to process that snippet. Way too slow -- I'd be looking at 
about 20 hours to process a single daily log file.

Just for fun, I copied the same code and the same log snippet to a 
dual-proc P3 500MHz machine running Fedora Core 2* with 1GB of RAM and 
tested it there. This machine provides web services and domain control 
for my network, so it's moderately utilized. The same code took six 
seconds to execute.

Granted I've got the GUI and all of that bogging down my Mac. However, 
I had nothing else fighting for CPU cycles and 700MB of RAM free when 
my testing was done. Even still, what would account for such a wide, 
wide, wide variation in the time required to process the data file? The 
code is 90% regular expressions and string finds.

Theories? Thanks!

-jag


* versions are:
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
and
Python 2.3.3 (#1, May  7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2


Joshua Ginsberg -- [EMAIL PROTECTED]
Brainstorm Internet Network Operations
970-247-1442 x131
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: database in python ?

2005-04-11 Thread Fred Pacquier
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> said :

> Hello I need to build table which need searching data which needs more
> power then dictionary or list in python, can anyone help me what kind
> of database suitable for python light and easy to learn. Is mySQL a
> nice start with python ?

There are a number of separate database engines with a python interface, as 
others in the thread have shown. However, if you mostly work with one table 
at a time, as you seem to imply, then you might have a look a Kirbybase : 
it's a single python module, and databases don't come any lighter or easier 
than that :)

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Generating RTF with Python

2005-04-14 Thread Sells, Fred
Apache fop does a good job of combining xslt+xml to generate pdf; the spec
says it does RTF, but I have not tried it.  Although fop is java, you can
run it as a (java) executable, so you could run it as a command from python.
It is almost as good as reportlab's stuff.

-Original Message-
From: Max M [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 31, 2005 11:56 AM
To: [email protected]
Subject: Re: Generating RTF with Python


Axel Straschil wrote:
> Hello!
> 
> 
>>does anyone know of a high-level solution to produce RTF from Python=20
>>(something similar to
>>Reportlab for producing PDF)?
> 
> Spend hours of googeling and searching, also in this NG, about two
> months ago. My conclusion is: On windwos, maybe you can include some
> hacks with dll's, under linux, linux support for generating rtf is none,
> and so is python's.
> 
> My workaround was: 
> http://www.research.att.com/sw/download/
> This includes an html2rtf converter, which I access from python via
> popen and temporary files. Not high-level, not very sexy ... ;-(


I looked at this a while ago, which might be a starter.

http://pyrtf.sourceforge.net/


-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Supercomputer and encryption and compression @ rate of 96%

2005-04-14 Thread Fred Pacquier
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> said :

> Well, I take advantage of this "folding" idea for years now.  Do you
> remember DoubleSpace?  I was getting to the limits [1] of my 100 MiB
> hard disk, so I was considering upgrading my hardware.  A female
> friend of mine, knowing a little but not a lot about MS-DOS asked the
> eye-opening question: "why don't you reapply double space to the
> compressed drive?"

Any BBS-era old-timers here remember NABOB ? :-)

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


noobie needs help with ctypes

2013-12-09 Thread Sells, Fred
I'm using python 2.6 on Linux/CentOs 6.x

I'm getting ctypes to work, but getting stuck on the use of  .argtypes.  Can 
someone point out what I'm doing.  This is my first use of ctypes and it looks 
like I'm getting different definitions in stackoverflow that may correspond to 
different version of python.

Here is my code.  Without the restype/argtypes it works, but I cannot figure 
out how to define argtypes to match the data.  
mylibrary = ctypes.CDLL(LIBRARY_PATH)
mdsconvert = mylibrary.RugVersionConverter
mdsconvert.restype = ctypes.c_int
mdsconvert.argtypes = [ charptr, #flat buffer of mds 3.0 data
ctypes.c_buffer, #computed flat buffer of mds 2.0 data
ctypes.c_buffer  #version set to "1.00.4" in c++, never 
used
]

def convertMds2to3(mds30buffer):
mds20 = ctypes.create_string_buffer('\000'*3000)
t = ctypes.create_string_buffer('\000'*30)
success = mdsconvert(mds30buffer,  ctypes.byref(mds20), ctypes.byref(t) )
print 'convert %s to %s success=%s version=%s' % (len(mds30buffer), 
len(mds20.value), success, t.value)
return mds20.value

--- C++ code looks like this 
---
extern "C"
   int RugVersionConverter( char * sInputRecord, char * MDS2_Rec, char * 
Version );

where sInputRecord is input and MDS2_Rec and Version are output.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: noobie needs help with ctypes

2013-12-09 Thread Sells, Fred
My management requires that we stick with the version that comes with CentOs 
which is 2.6.   I know that it’s possible to have multiple versions co-resident 
with or without virtualenv, but policy is policy ☹



From: Python-list 
[mailto:[email protected]] On Behalf Of 
Joel Goldstick
Sent: Monday, December 09, 2013 3:22 PM
To: Terry Reedy
Cc: [email protected]
Subject: Re: noobie needs help with ctypes

On Mon, Dec 9, 2013 at 3:15 PM, Terry Reedy 
mailto:[email protected]>> wrote:
On 12/9/2013 2:24 PM, Sells, Fred wrote:
I'm using python 2.6 on Linux/CentOs 6.x

I would use the latest 2.7 (or 3.3) for a new project if at all possible.

I seem to recall that Centos needs 2.6 as default python for its own purposes, 
so you need to install another version without messing with 2.6.  VirtualEnv 
might help.

I'm getting ctypes to work, but getting stuck on the use of  .argtypes.  Can 
someone point out what I'm doing.  This is my first use of ctypes and it looks 
like I'm getting different definitions in stackoverflow that may correspond to 
different version of python.

In particular, I am sure that there have been bugfixes for ctypes.


--
Terry Jan Reedy

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



--
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: noobie needs help with ctypes

2013-12-10 Thread Sells, Fred
Mucho apologies for rich text, I think I picked that up when replying to a post 
without properly checking.  Thanks for heads up.

Fred.

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


meta language to define forms

2014-03-27 Thread Sells, Fred
I'm trying to use python classes and members to define complex data entry forms 
as a meta language

The idea is to use a nice clean syntax like Python to define form content, then 
render it as HTML but only as a review tool for users,  The actual rendering 
would go into a database to let a vendor's tool generate the form in a totally 
non-standard syntax that's really clunky.

I don't have a lot of time or management support to do something elegant like 
XML and then parse it, I'm thinking more like

Class  FyFormNumber001(GeneralForm):
Section1 = Section(title="Enter Patient Vital Signs")
Question1 = NumberQuestion(title="Enter pulse rate", 
format="%d3")
Question2 = Dropdown(title="Enter current status")
Question2.choices = [ (1, "Alive and Kicking"), (2, 
"Comatose"), (3, "Dead"), ...]


Of course this is not quite legal python and I have a lot of flexibility in my 
"meta" language.  The basic model is that a single file would define a form 
which would have one or more sections,  each section would have one or more 
questions of various types (i.e. checkbox, radio button, text, etc).  Sections 
cannot be nested.

I don't have to have a perfect layout, just close enough to get the end users 
to focus on what they are asking for before we generate the actual code.  I 
tried an HTML WYSIWYG editor but that was too slow and I lost information that 
I need to retain when the actual form is generated.

The biggest problem (to me) is that I have to maintain the order; i.e. the 
order in which they are coded should be the order in which they are displayed.

I'm looking to do about 200 forms, so it is reasonable to invest some time up 
front to make the process work; meanwhile management wants results yesterday, 
so I have a trade-off to make.

Is there anything out there that would be close or do you have any suggestions.

Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: My attempts in playing with tail-recursion in python

2015-05-17 Thread Fred Spiessens
Hi Thomas, I like what you've been doing.
I think it would also be great if the "leave the loop" detector would be the 
actual stop condition in the recursion, applied to the arguments of the call.
That would of course force you to split the recursive function in two 
functions: one to detect the stop condition, and another one that makes the 
next call, but in my opinion, that would make perfect sense.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: webapp development in pure python

2011-10-25 Thread Sells, Fred
Quixote may be what you want, but it's been years since I've used it and
I don't know if it is still alive and kicking.  It was from MEMS if I
remember correctly.

Using django and Flex is one way to avoid html and javascript and it
works great for datagrids.

Fred.

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


RE: Using the Python Interpreter as a Reference

2011-11-25 Thread Sells, Fred
I'm looking at a variation on this theme.  I currently use
Flex/ActionScript for client side work, but there is pressure to move
toward HTML5+Javascript and or iOS.  Since I'm an old hand at Python, I
was wondering if there is a way to use it to model client side logic,
then generate the javascript and ActionScript.  I don't see an issue
using custom python objects to render either mxml, xaml or html5 but I'm
not aware if anyone has already solved the problem of converting Python
(byte code?) to these languages?  Any suggestions.

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


RE: Py and SQL

2011-12-01 Thread Sells, Fred
I find it easier to code like this

 

Sql = ‘’’select yadda, yadda, yadda

FROM a,b,c

Where this=that

ORDER BY deudderting’’’

 

With the appropriate %s(varname)  and  % against a dictionary rather than 
positional args, but that’s just me.

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Jerry Hill
Sent: Wednesday, November 30, 2011 5:15 PM
To: Verde Denim
Cc: Python list
Subject: Re: Py and SQL

 

On Wed, Nov 30, 2011 at 3:30 PM, Verde Denim  wrote:

dbCursor1.execute('select lpad(' ', 2*level) || c "Privilege, Roles and Users" 
from ( select null p, name c from system_privilege_map where name like 
upper(\'%&enter_privliege%\') union select granted_role p, grantee c from 
dba_role_privs union select privilege p, grantee c from dba_sys_privs) start 
with p is null connect by p = prior c')


I think this is your problem.  Your string is delimited with single quotes on 
the outside ('), but you also have a mix of single and double quotes inside 
your string.  If you were to assign this to a variable and print it out, you 
would probably see the problem right away. 

You have two options.  First, you could flip the outer quotes to double quotes, 
then switch all of the quotes inside the string to single quotes (I think that 
will work fine in SQL).  Second, you could use a triple-quoted string by 
switching the outer quotes to ''' or """.  Doing that would let you mix 
whatever kinds of quotes you like inside your string, like this (untested):

sql = '''select lpad(' ', 2*level) || c "Privilege, Roles and Users" from ( 
select null p, name c from system_privilege_map where name like 
upper(\'%&enter_privliege%\') union select granted_role p, grantee c from 
dba_role_privs union select privilege p, grantee c from dba_sys_privs) start 
with p is null connect by p = prior c'''

dbCursor1.execute(sql)

Once you do that, I think you will find that the "&enter_priviliege" bit in 
your SQL isn't going to do what you want.  I assume you're expecting that to 
automatically pop up some sort of dialog box asking the user to enter a value 
for that variable?  That isn't going to happen in python.  That's a function of 
the database IDE you use.  You'll need to use python to ask the user for the 
privilege level, then substitute it into the sql yourself.

-- 
Jerry

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


RE: Using the Python Interpreter as a Reference

2011-12-02 Thread Sells, Fred
Steven, that's probably the most elegant explanation of the "pythonic"
way I've ever seen.  I'm saving it for the next time upper management
want to use Java again.

-Original Message-
From: [email protected]
[mailto:[email protected]] On
Behalf Of Steven D'Aprano
Sent: Thursday, December 01, 2011 7:43 PM
To: [email protected]
Subject: Re: Using the Python Interpreter as a Reference

On Thu, 01 Dec 2011 10:03:53 -0800, DevPlayer wrote:

[...]
> Well, that may be a little hyperbolic. But with 2 spaces you can
> encourage coders to get very deep, indentially, and still fit 80
chars.

Why would you want to encourage coders to write deeply indented code?

In my opinion, if your code is indented four or more levels, you should 
start to think about refactorising your code; if you reach six levels, 
your code is probably a mess.

class K:
def spam():
if x:
for a in b:
# This is about as deep as comfortable
while y:
# Code is starting to smell
try:
# Code smell is now beginning to reek
with z as c:
# And now more of a stench
try:
# A burning, painful stench
if d:
# Help! I can't breathe!!!
for e in f:
# WTF are you thinking?
try:
# DIE YOU M***ER!!!
while g:
# gibbers quietly
...


The beauty of languages like Python where indentation is significant is 
that you can't hide from the ugliness of this code. 

class K: {
  # Code looks okay to a casual glance.
  def spam():{
   if x: { for a in b:{
 while y:{ try:{ with z as c:{
   try:{ if d:{ for e in f:{ try:{
 while g:{ ... 
   
 

Deeply indented code *is* painful, it should *look* painful.


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

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


RE: Shebang line on Windows?

2013-02-25 Thread Sells, Fred
When moving from windows to unix you need to run "dos2unix"   on any programs 
that use shebang (at least with python 2.6)   that is installed on some 
platforms but must be installed on others like CentOs but it is in their 
repository.

-Original Message-
From: Python-list 
[mailto:[email protected]] On Behalf Of 
James Harris
Sent: Friday, February 22, 2013 5:53 PM
To: [email protected]
Subject: Re: Shebang line on Windows?

On Feb 22, 6:40 pm, Zachary Ware 
wrote:

> On Fri, Feb 22, 2013 at 12:16 PM, Walter Hurry  
> wrote:

> > I use FreeBSD or Linux, but my son is learning Python and is using 
> > Windows.
>
> > My question is this: Would it be good practice for him to put 
> > #!/usr/bin/ env python at the top of his scripts, so that if made 
> > executable on *nix they will be OK? As I understand it this will 
> > have no effect on Windows itself.
>
> Adding the shebang line on Windows would be excellent practice.

A word of warning unless this has since been resolved: Whenever I have tried 
adding the shebang line on Windows and running it on Unix the latter has 
complained about the carriage return at the end of the line. This means that 
Unix does not work when invoked as follows.
(And, yes, the file has had chmod +x applied.)

  ./program.py

It is, of course, OK when run as

  python program.py

but that removes some of the benefit of the shebang line.

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

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


UDP socket, need help setting sending port

2005-12-19 Thread Sells, Fred
I'm using MSW XP Pro with Python 2.4 to develop but production will be Linux
with Python 2.3.  (could upgrade to 2.4 if absolutely necessary) I can also
switch to Linux for development if necessary.

I am writing some python to replace proprietary software that talks to a
timeclock via UDP.

The timeclock extracts the sending port from the UDP header and uses that
for all response messages.

I cannot find out how to set the sending port in the header.  Windows XP
appears to set an arbitrary port.  I've been using ethereal to analyze
network traffic and it seems that if I can set the sending port, I should be
OK.

I have been googling various combinations of "python udp ..." for the last
two hours and have not found anything that addresses how to set the sending
port.  I'm guessing that this may be in setsockopt but don't see any
parameters that "click".

Any help would be greatly appreciated.

Fred Sells
fred at adventistcare dott org


---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: UDP socket, the solution

2006-01-04 Thread Sells, Fred
import socket, threading, time, binascii, struct
from Configure import Debug
thanks to all, here's my final code that works, if it helps anyone


import socket, threading, time, binascii, struct
from Configure import Debug

ZERO = chr(0)

class Udp:

def __init__(self, my_address, destination_address, timeout=2.0,
log=None):
self.MyAddress = my_address  #(ip,port)
self.Destination = destination_address #(ip,port)
self.Socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.Socket.settimeout(timeout)
self.Socket.bind(self.MyAddress)
self.log = log

def sendto(self, msg):
nsent = self.Socket.sendto(msg, self.Destination)
if Debug.Udp: print >>Debug.Log, '\t\t\t\t   ==>', self.format(msg,
send=True)
return nsent

def recvfrom(self, size=4096):
data, addr = self.Socket.recvfrom(size)
if self.log: print >>self.log, '\t\t\t\t<==   ', self.format(data,
send=False)
return data

def format(self, x, send):
first = struct.unpack('>BBI', x[:6])
tmp = ' ctrl=%02x %02x n=%08x  ' % first
if len(x)>6:
if x[-1]==ZERO:
tmp += '  data="%s x00"' % x[6:-1]
else:
tmp += '  data="%s"' % x[6:]
return tmp


if __name__=='__main__':
syncmsg = struct.pack('>BBI', 8, 0x4a, 0xaabbccdd)
S = Udp( ('192.168.201.171', 1201) , ('192.168.201.72', 1202))
response = S.sendto(syncmsg)
x = S.recvfrom()
print x


---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for a particular http proxy...

2006-01-13 Thread Fred Pacquier
Hello,

I would be grateful if someone could point me to an existing and working 
http proxy implementation that satisfies the following requirements :

- as small and simple as possible, ideally no dependencies outside python
- easy to customize (for controlling outgoing http headers for instance)
- supports chaining to another remote proxy

I have spent some time on the list at : 
http://xhaus.com/alan/python/proxies.html

...but haven't found what I need yet : Some old pages/packages have broken 
links ; some are too full-featured and/or have heavy dependencies (xml, 
ssl, twisted etc.) ; some have remote proxy support but are complicated 
enough that I'm not sure where to hack at the request headers ; and the 
really simple ones don't chain to other proxies.

Actually "Tiny HTTP Proxy" and its derivatives would be just fine for what 
I want to do, but I don't know how and where to add remote proxy support.
I did get httpMonitor to work (although it is overkill), but it depends on 
PyXML (still 900 KB even pared down some), and it seems to have some 
strange side effects on the browser.

Any ideas welcome,
TIA,
fp

-- 
YAFAP : http://www.multimania.com/fredp/
-- 
http://mail.python.org/mailman/listinfo/python-list


ldap .passwd method, need help

2006-01-13 Thread Sells, Fred
I've got the python-ldap version 2.0.11 with python 2.4 under Linux

I've got the ldap stuff working for groups, but now I'm trying to use it to
change a user password.  I get a return of 2 and no error messages but it
does not change ldap.

I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the
same result.

Anyone know what I'm missing?

class LdapUser:
def __init__(self, uri=uri, binddn=BINDDN, password=""):
self.ldap = ldap.initialize(uri)
self.ldap.simple_bind(binddn, password)

def chg_pw(self,uid,oldpw,newpw):
print self.ldap.passwd_s(uid,oldpw,newpw)


if __name__=="__main__":
Ldap = LdapUser(password="secret")
Ldap.chg_pw("uid=joeblow,ou=abc,ou=def,dc=ghi,dc=org","", "new.pass")


---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


ldap passwd need help

2006-01-18 Thread Sells, Fred
I've got the python-ldap version 2.0.11 with python 2.4 under Linux

I've got the ldap stuff working for groups, but now I'm trying to use it to
change a user password.  I get a return of 2 and no error messages but it
does not change ldap.

I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the
same result.

Anyone know what I'm missing?

class LdapUser:
def __init__(self, uri=uri, binddn=BINDDN, password=""):
self.ldap = ldap.initialize(uri)
self.ldap.simple_bind(binddn, password)

def chg_pw(self,uid,oldpw,newpw):
print self.ldap.passwd_s(uid,oldpw,newpw)


if __name__=="__main__":
Ldap = LdapUser(password="secret")
Ldap.chg_pw("uid=joeblow,ou=abc,ou=def,dc=ghi,dc=org","", "new.pass")

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Where is Python in the scheme of things?

2006-10-05 Thread Sells, Fred
Every C++ and Java programmer that I know, who have done a moderate sized
project in Python (thus requiring learning it's strengths) states that they
hope to never go back to C++ or Java.

I cannot comment on VB programmers, since I don't speak to them ;)
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: CGI Tutorial

2006-10-06 Thread Sells, Fred
content is great, my comments are editorial.

I prefer PDF with bookmarks rather than HTML. 
1. easy to print the whole thing and read offline.
2. easy to find a secion from bookmarks, rather that chasing links
3. easy to save on my local "doc" folder so I can be sure It will always be
there.  (i.e. I don't have to try to find it when you change servers)

Of course that's just my opinion, I could be wrong ;)

If you choose to go the PDF route, I've found OpenOffice 2.0 pretty good at
generating PDF with bookmarks.  Just don't get too complex or OO may hose
you.
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: ideas for programs?

2006-05-31 Thread Sells, Fred
to regurgitate what others have said.

trying to solve a real-world problem is significantly more educational that
writing toy programs and class assignments.

Solving a real-world problem will generate more interest in your potential
ability that knowing any language.

Pick a problem that you and others you know would like to have solved, then
you can get support, feedback and motivation to keep going.

good luck!

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---
-- 
http://mail.python.org/mailman/listinfo/python-list


Fwd: Recursive Tree in Python

2006-09-27 Thread Fred Kitoogo
Note: forwarded message attached.


Kitoogo Fredrick Edward





___ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease 
of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html--- Begin Message ---








Hi there, 

 

I wish to create a recursive tree and test in Python for
combining classifiers, below are the two Algorithms (Training & Testing):-

 

Recursive Stacking
Algorithm for Training

Input:

Training Set S

Base learning algorithms A1, ...,At Base Classifiers
for combination Ct = {c1,.,ct} Cross-Validation
partition fold J (2 T

 if stopping criteria is not met then

 begin

take
all base level training data of type (c1, c2, ..., ct) into S(c1,c2,...,ct)

call
Recursive Stacking-Training on S(c1,c2,...,ct)

end

else

mark
this conflict type as a terminator conflict

3. Return the
Recursive Stacking tree

end

__

 

Recursive Stacking
Algorithm for Testing

Input:

Testing Data: D

Output:

Classifications

 

__

begin

1. for all (xi, ?) E D call stacking to return meta-level testing item (C1(x), ,Ct(x)) and put

into Mtest

2. for all (xi, ?) E D put it into subset D(c1,c2,ct)

according to its
type (c1, c2, ct) in Mtest

3. for each subset D(c1,c2,ct)

if (c1, c2, ct) is a
terminator conflict then

for
all (xi, ?) 2E D(c1,c2,...,ct) use the
majority label of type (c1, c2, , ct)

else

call
recursive stacking - Testing with D(c1,c2,...,ct) and use the
returned classifications

4. Combine
predictions for each subset and return

end

_

 

Can somebody please help?

 

 

Thanks,

 

 

Kitoogo Fredrick Edward

PHD Student

email: [EMAIL PROTECTED]

  [EMAIL PROTECTED]

  [EMAIL PROTECTED]

Tel: 256-41-233423

 
256-77-2-855884

 






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

RE: CGI -> mod_python

2006-10-03 Thread Sells, Fred
I'm confused.

is WSGI only a specification, or are there implementations, and if so which
ones
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ruby/Python/REXX as a MUCK scripting language

2006-11-25 Thread Fred Bayer

Tony Belding wrote:
> I'm interested in using an off-the-shelf interpreted language as a 
> user-accessible scripting language for a MUCK.  I'm just not sure if I 
> can find one that does everything I need.  The MUCK must be able to call 
> the interpreter and execute scripts with it, but the interpreter must 
> also be able to call functions in the MUCK code.  And then there's the 
> security issue that really worries me. . .  I have to be able to limit 
> what the interpreter can execute.  I can't have my users running scripts 
> that access the console, access the filesystem or sockets directly, or 
> call libraries or other binaries outside the MUCK.
> 
> Is this practical?  I'm thinking of Ruby or Python for this, if they can 
> meet the requirements.
> 

Don't forget Lua: www.lua.org
It fulfills your requirements and is easily embedable.

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


RE: Python work in UK

2006-11-29 Thread Sells, Fred
The technical director of Cabletron used to write applications in Python,
then give the working product/code to the development group to convert.
Perhaps you could build stuff in Python and outsource the conversion to
India?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Behalf Of Steven Wayne
Sent: Friday, November 24, 2006 10:42 AM
To: [email protected]
Subject: Re: Python work in UK


On Thu, 23 Nov 2006 19:28:26 +, Will McGugan
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'd love to work in Python, for the sake of my blood pressure, but there 
> doesnt seem to be that many jobs that look for Python as the main skill. 
> I use Python at work from time to time, and occasionaly get to spend 
> several days on a Python project but the majority of the time I use C++. 
> How can I make that leap to working with Python? There doesn't seem to 
> be many UK positions on the jobs section of Python.org or the usual jobs 
> sites. Any recommended jobs sites or tips? (I have googled)
>
> In the off chance that a potential empolyer is reading this, I'm looking 
> for something in web development, applications, graphics or other 
> interesting field. Here is a copy of my CV.
>
> http://www.willmcgugan.com/cvwillmcgugan.pdf
>
> Regards,
>
> Will McGugan

www.riverhall.co.uk are looking.

Steven
-- 
 .''`.
: :'  :
`. `'`
  `-
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: python vs java eclipse

2006-12-02 Thread Sells, Fred
If you're in the PyDev perspective, F9 runs the current script while
ctrl-F11 reruns the last script run.  I have found that certain types of
operations just plain don't work this way and must be run from a
conventional shell window.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Behalf Of krishnakant Mane
Sent: Friday, December 01, 2006 6:19 AM
To: [email protected]
Subject: Re: python vs java eclipse


just used the py dev plugin for eclipse.
it is great.
auto indentation and intellisence.
and all other things.
so now how does it look from this end?
python + productivity and eclipse + productivity = double productivity!
only problem with the plugin is that I find it difficult to manage the
script running.
I open a command prompt and run the scripts manually.
any suggestion for this.
for example I had name = raw_input("please enter your name") and the
moment I type the first letter on the keyboard the code execution
moves over to the next statement.  should it not wait for the return
key as it always does?
Krishnakant.
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Async callback in python

2006-12-06 Thread Sells, Fred
the standard print gets "delayed" somewhere inside python, however if you
use

print >>sys.stderr, "whatever", 3, 4 5

that prints immediately, or so it seems to me.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Behalf Of Linan
Sent: Monday, December 04, 2006 11:18 PM
To: [email protected]
Subject: Async callback in python


Hi,

In javascript, code could be written like this:

...

var _p=XMLHttpRequest();
_p.open('GET',url,true);
_p.send(null);
_p.onreadystateChange=function(){
if(_p.readyState==4)
cb(_p.responseText);
}
...

This basic AJAX code allows function to be called when it's invoked,
without blocking the main process. There is same library asyncore in
python. However, I can't validate it's asynchronous through code:
class T(asyncore.dispatcher):
def __init__(self,host,url):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect((host,80))
self.url='GET %s HTTP/1.0\r\n\r\n' % url

def handle_connect(self):
pass

def handle_close(self):
self.close()

def handle_read(self):
print 'READING.'
print self.recv(256)

def handle_write(self):
sent=self.send(self.url)
self.url=self.url[sent:]

t=T('aVerySlowSite','/')
asyncore.loop()
for i in range(0,10):
print '%d in main process' % i
time.sleep(1)

Suppose it's asynchronous, couple of '%d in main process' lines should
be mixed in the output of T.handle_read(), right? But I found that
actually main process was blocked at asyncore.loop(), until the the
socket was closed. My questions:
1, Did I do anything wrong?
2, Is it real asynchronous?
3, If not, where to get the real one(s)?

Any comment is welcome :)

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


Re: *** C.L.L README/FAQ ***

2006-12-08 Thread Fred Gilham

A suggestion is to mention Dylan as a possibility to people who think
Lisp syntax is too funky but want to see something Lisp-like.

-- 
Fred Gilham  [EMAIL PROTECTED]
Progressive (adj): Value-free; tolerant; non-judgemental.
E.g. traditional archery instruction methods spent tedious hours
teaching the archer to hit a bulls-eye.  Progressive methods achieved
better results by telling the student archer to shoot in the manner he
or she found most comfortable, then calling whatever the arrow hit the
bulls-eye.
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   3   >