ANN: matplotlib-0.80

2005-04-14 Thread John Hunter

matplotlib is a 2D graphics package that produces plots from python
scripts, the python shell, or embeds them in your favorite python GUI
-- wx, gtk, tk, fltk and qt.  Unlike many python plotting alternatives
is written in python, so it is easy to extend.  matplotlib is used in
the finance industry, web application servers, and many scientific and
enginneering disciplines.  With a large community of users and
developers, matplotlib is approaching the goal of having a full
featured, high quality, 2D plotting library for python.

A lot of development has gone into matplotlib since the last major
release, which I'll summarize here.  For details, see the notes for
the incremental releases at http://matplotlib.sf.net/whats_new.html. 

Improvements since 0.70

 -- contouring: 

Lots of new contour funcitonality with line and polygon contours
provided by contour and contourf.  Automatic inline contour
labeling with clabel. See
http://matplotlib.sourceforge.net/screenshots.html#pcolor_demo

 -- QT backend
Sigve Tjoraand, Ted Drain and colleagues at the JPL collaborated
on a QTAgg backend

 -- Unicode strings are rendered in the agg and postscript backends.
Currently, all the symbols in the unicode string have to be in the
active font file.  In later releases we'll try and support symbols
from multiple ttf files in one string.  See
examples/unicode_demo.py

 -- map and projections

A new release of the basemap toolkit -  See
http://matplotlib.sourceforge.net/screenshots.html#plotmap

 -- Auto-legends

The automatic placement of legends is now supported with
loc='best'; see examples/legend_auto.py.  We did this at the
matplotlib sprint at pycon -- Thanks John Gill and Phil! Note that
your legend will move if you interact with your data and you force
data under the legend line.  If this is not what you want, use a
designated location code.

 -- Quiver (direction fields)

Ludovic Aubry contributed a patch for the matlab compatible quiver
method.  This makes a direction field with arrows.  See
examples/quiver_demo.py

 -- Performance optimizations

Substantial optimizations in line marker drawing in agg

 -- Robust log plots

Lots of work making log plots just work.  You can toggle log y
Axes with the 'l' command -- nonpositive data are simply ignored
and no longer raise exceptions.  log plots should be a lot faster
and more robust


 -- Many more plotting functions, bugfixes, and features, detailed in
the 0.71, 0.72, 0.73 and 0.74 point release notes at
http://matplotlib.sourceforge.net/whats_new.html


http://matplotlib.sourceforge.net

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

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


[ANN] pylint 0.6.4

2005-04-14 Thread Sylvain Thénault
Hello all,

I'm pleased to announce a new release of PyLint. This release mainly
fixes multivalued options bug and a systematic crash with python 2.2.
Users should also use the latest logilab's common library (0.9.3).


What's new ?

* allow to parse files without extension when a path is given on the
  command line (test noext)

* don't fail if we are unable to read an inline option  (e.g. inside a
  module), just produce an information message (test func_i0010)

* new message E0103 for break or continue outside loop (close #8883,
  test func_continue_not_in_loop)

* fix bug in the variables checker, causing non detection of some
  actual name error (close #8884, test
  func_nameerror_on_string_substitution)

* fix bug in the classes checker which was making pylint crash if
  object is assigned in a class inheriting from it (test 
  func_noerror_object_as_class_attribute)

* fix problem with the similar checker when related options are
  defined in a configuration file

* new --generate-man option to generate pylint's man page (require the
  latest logilab.common (= 0.9.3)

* packaged (generated...) man page


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/pylint/ for the complete
check list). The big advantage with Pylint is that it is highly
configurable, customizable, and you can easily write a small plugin to
add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list

mailto://[EMAIL PROTECTED]


-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

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

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: numarray-1.3.0

2005-04-14 Thread Todd Miller
Release Notes for numarray-1.3.0

Numarray is an array processing package designed to efficiently
manipulate large multi-dimensional arrays.  Numarray is modelled after
Numeric and features c-code generated from python template scripts, the
capacity to operate directly on arrays in files, arrays of heterogeneous
records, string arrays, and in-place operation on memory mapped files.

I. ENHANCEMENTS

1. Migration of NumArray.__del__ to C (tp_dealloc).  Overall
performance.

2. Removal of dictionary update from array view creation improves
performance of view/slice/subarray creation.  This should e.g. improve
the performance of wxPython sequence protocol access to Nx2 arrays.
Subclasses now need to do a.flags |= numarray.generic._UPDATEDICT to
ensure that dictionary based attributes are inherited by views. 
NumArrays no longer do this by default.

2. Modifications to support scipy.special.

3. Removal of an unnecessary getattr() from ufunc calling sequence.
Ufunc performance.

II. BUGS FIXED / CLOSED

1179355 average() broken in numarray 1.2.3
1167184 Floating point exception in numarray's dot()
1151892 Bug in matrixmultiply with zero size arrays
1160184 RecArray reversal
1156172 Incorect error message for shape incompatability
1155538 Incorrect error message when multiplying arrays

See
http://sourceforge.net/tracker/?atid=450446group_id=1369func=browse
for more details.

III. CAUTIONS

This release should be backward binary compatible with numarray 1.1.1
and 1.2.3.

WHERE
---

Numarray-1.3.0 windows executable installers, source code, and manual is
here:

http://sourceforge.net/project/showfiles.php?group_id=1369

Numarray is hosted by Source Forge in the same project which hosts
Numeric:

http://sourceforge.net/projects/numpy/

The web page for Numarray information is at:

http://stsdas.stsci.edu/numarray/index.html

Trackers for Numarray Bugs, Feature Requests, Support, and Patches are
at the Source Forge project for NumPy at:

http://sourceforge.net/tracker/?group_id=1369

REQUIREMENTS
--

numarray-1.3.0 requires Python 2.2.2 or greater.  Python-2.3.4 or
Python-2.4.1 is recommended.


AUTHORS, LICENSE
--

Numarray was written by Perry Greenfield, Rick White, Todd Miller, JC
Hsu, Paul Barrett, Phil Hodge at the Space Telescope Science
Institute.  We'd like to acknowledge the assitance of Francesc Alted,
Paul Dubois, Sebastian Haase, Chuck Harris, Tim Hochberg, Nadav
Horesh, Edward C. Jones, Eric Jones, Jochen Kuepper, Travis Oliphant,
Pearu Peterson, Peter Verveer, Colin Williams, Rory Yorke, and
everyone else who has contributed with comments and feedback.

Numarray is made available under a BSD-style License.  See
LICENSE.txt in the source distribution for details.

--
Todd Miller [EMAIL PROTECTED]


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

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: how to explain such codes, python's bug or mine?

2005-04-14 Thread MaHahaXixi
yes. i understand now.
but i use another trick.
list is in vary size, so i do not wanna copy it.
Jim [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 MaHahaXixi wrote:
 j = range(20)
 print j
 
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
 
 for k in j:
 
   if k = 10:
j.remove(k)
 
 
 
 print j
 
  [1, 3, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19]
 
 
 
  Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on
  win32
  Type copyright, credits or license() for more information.
 
  i think python do convert there codes to such style:
  for (i = 0; i  len(j); i++)
 k = j[i]
 ..

  what do u think?
 
 

 I'm not quite sure of your question but with the second style you're not
 attempting to change the original list but make a copy. That's perfectly
 easy to do in Python as it is. The exampmle is a cautionary one about
 changing the list on which you are iterating.

 Jim


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


Re: Newbie Tkinter Question

2005-04-14 Thread Peter Otten
Pseud O'Nym wrote:

 the following fragment doesn't cause any errors and results in buttons the
 correct size for the images, but the buttons don't work, and the images
 aren't displayed. If I add a text property, and remove the images, they
 work fine, so the rest of my code's OK. I've searched this group and
 Python.org to no avail.
 
 class App:
   def __init__(self, master):
 frame = Frame(master)
 frame.pack(side=LEFT, fill=Y)
 image1 = PhotoImage(file='button_a.gif')
 self.button = Button(frame, image=image1)
 self.button.pack(side=TOP)

  self.image = image1

 Can anyone enlighten me?

For reasons that are beyond me widgets do not increase the reference count
of a PhotoImage. Therefore you have to put a reference to the image
elsewhere, e. g. into the App instance, to prevent it from being
garbage-collected when the image1 variable goes out of scope.

Peter

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


Re: Python 2.4 killing commercial Windows Python development ?

2005-04-14 Thread Martin v. Löwis
Roger Binns wrote:
- I could make some sort of installer that did all the non-Python 
 interpretter
  pieces and it would have to be compatible with anyone else doing the same
  thing.
 
 The first is a waste of my time and effort, and I do the second except I also
 include the Python interpretter meaning there are no dependencies.

If that works for you and your users, fine - the main point of this
thread is that some users complain they can't do that anymore, because
they have no license to distribute msvcr71. For those users: what is
the reason not to use the approach of shipping an application that
requires a certain version of Python pre-installed on the target
machine?

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


Re: Programming Language for Systems Administrator

2005-04-14 Thread Ville Vainio
 zsolt == pythonUser 07 [EMAIL PROTECTED] writes:

zsolt Python is great, but having much admin type experience,
zsolt I've found python to be less than Ideal when dealing with
zsolt system calls and standard Input Ouput.

Have you tried the 'subprocess' module to see whether it solves your
problems, new in 2.4?

That said, I've never had the problems you describe with normal popen*
calls either.

-- 
Ville Vainio   http://tinyurl.com/2prnb
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie Tkinter Question

2005-04-14 Thread Hans Georg Krauthaeuser
Peter Otten schrieb:
 Pseud O'Nym wrote:
 
 
the following fragment doesn't cause any errors and results in buttons the
correct size for the images, but the buttons don't work, and the images
aren't displayed. If I add a text property, and remove the images, they
work fine, so the rest of my code's OK. I've searched this group and
Python.org to no avail.

class App:
  def __init__(self, master):
frame = Frame(master)
frame.pack(side=LEFT, fill=Y)
image1 = PhotoImage(file='button_a.gif')
self.button = Button(frame, image=image1)
self.button.pack(side=TOP)
 
 
   self.image = image1
 
 
Can anyone enlighten me?
 
 
 For reasons that are beyond me widgets do not increase the reference count
 of a PhotoImage. Therefore you have to put a reference to the image
 elsewhere, e. g. into the App instance, to prevent it from being
 garbage-collected when the image1 variable goes out of scope.
 
 Peter
 
Because I stumbled across the same 'feature' just recently, I think it's
good to give a reference...

From http://tkinter.unpythonic.net/wiki/Images

Something that seems to bite every new Tkinter programmer at least
once: you've loaded a PhotoImage, applied it to a Button, Label, or
other widget, and nothing shows up - because you referenced the image
only via a local variable, so it went out of scope and got deleted
before the widget ever appeared. The usual solution is to store a
reference to the image as an attribute of the widget that is to display it.

You might just call this a bug in Tkinter, but the reality isn't quite
that simple... Tk images are not first-class objects: when you apply one
to a widget, you do not in any sense pass a reference to the image.
Instead, you just pass a name, which Tk looks up in an internal table of
defined images (from which images can only be deleted manually). From
Tkinter, passing a PhotoImage as a parameter actually only sends the
str() of the image object to the Tcl side: this is just a string, the
randomly-generated name assigned when the object was created. No
reference to the image itself means no reference counting means no
way for the Python side to be notified when the image is truly no longer
used. If Tkinter didn't delete images when no Python reference to them
existed, they would be unavoidable memory leaks.
...

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


Re: templating system

2005-04-14 Thread Ville Vainio
 Erik == Erik Max Francis [EMAIL PROTECTED] writes:

Erik All I meant by that note was that EmPy was not primarily
Erik designed for blazing speed; that is, it could easily be made
Erik much more efficient in a lot of ways.  I've never had a need

It would be interesting to see benchmarks comparing different
templating system. I suppose a web templating system like PSP (of
mod_python) would be optimized for speed.

-- 
Ville Vainio   http://tinyurl.com/2prnb
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using a python web client behind a proxy (urllib and twisted.web)

2005-04-14 Thread Mike Meyer
Matthijs [EMAIL PROTECTED] writes:

 I have been trying to make a script that will download several rss
 feeds to my computer. The only problem I have is that I have to go
 through a proxy.

 First I tried using urllib (python 2.4, win32) but I found that the
 http_proxy and no_proxy code were not implemented for win32. I have
 made changes to urllib and urllib2 so that they use the proxy set in
 either the windows registry or in an environment variable.

 Question: How can I get this code added to the python distribution?

submit a patch to URL: http://sourceforge.net/tracker/?group_id=5470 .

mike
-- 
Mike Meyer [EMAIL PROTECTED]  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list


Inelegant

2005-04-14 Thread Dan

I've just begun playing with Python, and so far I like what I see.
It's a very elegant language.  But I've found something that's, well,
a bit ugly.  Maybe someone can point out to me where I'm wrong.

If you use triple quotes to define a string, then the newlines are
implicitly included.  This is a very nice feature.  But if you're
inside a function or statement, then you'll want the string to be
positioned along that indentation.  And the consequences of this is
that the string will include those indentations.

For example:

def SomeFunction()
   if SomeCondition:
  MyString = 
  
  The quick brown fox
  
  print MyString

The output will be:

  The quick brown fox

But what you really want is:

The quick brown fox

The way around it is to write the function thus:

def SomeFunction()
   if SomeCondition:
  MyString = 

The quick brown fox

  print MyString

But that's just ugly.  It seems to me that the string should be
interpreted with the edge along the indentation line, not from the
start of the line.  But that would probably create other problems.

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


Printable version of Python tutorila

2005-04-14 Thread sandygarg
I liked the python tutorial (
http://www.python.org/doc/current/tut/tut.html ) very much.
Now i want to print this tutorial.
Where do i get a printable version of the document?

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


how to solve [ 1144533 ] htmllib quote parse error within a script

2005-04-14 Thread jerky
hi,everyone,
get the details in 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1144533group_id=5470

many thanks!


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


Re: Printable version of Python tutorila

2005-04-14 Thread Mikael Olofsson
[EMAIL PROTECTED] wrote:
I liked the python tutorial (
http://www.python.org/doc/current/tut/tut.html ) very much.
Now i want to print this tutorial.
Where do i get a printable version of the document?
http://www.python.org/doc/current/download.html
Regards
/Mikael Olofsson
Universitetslektor (Senior Lecturer [BrE], Associate Professor [AmE])
Linköpings universitet
---
E-Mail:  [EMAIL PROTECTED]
WWW: http://www.dtr.isy.liu.se/en/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
---
Linköpings kammarkör: www.kammarkoren.com   Vi söker tenorer och basar! 

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


Re: Inelegant

2005-04-14 Thread Terry Hancock
On Thursday 14 April 2005 02:03 am, Dan wrote:
 If you use triple quotes to define a string, then the newlines are
 implicitly included.  This is a very nice feature.  But if you're
 inside a function or statement, then you'll want the string to be
 positioned along that indentation.  And the consequences of this is
 that the string will include those indentations.
  [...]
 But that's just ugly. 

Yeah, it's definitely a wart.  So much so that recent Python
distributions include a function to fix it:

 from textwrap import dedent
 string_block = dedent(
...   This string will have the leading
...   spaces removed so that it doesn't
...   have to break up the indenting.
...   )
 string_block
\nThis string will have the leading\nspaces removed so that it doesn't\nhave 
to break up the indenting.\n
 print string_block
 
This string will have the leading
spaces removed so that it doesn't
have to break up the indenting.
 



--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com

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


Re: Printable version of Python tutorila

2005-04-14 Thread sandygarg
Thanks a lot...
I've foolishly WGETed the entire python.org.

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


(OT) Web Hosting Special Offer..............................................................................................................................................................................................................................................................................................

2005-04-14 Thread host
UHOSTNET.COM [EMAIL PROTECTED] ²{±À¥X¥þ·sÀu´f

©Ò¦³¦b¥»¤ë§C«e¥Ó½Ðªº¨ä¥¦¤½¥qÂಾ«È¤á§Y¦h°e±z¤T­Ó¤ëªA°È
¤ä´© PHP+MySQL, Access+ASP, ASP.NET, CGI, SSI ¹q¶l¯f¬r¹LÂo, ©U§£¹q¶l¹LÂo ¤Î 
WebMail µ¥..

¥»¤ë§C«e¥Ó½ÐW1000§Y°e­º¦¸¦w¸ËÁʪ«¨®µ{¦¡ osc.
http://shop2.uhostnet.com

¨C¤ë¥u»Ý $20 °_

­º­¶
http://www.uhostnet.com

·s«È¤á¶}³q¼ËªO
http://dummy.uhostnet.com

·s«Ȥᴣ¨Ñ¤C¤Ñ§K¶O«Ø¯¸´Á¡C 
¥i¨Ï¥Î¥»¤½¥q§K¶O´£¨Ñªº°Æ°ì¦W¡C 
ªA°È­p¹º¶R¤Q°e¤G¡A¤Z¹wú¤Q­Ó¤ëªA°È¤ë¶O¡A¦h°e¨â­Ó¤ë¡C 
²{§Y¥Ó¨ä¥¦¤½¥qÂà¥Î§Ú­Ì¡A§Y¦h°e±z¤T­Ó¤ëªA°È¡C(¥ô¦ó°ì¦WÂಾ)
¥H¤W­p¹º¥þ±Ä¥Î¤¤¤åWIN2003¥­¥x¡A«È¤á¥ç¥i¿ï¥Î¥»¤½¥qªºLinux¥­¥xªA°È­p¹º¡C 

ªþ°e¹ê¥Îµ{¦¡
ASP ¯d¨¥Ã¯,²á¤Ñ«Ç,ASP ¤H¼Æ¾¹,PHP ¤H¼Æ¾¹,ASP ºô¤W¹q¶lªí®æ,ASP 
Àɮ׺޲zµ{¦¡,ºô¤W°Ó©±,©ç½æ¨t²Î¤Î¦U´Ú½×¾Âµ{¦¡..

¨C¤ë $20 ºô­¶±H¦sªA°È
Basic Plan W200: (¨C¤ë $20)
-- 200MB ºô­¶ªÅ¶¡
-- µL­­¹q¶l«H½c
-- µL­­¸ê®Æ¶Ç¿é¶q
-- ¤ä´© ASP+Access / CGI
-- ¹q¶l¯f¬r¹LÂo¨t²Î
-- ©U§£¹q¶l¹LÂo¨t²Î
http://www.uhostnet.com/modules.php?name=servicefile=indexfunc=windetailsplan=A

Windows W300: (¨C¤ë $38)
-- [EMAIL PROTECTED]
-- 300MB ºô­¶ªÅ¶¡
-- µL­­¹q¶l«H½c
-- µL­­¸ê®Æ¶Ç¿é¶q
-- ¤ä´© PHP+MySQL, ASP+ACCESS, CGI, SSI
-- 1 ­Ó MySQL ¸ê®Æ®w (5MB)
-- ¹q¶l¯f¬r¹LÂo¨t²Î
-- ©U§£¹q¶l¹LÂo¨t²Î
http://www.uhostnet.com/modules.php?name=servicefile=indexfunc=windetailsplan=B

Windows W500: (¨C¤ë $48)
-- [EMAIL PROTECTED]
-- ¤lºô°ì 3 ­Ó (¼v®g¤£¦P¥Ø¿ý)
-- 500MB ºô­¶ªÅ¶¡
-- µL­­¹q¶l«H½c
-- µL­­¸ê®Æ¶Ç¿é¶q
-- ¤ä´© PHP+MySQL, ASP+ACCESS, CGI, SSI
-- 1 ­Ó MySQL ¸ê®Æ®w (10MB)
-- ¹q¶l¯f¬r¹LÂo¨t²Î
-- ©U§£¹q¶l¹LÂo¨t²Î
http://www.uhostnet.com/modules.php?name=servicefile=indexfunc=windetailsplan=C

Windows W800: (¨C¤ë $58)
-- [EMAIL PROTECTED]
-- ¤lºô°ì 5 ­Ó (¼v®g¤£¦P¥Ø¿ý)
-- 800MB ºô­¶ªÅ¶¡
-- µL­­¹q¶l«H½c
-- µL­­¸ê®Æ¶Ç¿é¶q
-- ¤ä´© PHP+MySQL, ASP+ACCESS, CGI, SSI
-- 1 ­Ó MySQL ¸ê®Æ®w (20MB)
-- ¹q¶l¯f¬r¹LÂo¨t²Î
-- ©U§£¹q¶l¹LÂo¨t²Î
http://www.uhostnet.com/modules.php?name=servicefile=indexfunc=windetailsplan=D

Windows W1000: (¨C¤ë $68)
-- [EMAIL PROTECTED]
-- ¤lºô°ì 10 ­Ó (¼v®g¤£¦P¥Ø¿ý)
-- 1GB ºô­¶ªÅ¶¡
-- µL­­¹q¶l«H½c
-- µL­­¸ê®Æ¶Ç¿é¶q
-- ¤ä´© PHP+MySQL, ASP+ACCESS, CGI, SSI
-- 1 ­Ó MySQL ¸ê®Æ®w (50MB)
-- ¹q¶l¯f¬r¹LÂo¨t²Î
-- ©U§£¹q¶l¹LÂo¨t²Î
-- °e­º¦¸¦w¸Ë½×¾Âµ{¦¡©Î¶W±jºô¤W°Ó©±¨t²Î
http://www.uhostnet.com/modules.php?name=servicefile=indexfunc=windetailsplan=E


«È ¤á ¦C ªí : http://www.uhostnet.com/modules.php?name=clients
.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python license (2.3)

2005-04-14 Thread Antoon Pardon
Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
 Antoon Pardon wrote:
 Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
 
Antoon Pardon wrote:

Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:

Yes, the license text and the copyright notice must be attached. It 
doesn't mean that the PSF license is the operative one for the 
derivative work.


Why attach a license that is not operative. That doesn't make sense
to me and will IMO just create confusion.

Because it's not your code. The tiny obligation that you have to satisfy 
is to say that some of the code comes from someone else and is available 
under such-and-such a license. That's it. You can keep the code hidden, 
you can charge whatever you like for it, but you have to attribute it 
properly. Open source licenses don't get much less restrictive than this.
 
 
 Well maybe this is a semantic problem. I wouldn't use the word attach
 here.

 Fair enough. The license text is included *for reference*, not because 
 it is *the* license for the derived work. In fact, it *can't* be the 
 license of the derived work because you are not the PSF.

 So what I seem obligated to do, is 1) Mentioning this came
 from the python distribution and 2) explain where this distribution can
 be attained and under what license.

 The minimum is:

 1) Put the copyright notice in.
 2) Reference a copy of the PSF License. (Practically speaking, a URL 
 will probably do.)
 3) List the modifications you made.
 4) Put your copyright notice in and whatever terms you want to apply.

Of course, IANAL and TINLA, so if you want real legal advice instead of 
advice from random newsgroup bums like myself, you should talk to a lawyer.
 
 
 Well if it comes so far I have to consult a lawyer I'd rather not publish
 it in the first place.

 Then take the (free) advice that you asked for. 

I'll do that and I appreciate your time in giving it.

 And please do read Rosen's book.

I started already.

 The only reason I'm concerned is that this is to be part of a tutorial
 and I prefer not to burden those who read the tutoral with any kind of
 license. As far as I'm concerned people reading the tutorial can use
 any code provided with it in any way they see fit.

 You can't *quite* go that far if you are deriving code from Python, but 
 it's about as close as you can get. You still have those light 
 restrictions about attribution and notification of changes.

I'm not sure I follow. As far as I understand, I can license the result
however I see fit, as long as I go by the conditions for using the
original code. So it seems I can use a license so that the readers
of the tutorial don't have to be concerned in how they use the code.

 I see this as my contribution to the communities who has provided me
 with all kinds of things that are usefull to me. I'm willing to put
 time into this, but if I have to spend money because it is impossible
 otherwise to find out how to contribute legally, that is a hurdle
 I'm reluctant to take.

 You could take a look at what other people are doing. Most of us here 
 are writing and releasing software derived from Python, legally so and 
 without complication.

I would do that if I were just writing code I thought others could
find usefull. I then would feel no problem burdening those users
with the same kind of license I found in the product I took some
code from. But I also think that readers of documentation should
be free to use any code included in any way they see fit.

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


Re: Simple Python + Tk text editor

2005-04-14 Thread Eric Brunel
On Thu, 14 Apr 2005 06:41:26 +0100, Jonathan Fine [EMAIL PROTECTED] wrote:
[snip]
And for my project (integration of Python and TeX) there
is most unlikely to be a better one.
Do you know the (apparently dead) project named e:doc? You can find it here:
http://members.nextra.at/hfbuch/edoc/
It's a kind of word processor that can produce final documents to various 
formats using backends, and one of the backends is for LaTeX.
It's written in Perl, but with Perl::Tk as a tool-kit, so it is quite close to 
Tkinter. There may be some ideas to steal from it.
HTH
--
python -c 'print .join([chr(154 - ord(c)) for c in 
U(17zX(%,5.z^5(17l8(%,5.Z*(93-965$l7+-])'
--
http://mail.python.org/mailman/listinfo/python-list


Re: Compute pi to base 12 using Python?

2005-04-14 Thread Richie Hindle

[Dan]
 Now you've got me curious.  Why would an artist want the first 3003
 digits of pi to the base 12?

[Dick]
 He says,
 Do you know how I can get base12 pi?
 Because the chromatic scale is base12.
 c c# d d# e f f# g g# a a# b

He should read Douglas Adams' fictional essay Music and Fractal
Landscapes, from Dirk Gently's Holistic Detective Agency:

 I believe that there must be a form of
  music inherent in nature, in natural objects, in the patterns
  of natural processes.  A  music that would be as deeply
  satisfying as any naturally occurring beauty [...]

You can see the text here:


http://66.102.9.104/search?q=cache:3Ni6gRXCcJgJ:tash.dns2go.com/FTP/P800/Books%2520txt/Douglas%2520Adams%2520-%2520Dirk%2520Gently%27s%2520Holistic%2520Detective%2520Agency.txt+%22douglas+adams%22+%22Music+and+Fractal+Landscapes%22hl=en

or via this tinyurl:

  http://tinyurl.com/6ugnk

(Search within that page for the phrase Music and Fractal Landscapes.
Or Google for it, which is how I found the link.)

-- 
Richie Hindle
[EMAIL PROTECTED]

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


Re: Python license (2.3)

2005-04-14 Thread Robert Kern
Antoon Pardon wrote:
Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:

Well if it comes so far I have to consult a lawyer I'd rather not publish
it in the first place.
Then take the (free) advice that you asked for. 
I'll do that and I appreciate your time in giving it.
Gladly given, and I apologize if I sound a bit snippy.
And please do read Rosen's book.
I started already.
The only reason I'm concerned is that this is to be part of a tutorial
and I prefer not to burden those who read the tutoral with any kind of
license. As far as I'm concerned people reading the tutorial can use
any code provided with it in any way they see fit.
You can't *quite* go that far if you are deriving code from Python, but 
it's about as close as you can get. You still have those light 
restrictions about attribution and notification of changes.
I'm not sure I follow. As far as I understand, I can license the result
however I see fit, as long as I go by the conditions for using the
original code. So it seems I can use a license so that the readers
of the tutorial don't have to be concerned in how they use the code.
You can't take away the requirement to keep the PSF's copyright notice 
on their bits of code. You can give permission for users to do what they 
like with your parts of the code.

However, the requirements of the PSF license are about as trivial as you 
get outside of the public domain.

I see this as my contribution to the communities who has provided me
with all kinds of things that are usefull to me. I'm willing to put
time into this, but if I have to spend money because it is impossible
otherwise to find out how to contribute legally, that is a hurdle
I'm reluctant to take.
You could take a look at what other people are doing. Most of us here 
are writing and releasing software derived from Python, legally so and 
without complication.
I would do that if I were just writing code I thought others could
find usefull. I then would feel no problem burdening those users
with the same kind of license I found in the product I took some
code from. But I also think that readers of documentation should
be free to use any code included in any way they see fit.
If they have issues with distributing code derived from Python, why are 
they reading a Python tutorial?

--
Robert Kern
[EMAIL PROTECTED]
In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die.
  -- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Simon Brunning
On 4/14/05, Greg Ewing [EMAIL PROTECTED] wrote:
 Actually it was me who wrote that, not Scott.
 
 (Darn. I finally say something that gets into Quote of the
 Week, and it's attributed to someone else! :-) :-) :-)

Ooops. I'm really very sorry about that.

Try and think of something else witty to say over the next day or two
- I'm sure I can squeeze you into next week's. ;-)

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


Re: Formated String in optparse

2005-04-14 Thread Norbert Thek
Thank You for your help, its working!

Now I have an additional question.
The problem is the encoding of the Text
I'm using German, Can you tell me how to encode
the textstring that the Windows commandline shows the special letters 
right?  
For exampel i get 'f³r' but i want 'für'  (maybe reader with only an english
enabled browser wouldn't see a difference..)

I tried to work with the encode method of string but It didn't work for me
some hint what to do?


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


Re: Python license (2.3)

2005-04-14 Thread Antoon Pardon
Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:
 Antoon Pardon wrote:
 Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
 
 I would do that if I were just writing code I thought others could
 find usefull. I then would feel no problem burdening those users
 with the same kind of license I found in the product I took some
 code from. But I also think that readers of documentation should
 be free to use any code included in any way they see fit.

 If they have issues with distributing code derived from Python, why are 
 they reading a Python tutorial?

Try and look it from a students viewpoint. He is learing languages,
algorithms and so on. Now he is ready to write his own program.
Chances are high that he will rely on examples from the
courses/documentation he read. It is just not practical for someone
like that to figure out all the possible different licenses under
which he can use the examples from the various documenation sources.

Now if this documentation refers to code from yet another source
with its own license, using it becomes an utter nightmare for
the student, because now he has to figure out which piece of
the code is original from the author of the documentation and
which was copied from the other source.

Consideration like this, let me come to the conclusion that
code included with documentation should come with no strings
attached for the students to reuse.

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


Supercomputer and encryption and compression @ rate of 96%

2005-04-14 Thread c3poptuse
Supercomputer and encryption and compression @ rate of 96%

Take a document then or a 3D matrix document change it two random or
binary code or just a program for 0's and 1's and fold it over and over
like a piece of paper then having the 1 and 0 add each other or the
0,1's canceling each other out 1+0=0 and 0+1=1 1+1=1 0+0=0 if you gave
the folds addresses like on a spread sheet there would be no math.
First A 1-24  would fold to k 1-24 down.(See Example A )  Then at F1-24
down two k 1-24 ( See example B )  If you written a very long letter
and then change it two binary code it would look like this.
   123456789.24
 a.01010101010101010101010
 b.10010101010101010101010
 c.01010101001010101010010
 e.00010101000101010101010
 f.10010101010100101010101 First A 24  would fold to k 24 down
 g.0101010101011100101  See Example A
 h.01001010101010101010111
 I.0111001101010101010
 j.01010101010101010101010
 k.10101010101010101010101


   See Example A
   123456789.24
 f.10010101010100101010101
 g.0101010101011100101
 h.01001010101010101010111 Then at F1-24 down two k 1-24
 I.0111001101010101010
 j.01010101010101010101010
 k.10101010101010101010101


  See example B
   123456789.24
 I.0111001101010101010
 j.01010101010101010101010 Then from I 1-24 to K 1-24
 k.10101010101010101010101

   123456789.24
 j.01010101010101010101010  Then from j-24 to j-1

   123456789...
 j.010101010101 Then from j-12 to j-1

   123456
 j.010101   Then from j-6 to j1

   123
 j.010  Then from j-3 to j1

   12
 j.01Then from j-2 to j1


 j.0 Then you would have
 1 bit to transfer over the
 Internet
The bit sent would be 0 and the key code would be F1-24,k 1-24,
I 1-24,K 1-24,j24,j1,j12,j1,j6,j1,j3,j1,j2,j1 and would unzip or be new
encryption you could encrypt or compress 100 terabits down to 1 bit of
information. Now if you take this idea from my web site you could make
this allot more complex and unbreakable. Data encryption 360 degrees
rotation document 90 degrees and encrypt on every angel then 45 degrees
change it two binary code do it again and again and fold it over like a
piece of paper then having the one's and zero cancel each other out. In
theory you could send a 100 terabit program to someone's computer and
have it unzip and run and install or make
A computer processor like the new 64 bit AMD have the bit unzip into a
large ram drive and buffer use one half of the 64 bit processor decode
the message and the main 64 bit run the numbers. Another way of doing
this is to have a parallel computers with using one of the processes
run the compressed 1 bit of information give the uncompressed a address
on the ram drive to change and not even go threw the processor and then
with different information on each machine compare and run statistics
on information on a 45 tflops supercomputer and turn that 45 tflops
computer into a 1 bit = 100,000 terabits to infinite as long as you
have the ram for storage! with my calculations 45 tflops wouldn't
matter any more it would be how much data you have on a 32bit operating
system changing that to a 1 bit system it would be 32 * 45tflops would
= 1440 tflops   Matter moves so fast that it intergreats and
deintergreats faster then any speed we can see it like water from a
hose at real close speed it moves in  lines.

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


Re: Python license (2.3)

2005-04-14 Thread Robert Kern
Antoon Pardon wrote:
Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
I would do that if I were just writing code I thought others could
find usefull. I then would feel no problem burdening those users
with the same kind of license I found in the product I took some
code from. But I also think that readers of documentation should
be free to use any code included in any way they see fit.
If they have issues with distributing code derived from Python, why are 
they reading a Python tutorial?

Try and look it from a students viewpoint. He is learing languages,
algorithms and so on. Now he is ready to write his own program.
Chances are high that he will rely on examples from the
courses/documentation he read. It is just not practical for someone
like that to figure out all the possible different licenses under
which he can use the examples from the various documenation sources.
The PSF License is about as light as they come.
Now if this documentation refers to code from yet another source
with its own license, using it becomes an utter nightmare for
the student, because now he has to figure out which piece of
the code is original from the author of the documentation and
which was copied from the other source.
Then write your own code and don't use anyone else's. You can't offer 
extra permissions for code that's not yours.

Consideration like this, let me come to the conclusion that
code included with documentation should come with no strings
attached for the students to reuse.
No such thing, really. Copyright law requires almost as much as the PSF 
license. The MIT license is shorter, possibly more easily 
understandable, but practically amounts to more-or-less the same thing.

In short, don't worry about it. Don't sue people, keep the attributions 
intact, and probably no one will care.

--
Robert Kern
[EMAIL PROTECTED]
In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die.
  -- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list


Re: Inelegant

2005-04-14 Thread Bengt Richter
On Thu, 14 Apr 2005 02:43:40 -0500, Terry Hancock [EMAIL PROTECTED] wrote:

On Thursday 14 April 2005 02:03 am, Dan wrote:
 If you use triple quotes to define a string, then the newlines are
 implicitly included.  This is a very nice feature.  But if you're
 inside a function or statement, then you'll want the string to be
 positioned along that indentation.  And the consequences of this is
 that the string will include those indentations.
  [...]
 But that's just ugly. 

Yeah, it's definitely a wart.  So much so that recent Python
distributions include a function to fix it:

 from textwrap import dedent
 string_block = dedent(
...   This string will have the leading
...   spaces removed so that it doesn't
...   have to break up the indenting.
...   )
 string_block
\nThis string will have the leading\nspaces removed so that it doesn't\nhave 
to break up the indenting.\n
 print string_block
 
This string will have the leading
spaces removed so that it doesn't
have to break up the indenting.
 

I never liked any of the solutions that demand bracketing the string with 
expression brackets,
but I just had an idea ;-)

  class Dedent(object):
 ... def __init__(self, **kw): self.kw = kw
 ... def __add__(self, s):
 ... lines = s.splitlines()[1:]
 ... margin = self.kw.get('margin', 0)*' '
 ... mnow = min(len(L)-len(L.lstrip()) for L in lines)
 ... return '\n'.join([line[mnow:] and margin+line[mnow:] or '' for 
line in lines])
 ...
 ...

Normally you wouldn't pass **kw in like this,
you'd just write
 mystring = Dedent()+\

or

 mystring = Dedent(margin=3)+\

but  I wanted to control the print. Note the the first line, unless you escape 
it (ugly there)
is zero length and therefore has zero margin, which subverts the other 
shifting, so I just drop that line.
You have to live with the backslash after the + as payment for preferring not 
to have parentheses ;-)

  def foo(**kw):
 ... mystring = Dedent(**kw)+\
 ... 
 ... This makes
 ...for a cleaner isolation
 ... of the string IMO.
 ... 
 ... return mystring
 ...
  print '\n%s'%foo()
 
 This makes
for a cleaner isolation
 of the string IMO.
 
  print '\n%s'%foo(margin=3)
 
This makes
   for a cleaner isolation
of the string IMO.
 

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


Re: Python license (2.3)

2005-04-14 Thread Antoon Pardon
Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:
 Antoon Pardon wrote:
 Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:
 
Antoon Pardon wrote:

Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:

I would do that if I were just writing code I thought others could
find usefull. I then would feel no problem burdening those users
with the same kind of license I found in the product I took some
code from. But I also think that readers of documentation should
be free to use any code included in any way they see fit.

If they have issues with distributing code derived from Python, why are 
they reading a Python tutorial?
 
 
 Try and look it from a students viewpoint. He is learing languages,
 algorithms and so on. Now he is ready to write his own program.
 Chances are high that he will rely on examples from the
 courses/documentation he read. It is just not practical for someone
 like that to figure out all the possible different licenses under
 which he can use the examples from the various documenation sources.

 The PSF License is about as light as they come.

 Now if this documentation refers to code from yet another source
 with its own license, using it becomes an utter nightmare for
 the student, because now he has to figure out which piece of
 the code is original from the author of the documentation and
 which was copied from the other source.

 Then write your own code and don't use anyone else's. You can't offer 
 extra permissions for code that's not yours.

Well then I'll just have to do that.

 Consideration like this, let me come to the conclusion that
 code included with documentation should come with no strings
 attached for the students to reuse.

 No such thing, really. Copyright law requires almost as much as the PSF 
 license. The MIT license is shorter, possibly more easily 
 understandable, but practically amounts to more-or-less the same thing.

If I read a tutorial or a course on algorithms both with examples.
Does copyright law require that I attribute if I reuse code
from these examples? Even if it was pseudo code that I had
to translate in an actual language.

Suppose some time has passed and I have to write similar code.
I cant find the documentation but this time I'm experienced
enough so that I can recreate the code. Do I still need to
attribute the code?

What if the code is so short that basically everyone that
solves the problem writes the same kind of code?

 In short, don't worry about it. Don't sue people, keep the attributions 
 intact, and probably no one will care.

If they don't care, why did they attach such a license in the first
place.

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


Re: preallocate list

2005-04-14 Thread Jim
John Machin wrote:
On Wed, 13 Apr 2005 14:28:51 +0100, Jim [EMAIL PROTECTED]
wrote:

Thanks for the suggestions. I guess I must ensure that this is my bottle 
neck.
code
   def readFactorsIntoList(self,filename,numberLoads):

1. numberLoads is not used. 


factors = []
   f = open(self.basedir + filename,'r')
   line = f.readline()
   tokens = line.split()
   columns = len(tokens)
   if int(columns) == number:

2. columns is already an int (unless of course you've redefined
len!). Doing int(columns) is pointless.
3. What is number? Same as numberLoads?
4. Please explain in general what is the layout of your file and in
particular, what is the significance of the first line of the file and
of the above if test. 


   for line in f:
   factor = []
   tokens = line.split()
   for i in tokens:
   factor.append(float(i))

4. factor is built and then not used any more??

   factors.append(loadFactor)

5. What is loadFactor? Same as factor?

   else:
   for line  in f:
   tokens = line.split()
   factors.append([float(tokens[0])] * number)

6. You throw away any tokens in the line after the first??

return factors
/code
OK. I've just tried with 4 lines and the code works.

Which code works? The code you posted? Please define works.

With 11000 lines it 
uses all CPU for at least 30 secs. There must be a better way.

Perhaps after you post the code that you've actually run, and
explained what your file layout is, and what you are trying to
achieve, then we can give you some meaningful help.
Cheers,
John

Thanks for looking John. For that I should take a little time to explain.
I tried to rename the variables, some of them were four words long. I 
got a couple of the renames wrong. Sorry.

Regarding 'works'. I meant that with a text file of four lines the code 
completed. With my desired size 11000 lines it didn't complete within 
the limits of my patience. I didn't try any other size.

Also I perhaps wrongly use the newsgroup threads paradigm in trying to 
restart my query with extra information (that turned out a little faulty).

Luckily the other branches yielded fruit.
Thanks again
Jim
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python license (2.3)

2005-04-14 Thread Robert Kern
Antoon Pardon wrote:
Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
Op 2005-04-14, Robert Kern schreef [EMAIL PROTECTED]:

Antoon Pardon wrote:

Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]:
I would do that if I were just writing code I thought others could
find usefull. I then would feel no problem burdening those users
with the same kind of license I found in the product I took some
code from. But I also think that readers of documentation should
be free to use any code included in any way they see fit.
If they have issues with distributing code derived from Python, why are 
they reading a Python tutorial?

Try and look it from a students viewpoint. He is learing languages,
algorithms and so on. Now he is ready to write his own program.
Chances are high that he will rely on examples from the
courses/documentation he read. It is just not practical for someone
like that to figure out all the possible different licenses under
which he can use the examples from the various documenation sources.
The PSF License is about as light as they come.

Now if this documentation refers to code from yet another source
with its own license, using it becomes an utter nightmare for
the student, because now he has to figure out which piece of
the code is original from the author of the documentation and
which was copied from the other source.
Then write your own code and don't use anyone else's. You can't offer 
extra permissions for code that's not yours.

Well then I'll just have to do that.

Consideration like this, let me come to the conclusion that
code included with documentation should come with no strings
attached for the students to reuse.
No such thing, really. Copyright law requires almost as much as the PSF 
license. The MIT license is shorter, possibly more easily 
understandable, but practically amounts to more-or-less the same thing.

If I read a tutorial or a course on algorithms both with examples.
Does copyright law require that I attribute if I reuse code
from these examples?
If the amount copied is large enough.
Even if it was pseudo code that I had
to translate in an actual language.
Probably not. Copyright controls copying (and a few other things, but 
they have less relevance in a software context).

Suppose some time has passed and I have to write similar code.
I cant find the documentation but this time I'm experienced
enough so that I can recreate the code. Do I still need to
attribute the code?
Again, probably not.
What if the code is so short that basically everyone that
solves the problem writes the same kind of code?
No, copyright requires creativity.
Rosen's book should answer these questions for you.
In short, don't worry about it. Don't sue people, keep the attributions 
intact, and probably no one will care.
Sorry, that list should also have had follow courteous practices with 
other people's code which includes listing changes and a reference to 
the license of that code.

If they don't care, why did they attach such a license in the first
place.
Lawyers. The original license (the CNRI License) was much briefer and 
vaguer, although it amounts to the same requirements, practically. The 
PSF license made those requirements, disclaimers, etc. explicit.

--
Robert Kern
[EMAIL PROTECTED]
In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die.
  -- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list


Re: A beginer question about SOAP and Python: SOAPpy.Types.structType HashStringResponse at 23909440: {}

2005-04-14 Thread bruno modulix
Jim wrote:
Hi all,
I am new to SOAP and Python. I am practicing
learning SOAP with Python. I sent a request
and I got the following response:
SOAPpy.Types.structType HashStringResponse
at 23909440: {}
What does that mean? 
Seems like you've got a SOAPpy.Types.structType instance that is named 
HashStringResponse, that is located at memory address 23909440, and that 
looks like an empty dict.

and how can I print the
result hash string ?
I don't know. I've never played with SOAP, so I don't even know if this 
(HashStringResponse) is part of the standard SOAP api or if it's 
specific to the service you're calling.

Did you look at the SOAPpy api for the description of Types.structType ?
--
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


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

2005-04-14 Thread Will McGugan
[EMAIL PROTECTED] wrote:
Supercomputer and encryption and compression @ rate of 96%
The bit sent would be 0 and the key code would be F1-24,k 1-24,
I 1-24,K 1-24,j24,j1,j12,j1,j6,j1,j3,j1,j2,j1 and would unzip or be new
encryption you could encrypt or compress 100 terabits down to 1 bit of
information. Now if you take this idea from my web site you could make
this allot more complex and unbreakable. Data encryption 360 degrees
rotation document 90 degrees and encrypt on every angel then 45 degrees
change it two binary code do it again and again and fold it over like a
piece of paper then having the one's and zero cancel each other out. In
theory you could send a 100 terabit program to someone's computer and
have it unzip and run and install or make
A computer processor like the new 64 bit AMD have the bit unzip into a
large ram drive and buffer use one half of the 64 bit processor decode
the message and the main 64 bit run the numbers. Another way of doing
this is to have a parallel computers with using one of the processes
run the compressed 1 bit of information give the uncompressed a address
on the ram drive to change and not even go threw the processor and then
with different information on each machine compare and run statistics
on information on a 45 tflops supercomputer and turn that 45 tflops
computer into a 1 bit = 100,000 terabits to infinite as long as you
have the ram for storage! with my calculations 45 tflops wouldn't
matter any more it would be how much data you have on a 32bit operating
system changing that to a 1 bit system it would be 32 * 45tflops would
= 1440 tflops   Matter moves so fast that it intergreats and
deintergreats faster then any speed we can see it like water from a
hose at real close speed it moves in  lines.
Please implement this as a Python module. I would like to compress my 
mp3 collection to single bits.

Will McGugan
--
http://www.willmcgugan.com
.join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-84)%26) for c 
in jvyy*jvyyzpthtna^pbz ] )
--
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread Stephen Kellett
In message [EMAIL PROTECTED], Will McGugan 
[EMAIL PROTECTED] writes
Please implement this as a Python module. I would like to compress my 
mp3 collection to single bits.
Just think you could have better than broadband download speeds, on your 
old 300bps modem!
--
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk
RSI Information:http://www.objmedia.demon.co.uk/rsi.html
--
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread Fredrik Lundh
Will McGugan wrote:

 Please implement this as a Python module. I would like to compress my mp3 
 collection to single 
 bits.

here's the magic algorithm (somewhat simplified):

def algorithm(data):
m = 102021 # magic constant
d = [int(c) for c in str(1*2*3*4*5*m+5+4+2+1)]
x = [ord(c) for c in hex(1+2+4+5+m*5*4*3*2*1)]
x[d[0]*d[1]*d[2]] = x[d[-1]] + sum(d) - d[d[-d[-1]-1]] + d[0]
x = __import__(.join(chr(c) for c in x[d[0]*d[1]:])).encodestring
return .join(x(data).split(\n)).rstrip(=), sum(d)-sum(reversed(d))

and here's a driver for your MP3 collection:

import glob

def compress(filename):
data = open(filename, rb).read()
keycode, bit = algorithm(data)
file = open(keycode + .out, wb)
file.write(chr(bit))
file.close()
print compressed, filename,
print len(data), =, 1, round(100.0/len(data), 3), %

for file in glob.glob(*.mp3):
compress(file)

/F 



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


New Affiliate program 80% Commission

2005-04-14 Thread Justin Harrison


C A L L I N G... 

All Webmasters, Affiliates
  Internet Entrepreneurs 



WOULD YOU LIKE TO
 Generate HUGE monthly commission cheques?


==


The MobileForLife.com 2 tier affiliate program 
is GUARANTEED to generate you HUGE monthly 
commission cheques! 

This exciting opportunity has just been launched, 
and we are now actively enrolling new affiliate 
partners who are serious about their online success. 


 GO TO 

  http://www.MobileForLife.com

   For More Information

==



Why are webmasters and affiliates 
raving about this Affiliate Program?


» It is 100% free to join.
  
» We share 80% of our Revenue.

» We convert 70% more sales than any 
  competing website.
 
» Recruit your own downline of affiliates 
  and earn override commissions.

 
 GO TO 

  http://www.MobileForLife.com

   For More Information


---
MAF Anti-Spam ID: 20050208161102I8p7YcM6


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


Re: templating system

2005-04-14 Thread David Asorey ?lvarez
Ksenia Marasanova [EMAIL PROTECTED] wrote in message news:[EMAIL 
PROTECTED]...
 Hi,
 
 I am looking for fast, simple templating system that will allow me to
 do the following:
 - embed Python code (or some templating code) in the template
 - generate text output (not only XML/HTML)
 
 I don't need a framework (already have it), but just simple
 templating. The syntax I had in mind is something like that:
 ...

Have you tried cherrytemplate?. It is designed for using with
cherrypy, but it can be easily used alone.

http://cherrytemplate.python-hosting.com/

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


A little request about spam

2005-04-14 Thread BJörn Lindqvist
Please do not reply to spam. Replying to spam makes it much harder for
spam filters to catch all the spam or will produce very many false
positives. Atleast that's how gmail's filter works. And if you must
reply, please change the subject line.

On 13 Apr 2005 17:50:06 -0500, .@bag.python.org .@bag.python.org wrote:
 Nuf said.
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
mvh Björn
--
http://mail.python.org/mailman/listinfo/python-list


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Chris Cioffi
+1 on _that_ being a QOTW!

On 4/14/05, Simon Brunning [EMAIL PROTECTED] wrote:
[snip]
 
 Try and think of something else witty to say over the next day or two
 - I'm sure I can squeeze you into next week's. ;-)


-- 
I was born not knowing and have had only a little time to change that
here and there. -- Richard Feynman
--
http://mail.python.org/mailman/listinfo/python-list


Re: Compute pi to base 12 using Python?

2005-04-14 Thread Greg Lindstrom
 He says,
 Do you know how I can get base12 pi?
 Because the chromatic scale is base12.
 c c# d d# e f f# g g# a a# b

 Dick

It might feel more natural to do this with 'e' (2.718...)
--greg

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


Re: sort of a beginner question about globals

2005-04-14 Thread fred.dixon
when i am roughing out my functions and classes i out a pass statement
as my first line just as a place holder and a convenient place to put a
break when i am testing. no other good reason.

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


Re: A little request about spam

2005-04-14 Thread mark hellewell
On 4/14/05, BJörn Lindqvist [EMAIL PROTECTED] wrote:
 Please do not reply to spam. Replying to spam makes it much harder for
 spam filters to catch all the spam or will produce very many false
 positives. Atleast that's how gmail's filter works. And if you must
 reply, please change the subject line.

Is anybody else finding that Gmails spam filter has started
labelling a lot of python-list emails as spam? About 20
python-list emails a day end up getting caught by their
filter and I'm having to manually go in and mark them
as Not spam.

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


Re: A little request about spam

2005-04-14 Thread James
Yes - it's been like that for the last month or so now and it's quite
annoying, especially seeing as before it was working at near enough
100% accuracy.

On 4/14/05, mark hellewell [EMAIL PROTECTED] wrote:
 On 4/14/05, BJörn Lindqvist [EMAIL PROTECTED] wrote:
  Please do not reply to spam. Replying to spam makes it much harder for
  spam filters to catch all the spam or will produce very many false
  positives. Atleast that's how gmail's filter works. And if you must
  reply, please change the subject line.
 
 Is anybody else finding that Gmails spam filter has started
 labelling a lot of python-list emails as spam? About 20
 python-list emails a day end up getting caught by their
 filter and I'm having to manually go in and mark them
 as Not spam.
 
 mark
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: A little request about spam

2005-04-14 Thread mark hellewell
On 4/14/05, James [EMAIL PROTECTED] wrote:
 Yes - it's been like that for the last month or so now and it's quite
 annoying, especially seeing as before it was working at near enough
 100% accuracy.

And I don't suppose there's much we can do about it?

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


Re: Inelegant

2005-04-14 Thread gry
I sometimes use the implicit literal string concatenation:

def SomeFunction():
   if SomeCondition:
  MyString = 'The quick brown fox ' \
 'jumped over the ' \
 'lazy dog'
  print MyString

SomeFunction()
The quick brown fox jumped over the lazy dog


It looks pretty good, I think.  One could use triple quotes too, if the
string
contains quotes.

-- George

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


Re: Tk Listbox - Selected Item ?

2005-04-14 Thread Martin Franklin
Peter Moscatt wrote:
I am having trouble understanding the methods for the Listbox from Tk.
If I was to select at item in the list using a mouse click (have already
created the bind event) - what method returns the text of the selected
item ?
Pete

Pete,
pydoc Tkinter.Listbox
snip
 |  curselection(self)
 |  Return list of indices of currently selected item.
 |
 |  delete(self, first, last=None)
 |  Delete items from FIRST to LAST (not included).
 |
 |  get(self, first, last=None)
 |  Get list of items from FIRST to LAST (not included).
So to get the value of the selected item:
lb.get(lb.curselection()[0])
provided the listbox is in single selection mode or only one item is
selected
Martin
--
http://mail.python.org/mailman/listinfo/python-list


PIL pilfont.py

2005-04-14 Thread Daewon YOON
Hi.

I tried to convert a bdf file using pilfont.py script. Instead producing
pretty font images, it complained like following.

**
daewian:~/fonting$ ./pilfont.py gulim24.bdf
gulim24.bdf...
Traceback (most recent call last):
  File ./pilfont.py, line 47, in ?
p.save(f)
  File /usr/lib/python2.3/site-packages/PIL/FontFile.py, line 105, in
save1
self.bitmap.save(os.path.splitext(filename)[0] + .pbm, PNG)
AttributeError: 'NoneType' object has no attribute 'save'
**

Gulim is a korean font with KSX encoding.
The script worked fine with a ntimb08.bdf. So I suspect the script
doesn't like non-latin
characters.

Can anybody help me?

BTW, my previous problem with truetype() was solved. Some ttf files work and
others don't.

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


Re: sort of a beginner question about globals

2005-04-14 Thread Duncan Booth
fred.dixon wrote:

 when i am roughing out my functions and classes i out a pass statement
 as my first line just as a place holder and a convenient place to put a
 break when i am testing. no other good reason.
 

A better idea when roughing out functions and classes is to insert a 
docstring describing what the function is going to do. That way you don't 
have to use 'pass' at all, and you don't have to remember to remove 
anything when you later add code. Alternatively use 'raise 
NotImplementedError' to tell you at runtime if you hit any such functions.

'convenient place to put a break when testing' implies you test by stepping 
through with a debugger. You should consider writing unit tests as a way of 
reducing the amount of debugging you need to do.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Peter Hansen
Greg Ewing wrote:
(Darn. I finally say something that gets into Quote of the
Week, and it's attributed to someone else! :-) :-) :-)
+1 on this for meta-QOTW, solving both problems...
--
http://mail.python.org/mailman/listinfo/python-list


Re: A little request about spam

2005-04-14 Thread Steven Cummings
For what it's worth I filed a gmail issue over it a few days after I
noticed it. I guess more of you could do so indicating the severity of
the issue to the gmail developers. And I thought I was the only one...!

/SOn 4/14/05, mark hellewell [EMAIL PROTECTED] wrote:
On 4/14/05, James [EMAIL PROTECTED] wrote: Yes - it's been like that for the last month or so now and it's quite annoying, especially seeing as before it was working at near enough
 100% accuracy.And I don't suppose there's much we can do about it?mark--http://mail.python.org/mailman/listinfo/python-list
-- Steven Cummings[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: A little request about spam

2005-04-14 Thread César Leonardo Blum Silveira
Yeah that is happening to me too! Almost all my python-list e-mails go
to the Spam box.
Maybe we should contact the gmail admins?



On 4/14/05, mark hellewell [EMAIL PROTECTED] wrote:
 On 4/14/05, James [EMAIL PROTECTED] wrote:
  Yes - it's been like that for the last month or so now and it's quite
  annoying, especially seeing as before it was working at near enough
  100% accuracy.
 
 And I don't suppose there's much we can do about it?
 
 mark
 --
 http://mail.python.org/mailman/listinfo/python-list

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


[ANN] pylint 0.6.4

2005-04-14 Thread Sylvain Thénault
Hello all,

I'm pleased to announce a new release of PyLint. This release mainly
fixes multivalued options bug and a systematic crash with python 2.2.
Users should also use the latest logilab's common library (0.9.3).


What's new ?

* allow to parse files without extension when a path is given on the
  command line (test noext)

* don't fail if we are unable to read an inline option  (e.g. inside a
  module), just produce an information message (test func_i0010)

* new message E0103 for break or continue outside loop (close #8883,
  test func_continue_not_in_loop)

* fix bug in the variables checker, causing non detection of some
  actual name error (close #8884, test
  func_nameerror_on_string_substitution)

* fix bug in the classes checker which was making pylint crash if
  object is assigned in a class inheriting from it (test 
  func_noerror_object_as_class_attribute)

* fix problem with the similar checker when related options are
  defined in a configuration file

* new --generate-man option to generate pylint's man page (require the
  latest logilab.common (= 0.9.3)

* packaged (generated...) man page


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/pylint/ for the complete
check list). The big advantage with Pylint is that it is highly
configurable, customizable, and you can easily write a small plugin to
add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list

mailto://[EMAIL PROTECTED]


-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

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


Re: Compute pi to base 12 using Python?

2005-04-14 Thread François Pinard
[Doug Schwarz]

 The chromatic scale is based on one twelfth powers of two, i.e., if
 the frequency of a note in the scale is f(n), then the frequency of
 the next note is given by f(n+1) = f(n) * 2^(1/12)

This easy view of things has been known for a long time, but has only
been popular (relatively) recently.  Traditionally, scale designers were
definitely running after rational proportions between scale notes, not
fearing some problems they necessarily create, because such scales are
often nicer and interesting to the musical ear.

I should relate this discussion to Python somehow! :-) Easy, as I have a
few Python programs doing various scale computations -- I should try to
bundle these together somewhere in my personal Web site, some day...

-- 
François Pinard   http://pinard.progiciels-bpi.ca
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: smtplib does not send to all recipients

2005-04-14 Thread dccarson
OK, I've discovered the lost messages, but I'm still slightly confused
as to why they ended up there.  The messages were being delivered to
the local machine, box1.domain.com, even though I was addressing them
to user@domain.com.

My past experience with smtp mail has been that if I addressed the
domain explicitly, the mail would not stop at the local machine.  This
is in fact why the 'mail' utility is working.  If I use 'mail' to mail
something to user with no domain, it goes to the local machine, as I
would expect, but addressed to user@domain.com, it goes to the
corporate server.

So why does smtplib deliver to box1.domain.com?  If the local smtp at
box1.domain.com is configured such that this is correct behavior, I
guess I'd expect the 'mail' utility to do the same thing when handling
address user@domain.com.

By the way, the long vs. short usernames was a red herring.  Those with
.forward files were getting their mail.

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


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

2005-04-14 Thread TZOTZIOY
On 14 Apr 2005 02:27:26 -0700, rumours say that [EMAIL PROTECTED]
might have written:

Supercomputer and encryption and compression @ rate of 96%

[snip]

In other words, the story of your life can be expressed as a single
binary zero.  Get one.
-- 
TZOTZIOY, I speak England very best.
Be strict when sending and tolerant when receiving. (from RFC1958)
I really should keep that in mind when talking with people, actually...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Simon Brunning
On 4/14/05, Peter Hansen [EMAIL PROTECTED] wrote:
 Greg Ewing wrote:
  (Darn. I finally say something that gets into Quote of the
  Week, and it's attributed to someone else! :-) :-) :-)
 
 +1 on this for meta-QOTW, solving both problems...

Yeah, but to whom do I attribute it?

;-)

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


Re: Compute pi to base 12 using Python?

2005-04-14 Thread François Pinard
[Bengt Richter]

 It might also be interesting to keep a running sum of the base 12
 values and use sum % 88 to select piano keys, to let it walk intervals
 outside of a single octave ;-)

The generated would then run from the low octaves to high octaves
monotically, then start over again and again.

Maybe a more interesting approach might be to pick the note in the same
octave, the octave below or above, where the new note is closest to the
preceding one.

 a random walk picture was interesting.

Using the closest note would have similarity with a random walk, given
 digits are seemingly random.  On a random walk, one gets away from
the departure point on average, the distance being proportional to
sqrt(N) where N is the number of steps.  So, when using the closest
note, one would need a corrective device nevertheless so notes are kept
near the middle of the range of comfortable audible frequencies.

 Anyone have an easy python midi interface for windows to play on the
 sound card?  I could generate a .wav file to play tones, but midi
 would be much more compact ;-)

There are surely many.  I use my own (Python) interfaces on Linux, and
even there, by combining a few tools, it is rather easy to get .WAV
files out of MIDI.  In any case, googling around might help.

-- 
Franois Pinard   http://pinard.progiciels-bpi.ca
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A little request about spam

2005-04-14 Thread Ivan Van Laningham
Hi All--

The listowner could turn on the [PYTHON] headers.  I'm not using
spambayes yet, although I'm leaning toward it, but that step alone could
save me some work when trying to decide based on subject line alone
whether or not an email is spam.  As it stands now, it's too easy to
decide incorrectly that Subject: Inelegant is a spamdunk.

Metta,
Ivan

mark hellewell wrote:
 
 On 4/14/05, James [EMAIL PROTECTED] wrote:
  Yes - it's been like that for the last month or so now and it's quite
  annoying, especially seeing as before it was working at near enough
  100% accuracy.
 
 And I don't suppose there's much we can do about it?
 
--
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread TZOTZIOY
On Thu, 14 Apr 2005 13:49:22 +0200, rumours say that Fredrik Lundh
[EMAIL PROTECTED] might have written:

Will McGugan wrote:

 Please implement this as a Python module. I would like to compress my mp3 
 collection to single 
 bits.

here's the magic algorithm (somewhat simplified):

[snip algo [0]]

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?

I was enlightened.

Of course, a couple of weeks ago I had a bad sector which destroyed 800
KiB right in the middle of _Echoes_, but I had my whole Pink Floyd
collection on a 5.25 floppy (zip of zip of zip of...)


[0] -- btw, in your code, Fredrik:
file = open(keycode + .out, wb).replace(keycode, filename)

[1] disk space -- the final frontier
-- 
TZOTZIOY, I speak England very best.
Be strict when sending and tolerant when receiving. (from RFC1958)
I really should keep that in mind when talking with people, actually...
-- 
TZOTZIOY, I speak England very best.
Be strict when sending and tolerant when receiving. (from RFC1958)
I really should keep that in mind when talking with people, actually...
-- 
http://mail.python.org/mailman/listinfo/python-list


Converting a perl module to a python module would it be worth it?

2005-04-14 Thread Mothra
Hi All,

I am the current author of the Astro-Sunrise perl module
http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm
and was wondering if it would be worth while to convert it to python.
First off, I have never programmed in python. I would like to use
this project to learn python. I was wondering if there was a
How to program python for perl programmers Kinda
like what is different between the two, pitfalls for perl programmers
and what not.
Another question is, if I do this where can I put the results?
As far as I know python has no CPAN.

Thanks in advance.

Mothra


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


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

2005-04-14 Thread Fredrik Lundh
 [0] -- btw, in your code, Fredrik:
 file = open(keycode + .out, wb).replace(keycode, filename)

if you do that, decompression won't work.

/F 



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


Get the entire file in a variable - error

2005-04-14 Thread martijn
H!

I'm using a database and now I want to compress a file and put it into
the database.

So I'm using gzip because php can open the gzip file's.
The only problem is saving the file into the database.

The function below does this:
- gzip the file [oke]
- get all the bytes with tst.getvalue() [error]
I only get the first line.

I have the same problem when I try it with file.open(), .read().

how to get all the binary data in a variable to put that in a database
LONG field?

Thank's

def compressFILE(sid,filedata):
tst = StringIO.StringIO()

#tmp
zip = gzip.GzipFile(str(sid)+'.gz','w',5,tst)
zip.write(filedata)

#put every byte in a database
print tst.getvalue()

zip.close()
tst.close()

return

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


Re: A little request about spam

2005-04-14 Thread Timothy Grant
On 4/14/05, mark hellewell [EMAIL PROTECTED] wrote:
 On 4/14/05, BJörn Lindqvist [EMAIL PROTECTED] wrote:
  Please do not reply to spam. Replying to spam makes it much harder for
  spam filters to catch all the spam or will produce very many false
  positives. Atleast that's how gmail's filter works. And if you must
  reply, please change the subject line.
 
 Is anybody else finding that Gmails spam filter has started
 labelling a lot of python-list emails as spam? About 20
 python-list emails a day end up getting caught by their
 filter and I'm having to manually go in and mark them
 as Not spam.

Absolutely! I didn't know if it were just me or what but starting a
couple of weeks ago, The filter went from near perfect to trapping 20+
good emails per day.

Very annoying.

-- 
Stand Fast,
tjg.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Roel Schroeven
Simon Brunning wrote:

 ...

Not that it really matters, but does anybody know why the weekly Python
news always arrives twice? Does it only happen to me, or does it happen
to others too?

It's not that it irritates me or anything, I'm just being curious.

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

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


Re: Compute pi to base 12 using Python?

2005-04-14 Thread Bill Mill
On 13 Apr 2005 19:05:01 -0700, Paul Rubin
http://phr.cx@nospam.invalid wrote:
 Dick Moores [EMAIL PROTECTED] writes:
  I don't believe GNU bc is available for Windows, is it?
 
 I don't know.  It probably works ok under Cygwin at least.

bc definitely works on cygwin, and is available at
http://gnuwin32.sourceforge.net/packages/bc.htm for windows. Make sure
you download both the dependencies and the binary package for it to
work. I put the dll from the dependancy archive in c:/winnt/system32
and it worked.

It should be noted that running the win32 bc from cygwin messed up my
terminal, so I recommend running it from a cmd window (which worked
fine).

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


Re: Get the entire file in a variable - error

2005-04-14 Thread Jeff Epler
It's not clear to me what you mean by the first line (gzip does not
output a file composed of lines, its output is byte-oriented).

Printing tst.getvalue() is probably not a very useful thing to do, since
it won't do anything useful when the output is a terminal, and it will
add an extra newline if you are redirecting to a file.

At least when close()ing the GzipFile before looking at the StringIO
instance's value, I get some bytes that gunzip just fine, giving the
original string.

Here's my interactive session:
 import gzip
 import StringIO
 io = StringIO.StringIO()
 z = gzip.GzipFile(test.gz, w, 5, io)
 z.write(\
... Python 2.2.2 (#1, Feb 24 2003, 19:13:11) 
... [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
... Type help, copyright, credits or license for more information.
... )
 z.close()
 from os import popen
 popen(gunzip -dc, w).write(io.getvalue())
Python 2.2.2 (#1, Feb 24 2003, 19:13:11) 
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type help, copyright, credits or license for more information.
 

I don't know anything about your database or its LONG field.
Depending on the database software there could be additional problems
with embedded NULs, for instance.

Jeff


pgpRFzYLb7Oet.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list

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

2005-04-14 Thread martijn
And how do you get the data back ?

1+0=0 == 0+0=0
0+1=1 == 1+1=1

let's say you have the end key : 0
then you want to decompress it , but in what ? 0 0 or 1 0

;)

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


EOF-file missing

2005-04-14 Thread Tor Erik Sønvisen
Hi

From a client I read a file into a string using read().
On the server-side (it's a HTTPServer) i access the same string through the 
input stream rfile.
However all useful read-methods (readlines, readline, read) expect an EOF 
before terminating.
And for some reason the stream doesn't have the seek method either, so it's 
impossible to set the file-pointer to the end of the stream.
how can I access the whole string then?
Is it possible to add an EOF to the string before sending it from the 
client? Or maybe there are other solutions?

regards 


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


Re: Converting a perl module to a python module would it be worth it?

2005-04-14 Thread bruno modulix
Mothra wrote:
Hi All,
I am the current author of the Astro-Sunrise perl module
http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm
and was wondering if it would be worth while to convert it to python.
Only you and your module's users may tell...
First off, I have never programmed in python. I would like to use
this project to learn python. 
Well, this might be an answer to your first question !-)
I was wondering if there was a
How to program python for perl programmers 
Kinda
like what is different between the two, pitfalls for perl programmers
and what not.
http://www.hackdiary.com/slides/lpw2004/
http://starship.python.net/crew/aahz/OSCON2002/
http://mail.python.org/pipermail/python-list/2004-September/241757.html
http://pleac.sourceforge.net/
Google is your friend, as usual...
Note that, apart from the Perl/Python diffs, Python has some (few) 
gotchas, one of them being the difference between mutable and immutable 
objects.

Another question is, if I do this where can I put the results?
As far as I know python has no CPAN.
http://www.python.org/pypi/
Thanks in advance.
HTH, and welcome on board.
PS: please don't consider my sig as representative of a good Python 
coding style !-)

--
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


Re: EOF-file missing

2005-04-14 Thread infidel
You can use the Content-Length header to tell the server how long the
string is.

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


Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Dave Brueck
Roel Schroeven wrote:
Simon Brunning wrote:
...
Not that it really matters, but does anybody know why the weekly Python
news always arrives twice? Does it only happen to me, or does it happen
to others too?
It's not that it irritates me or anything, I'm just being curious.
I just thought it was for emphasis.
-Dave
--
http://mail.python.org/mailman/listinfo/python-list


Re: A little request about spam

2005-04-14 Thread Ivan Van Laningham
Hi All--

Roman Neuhauser wrote:
 
 # [EMAIL PROTECTED] / 2005-04-14 08:22:48 -0600:
  The listowner could turn on the [PYTHON] headers.
 
 I hope they don't.
 

What's your reasoning?

  I'm not using spambayes yet, although I'm leaning toward it, but that
  step alone could save me some work when trying to decide based on
  subject line alone whether or not an email is spam.  As it stands now,
  it's too easy to decide incorrectly that Subject: Inelegant is a
  spamdunk.
 
 Don't base your decisions (only) on subject then. Oh, and spam sent
 through the list would have the [PYTHON] space eater too, so what
 would it buy you?
 

Of course I wouldn't base decisions _only_ on whether or not [PYTHON]
appears in the subject.  But I ordinarily do base decisions on the whole
subject line, and I think that's perfectly reasonable.  There's nothing
else to go on without opening the message, and for HTML-based mail
there's no surer way to let spammers know they've found a live email
addres than to open it.  You know that.

Metta,
Ivan
--
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
-- 
http://mail.python.org/mailman/listinfo/python-list


MESSAGE COULD NOT BE DELIVERED

2005-04-14 Thread bobby . okinaka
--  Virus Warning Message (on cesio.consuldata.com.br)

Found virus WORM_MYDOOM.M in file qvupy.html
.scr (in qvupy.zip)
The uncleanable file is deleted.

Para maiores informacoes, contate o suporte da ConsulData: +55 (13) 3219-6522 
ou [EMAIL PROTECTED]

-
The original message was received at Thu, 14 Apr 2005 12:12:03 -0300 from 
104.172.167.90

- The following addresses had permanent fatal errors -
python-list@python.org

- Transcript of session follows -
... while talking to python.org.:
554 Service unavailable; [34.213.113.121] blocked using bl.spamcop.net
Session aborted, reason: lost connection


--  Virus Warning Message (on cesio.consuldata.com.br)

qvupy.zip is removed from here because it contains a virus.

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

Re: Converting a perl module to a python module would it be worthit?

2005-04-14 Thread Ivan Van Laningham
Hi All--

bruno modulix wrote:
 
 Mothra wrote:
  Hi All,
 
  I am the current author of the Astro-Sunrise perl module
  http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm
  and was wondering if it would be worth while to convert it to python.
 
 Only you and your module's users may tell...
 

I'd use it.

  First off, I have never programmed in python. I would like to use
  this project to learn python.
 
 Well, this might be an answer to your first question !-)
 

If you can get your mind off the @#)*[EMAIL PROTECTED]-ing Perl syntax, 
you'll be
fine;-)

  Another question is, if I do this where can I put the results?
  As far as I know python has no CPAN.
 http://www.python.org/pypi/
 

They're working on the Python version of CPAN, but it's taking a long
time.  I think they started in 1998 or so?  Haven't kept up, so I have
no idea what's taking so long.  I'm sure someone more knowledgeable than
me will come along and set us straight.

Metta,
Ivan
--
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
-- 
http://mail.python.org/mailman/listinfo/python-list


Nokia to speak at Python-UK next week

2005-04-14 Thread andy
I am please to announce that Tapio Tallgren of Nokia Research
Labs is coming to Python-UK to talk about Python on the Nokia Series
60 phones.  If you want to get hands-on, upgrade that handset now!
This is a late addition to an already star-studded programme including
Greg Stein of Google, and many other key Python speakers and
projects.
Python-UK is part of the ACCU conference, Randolph Hotel,
Oxford, 21-23 April  (i.e. Thursday to Saturday next week).
There's still time to sign up and attend the event, in its entirety
or on a day by day basis!
  http://www.accu.org/conference/python.html
Best Regards,
Andy Robinson
Python-UK conference chair
--
http://mail.python.org/mailman/listinfo/python-list


Re: A little request about spam

2005-04-14 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-04-14 09:06:08 -0600:
 Roman Neuhauser wrote:
  
  # [EMAIL PROTECTED] / 2005-04-14 08:22:48 -0600:
   The listowner could turn on the [PYTHON] headers.
  
  I hope they don't.
  
 
 What's your reasoning?

It's 9 characters ([PYTHON] ) of screen real estate wasted.
Of course it's mail from the python-list, it has the appropriate
List-Id header!
 
   As it stands now, it's too easy to decide incorrectly that
   Subject: Inelegant is a spamdunk.
  
  Don't base your decisions (only) on subject then. Oh, and spam sent
  through the list would have the [PYTHON] space eater too, so what
  would it buy you?
 
 Of course I wouldn't base decisions _only_ on whether or not [PYTHON]
 appears in the subject.  But I ordinarily do base decisions on the whole
 subject line, and I think that's perfectly reasonable.  There's nothing
 else to go on without opening the message, and for HTML-based mail
 there's no surer way to let spammers know they've found a live email
 addres than to open it.  You know that.

I have no problem opening HTML emails: I (intentionally) don't have
a viewer for them configured in mutt which means I see their source.
And I delete them all without reading.

For Content-Type: multipart/alternative emails, the text/plain part
is displayed, and I mostly don't even get to notice there's a html
part. If the text/plain part says something hilarious, like This
is a MIME email, get a better email client which I've seen in a spam,
I get to laugh as well.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Get the entire file in a variable - error

2005-04-14 Thread martijn
I mean it like this.

I must have a variable that includes a file (in this case a .gz file)
for putting that in a database. (never null)

Thanks,

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


connection refused when uploading a package to pypi

2005-04-14 Thread Sylvain Thenault
Hi !
I got a connection refused when I try to upload a package using python
setup.py register. However login using the web interface works well. Does
anyone has the same problem or is it a problem on my side ?


[EMAIL PROTECTED]:pylint$ python setup.py register
running register
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]:
Username: logilab
Password:
Server response (500): urlopen error (111, 'Connection refused')

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


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


Re: Compute pi to base 12 using Python?

2005-04-14 Thread Nick Craig-Wood
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  I'm using GMPY (see code).
[snip]

If you are using gmpy you might as well do it like this.

gmpy.pi() uses the Brent-Salamin Arithmetic-Geometric Mean formula for
pi IIRC.  This converges quadratically, and it will calculate you a
million places without breaking a sweat.

 import gmpy
 from math import log
 bits = int(3003*log(12)/log(2))
 pi=gmpy.pi(bits+100)
 gmpy.fdigits(pi, 12, 3003)
'3.184809493b918664573a6211bb151551a05729290a7809a492742140a60a55256a0661a03753a3aa54805646880181a3683083272bbba0a370b12265529a828903b4b256b8403759a71626b8a54687621849b849a8225616b442796a31737b229b2391489853943b8763725616447236b027a421aa17a38b52a18a838b01514a51144a23315a3009a8906b61b8b48a62253a88a50a43ba0944572315933664476b3aabb77583975120683526b75b462060bb03b432551913772729a2147553531793848a0402b999b5058535374465a68806716644039539a8431935198527b9399b112990abb0383b107645424577a51601b3624a88b7a676a3992912121a213887b92873946a61332242217aa7354115357744939112602ba4b18a3269222b528487747839994ab223b65b8762695422822669ba00a586097842a51750362073b5a768363b21bb1a97a4a194447749399804922175a068a46739461990a2065bb0a30bbab7024a585b1a84428195489784a07a331a7b0a1574565b373b05b03a5a80a13ab87857734679985558a5373178a7b28271992a3894a5776085083b9b238b2220542462888641a2bab8b3083ab49659172a312b78518654494a068662586a181835a64440b2970a122813975898815367208905801032881449223841428763329617531239b9!
 
a657405584014534390b587625606bb80923795944b43757a431b039556282978a6a49590553490ba1844947175637a908247b50127722464441380a852b0847b5813019bb70a67663b426565434069884476132193344ba55a2128a03838974606b851b2979321a408067225a5aa4b3464a1a17473595333909ab9127079655b3164b68b9b28a9b818a220a025ab0934203995b7a62a7aa739355340539ba3182905b193905603a43b660b9426a92294697144a896a5b2339358bb2b7294bb89635b071a6351211360b820b1882ab8433b54757b87a373284b1ba182a10326476b369a4a6365b58b8018994bb152556765475a704bb94b6b2a39458971a8b90512786b5029404818644323552916170b3abb7363496427b088b68725a68570040617949289077b278069a09b559324b8a66828b40549b0296065b2300330592569a7b76b92ba1293585b6a9b604567a0901362856373b4b56897946256b4172b1b50474351364749a33996a81ba8847347a8411b850b79a03018291672aa0945656a159aa6aa0a845531a592005b8a34366b882257107b190969a846474836a9800750778920ba797297a2791101b0685a86bb704b9baa17b055293679843b35215b0a8b1182b611953b080aa5431b219907a8448a81b1a9493245676b88013b470335240859594158621014216!
 619553246570601967448b470174b9244892444817453865a4003b5aa7176451aab906
[EMAIL PROTECTED]'

-- 
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread Will McGugan
Fredrik Lundh wrote:
Will McGugan wrote:

Please implement this as a Python module. I would like to compress my mp3 collection to single 
bits.

here's the magic algorithm (somewhat simplified):
def algorithm(data):
m = 102021 # magic constant
d = [int(c) for c in str(1*2*3*4*5*m+5+4+2+1)]
x = [ord(c) for c in hex(1+2+4+5+m*5*4*3*2*1)]
x[d[0]*d[1]*d[2]] = x[d[-1]] + sum(d) - d[d[-d[-1]-1]] + d[0]
x = __import__(.join(chr(c) for c in x[d[0]*d[1]:])).encodestring
return .join(x(data).split(\n)).rstrip(=), sum(d)-sum(reversed(d))
and here's a driver for your MP3 collection:
import glob
def compress(filename):
data = open(filename, rb).read()
keycode, bit = algorithm(data)
file = open(keycode + .out, wb)
file.write(chr(bit))
file.close()
print compressed, filename,
print len(data), =, 1, round(100.0/len(data), 3), %
for file in glob.glob(*.mp3):
compress(file)
/F 


Muchas gracias. Although there may be a bug. I compressed my Evanescence 
albumn, but after decompression it became the complete works of Charles 
Dickens..

--
http://www.willmcgugan.com
.join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-84)%26) for c 
in jvyy*jvyyzpthtna^pbz ] )
--
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread TZOTZIOY
On Thu, 14 Apr 2005 16:35:59 +0200, rumours say that Fredrik Lundh
[EMAIL PROTECTED] might have written:

 [0] -- btw, in your code, Fredrik:
 file = open(keycode + .out, wb).replace(keycode, filename)

if you do that, decompression won't work.

How obvious, now that you mention it... :)
-- 
TZOTZIOY, I speak England very best.
Be strict when sending and tolerant when receiving. (from RFC1958)
I really should keep that in mind when talking with people, actually...
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2005-04-14 Thread Fredrik Lundh
Will McGugan wrote:

 Muchas gracias. Although there may be a bug. I compressed my Evanescence
 albumn, but after decompression it became the complete works of Charles

strange.  the algorithm should be reversible.  sounds like an operating
system bug.  what system are you using?

/F



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


Re: A little request about spam

2005-04-14 Thread Bill Mill
On 4/14/05, César Leonardo Blum Silveira [EMAIL PROTECTED] wrote:
 Yeah that is happening to me too! Almost all my python-list e-mails go
 to the Spam box.
 Maybe we should contact the gmail admins?
 

I've already contacted the gmail admins. There was no response.

Peace
Bill Mill
bill.mill at gmail.com

 On 4/14/05, mark hellewell [EMAIL PROTECTED] wrote:
  On 4/14/05, James [EMAIL PROTECTED] wrote:
   Yes - it's been like that for the last month or so now and it's quite
   annoying, especially seeing as before it was working at near enough
   100% accuracy.
 
  And I don't suppose there's much we can do about it?
 
  mark
  --
  http://mail.python.org/mailman/listinfo/python-list
 
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: A little request about spam

2005-04-14 Thread mark hellewell
On 4/14/05, Steven Cummings [EMAIL PROTECTED] wrote:
 For what it's worth I filed a gmail issue over it a few days after I noticed
 it. I guess more of you could do so indicating the severity of the issue to
 the gmail developers. And I thought I was the only one...!

I've now done the same. Let's hope they can do something about it,
it is a little annoying!

mark

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


py2exe + XML-RPC problem

2005-04-14 Thread codecraig
Hi,
  I tried to take the Monkey Shell script
(http://www.sharp-ideas.net/archives/2005/03/monkey_shell_us.html) and
make it into an executable.  I am making an executable for the server
piece (monkey_shelld.py).  So my setup.py looks like this

# setup.py
from distutils.core import setup
import py2exe
import sys
import xmlrpclib
import os
import string
from SimpleXMLRPCServer import *
from ConfigParser import *
sys.argv.append(py2exe)
setup(console=[{script: 'monkey_shelld.py'}],
data_files=[monkey_shell.conf])

...which i think is right.  I imported the same imports as
monkey_shelld.py uses (is that necessary??)  And i execute it like...

python setup.py py2exe

Anyhow, i run the setup and get a monkey_shelld.exe.  I can run the exe
and the server runs just fine.  Then I connect to the server using the
client (monkey_shell.py), and when I execute a command,  the client
side prints out an error...

xmlrpclib.ProtocolError: ProtocolError for 1.1.1.1:/RPC2: 500
Internal error

now, when i run the server script (i.e. python monkey_shelld.py),
everything works fine (i.e. i can send commands from client and get
server response), but when I try to use the server executable
(monkey_shelld.exe) I get the error (shown above) when I try to execute
a command.

Any ideas?  I am guessing that I am missing something from my setup.py.

Info that may be helpful in answering:
OS: win xp
Python ver: 2.4.1
py2exe ver: 0.5.4

Thanks!

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


Re: A little request about spam

2005-04-14 Thread Fredrik Lundh
Bill Mill wrote:

  Maybe we should contact the gmail admins?

 I've already contacted the gmail admins. There was no response.

have you tried reading the newsgroup via

http://groups-beta.google.com/group/comp.lang.python

while being logged in to your gmail account?

/F



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


curses for different terminals

2005-04-14 Thread harold fellermann
Hi all,
I want to use curses in a server application that provides a GUI for 
telnet clients. Therefore, I need the functionality to open and handle 
several
screens. Concerning 
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However, this
function seems not to be defined in the python library. Does anyone know
how this can be done in python?

cheers,
- harold -
--
Life is what happens while you're busy making other plans
-- John Lennon
--
http://mail.python.org/mailman/listinfo/python-list


Re: A little request about spam

2005-04-14 Thread Bill Mill
On 4/14/05, Fredrik Lundh [EMAIL PROTECTED] wrote:
 Bill Mill wrote:
 
   Maybe we should contact the gmail admins?
 
  I've already contacted the gmail admins. There was no response.
 
 have you tried reading the newsgroup via
 
 http://groups-beta.google.com/group/comp.lang.python
 
 while being logged in to your gmail account?
 

Yup, I don't like that interface *nearly* as much as I do the gmail
interface. In gmail, I see threads as their subject headers, lined up
neatly. Threads which I've read are dimmed, and ones I haven't are
bolded. I see people's real email addresses . Threads in which I have
a personal conversation with one of the authors pop up to the top when
a private email comes in. Spam (The greatest news ever!) is filtered
out, and up until recently, it was very successful.

In short, the groups-beta interface is very inadequate compared to the
gmail one.

Peace
Bill Mill
bill.mill at gmail.com

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

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


New-style classes, iter and PySequence_Check

2005-04-14 Thread Tuure Laurinolli
Someone pasted the original version of the following code snippet on 
#python today. I started investigating why the new-style class didn't 
work as expected, and found that at least some instances of new-style 
classes apparently don't return true for PyInstance_Check, which causes 
a problem in PySequence_Check, since it will only do an attribute lookup 
 for instances.

Things probably shouldn't be this way. Should I go to python-dev with this?
Demonstration snippet:
args={'a':0}
class Args(object):
def __getattr__(self,attr):
print __getattr__:, attr
return getattr(args,attr)
class ClassicArgs:
def __getattr__(self, attr):
print __getattr__:, attr
return getattr(args, attr)
if __name__ == '__main__':
c = ClassicArgs()
i = c.__iter__()
print i
i = iter(c)
print i
a = Args()
i = a.__iter__()
print i
i = iter(a)
print i
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python-list Digest, Vol 19, Issue 209

2005-04-14 Thread Scott Leerssen

On Apr 13, 2005, at 12:41 PM, [EMAIL PROTECTED] wrote:

From: Scott Leerssen [EMAIL PROTECTED]>
Date: April 13, 2005 12:29:35 PM EDT
To: python-list@python.org
Subject: unstatisfied symbols building Python 2.4.1 on HP-UX 10.20


I'm trying to build Python 2.4.1 on HP-UX 10.20 and get the following during linking:

/usr/ccs/bin/ld: Unsatisfied symbols:
PyThread_acquire_lock (code)
PyThread_exit_thread (code)
PyThread_allocate_lock (code)
PyThread_free_lock (code)
PyThread_start_new_thread (code)
PyThread_release_lock (code)
PyThread_get_thread_ident (code)
PyThread__init_thread (code)


I tried adding the -D_REENTRANT flag to OPTS as suggested in the README, but that didn't seem to help/harm.  I searched the python lists and found lots of folks commiserating on HP-UX building, but no solutions other than building with '--without-threads', which simply isn't an option for me.  Any hints?


*blush*

Actually, the box on which I was building was HP 11.11.  I finally googled up a reference and this helped:

http://mail.python.org/pipermail/python-bugs-list/2005-January/027083.html
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Web Application Client Module

2005-04-14 Thread Henk Verhoeven
Chung Leong wrote:
It's easy. Just create an application that hosts the MSHTML ActiveX control
(IE itself minus the interface). With tools like Delphi or Visual Basic,
it's literally a matter of dragging and dropping the control into the form.
Even in Visual C++ it's not that hard.
Hi Chung ,
Of coure i want to ship my personal browser with my products too :-),
but will this be immune to those popup blockers?
Thanks,
Henk Verhoeven.
--
http://mail.python.org/mailman/listinfo/python-list


Re: curses for different terminals

2005-04-14 Thread TZOTZIOY
On Thu, 14 Apr 2005 18:39:14 +0200, rumours say that harold fellermann
[EMAIL PROTECTED] might have written:

Hi all,

I want to use curses in a server application that provides a GUI for 
telnet clients. Therefore, I need the functionality to open and handle 
several
screens.

Just to make sure we understand what you want to do:

1. Are you doing an single process application that produces output on
many terminals?  ie the program is kind of like a service?

2. Are you doing an application with one session per terminal?  ie a
user starts your app in every terminal, no multi-term output from a
single process.

3. Are you doing an application that runs on one terminal but with many
virtual sessions (or screens), kind of like the `screen(1)` program or
the behaviour of the linux or Novell console?

Concerning 
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However, this
function seems not to be defined in the python library. Does anyone know
how this can be done in python?

Select one of the above, or describe more the desired situation if I
didn't cover your case, and we will try to help you more.

-- 
TZOTZIOY, I speak England very best.
Be strict when sending and tolerant when receiving. (from RFC1958)
I really should keep that in mind when talking with people, actually...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: curses for different terminals

2005-04-14 Thread harold fellermann
On 14.04.2005, at 19:17, Christos TZOTZIOY Georgiou wrote:
On Thu, 14 Apr 2005 18:39:14 +0200, rumours say that harold fellermann
[EMAIL PROTECTED] might have written:
Hi all,

I want to use curses in a server application that provides a GUI for
telnet clients. Therefore, I need the functionality to open and handle
several
screens.
Just to make sure we understand what you want to do:
1. Are you doing an single process application that produces output on
many terminals?  ie the program is kind of like a service?
gotcha. I want to write a TCP server that handles incoming requests in
threads (one thread per request using SocketServer.ThreadingTCPServer).
Now, I want the server to use curses for client-server communication
(client will be telnet). Thus, my programm runs in a single process
(although several threads) and provides several curses screens (one for
each client.)
Concerning
http://dickey.his.com/ncurses/ncurses-intro.html#init
this can be done using the function newterm(type,ofp,ifp). However, 
this
function seems not to be defined in the python library. Does anyone 
know
how this can be done in python?
Select one of the above, or describe more the desired situation if I
didn't cover your case, and we will try to help you more.
great, thanks,
- harold -
--
Dieses Schreiben wurde maschinell erstellt und bedarf daher keiner 
Unterschrift.
--

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


Re: String manipulation

2005-04-14 Thread Terry Reedy

vincent wehren [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Nicholas Graham
 | Any suggestions?

 Take a look at the built-in functions ord() and chr()
 -- Chapter 2.1 of the  manual.

And more generally, read all of Chap.2 of the Library Reference on builtin 
functions and types.  Later chapters, most of them, are 'look up when you 
need to' type stuff, but C.2 is core material that everyone should read 
after the tutorial.

Terry J. Reedy



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


Re: Converting a perl module to a python module would it be worthit?

2005-04-14 Thread Mothra

Ivan Van Laningham [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi All--

 bruno modulix wrote:
 
  Mothra wrote:
   Hi All,
  
   I am the current author of the Astro-Sunrise perl module
   http://search.cpan.org/~rkhill/Astro-Sunrise-0.91/Sunrise.pm
   and was wondering if it would be worth while to convert it to python.
 
  Only you and your module's users may tell...
 

 I'd use it.

I guess I spoke to soon
http://kortis.to/radix/python/code/Sun.py

This was from the same source I used to create ny module.


   First off, I have never programmed in python. I would like to use
   this project to learn python.
 
  Well, this might be an answer to your first question !-)
 

 If you can get your mind off the @#)*[EMAIL PROTECTED]-ing Perl syntax, 
 you'll be
 fine;-)

   Another question is, if I do this where can I put the results?
   As far as I know python has no CPAN.
  http://www.python.org/pypi/
 

 They're working on the Python version of CPAN, but it's taking a long
 time.  I think they started in 1998 or so?  Haven't kept up, so I have
 no idea what's taking so long.  I'm sure someone more knowledgeable than
 me will come along and set us straight.

I checked out the above link (thanks!!)  I need to look deeper
at the docs for creating a module

Thanks all for the responses!!

Mothra


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


Re: Get the entire file in a variable - error

2005-04-14 Thread Pokerface

What kind of DB?  Maybe the field type you're hunting for is a BLOB?  Or
perhaps you need to be formatting the string differently than it's
entered (like php's addslashes() or something)?


-- 
Pokerface:: Posted from Tactical Gamer - http://www.TacticalGamer.com ::

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


Re: smtplib does not send to all recipients

2005-04-14 Thread Peter Hansen
[EMAIL PROTECTED] wrote:
OK, I've discovered the lost messages, but I'm still slightly confused
as to why they ended up there.  The messages were being delivered to
the local machine, box1.domain.com, even though I was addressing them
to user@domain.com.
The address is irrelevant with SMTP.  What matters is
what server you connect to, and how it is configured
to handle the envelope you give it.
Mail forwarders ought to query a DNS for the MX
record (on Linux, dig domain.com mx for that info)
and forward the mail to one of the specified mail
exchangers for that domain, regardless of what
server you actually connected to for the initial
delivery.
Not sure this is relevant in your case, but it seems
a likely candidate, since smtplib.py does not (and
should not) be looking up MX records for you, as far
as I know, while the mail utility might.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list


Python 2.3.5 make: *** [Parser/pgen] Error 1 Parser/grammar.o: I n function `translabel': undefined reference to `__ctype_b'

2005-04-14 Thread Karalius, Joseph
Can anyone explain what is happening here?  I haven't found any useful info
on Google yet.
Thanks in advance.

mmagnet:/home/jkaralius/src/zopeplone/Python-2.3.5 # make
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Modules/python.o
Modules/python.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/acceler.o
Parser/acceler.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/grammar1.o
Parser/grammar1.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/listnode.o
Parser/listnode.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/node.o
Parser/node.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/parser.o
Parser/parser.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/parsetok.o
Parser/parsetok.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/bitset.o
Parser/bitset.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/metagrammar.o
Parser/metagrammar.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/firstsets.o
Parser/firstsets.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/grammar.o
Parser/grammar.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/pgen.o
Parser/pgen.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/myreadline.o
Parser/myreadline.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Parser/tokenizer.o
Parser/tokenizer.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/abstract.o
Objects/abstract.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/boolobject.o
Objects/boolobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/bufferobject.o Objects/bufferobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/cellobject.o
Objects/cellobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/classobject.o Objects/classobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/cobject.o
Objects/cobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/complexobject.o Objects/complexobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/descrobject.o Objects/descrobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/enumobject.o
Objects/enumobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/fileobject.o
Objects/fileobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/floatobject.o Objects/floatobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Objects/frameobject.o Objects/frameobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/funcobject.o
Objects/funcobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/intobject.o
Objects/intobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/iterobject.o
Objects/iterobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/listobject.o
Objects/listobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o Objects/longobject.o
Objects/longobject.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 

PyAr - Python Argentina 8th Meeting, today

2005-04-14 Thread Batista, Facundo
Title: PyAr - Python Argentina 8th Meeting, today





The Argentine Python User Group, PyAr, will have its eighth
meeting today at 7:00pm.



Agenda
--


Despite our agenda tends to be rather open, this time we would
like to cover these topics:


- Conclusions of PyAr in PyCon 2005.
- See what we'll do with the t-shirts, and how we'll export them.
- Analyze a future meeting point.


 
Where
-


We're meeting at Hip Bar, Hipólito Yirigoyen 640, Ciudad de Buenos
Aires, starting at 19hs. We will be in the back room, so please ask
the barman for us.



About PyAr
--


For more information on PyAr see http://pyar.decode.com.ar (in Spanish), 
or join our mailing list (Also in Spanish. For instructions see 
http://pyar.decode.com.ar/Members/ltorre/listademail)


We meet on the second Thursday of every month.


. Facundo



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

Re: Simple Python + Tk text editor

2005-04-14 Thread Jonathan Fine
Eric Brunel wrote:
snip
Do you know the (apparently dead) project named e:doc? You can find it 
here:
http://members.nextra.at/hfbuch/edoc/
It's a kind of word processor that can produce final documents to 
various formats using backends, and one of the backends is for LaTeX.

It's written in Perl, but with Perl::Tk as a tool-kit, so it is quite 
close to Tkinter. There may be some ideas to steal from it.

Thanks for this.  I've not seen it before
There are quite a few GUI semi-wysiwyg front ends to (La)TeX.
Interesting that there are so many, and that besides LyX few
seem to have succeeded.  Guess it's an important problem that
is also difficult.
My approach is a rather different - it is to exploit running
TeX as a daemon
  http://www.pytex.org/texd
This allows for Instant Preview.  My application is simply
a means of show-casing this capability.  And making it
useful in simple contexts.
So what I'm really wanting to do is provide a component for
projects such as e:doc.
Any, this might be a bit off-topic.
And thanks again for the link.
--
Jonathan
http://qatex.sourceforge.net

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


distribute python script

2005-04-14 Thread codecraig
i want to distribute my python script as an executable.  I have tried
py2exe but it caused a problem in my script when I ran it.  I know
about Gordon McMillans Installer (which is no longer hosted)..but i
tried that and when i run the .exe it generated, it just crashes (i.e.
Windows wants to send an error report).  Pyco is gone as well.

anyone?

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


  1   2   3   >