Pyro 4.0 released

2010-06-13 Thread Irmen de Jong

Pyro 4.0
-
I'm extremely pleased to announce the release of Pyro 4.0!
This is the first official release of the new incarnation of Pyro.


What is Pyro?
-
PYthon Remote Objects provides a very easy way of remote communication
between python objects somewhere in a network. It enables you to do
remote method calls on objects as if they were normal local objects.
Objects can be located by a direct identifier or indirectly by logical,
humanly-readable names that are managed in a name server.
Pyro is designed to be simple (but powerful) so it's only a manner of
adding a few lines of code to ignite your objects.
Simple example: http://www.razorvine.net/python/Pyro/Example


Changes
---
The most important changes compared to Pyro 3.x are:

- total rewrite, API similar but not backward compatible
- simpler  faster  better
- some features have been removed for the sake of the above
- Python 3.x compatible! (separate download for now)
- requires Python 2.5+, works with jython and ironpython (recent versions)
- large amount of unit tests
- many rewritten examples
- no manual yet, but the ideas are similar to Pyro 3.x, so look there for now


Website  Download
--
Detailed info here: http://www.razorvine.net/python/Pyro
(a page about migration from Pyro 3.x is included)

Download Pyro 4.0 here: http://www.xs4all.nl/~irmen/pyro4/download/

License: MIT software license.


Enjoy,
Irmen de Jong
--
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/12/10 8:26 PM, Gregory Ewing wrote:
 On Jun 12, 6:05 pm, Stephen Hansen me+list/pyt...@ixokai.io wrote:
 
 A programming goof, oversight or unexpected event causes an exception.
 It doesn't cause a buffer overflow.
 
 The important thing here isn't so much the exception as
 the *traceback*.
 
 When you've been programming in Python for a while, it's
 easy to forget how much help the traceback is in tracking
 down bugs. Suddenly being faced with having to do without
 one comes as a rude shock.

Oh, agreed absolutely.

The exception just gets things started. If its something you're prepared
for, you can recover just fine.

Worst case scenario, you get a traceback.

And you pity those people who have to have gdb running before hand and
get a stack trace ;-)


-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/12/10 8:42 PM, Gregory Ewing wrote:
 Stephen Hansen wrote:
 
 Its one thing for Python to make available foot-shooting tools(this is
 good! I love ctypes, with care) for the developer, its another thing
 entirely for it to shoot at the ground in the normal course of its
 operation and hope it doesn't blow off any big toes. :)
 
 I would hope that a module included in the stdlib was written
 by a sufficiently skilled marksman that it can successfully
 carry out ground-targeting without loss of appendages. And I'd
 better stop before this metaphor undergoes a sudden catastrophic
 stress fracture.

Wow, I had difficulty taking the metaphor as far as I did. I bow to you,
sir! :)

 Seriously, though, if you can't trust someone to write safe
 ctypes-using code, can you trust them to write safe C code any
 better? Especially considering that the equivalent C code is
 much longer and more tedious to write, with attendant risk of
 the author losing concentration and making a mistake.

I don't disagree at all; in fact I consider the use of ctypes entirely
fine, if the devs doing it take sufficient care.

But I do get the point of the policy, even though in certain cases --
namely, win32 api access -- it pains me and I wish there could be a
middle-way which gave me the best of both worlds.

If ctypes is in place, then anything can use ctypes. Clearly, that stuff
which may make it into the stdlib will be best of breed from a safety
stand point, and they're using ctypes just as a maintenance relief and
not due to lack of ability or knowledge.

But now -everything- has access to ctypes. And that's sort of dangerous.
I've been in environments where corporate / security interests were such
that they'd like to /not/ have ctypes, as the safety of Python was a key
selling point. Removing ctypes preserves that safety. But you can't have
the stdlib breaking then, with only certain parts working.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is the best implementation of LISP family of languages for real world programming ?

2010-06-13 Thread Antti Andy Ylikoski

13.6.2010 7:02, Antti Andy Ylikoski kirjoitti:

12.6.2010 22:54, Pascal J. Bourguignon kirjoitti:

bolegagnuist...@gmail.com writes:



[PAIP]


Is there anything in this old norvig book that makes it worth
pursuing as a text ?


Yes.



I agree with his criticism that the book is old, mine stems from the
year 1992.

I bought and studied the Russell-Norvig books on Artificial
Intelligence: A Modern Approach, ie. the 1th, 2nd (and in the future
the 3rd edition), in order to learn modern AI theory. They have
discontinued the 3rd edition but I succeeded in ordering a copy anyway.
I have read the 1st and the 2nd editions, but I have not yet received by
mail the 3rd edition.

But I only got the PAIP book to learn Common LISP, not in order to study
modern AI. This is why I'm discussing this in the news:comp.lang.LISP
newsgroup.

Any good modern LISP textbooks out there?

Can anyone point to me any other good modern textbooks on AI than the
3rd edition of the Russell-Norvig book? (Which is reputable.)

kind regards, Antti Ylikoski
Helsinki, Finland, the E.U.


I answer my own question: it is a very good idea to visit the AAAI site

http://www.aaai.org

and purchase several conference proceedings of the biennal AAAI 
conference.  -- This is for those who want something more non-basic than 
a textbook.


kind regards, Antti J. Ylikoski

(Dislaimer: in the LISP newsgroup this is almost off topic)

PS.  Also see the IJCAI biennal conference proceedings, from the Google 
or the Bing.


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


Re: GUIs - A Modest Proposal

2010-06-13 Thread Stephen Hansen
On 6/12/10 8:34 PM, Gregory Ewing wrote:
 lkcl wrote:
 
  * in neither gtk nor qt does there exist an auto-layout widget
 that's equivalent to putting some span / DOM objects into a div /,
 to flow widgets that wrap around.
 
 You essentially seem to be complaining here that pqyqt and
 pygtk are not HTML. They have their own auto-layout mechanisms
 that do what they're designed to do well enough -- they just
 happen to be based on a different model from HTML.
 
 I'm far from convinced that HTML and CSS are the One True Way
 to design GUIs these days, that web apps are about to take over
 the world, etc. There is still a place for GUI toolkits that
 are not based on the DOM, or whatever the W3C technology of
 the month is.

Agreed. While web interfaces have a certain appeal, and definite
strengths, they have difficulties as well.

Although I have never used gtk directly, I do use wxWidgets/wxPython
extensively, and its Linux-port is GTK based. Its a serious learning
curve, I do freely admit. But once I began to think in wx, it works well.

And all of my wxPython apps use dynamic / auto-layout sort of
orientation and sizing without any sort of explicit management. So its
clearly -possible-. Maybe its entirely done in wx, and wx does all the
pain that lkcl went through trying to get gtk to do it. But that seems
unlikely.

But I don't actually know, one way or the other.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GUIs - A Modest Proposal

2010-06-13 Thread Stephen Hansen
On 6/12/10 8:22 PM, Gregory Ewing wrote:
 Terry Reedy wrote:
 
 Would it be possible to write a program that converts a module that
 uses ctypes to interface to a dll to a corresponding C extension
 program that would compile to a drop in replacement extension module?
 
 Probably, but I don't see how that could be done automatically
 in a way that ensured the result would be any safer than the
 original ctypes-using version. If you preserve the semantics of
 the Python code, you also preserve any bugs it might have.

I dunno. This is exactly what Cython does. I have exactly one extension
module in Cython that uses it, and so very limited experience-- but it
seems very solid and very safe, from my admittedly limited attempts at
breaking it.

True, Cython != Python. But its close enough that Python programmers can
do it without knowing the pain of C, just following a certain limited
Python subset. Its very doable, very accessible, and *seems* to address
this very issue.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Stephen Hansen
I call bullshit.

The Python community is vibrant, accessible, and willing to endure far
more then anyone has any right to expect when people come to it for help.

The community seems willing to explain fundamental concepts to newbies
over, and over, and over again; to go out of their way, time and again,
to spend countless man-hours showing newbies how to think in Python, how
to be successful in Python, how to excel in Python.

It does expect something from those coming to it for aide; it expects
the seeker to disclose the problem in a complete, clear manner, with
real code and errors, with clear questions; and then it goes out of its
way to explain what all is going on, and how to approach the problem in
a Pythonic way.

And when the newbies fail to show even the vaguest level of
due-diligence (let alone, ability to simply Google a problem), the
community doesn't call them idiots, doesn't tell them to RTFM and GFYS,
but explains again, how best to ask a question, what to include so that
we can help you best, and then try to find a solution, even when the
community is dubious of the intent of the asker.

Why do people respond poorly to you?

Because you don't just argue a point of view.

You don't argue a position; you don't support it with facts, logic,
reason. You start immediately into this emotional rhetoric,
pseudo-inspirational nonsense which just comes off as inane. It's like a
bad cross between a politician and an self-help speaker, and the crux of
your arguments are focused on that emotional charge-- how TCL is impure,
gross, and its inclusion makes us less, makes us the mockery of the
language world, how everyone loathes and detests it.

None of that is true, on any factual level.

Time and time again, you presume to speak for us, for we, and that's
detestable.

Meaning to or not, you come across as a troll, as if these emotional
responses are your end and not your means.

Make an argument. Support it with facts, leave out the rhetoric, make
your case. This is a forum of engineers-- even if most of us aren't
professional engineers, and many are just starting along the line of
becoming engineers. But this is not a religious organization. This is
not a political party. By and large, we don't mind if someone chooses
another solution. (Yes, I'm speaking for we now, I know)

Practicality beats purity.

This is a fundamental concept, not only in Python, but in the community.
The community is about solving problems. Not an agenda. There is no
desire to win. There is no desire to be best. There is a desire for
individuals to be empowered to succeed.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/12/10 10:10 PM, Cameron Simpson wrote:
 Python advocacy seems to be by example, not cheerleading.

+1 QOTW

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GUIs - A Modest Proposal

2010-06-13 Thread Jeremy Sanders
lkcl wrote:

  * in neither gtk nor qt does there exist an auto-layout widget
 that's equivalent to putting some span / DOM objects into a div /,
 to flow widgets that wrap around.  yes, you can put words into a
 Label and get them to flow, but not _widgets_.

I'm pretty sure in PyQt4 that you can derive your own layout class from 
QLayout to get what you want. No C++ is required. You can easily extend PyQt 
without using C++.

There is even an example in the PyQt examples which does something similar 
to what you want: see examples/layouts/flowlayout.py

Personally I find the Qt layout to be much better than anything provided by 
CSS and HTML. Personally I'd rather be writing complex C++ templates that 
those, though it does give you a feeling of achievement when you get what 
you want with CSS.

Jeremy

-- 
Jeremy Sanders
http://www.jeremysanders.net/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Martin P. Hellwig

snip all
At first I wanted to response in the style of 'karma is a bitch' or 
'what goes around comes around' but then I considered that won't be 
helping much, so I only did at first in a meta sort of way, sorry for that.
The thing is that sometimes for no good or appealing reasons, which I 
personally think in this case isn't so, the whole world is against you.


So I would propose that, instead of beating up a dead horse (I try to 
write from your point of view) you fork the project, call it Rython (or 
whatever you fancy) and create the community you want by patching up the 
language to your standards.


I promise if there is something where I am competent enough I will 
seriously consider contributing.


--
mph

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


Re: Re: Deformed Form

2010-06-13 Thread Dave Angel

Victor Subervi wrote:

snip

DaveA suggested I not use the same name for my fn. as I do for my var;
however, there is a difference in capitalization, and I'm trying to
standardize this way. It makes it easy to recognize the difference (caps)
and easy to recognize which vars go with which fns.

  


That's not what I said.  I said:
I'd also suggest you not use the same name for the module that you 
use for the function in that module.  That's the cause of another 
confusion I had with your message. 



Since you didn't name your modules (what you persist in calling 
scripts), I can only guess their names from the import statements:

e.g.:
from New_Passengers_Curr_Customers import New_Passengers_Curr_Customers


I don't see any case difference there.

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


Re: GUIs - A Modest Proposal

2010-06-13 Thread lkcl
On Jun 13, 3:34 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
 lkcl wrote:
   * in neither gtk nor qt does there exist an auto-layout widget
  that's equivalent to putting some span / DOM objects into a div /,
  to flow widgets that wrap around.

 You essentially seem to be complaining here that pqyqt and
 pygtk are not HTML.

 no, i'm not complaining - i'm pointing out that in my meandering
experiences to pick suitable technology, i found, very simply, that
both pyqt and pygtk didn't cut it.  that's not a complaint.  so i'm
stating/implying that from the experience that i had with both
toolkits, pyqt and pygtk were not as easy to create layouts or widgets
with (but caveat: jeremy kindly points out that in pyqt there is
examples/layouts/flowlayout.py)

 another way to put that: i'm stating that, in my search for suitable
technology to implement W3C-standards-like behaviour, such that i
could map an existing widget set API on top of it, i found both pygtk
and pyqt4's bang per buck as far as both extensibility and existing
functionality was concerned to be below an acceptable threshold *for
me*.

 statement of personal experience. not complaint.

 They have their own auto-layout mechanisms
 that do what they're designed to do well enough -- they just
 happen to be based on a different model from HTML.

 one which turns out to be sufficiently different from HTML as to make
it beyond my time and patience to implement one in terms of the
other.  again - that's not a complaint, just a statement that i
prefer to leverage technologies where the bang per buck or better
bang per line-of-code is way above average.


 I'm far from convinced that HTML and CSS are the One True Way
 to design GUIs these days,

 if you have HTML the fileformat and CSS the fileformat in mind
when saying that, i can tell you right now that they're not.
fortunately, with the W3C DOM functions exposing properties and style
attributes, it's possible to manipulate the exact same attributes that
CSS and HTML files provide access to, using a declarative
programming style.

 so with pyjamas you get the best of both worlds.  (and i've found
that the combination of the advanced features of python, and
declarative DOM manipulation, is _definitely_ worthwhile exploring,
and i definitely find it to be far more powerful than pyqt4 or pygtk
programming).

 it's the exact same thing for SVG image file-format.  i'm
_definitely_ not convinced that SVG the image fileformat is The One
True Way to design images - but i'm equally definitely convinced of
the power of SVG manipulation libraries which allow for the creation
SVG images using declarative programming.

 but, all that having been said, and returning to HTML and CSS (the
fileformats), there's a lot to be said for convincing people who are
stuck in those worlds of the benefits and freedom of declarative
programming... _without_ having to get involved directly in
javascript.

 that web apps are about to take over
 the world, etc. There is still a place for GUI toolkits that
 are not based on the DOM,

 that there definitely are.

 or whatever the W3C technology of the month is.

 :) don't underestimate how much time and money is going into the W3C
standards!  and remember, someone's got to implement them, so the
actual proof of the pudding is not what the W3C thinks but whether the
technology ends up actually in the hands of users and is successful
_for users_.

 l.

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


Re: GUIs - A Modest Proposal

2010-06-13 Thread lkcl
On Jun 13, 9:01 am, Jeremy Sanders jeremy
+complangpyt...@jeremysanders.net wrote:
 lkcl wrote:
   * in neither gtk nor qt does there exist an auto-layout widget
  that's equivalent to putting some span / DOM objects into a div /,
  to flow widgets that wrap around.  yes, you can put words into a
  Label and get them to flow, but not _widgets_.

 I'm pretty sure in PyQt4 that you can derive your own layout class from
 QLayout to get what you want. No C++ is required. You can easily extend PyQt
 without using C++.

 really?  drat.  i could have done with knowing that at the time.
hmmm, perhaps i will return to the pyqt4 port after all.

 There is even an example in the PyQt examples which does something similar
 to what you want: see examples/layouts/flowlayout.py

 excellent!  that actually makes it worthwhile carrying on.  the only
other thing that needs solving is that RichText is forced to have its
width and height set.  but it mayyy be possible to create an
appropriate QLayout derivative: i'll have to see.


 Personally I find the Qt layout to be much better than anything provided by
 CSS and HTML. Personally I'd rather be writing complex C++ templates that
 those, though it does give you a feeling of achievement when you get what
 you want with CSS.

 i didn't point this out at the time (and have done so to graham's
post, but it's worth reiterating briefly here): remember that you're
not _entirely_ stuck with CSS the file-format - you _can_ do
declarative DOM manipulation (from python):

 self.element.style.backgroundColor = #ffcc00

 that's python _not_ javascript :)

 so, now you can create **kwargs jobbies, you can store properties in
xml fileformats, read them and then apply them using **kwargs to the
stylesheets; you can create functions which set multiple CSS
properties at once, based on some calculations and so on.

 so, yah - when you're stuck with just CSS the fileformat, it's a
complete dog.  joy.  lovely.  you can set the width and the
background.  wow, big deal.  but when you start combining it with
python, you've opened up a completely new dimension.

 it's in fact how the entire pyjamas UI widget set is created, by
doing nothing more than direct manipulation of bits of DOM and direct
manipulation of the style properties.  really really simple.

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


Re: Community (*sigh*)

2010-06-13 Thread Thomas Jollans
You want to contribute to the stdlib? No problem, it's easy! I did so
recently. You file an issue on the python.org bug tracker, describing
the problem, and attach a patch that fixes it. A nice developer with
commit rights will be with you shortly. The guy that committed my tiny
little patch the other day was even kind enough to add me to the authors
(or was it acknowledgements? I forget.) file.

Oh, you want to contribute a new package/module? Then write it, and post
it to the cheese shop! If it's any good, people may want to help you
build upon the foundation you laid. If it's really, really good, and
universally useful, it might actually end up in the stdlib. For example,
the standard unittest module which we all know and love was an
independent package once upon a time!

Also, I'm sick of reading a modest proposal in hundreds of subject lines.

-- Thomas


On 06/13/2010 05:09 AM, rantingrick wrote:
 
 -
  Where is the community?
 -
 
 I think the Python community is broken. I think we don't really have
 a community. It's more like a handful of negitive people at the top
 and every one else is chopped liver.
 
 Just today i saw another chance to contribute code to Python's stdlib,
 but then that nagging feeling of Whats the use, these people are just
 going to discredit you and never accept code from you just because
 they hate you. Sadly though the only damage is done to Python.
 
 For those who are not aware my very first post to c.l.p (and Usenet)
 was about 1.5 years ago. At that time i saw a void that Python could
 fill nicely as a simple scripting language for an very quickly
 advancing 3D modeling application (Google SketchUp). (You can search
 the archives for a thread called...Help, Google SketchUp needs a
 Python API if you are interested.)
 
 So i my first thought was to find out if anyone was interested in
 starting this project up. So i posted my ideas and to my complete and
 utter surprise i was lynched by the Python community as a heretic
 How dare you ask other people to help do what you should be doing
 yourself ... well that was the Sunday school version of the
 responses i received. I was discredited and mobbed for no apparent
 reason except that i had the balls to ask the question in the first
 place. I was only looking to get feedback, but the endless hoards
 insisted that they new my intentions better than *I*.
 
 Why was the reaction so negative? Well i will admit some fault in the
 fact that i trashed Ruby pretty bad. I felt everything i said was true
 IMO then as is now (mostly). People should have a right to opinions.
 However since i was such an unknown and you could say a newbie,
 was this reaction warranted? I think not, and it speaks volumes to the
 negative attitudes within this community.
 
 This brings me to a new question. How many really exceptional Python
 programmers have been left out OR pushed out because of the extreme
 narcissism of the core python group. And when i say core i am
 speaking of the handful of people who hang out here discrediting and
 mobbing anybody they see as a threat to their superiority. They clutch
 to power like a hated dictator because that is all they have left.
 
 You people need to get a life, drop your narcissistic attitudes and be
 more helpful, friendly, and welcoming to the wider world. This
 community is not a community, its a Cosa Nostra. Your predator like
 behaviors are bleeding the spirit of Python's community. This
 community does not belong to you or me or even GvR, we all share an
 equal piece. And no matter how much, or little, each of use
 contribute, we all share an equally divided peice.
 
 I have spoken with other Python programmers (far more advanced than
 myself) who echo this sentiment. However unlike me they cannot afford
 to sacrifice their image to this group, EVEN if the group is at fault!
 However this behavior is causing Python to suffer from lack of diverse
 developers, and shrinks the pool of those who wish to participate.
 
 But i'll tell you one thing, you will never bleed me dry because i am
 stronger than all! I will be a thorn in your sides every time you pick
 on a newbie. I will point out every negative comment you make, it will
 not be hidden as you like. Whether i am accepted or assassinated i
 will create an irreversible butterfly affect that no organization of
 negativity can endure. I will bring some positive attitudes to this
 group if it's the last thing i do! That will be my contribution to
 this group, and it may just save the Python community as a whole!
 
 
 
 
 

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


Re: What's a good XSL to translate xmlrunner.py output into a test report?

2010-06-13 Thread Stefan Behnel

Phlip, 06.06.2010 19:12:

Here's xmlrunner.py:

  http://www.rittau.org/python/xmlrunner.py

you attach it to your developer tests, and it emits a file called
TEST-unittest.TestSuite.xml, containing auspicious wackiness like
this:

   testcase
classname=tests.unit.gateways.authorize_net_tests.AuthorizeNetTests
name=test_failed_credit time=0.0017/testcase
   testcase
classname=tests.unit.gateways.authorize_net_tests.AuthorizeNetTests
name=test_fraudulent_avs_result time=0.0010/testcase
   testcase
classname=tests.unit.gateways.authorize_net_tests.AuthorizeNetTests
name=test_fraudulent_cvv_result time=0.0011/testcase


Bump? Anyone reporting on their unit tests here?


I only use XML reporting in combination with the Hudson-CI tool. It parses 
the output and (amongst other things) reports the results over a serious of 
builds through its web site. It's also very easy to set up, so maybe that's 
what you are actually looking for?


Stefan

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


Re: Issue with xml iterparse

2010-06-13 Thread Stefan Behnel

bfrederi, 03.06.2010 22:44:

I am using lxml iterparse and running into a very obscure error. When
I run iterparse on a file, it will occasionally return an element that
has a element.text == None when the element clearly has text in it.


I assume you are referring to the 'start' event here, right? Tag content is 
not guaranteed to be parsed at this point, so containing text may or may 
not be available. Only the 'end' event guarantees that it has been parsed 
(well, or the 'start' event of a child element).




I copy and pasted the problem xml into a python string, used StringIO
to create a file-like object out of it


Note that the right thing to use in Py2.6 and later is BytesIO.

Stefan

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


Re: Printing forms and labels in Python

2010-06-13 Thread Mel
Monte Milanuk wrote:

 I realized today that one thing I have never seen covered in any Python
 tutorial is how to format and print things to a physical printer.  I did
 a little bit of searching and didn't come up with much... either I'm
 really not using the right search terms, or physical printing is a black
 hole/art...?

It's massively device-specific...

What I did when I needed precision printing was have my Python programs 
generate PostScript code, then run that through ghostscript to do the actual 
printing.  PostScript was designed to control printers down to the pixel.  
It's possible to streamline the production run by running ghostscript using 
the subprocess module.  Of course you have to learn PostScript to do this, 
which is not really simple.

The other possibility that I'm aware of might be to get a graphics package 
(the one built in to wx is the one I'm familiar with) and  set up your 
printable text and graphics in a appropriate device context suitable for 
your printer.

Mel.

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


Mark built-in module as deprecated

2010-06-13 Thread moerchendiser2k3
Hi,

can anyone give me a hint how to mark a built-in module as deprecated?
So mark via warnings... I create a module with Py_InitModule4.

Thanks in advance!!

Bye, moerchendiser2k3
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (*sigh*)

2010-06-13 Thread John Bokma
Thomas Jollans tho...@jollans.com writes:

 Also, I'm sick of reading a modest proposal in hundreds of subject lines.

OK, how about a modest proposal in the body? Please do not top post. Or
at least don't quote a very, very long article. Thank you.

-- 
John Bokma   j3b

Hacking  Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl  Python Development
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Mark built-in module as deprecated

2010-06-13 Thread Thomas Jollans
On 06/13/2010 03:54 PM, moerchendiser2k3 wrote:
 Hi,
 
 can anyone give me a hint how to mark a built-in module as deprecated?
 So mark via warnings... I create a module with Py_InitModule4.

How are modules ever marked as deprecated? I think all there is to it is
issuing a DeprecationWarning... something  like

PyErr_WarnEx(PyExc_DeprecationWarning, foo deprecated. use fuzz, 1);

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


Re: Printing forms and labels in Python

2010-06-13 Thread jfabiani
Monte Milanuk wrote:

 Hello,
 
 I'm still a relative newbie to python, so I apologize if this is covered
 in detail somewhere and I missed it.
 
 I have a program or two that I want to work on once I get more
 proficient with python and sqlite and tkinter/wxpython.  One of the big
 'features' of those programs I want to make is going to be printing out
 match results (scores) from a competition along with competitor names
 and other pertinent information.  Currently most people are doing this
 in Excel, though there is one (old) DOS program written in BASIC that
 not only prints the match results and the reports for the sanctioning
 body, but also prints labels via a Dymo Label maker.
 
 I realized today that one thing I have never seen covered in any Python
 tutorial is how to format and print things to a physical printer.  I did
 a little bit of searching and didn't come up with much... either I'm
 really not using the right search terms, or physical printing is a black
 hole/art...?
 
 TIA,
 
 Monte
It's still possible to send esc char's to the printer (just like the dos
program).  So in days of DOS programs there were routines that matched
epsons, HP, and a few other printers that the dos programs used to print to
(http://webpages.charter.net/dperr/links/esc_p2.htm).  

Idea was simple send the printer the esc codes and the text you wanted
printed.  Just insure you have the right port (BTW not as easy as it used
to be). 

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


Re: GUIs - A Modest Proposal

2010-06-13 Thread Stephen Hansen
On 6/13/10 4:29 AM, lkcl wrote:
  it's in fact how the entire pyjamas UI widget set is created, by
 doing nothing more than direct manipulation of bits of DOM and direct
 manipulation of the style properties.  really really simple.

Did you just call DOM manipulation simple with a straight face? I don't
think I've ever seen that before.

HTML+CSS have some very strong advantages. Simplicity is not one of
them. Precision web design these days is a dark art. (Go center an image
vertically and horizontally in an arbitrary sized field!)

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deformed Form

2010-06-13 Thread Stephen Hansen
On 6/12/10 12:50 PM, Dennis Lee Bieber wrote:
 On Sat, 12 Jun 2010 14:42:27 -0400, Victor Subervi
 victorsube...@gmail.com declaimed the following in
 gmane.comp.python.general:
 

 Interestingly,
 ls -al
 reveals *no* *.pyc files.

   Which would seem to indicate that you have no user modules that are
 imported into other modules when run. And that there is no sharing of
 data between the modules you have.

Not really; pyc file generation is optional. Its a performance
enhancement, but if it doesn't work, there's no problem.

No pyc files indicates to me that the web process doesn't have *write*
access to this directory, which is actually entirely fine and dandy. I'd
just pre-compile them all first, because otherwise Python has to read
the original source, parse and build up bytecode for each file every
request.

I'd python -m compileall -f . whenever you edit a file and before testing.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing forms and labels in Python

2010-06-13 Thread Joel Goldstick

Monte Milanuk wrote:

Hello,

I'm still a relative newbie to python, so I apologize if this is covered 
in detail somewhere and I missed it.


I have a program or two that I want to work on once I get more 
proficient with python and sqlite and tkinter/wxpython.  One of the big 
'features' of those programs I want to make is going to be printing out 
match results (scores) from a competition along with competitor names 
and other pertinent information.  Currently most people are doing this 
in Excel, though there is one (old) DOS program written in BASIC that 
not only prints the match results and the reports for the sanctioning 
body, but also prints labels via a Dymo Label maker.


I realized today that one thing I have never seen covered in any Python 
tutorial is how to format and print things to a physical printer.  I did 
a little bit of searching and didn't come up with much... either I'm 
really not using the right search terms, or physical printing is a black 
hole/art...?


TIA,

Monte



Why not go the other direction.  Use python to do your processing, and 
send the results to excel.  There are python modules that read and write 
excel files.


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


Re: GUIs - A Modest Proposal

2010-06-13 Thread Michael Torrie
On 06/13/2010 05:29 AM, lkcl wrote:
  really?  drat.  i could have done with knowing that at the time.
 hmmm, perhaps i will return to the pyqt4 port after all.

We're now wandering well off-topic here, but then again this thread was
never really on any particular topic.

I have to say I'm really confused as to your issues with GTK and Qt.
I've seen and done all kinds of fancy widget layouts in Qt and have
*never* had to subclass layout.  If you think you need to subclass
QLayout, most of the time you're doing it wrong.  You are familiar with
how the vertical and horizontal layouts and spacers work in Qt, aren't
you?  Sometimes you need a grid for a table or the specialized form
grid.   But other than that you want a dynamically-sizing layouts most
of the time.  And Qt's Vertical and Horizontal layouts do that.

I'm also confused by your claim that GTK lacks the layout widgets you
need as well.  GTK has the GtkHBox layout class which acts much like
your span tag.  Anything to pack in the hbox is automatically layed
out in a dynamicially-resizing way.  Any GTK dialog or window is a
combination of different layouts, nested to get the desired layout.
Works extremely well.

  excellent!  that actually makes it worthwhile carrying on.  the only
 other thing that needs solving is that RichText is forced to have its
 width and height set.  but it mayyy be possible to create an
 appropriate QLayout derivative: i'll have to see.

Again I'm confused here.  I just created a little Window in Qt Designer
and was able to get my RichText (There isn't a Rich Text widget in Qt;
Just TextEdit with Rich text enabled) widget to resize automatically
just fine as I resized the window.  I'm obviously missing something.



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


Re: Community (A Modest Proposal)

2010-06-13 Thread rantingrick
On Jun 13, 5:04 am, Martin P. Hellwig martin.hell...@dcuktec.org
wrote:

 So I would propose that, instead of beating up a dead horse (I try to
 write from your point of view) you fork the project, call it Rython (or
 whatever you fancy) and create the community you want by patching up the
 language to your standards.

I have considered this although i dared not say it on the list until
all diplomatic means have failed, and it seems that we have reached
that point. Also i do not think splitting the community was a good
idea. However, if the ivory towers continue to pretend that the rest
of the Python community does not exist well then they will force my
hand, and i will start a fork. Then we will have a sort of ironic
situation... the very people who rail *against* me (and others) would
actually be working *for* me unwillingly but without recourse. he-he
Yes, as you've said karma *is* a bitch ;-)

 I promise if there is something where I am competent enough I will
 seriously consider contributing.

That is a wonderful response Martin thank you. I don't know if you are
serious, but a wonderful response nonetheless!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GUIs - A Modest Proposal

2010-06-13 Thread Arndt Roger Schneider

lkcl schrieb:


[snip]

it's the exact same thing for SVG image file-format.  i'm
_definitely_ not convinced that SVG the image fileformat is The One
True Way to design images - but i'm equally definitely convinced of
the power of SVG manipulation libraries which allow for the creation
SVG images using declarative programming.

 



You rather severly underestimate the impact from SVG!
1. SVG is a complete visualization system and not an fancy way to create 
icons.

   SVG and SMIL are an extreme powerful environment. With it's
   possible to create(design) sophisticated graphical and interactive 
--resolution independent--

   applictions without resorting to javascript or direct DOM manipulations.
   Javascript or other languages are still necessary to feed data into 
an SVG

   visualization, but not for much more. Further more SVG and the GPU are
   a natural combination.

2. Many of CSS shiny new features --such as animation originate
  from SVG.
3. SVG-Print: Printing is one of the biggest problems in
  the current IT-landscape. I do not want to install printer
  drivers on each telephon I own, neither on any other device --mobile
  or not. The printer must contain a computer running an OS and has to
  handle an agreed upon page description language (Xml based)...


Using HTML/CSS/DOM/javascript for application building:
Well, yes can be done. HTML is however text oriented; each
application entirely based on this technology will be satured
with text. HTML works reasonable well with applications of the past
two decades, but the importance of text is dwindling and other
graphical means of communication become more and more relevant.


but, all that having been said, and returning to HTML and CSS (the
fileformats), there's a lot to be said for convincing people who are
stuck in those worlds of the benefits and freedom of declarative
programming... _without_ having to get involved directly in
javascript.

 



Any User Interface should be pre-determined;
this concept allows the consequent separation of
application logic and presentation. It's not only important
for Web-applications!


that web apps are about to take over
the world, etc. There is still a place for GUI toolkits 


that
are not based on the DOM,
   



that there definitely are.

 


or whatever the W3C technology of the month is.
   



:) don't underestimate how much time and money is going into the W3C
standards!  and remember, someone's got to implement them, so the
actual proof of the pudding is not what the W3C thinks but whether the
technology ends up actually in the hands of users and is successful
_for users_.

l.

 


The mony part is definitly important. Tk is actually a good example for
the working of money-politics (the absence thereof).

-roger


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


Re: Community (A Modest Proposal)

2010-06-13 Thread rantingrick
On Jun 13, 1:50 am, Stephen Hansen me+list/pyt...@ixokai.io wrote:

 You don't argue a position; you don't support it with facts, logic,
 reason. You start immediately into this emotional rhetoric,
 pseudo-inspirational nonsense which just comes off as inane. It's like a
 bad cross between a politician and an self-help speaker, and the crux of
 your arguments are focused on that emotional charge-- how TCL is impure,
 gross, and its inclusion makes us less, makes us the mockery of the
 language world, how everyone loathes and detests it.

Could it be that *you* are taking my opinions and suggestions too
emotionality?

 Meaning to or not, you come across as a troll, as if these emotional
 responses are your end and not your means.

My *ends* are to move Python forward. No i do not i have all the
answers however i can look at what i do see and ask the hard
questions. Then i would like to get some thoughtful answers.

Instead of just simply barking down orders from the top we need to
have useful discussion on the many topics that concern Python. And not
just the core developers or the core protagonist on this list
should be involved in this discussion. Everyone needs to have a chance
to speak.

My are arguments for Tkinter/Tcl/Tk are all true. However it should be
a community decision (not my sole decision or yours!) as to whether
Tkinter stays or not. As i have said before i *do* actually use
Tkinter quite a lot (along with other libraries). But we must make a
choice, Keep Tkinter and improve it, or dump Tkinter and consider
something that will scale better for the future. I AM HAPPY EITHER
WAY!

I have documented time and again the poor state of IDLE. The only
responses i ever get are...

 Nobody uses IDLE
 Only a dumbass would use IDLE
 I have never used IDLE but i *know* nothing is wrong with it

... and all these arguments are BS! It's just more argumentative
hyperbole that keeps these and many other modules in static
development. I am also committing to contributing code myself *if* it
will be seriously considered on the *value* of the code and NOT *who*
it originated from. But i digress...

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


Re: a +b ?

2010-06-13 Thread alex23
Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
 No, I think your code is very simple. You can save a few lines by writing
 it like this:

 s = input('enter two numbers: ')
 t = s.split()
 print(int(t[0]) + int(t[1]))  # no need for temporary variables a and b

Not that we're playing a round of code golf here, but this is a
slightly nicer take on your version:

one, two = input('enter two numbers: ').split()
print(int(one) + int(two))

I like names over subscripts, but that's just me :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Zeth
On Jun 13, 4:09 am, rantingrick rantingr...@gmail.com wrote:
  Where is the community?

In Birmingham from 17th to 22nd of July:
http://www.europython.eu/talks/timetable/

(Couldn't resist - one good troll deserves another)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: introducing Lettuce, BDD tool for python with Django integration

2010-06-13 Thread Aahz
In article 83dddac7-7a3a-4dee-9944-ee2f0ec72...@u20g2000pru.googlegroups.com,
alex23  wuwe...@gmail.com wrote:
Tycho Andersen ty...@tycho.ws wrote:

 I think his point may have been that there could be more than one
 meaning. My first guess would have been binary decision diagram.

Ah, good point. My apologies for the dig, Terry :)

Another point is that it is (or should be) incumbent upon a poster not to
waste the time of readers.  If a new-ish term is being introduced,
expecting each person to search for the meaning is rude.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing forms and labels in Python

2010-06-13 Thread Monte Milanuk

On 6/13/10 8:00 AM, Joel Goldstick wrote:


Why not go the other direction. Use python to do your processing, and
send the results to excel. There are python modules that read and write
excel files.


Well... partly because Excel is not exactly cross-platform.  Granted, 
the mass majority of people using a program like I have in mind will be 
doing so on Windows, but I was hoping to *not* tie things to any one 
platform if I could avoid it.  Probably an overly ambitious goal at this 
point.


The other part... maybe its my relative newbie experience level showing 
here, but having to call/open Excel to print something from a python app 
feels a little like admitting that python can't do it in a reasonable 
manner.  If I wanted to have to open Excel to print out the results, I 
think I'd just as soon spend the effort and make the whole thing an 
Excel/VBA app and skip python entirely.


Perhaps (probably) I'm not understanding some of how the lower level 
systems stuff works here...  I thought the print drivers were there to 
take care of the low-level device-specific communication, and provide a 
somewhat simplified common interface for regular programs like M$ Word, 
Open Office, Adobe Reader, etc. to use.  Those programs don't access the 
hardware directly, do they?  Don't they hand off the print job to the 
OS-specific print drivers, and let them handle the spooling, etc.?  From 
my (admittedly limited) understanding of things on Windows, Mac  Linux, 
that seems to be somewhat common between platforms. Isn't there some 
sort of module in Python to do the same?  I could understand it needing 
to be somewhat *platform* specific, perhaps... but I have old copies of 
M$ Office 2003 printing out just duckily on printers that only came out 
on the market less than a year ago.  I updated the printer drivers and 
changed the default printer, but nothing printer-related in Word or 
Excel changed (that I know of)... but it still manages to hand off to 
the operating system print drivers just fine... which is kind of what I 
figured Python would do.


Is that (to some degree) what ReportLab does?

TIA,

Monte

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


Re: how to get a reference to the __main__ module

2010-06-13 Thread Aahz
In article hun8s4$h4...@news.albasani.net, WH  whz...@gmail.com wrote:

'x' in getattr() should be a reference to the __main__ module, right?
How to get it?  

Just for the record, the best way to get a reference to __main__ is to
import it:

import __main__
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Aahz
In article 0912f443-e83a-4436-80db-b1cb915d5...@r27g2000yqb.googlegroups.com,
Zeth  theol...@gmail.com wrote:
On Jun 13, 4:09=A0am, rantingrick rantingr...@gmail.com wrote:

 Where is the community?

In Birmingham from 17th to 22nd of July:
http://www.europython.eu/talks/timetable/

(Couldn't resist - one good troll deserves another)

That's not a troll, that's publicity!  And a nice subversion of the
troll.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a +b ?

2010-06-13 Thread exarkun

On 04:25 pm, wuwe...@gmail.com wrote:

Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
No, I think your code is very simple. You can save a few lines by 
writing

it like this:

s = input('enter two numbers: ')
t = s.split()
print(int(t[0]) + int(t[1]))  # no need for temporary variables a and 
b


Not that we're playing a round of code golf here, but this is a
slightly nicer take on your version:

one, two = input('enter two numbers: ').split()
print(int(one) + int(two))

I like names over subscripts, but that's just me :)


Fore!

   print(sum(map(int, input('enter two numbers: ').split(

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


Re: math.erfc OverflowError

2010-06-13 Thread Aahz
In article mailman.1348.1276386991.32709.python-l...@python.org,
geremy condra  debat...@gmail.com wrote:

Bug filed, http://bugs.python.org/issue8986.

Please don't put extraneous punctuation on URLs.  That period is a valid
URL character, but it's invalid for this URL, and it's not obvious to the
reader whether the period should be part of the URL.  URLs in general
should go on their own line, but at least separate them with whitespace
(or use the icky angle-bracket hack supported by most mail/newsreaders).
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-13 Thread Terry Reedy

On 6/12/2010 11:42 PM, Gregory Ewing wrote:


Seriously, though, if you can't trust someone to write safe
ctypes-using code, can you trust them to write safe C code any
better?


No, and I think you are missing the concern about ctypes. There are two 
issues of ctypes versus safety/security: competance and intention. In an 
environment where one is *not* allowed access to a C compiler, but is 
allowed (partial) access to Python, it may make sense to remove ctypes, 
alone with some other things. I am thinking of a website host, or Google 
apps, perhaps.


Terry Jan Reedy

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


Re: WebBrowserProgramming [was: GUIs - A Modest Proposal]

2010-06-13 Thread Aahz
In article cf08e777-b98b-4b7c-96df-e7b127c02...@y4g2000yqy.googlegroups.com,
lkcl  luke.leigh...@gmail.com wrote:

 i'm recording all of these, and any other web browser manipulation
technology that i've ever encountered, here:

 http://wiki.python.org/moin/WebBrowserProgramming

Neat!  Why aren't you including Selenium/Windmill?
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GUIs - A Modest Proposal

2010-06-13 Thread lkcl
On Jun 13, 3:52 pm, Arndt Roger Schneider arndt.ro...@addcom.de
wrote:
 lkcl schrieb:

  [snip]

  it's the exact same thing for SVG image file-format.  i'm
 _definitely_ not convinced that SVG the image fileformat is The One
 True Way to design images - but i'm equally definitely convinced of
 the power of SVG manipulation libraries which allow for the creation
 SVG images using declarative programming.

 You rather severly underestimate the impact from SVG!

 no - i kept things brief, so as not to dominate the postings here:
you've very kindly filled in the blanks, and given far more
information than even i was aware of, which is great.

 1. SVG is a complete visualization system and not an fancy way to create
 icons.

 ... all of which is accessible via DOM manipulation, via the W3C-DOM-
specified functions through the canvas / element.   use of which has
resulted in the creation of a very powerful _python_ library which re-
presents those SVG Canvas functions.  fillRect. saveContext.
translate.

 demo of end-result usage can be seen here:
   http://pyjs.org/examples/gwtcanvas/output/GWTCanvasDemo.html
   http://pyjs.org/examples/asteroids/output/Space.html

 Using HTML/CSS/DOM/javascript for application building:
 Well, yes can be done.

 yes, it could.  personally i wouldn't recommend the javascript bit.
it's too dreadful. :)

 HTML is however text oriented; each
 application entirely based on this technology will be saturated
 with text.

 ah - no, it won't.  isn't.  pyjamas apps are the proof that that
isn't the case.  pyjamas applications contain, at the absolute basics,
_one_ HTML file comprising... about eight lines, the most important
two bits being a meta tag naming the pre-compiled application, and a
script tag with bootstrap.js which knows about the aforementioned
meta tag.  that's _it_.  the rest can be done _entirely_ using
declarative-style programming.

 but... if you _want_ to, that loader file can be a full-blown PHP
app: just as long as that meta tag is there, and the bootstrap.js is
there, the pyjamas app can be initiated on top of the PHP page.
just like any other javascript can be run and can begin to manipulate
the DOM.  so it's just a matter of degree.  you can either specify
almost everything in text HTML/CSS or you can do entire DOM-
manipulation or anything in between, to suit _your_ personal
preference.

 i must not be explaining this very well, for which i apologise.

 or whatever the W3C technology of the month is.

  :) don't underestimate how much time and money is going into the W3C
 standards!  and remember, someone's got to implement them, so the
 actual proof of the pudding is not what the W3C thinks but whether the
 technology ends up actually in the hands of users and is successful
 _for users_.

  l.

 The mony part is definitly important. Tk is actually a good example for
 the working of money-politics (the absence thereof).

 :)  yehhs... and then people complain when it doesn't look good.
interesting neh?

 hence a reason why i'm advocating to leverage the incredible power
of the technologies which _have_ had vast amounts of money/effort
poured into them, with very little effort spent on the leveraging
bit.

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


Re: Community (*sigh*)

2010-06-13 Thread Terry Reedy

On 6/13/2010 7:40 AM, Thomas Jollans wrote:

You want to contribute to the stdlib? No problem, it's easy! I did so
recently. You file an issue on the python.org bug tracker, describing
the problem, and attach a patch that fixes it. A nice developer with
commit rights will be with you shortly.


That is more true now than is used to be. Last week while reviewing 
older issues tagged with 2.5, I found

http://bugs.python.org/issue3129
a bug report with patch with no comments for two years. I verified that 
the problem still existed in 3.1, read the patch, suggested application, 
and now the fix has been applied to 3.2.


Three points here:
1. even if an issue does not get immediae attention, someone will see it 
eventually.

2. people are needed to make it sooner than later.
3. almost anyone reading this could have typed 'import struct' and 
pasted in the two examples, like I did, and report the result. People 
who cannot change the header fields as I did can request assistence on 
#python chat channed or post change suggestions here or email someone 
like me or just suggest changes in the issue message, which will very 
likely get seen by someone who can respond.


Terry Jan Reedy



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


efficiently create and fill array.array from C code?

2010-06-13 Thread Thomas Jollans
Hi,

I'm writing some buffer-centric number-crunching routines in C for
Python code that uses array.array objects for storing/manipulating data.
I would like to:

1. allocate a buffer of a certain size
2. fill it
3. return it as an array.

I can't see any obvious way to do this with the array module, but I was
hoping somebody here might be able to help. My best shot would be to:

1. create a bytearray with PyByteArray_FromStringAndSize(NULL, byte_len)
2. fill its buffer
3. initialize an array from the bytearray.

The issue I have with this approach is that array will copy the data to
its own buffer. I'd much rather create an array of a certain size, get a
write buffer, and fill it directly -- is that possible?

I expect that numpy allows this, but I don't really want to depend on
numpy, especially as they haven't released a py3k version yet.

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/13/10 9:14 AM, rantingrick wrote:
 On Jun 13, 1:50 am, Stephen Hansen me+list/pyt...@ixokai.io wrote:
 
 You don't argue a position; you don't support it with facts, logic,
 reason. You start immediately into this emotional rhetoric,
 pseudo-inspirational nonsense which just comes off as inane. It's like a
 bad cross between a politician and an self-help speaker, and the crux of
 your arguments are focused on that emotional charge-- how TCL is impure,
 gross, and its inclusion makes us less, makes us the mockery of the
 language world, how everyone loathes and detests it.
 
 Could it be that *you* are taking my opinions and suggestions too
 emotionality?

No. Your emotional impact on me has been zero.

However, all you do is spew emotionally charged rhetoric. It doesn't
actually *work*, you don't fire me up, inspire me, convince me that
you've somehow made a point and said something of substance, as I can
recognize you have not. You start from a certain point you want to make,
and instead of making it with an actual argument, you start spewing
emotionally-charged nonsense. This is what politicians do to try to get
around not saying anything of substance or supporting their positions.
They're just better at it.

Do you want quotes? Okay!

--

You: Insane asylums are filled to the rafters with these people. They walk
around with tin foil wrapped around their heads supposedly because
cell phone towers are really mind control devices. Well at least
thats their side of the story ;-). You can also compare this attitude
to a heart transplant recipient who says he doesn't want the heart if
it came from a black, brown, or yellow person. In that case the hatred
is race based but it is exactly the same thing as we have here. Hate
is hate no matter what form it takes or excuse it makes.

Translation: I make the vague allusion of an insane asylum, then
include blatant bigotry and ignorance, and make sure to bring up the
'hatred' card and therefore through these utterly irrelevant additions,
I have discredited the opposition and I am therefore right.

--

You: These people are the ones who cannot change with the times. You know
what they say.  Change with the times or get left behind. They
would rather hack together a curses front-end than to drop into a GUI,
yes really. You old timers need to get with the program, GUI is here
to stay until wet-ware interfaces take over. So drag yourself into the
21st century (kicking and screaming if necessary)

Translation: I realize there is a significant subset of the community
who believe that GUI's should not be included in the stdlib, and they
have made coherent arguments as to why: since I can not refute them
directly, I shall write them into the position of being an anachronism,
a thing of the past to be moved on from and pitied. Even though they
have not lobbied for a great Return to the Console and abandonment of
the mouse, I shall imply that they have so you can discredit their
opinions as mere fringe fanaticism.

--

You: Oh Please lets not help user in the age of
take-over-my-puter--all-my-
data, and-my-freedoms, and-then-force-me-to-be-a-slave-to-you-just-so-
i-can-use-my-data, with-your-permission, master! era. Yes i have seen
these GUI, HTML, CSS, Javascript freaks of nature and lament them
daily! What a nightmare! Give me a good ole GUI and get the hell outta
my way!

Translation: The reality that more then one modern GUI(both QT and the
latest from Microsoft come to mind) systems have incorporated technology
that originated on the web into their application-based user interface
systems (not to be confused with a web user interface) is not lost on
me, but for whatever reason I just object in principle. So, instead of
arguing against such technologies on their merit, I shall distract the
entire point into the realm of hype and web-based applications, and
remind people of the dangers of giving our data over to The Cloud, and
that the Web 2.0 is all about taking control away you.

--

You: But we sure don't need an embedded TCL interpretor packaged
with Python either *YUCK*!!!

Translation: Even though I have absolutely no idea what technological
problems having TCL bundled with Python presents, I'm going to appeal to
your inner purist and fanatic, and say: If its not in Python, its
rubbish! Just cuz.

--

You: psst, hey Guido, it's time to make your triumphant comeback to
c.l.p. We are waiting...

Translation: As part of my ongoing passive-aggressive Tea Party-like
anger towards the Establishment over on python-dev, I shall repeatedly
make references to the abandonment of The Community by Those in Power
(and Guido in particular), and through this shall continue to try to
inspire you my fellow brothers to rise up and take Python back! All the
while attempting to appear to be at least a member of the loyal opposition.

--

You: ... well just keep your negativity to yourself. When you have real
solutions or real ideas that could foster real solutions then for
Pete's 

Re: GUIs - A Modest Proposal

2010-06-13 Thread Terry Reedy

On 6/13/2010 7:20 AM, lkcl wrote:


I'm far from convinced that HTML and CSS are the One True Way
to design GUIs these days,


  if you have HTML the fileformat and CSS the fileformat in mind
when saying that, i can tell you right now that they're not.
fortunately, with the W3C DOM functions exposing properties and style
attributes, it's possible to manipulate the exact same attributes that
CSS and HTML files provide access to, using a declarative
programming style.


With all the glamour hoopla over html/css/xml, it took me a while to 
realize that the really important thing is the underlying object model 
that the serialization formats communicate. I know this is a bit like 
saying words are important because of the thougths they express (which 
is not to say that beauty of expression is unimportant), but my point is 
that in explaining pyjames, you are sometimes running up against a 
fascination with the surface layers. Pyjamas requires a different 
orientation.


Terry Jan Reedy

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/13/10 8:42 AM, rantingrick wrote:
 However, if the ivory towers continue to pretend that the rest
 of the Python community does not exist well then they will force my
 hand, and i will start a fork. Then we will have a sort of ironic
 situation... the very people who rail *against* me (and others) would
 actually be working *for* me unwillingly but without recourse. he-he
 Yes, as you've said karma *is* a bitch ;-)

There is nothing ironic about it.

They will not be working for you; and they will not actually care in the
least that you have forked the code. They will not mind. They will not
be hurt, hampered, threatened, or in any way inconvenienced. They will
continue to do what they always have done. Volunteer to a project that
they care about.

The terms of that volunteer donation is that the work is open source;
not just open source, but open source with a very liberal license, that
says anyone can do basically anything they want. Including package it up
in a commercial application and make millions without ever giving
anything back, if one so chooses.

They know the license. They are fully aware of the terms by which they
do their volunteer work. They don't care what you do with it.

Its yours to use as you please.

Welcome to Open Source (not to be confused with Free Software, where
they don't care what you *do* with it, but do care that if you share it,
you share it on their terms-- note this statement is intended to be
taken as a neutral statement and not a condemnation of one over the other).

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Stephen Hansen
On 6/13/10 10:15 AM, Thomas Jollans wrote:
 Hi,
 
 I'm writing some buffer-centric number-crunching routines in C for
 Python code that uses array.array objects for storing/manipulating data.
 I would like to:


Take this with a grain of salt: I am *not* a C programmer, and my usage
of the Python/C API is extremely minimal.

However, I think you're looking for The Buffer Interface. Its, IIUC, the
way to read/write efficiently into existing data structures without
having to go all Pythony.

It changed in Py3k: http://www.python.org/dev/peps/pep-3118/

Again: I may be entirely wrong. Not my area of expertise. But I lurk a lot.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing forms and labels in Python

2010-06-13 Thread Diez B . Roggisch
Monte Milanuk memila...@gmail.com wrote:
 On 6/13/10 8:00 AM, Joel Goldstick wrote:
 
  Why not go the other direction. Use python to do your processing,
  and
  send the results to excel. There are python modules that read and
  write
  excel files.
 
 Well... partly because Excel is not exactly cross-platform.  Granted,
 the mass majority of people using a program like I have in mind will
 be doing so on Windows, but I was hoping to *not* tie things to any
 one platform if I could avoid it.  Probably an overly ambitious goal
 at this point.
 
 The other part... maybe its my relative newbie experience level
 showing here, but having to call/open Excel to print something from a
 python app feels a little like admitting that python can't do it in a
 reasonable manner.  If I wanted to have to open Excel to print out the
 results, I think I'd just as soon spend the effort and make the whole
 thing an Excel/VBA app and skip python entirely.
 
 Perhaps (probably) I'm not understanding some of how the lower level
 systems stuff works here...  I thought the print drivers were there to
 take care of the low-level device-specific communication, and provide
 a somewhat simplified common interface for regular programs like M$
 Word, Open Office, Adobe Reader, etc. to use.  Those programs don't
 access the hardware directly, do they?  Don't they hand off the print
 job to the OS-specific print drivers, and let them handle the
 spooling, etc.?  From my (admittedly limited) understanding of things
 on Windows, Mac  Linux, that seems to be somewhat common between
 platforms. Isn't there some sort of module in Python to do the same? 
 I could understand it needing to be somewhat *platform* specific,
 perhaps... but I have old copies of M$ Office 2003 printing out just
 duckily on printers that only came out on the market less than a year
 ago.  I updated the printer drivers and changed the default printer,
 but nothing printer-related in Word or Excel changed (that I know
 of)... but it still manages to hand off to the operating system print
 drivers just fine... which is kind of what I figured Python would do.
 
 Is that (to some degree) what ReportLab does?

No. Reportlab just generates PDF files which your operating system
will print. If you know how to - there used to be times when you just
needed to copy a file to a printer device to print it. 

However, the overall problem here is that printer APIs are very
different between os and they aren't abstracted in python to some common
module. They need access to GUI libraries which python doesn't expose
out of the box. 

So as sad as it may sound - going through some native program such as
excel or acrobat to perform the printing might be your best bet. 

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Terry Reedy

On 6/13/2010 12:14 PM, rantingrick wrote:


I have documented time and again the poor state of IDLE. The only
responses i ever get are...

  Nobody uses IDLE
  Only a dumbass would use IDLE
  I have never used IDLE but i *know* nothing is wrong with it


Perhaps you are listening selectively. I have said more than once on 
this list that I use IDLE, I like using it, it works for me, AND I would 
like it improved. When a student proposed that as part of a Google 
Summer of Code project, I (and others) encouraged him to go ahead, which 
he did. Any concrete effort you make to improve IDLE would be 
appreciated by me. There are issues on the tracker already.


Terry Jan Reedy

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Steven D'Aprano
On Sun, 13 Jun 2010 08:42:57 -0700, rantingrick wrote:

 i will start a fork.

That is the most sensible thing you have said yet. Please do so, it will 
be a great thing for the Python community.


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


Re: Community (A Modest Proposal)

2010-06-13 Thread Someone Something
Here's the thing. Python has one of the nicest communities of most
software projects (except maybe ubuntu), try Perl or C. Unless you
completely know what you're talking about, have spent atleast 1/2 an
hour researching your problem, those guys will refrain from helping.

On Sun, Jun 13, 2010 at 1:45 PM, Terry Reedy tjre...@udel.edu wrote:
 On 6/13/2010 12:14 PM, rantingrick wrote:

 I have documented time and again the poor state of IDLE. The only
 responses i ever get are...

  Nobody uses IDLE
  Only a dumbass would use IDLE
  I have never used IDLE but i *know* nothing is wrong with it

 Perhaps you are listening selectively. I have said more than once on this
 list that I use IDLE, I like using it, it works for me, AND I would like it
 improved. When a student proposed that as part of a Google Summer of Code
 project, I (and others) encouraged him to go ahead, which he did. Any
 concrete effort you make to improve IDLE would be appreciated by me. There
 are issues on the tracker already.

 Terry Jan Reedy

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

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


Re: Printing forms and labels in Python

2010-06-13 Thread Monte Milanuk

On 6/13/10 10:23 AM, Diez B. Roggisch wrote:


However, the overall problem here is that printer APIs are very
different between os and they aren't abstracted in python to some common
module. They need access to GUI libraries which python doesn't expose
out of the box.


I know the usual response to what I'm about to say is Knock yourself 
out, let us know when you have something workable but I have to say it 
anyways... wow, that seems like such a gaping hole that I can't hardly 
believe its not filled.  Printing final results is a *huge* part of what 
I'm wanting to do.


Seems like it'd be a huge opportunity for someone wanting to 
improve/contribute to python, or like one of the 'summer of code' 
projects, etc.




So as sad as it may sound - going through some native program such as
excel or acrobat to perform the printing might be your best bet.


Opening Adobe Reader as a sort of 'print preview' might be a workable 
solution... since the results will likely need to be a) archived and b) 
emailed out to the group.



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


Re: Printing forms and labels in Python

2010-06-13 Thread Anssi Saari
Monte Milanuk memila...@gmail.com writes:

 Hello,

 I'm still a relative newbie to python, so I apologize if this is
 covered in detail somewhere and I missed it.

 I have a program or two that I want to work on once I get more
 proficient with python and sqlite and tkinter/wxpython.  One of the
 big 'features' of those programs I want to make is going to be
 printing out match results (scores) from a competition along with
 competitor names and other pertinent information.  Currently most
 people are doing this in Excel, though there is one (old) DOS program
 written in BASIC that not only prints the match results and the
 reports for the sanctioning body, but also prints labels via a Dymo
 Label maker.

I actually looked into label printers recently. It seems that at least
the cheaper models from Brother and Dymo accept a bitmap in specific
dimensions and they print it pixel exactly. Very simple, in other
words. But different printers need different formats, which is why
there are printer drivers. I'd assume the DOS program you mention
supports a very specific Dymo printer?

Anyways, for operating systems using CUPS for printing (that would be
Mac OS X, Linux, *BSD at least), there seems to be pycups which wraps
the CUPS API.

From a quick study of
http://timgolden.me.uk/python/win32_how_do_i/print.html, it looks like
in Windows you can just use the win32 APIs for printing, which is
hard. An easier alternative seems to be using PIL to generate a DIB
with your data in it and printing that.
-- 
http://mail.python.org/mailman/listinfo/python-list


Colour TIFF support (PIL or otherwise)

2010-06-13 Thread Hans Georg Schaathun
Does anyone know how to handle TIFF images in Python?

The pylab support uses PIL, and using either pylab or PIL directly,
it messes up the colour scheme.  It may look as if it loads CMY believing
that it is RGB, but I am not absolutely sure.

I have no problem handling Microsoft BMP colour images or
TIFF grayscale images.  (Although the latter is flipped around a
horizontal axes when I load it using PIL directly.)

[The TIFF images I use are generated using ImageMagick convert.
Yes, you are right, I can just as well convert to MicroSoft BMP
for this purpose, so it is not a big problem.  I would just want 
to know if a general solution, supporting as many file formats
as possible, is possible.]

Thanks for any pointers or hints
:-- George

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


Re: GUIs - A Modest Proposal

2010-06-13 Thread Mark Lawrence

On 12/06/2010 14:44, lkcl wrote:

On Jun 6, 10:49 pm, Kevin Walzerk...@codebykevin.com  wrote:

- Pythonic
- The default GUI (so it replaces Tkinter)
- It has the support of the majority of the Python community
- Simple and obvious to use for simple things
- Comprehensive, for complicated things
- Cross-platform
- Looks good (to be defined)
- As small as possible in its default form


These goals are not all complementary. In fact, some of them, such as
small and comprehensive, are mutually exclusive.


  that's not quite true - you can create a simple core which is easily
extensible with third party contributions to create more comprehensive
widgets.

  in the GWT arena, you have gwt-g3d, gwt-incubator, gwt-gchart and so
on, all of which were created very easily thanks to the power of the
underlying GWT core codebase, _none_ of which are actually included
into GWT by default, _all_ of which can be installed by users and
simply imported just like the core.

  now s/GWT/pyjamas and you have the exact same thing, and all the
satisfiable requirements are met.

  l.


I'd just like to say thanks for opening up this thread. I've never yet 
written any GUI in Python, but should I need to do so this your comments 
and the responses will certainly stick in my mind.


Kindest regards.

Mark Lawrence.

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


Re: Community (A Modest Proposal)

2010-06-13 Thread David Robinow
On Sun, Jun 13, 2010 at 1:57 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
 On Sun, 13 Jun 2010 08:42:57 -0700, rantingrick wrote:

 i will start a fork.

 That is the most sensible thing you have said yet. Please do so, it will
 be a great thing for the Python community.
 Eagerly awaiting the transfer of this thread to comp.lang.rython
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing forms and labels in Python

2010-06-13 Thread Joel Goldstick

Monte Milanuk wrote:

Hello,

I'm still a relative newbie to python, so I apologize if this is covered 
in detail somewhere and I missed it.


I have a program or two that I want to work on once I get more 
proficient with python and sqlite and tkinter/wxpython.  One of the big 
'features' of those programs I want to make is going to be printing out 
match results (scores) from a competition along with competitor names 
and other pertinent information.  Currently most people are doing this 
in Excel, though there is one (old) DOS program written in BASIC that 
not only prints the match results and the reports for the sanctioning 
body, but also prints labels via a Dymo Label maker.


I realized today that one thing I have never seen covered in any Python 
tutorial is how to format and print things to a physical printer.  I did 
a little bit of searching and didn't come up with much... either I'm 
really not using the right search terms, or physical printing is a black 
hole/art...?


TIA,

Monte

I agree with you that it seems surprising that there isn't a simple way 
to print with python.  Another idea, which you may well think of as 
overkill:


Use django or another web framework, and make your application a web 
app.  With this approach you can display output to a web page, and 
create a print stylesheet that can be finely tuned to print.


This ups your work to get involved with a web framework, but it lets you 
provide your application to users without the need to install.  It also 
makes it totally platform agnostic



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


Re: Printing forms and labels in Python

2010-06-13 Thread Monte Milanuk

On 6/13/10 11:12 AM, Anssi Saari wrote:


I actually looked into label printers recently. It seems that at least
the cheaper models from Brother and Dymo accept a bitmap in specific
dimensions and they print it pixel exactly. Very simple, in other
words. But different printers need different formats, which is why
there are printer drivers. I'd assume the DOS program you mention
supports a very specific Dymo printer?


Honestly, I don't know.  The interface of that program usually has me 
grinding my teeth within minutes.  It was written years ago, and is in 
fact now being updated... to a 'new' version of BASIC (still with a 
'DOS' interface) only because the existing version will not run on 
anything newer than Win XP due to memory issues (assuming I understood 
the problem correctly).  I was looking today and see that Dymo makes a 
SDK available that is supposed to be cross-platform (more specifically, 
download the SDK for the platform you want to use), but given the age of 
this setup... I'm guessing it was probably hard-coded to a particular 
device.


The labels are sliding backwards into the 'nice to have' category. 
Being able to print out the final results sheets (one or two pages at 
the end of the day) is the primary goal at this point.




Anyways, for operating systems using CUPS for printing (that would be
Mac OS X, Linux, *BSD at least), there seems to be pycups which wraps
the CUPS API.


From a quick study of

http://timgolden.me.uk/python/win32_how_do_i/print.html, it looks like
in Windows you can just use the win32 APIs for printing, which is
hard. An easier alternative seems to be using PIL to generate a DIB
with your data in it and printing that.


Actually... for the results sheet, the shellExecute method he described 
just might work.



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


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Stefan Behnel

Thomas Jollans, 13.06.2010 19:15:

I'm writing some buffer-centric number-crunching routines in C for
Python code that uses array.array objects for storing/manipulating data.
I would like to:

1. allocate a buffer of a certain size
2. fill it
3. return it as an array.


Take a look at a) NumPy and b) Cython. You can also use Cython with the 
array module, but NumPy is a much more common way to deal with number 
crunching routines, especially multi-dimentional arrays.


Cython interacts with both through the buffer interface, which Stephen 
Hansen already mentioned, but it also has support for Python versions that 
do not already have it, and it certainly makes the interaction between 
Python code and C code really easy. It's also an optimising (mostly) Python 
compiler that's used a lot for number crunching code, in case you are not 
really into writing the code in C.


Stefan

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


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Stephen Hansen
On 6/13/10 11:41 AM, Stefan Behnel wrote:
 Take a look at a) NumPy and b) Cython. You can also use Cython with the
 array module, but NumPy is a much more common way to deal with number
 crunching routines, especially multi-dimentional arrays.

Does Cython support Py3k yet? The OP seemed to be concerned about using
numpy due to it not yet being ready for 3+.

If so, that's very awesome.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Community (A Modest Proposal)

2010-06-13 Thread Mark Lawrence

On 13/06/2010 18:24, Stephen Hansen wrote:

On 6/13/10 8:42 AM, rantingrick wrote:


[big snip]

Stephen, you've tried as have others with this troll, but you're wasting 
your time.  As I said a day or two back by paraphrasing Tommy Docherty, 
Ranting Rick is to Python what King Herod was to baby sitting.


I guess the best thing to do is let the poor little child go home to 
mummy, grab his comfort blanket and teddy, have a lovely glass of warm 
milk and some biscuits, and then let mummy tuck him up safely in bed.


Do I hate him (I assume him), or despise him or whatever. No.  I feel 
very sorry for him.  As he is incapable of communicating effectively I 
seriously do wonder if he suffers from some form of autism, Asperger 
Syndrome maybe?


Seriously.

Mark Lawrence.


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


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Stefan Behnel

Stephen Hansen, 13.06.2010 21:05:

On 6/13/10 11:41 AM, Stefan Behnel wrote:

Take a look at a) NumPy and b) Cython. You can also use Cython with the
array module, but NumPy is a much more common way to deal with number
crunching routines, especially multi-dimentional arrays.


Does Cython support Py3k yet? The OP seemed to be concerned about using
numpy due to it not yet being ready for 3+.


I didn't read that from the post, but you may be right.

Cython supports Py 2.3-3.1+, but NumPy still does not support Py3k (they 
are actually considering to rewrite parts of it in Cython to simplify the 
migration ;).


If the OP is targeting Py3, the array module might still be a viable 
solution together with Cython.


Stefan

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


Re: Printing forms and labels in Python

2010-06-13 Thread Monte Milanuk

On 6/13/10 11:30 AM, Joel Goldstick wrote:

Use django or another web framework, and make your application a web
app.  With this approach you can display output to a web page, and
create a print stylesheet that can be finely tuned to print.

This ups your work to get involved with a web framework, but it lets you
provide your application to users without the need to install.  It also
makes it totally platform agnostic


Actually, this was kind of the way I originally started out (albeit 
looking at PHP  MySQL), for exactly those reasons, except one - the 
installation.  Everything else - the gui would be in a familiar browser 
frame of reference, and a lot of the get-this/send-that would be a bit 
simpler, plus it would be an extension of what I know (and am still 
learning) with html/css.


The installation is the big snafu.  This isn't something I can install 
on a remote server and just have the users (tournament coordinators and 
their data entry helpers) connect to over the internet.  99% of the 
time, it will be one person on one computer at a location that is lucky 
if they have a 110VAC power outlet nearby.  Any kind of external network 
access short of a cell modem is pretty much out of the question. 
LAN/Wifi access between machines for some parallel data entry would be 
nice, but still asking a lot.  Expecting the end user (volunteers) to 
install/configure Apache server, MySQL server, Python, and Django starts 
to sound to be a little far-fetched.  I'd had some hope for cherrypy or 
web2py since they appear to provide a local http server without needing 
all the ancilliary stuff... somehow I didn't get the impression Django 
worked that way?


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


Re: Printing forms and labels in Python

2010-06-13 Thread rantingrick
On Jun 13, 1:13 pm, Monte Milanuk memila...@gmail.com wrote:
 On 6/13/10 10:23 AM, Diez B. Roggisch wrote:

  However, the overall problem here is that printer APIs are very
  different between os and they aren't abstracted in python to some common
  module. They need access to GUI libraries which python doesn't expose
  out of the box.

 I know the usual response to what I'm about to say is Knock yourself
 out, let us know when you have something workable but I have to say it
 anyways... wow, that seems like such a gaping hole that I can't hardly
 believe its not filled.  Printing final results is a *huge* part of what
 I'm wanting to do.

 Seems like it'd be a huge opportunity for someone wanting to
 improve/contribute to python, or like one of the 'summer of code'
 projects, etc.

EXACTLY! This is a major missing piece of Python stdlib or at least a
needed 3rd party module. But in order for it to be adopted we need to
make it cross platform. I would also like to include some Image
Acquisition capabilities just to round out the usability of the thing.
I can help on the windows side unfortunately i know nothing of mac and
Linux so if anyone else wants to try to create a stdlib acceptable
module (or just a good 3rd party mod) i will offer my limited win32
experiences to the pile.

As far as printing raw text to a printer Tim Golden has posted some
code here. Although limited it's a good start...

   http://timgolden.me.uk/python/win32_how_do_i/print.html

Also i found an incomplete script many moons ago if you are
interested. It's needs polishing however it's a start. The script
processes raw test and organizes it into pages before sending the data
to printer (win32 only!) I cannot find the link but if anybody wants
the script contact me. I need to wrap it into a class.  It's pretty
ugly, albeit working code.


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


Re: Community (A Modest Proposal)

2010-06-13 Thread Stephen Hansen
On 6/13/10 12:08 PM, Mark Lawrence wrote:
 On 13/06/2010 18:24, Stephen Hansen wrote:
 On 6/13/10 8:42 AM, rantingrick wrote:
 
 [big snip]
 
 Stephen, you've tried as have others with this troll, but you're wasting
 your time.

Realistically, I know. However, http://xkcd.com/386/ currently has a
grip on my spine.

 Do I hate him (I assume him), or despise him or whatever. No.  I feel
 very sorry for him.  

I feel very little one way or the other. Largely emotionally neutral on
the whole thing.

 As he is incapable of communicating effectively I
 seriously do wonder if he suffers from some form of autism, Asperger
 Syndrome maybe?

No offense, but I don't find such speculations or discussion of mental
illness to be appropriate.

I take issue with his communication style, that's all.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Printing forms and labels in Python

2010-06-13 Thread Benjamin Kaplan
On Sun, Jun 13, 2010 at 12:25 PM, Monte Milanuk memila...@gmail.com wrote:
 On 6/13/10 11:30 AM, Joel Goldstick wrote:

 Use django or another web framework, and make your application a web
 app.  With this approach you can display output to a web page, and
 create a print stylesheet that can be finely tuned to print.

 This ups your work to get involved with a web framework, but it lets you
 provide your application to users without the need to install.  It also
 makes it totally platform agnostic

 Actually, this was kind of the way I originally started out (albeit looking
 at PHP  MySQL), for exactly those reasons, except one - the installation.
  Everything else - the gui would be in a familiar browser frame of
 reference, and a lot of the get-this/send-that would be a bit simpler, plus
 it would be an extension of what I know (and am still learning) with
 html/css.

 The installation is the big snafu.  This isn't something I can install on a
 remote server and just have the users (tournament coordinators and their
 data entry helpers) connect to over the internet.  99% of the time, it will
 be one person on one computer at a location that is lucky if they have a
 110VAC power outlet nearby.  Any kind of external network access short of a
 cell modem is pretty much out of the question. LAN/Wifi access between
 machines for some parallel data entry would be nice, but still asking a lot.
  Expecting the end user (volunteers) to install/configure Apache server,
 MySQL server, Python, and Django starts to sound to be a little far-fetched.
  I'd had some hope for cherrypy or web2py since they appear to provide a
 local http server without needing all the ancilliary stuff... somehow I
 didn't get the impression Django worked that way?


Django has its own http server, for debugging purposes. That should
work well enough for this.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Mark Dickinson
On Jun 13, 12:56 am, geremy condra debat...@gmail.com wrote:
 On Sat, Jun 12, 2010 at 4:40 PM, Robert Kern robert.k...@gmail.com wrote:
  On 2010-06-12 17:49 , geremy condra wrote:

  In Python3.2, calling math.erfc with a value in [-27.2, -30) raises
  an OverflowError: math range error. This is inconsistent with the
  erfc function from scipy (scipy.special.erfc) as well as with the C99
  function by the same name, both of which return 2. I suspect that
  this is the result of the cutoff for the use of the continuing fraction
  approximation of erfc beginning when abs(x)  30, but I'm not sure.
  Is this desired behavior or should I file a bug report?

  Bug, I think.

 Bug filed,http://bugs.python.org/issue8986.

A bug indeed.  Many thanks for catching and reporting this, Geremy;
it would have been embarrassing for Python 2.7 to be released with
this bug in it.  (Well, I would have been embarrassed, anyway; not
sure about anyone else.)

In case anyone cares, the bug was due to a misinterpreted errno
value:  there's an exp(-x*x) term in the formulas for erf(x) and
erfc(x), and that term underflows to zero at abs(x) =
sqrt(1075*log(2)), which is around 27.297.  Some system math libraries
(unfortunately not including the ones I tested on;  I *did* test,
honest!) set errno on underflow to zero;  this errno value was then
being misinterpreted as an indication of overflow by Python's general
libm wrappings.

Anyway, it's fixed now.

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Alf P. Steinbach

* Steven D'Aprano, on 13.06.2010 19:57:

On Sun, 13 Jun 2010 08:42:57 -0700, rantingrick wrote:


i will start a fork.


That is the most sensible thing you have said yet. Please do so, it will
be a great thing for the Python community.


Not nice to quote out of context, there was an if and a then earlier in 
Rick's sentence.


I don't think he'll do it, or if he does, I don't think it will fly.

There are two reasons why I think it won't fly if attempted. One is the 
technical aspect: it's just too much, and maintaining compatibility with 
libraries is in direct conflict with the goal of improvement. The other is 
social: I don't think it would be possible to establish a sufficiently large 
supportive community for something in direct competition with CPython.


What I think will happen regarding the future of Python is the same as currently 
is happening with C++. The language evolved or rather perhaps devolved into 
higher complexity than its users, and even the compiler vendors, felt 
comfortable with. And then a number of similar but simpler languages (e.g. 
Objective C and Walter Bright's D, not to mentioned C++ as a better C and 
various formalizations of that subset idea) started to fill some of the niche 
that C++ earlier had all of; this is still an ongoing process.


Comparing C++ and Python evolution may seem far fetched, but e.g. the C++ 
standardization working groups adopted the idea of PEPs from Python. In C++ 
they're called proposals or papers but it's much the same thing. Python has 
Guido, C++ has Bjarne. In both cases the original language was designed 
single-handedly by the god. And in both cases it's now essentially 
design-by-committee.



Cheers,

- Alf

--
blog at url: http://alfps.wordpress.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Robert Kern

On 2010-06-13 14:17 , Stefan Behnel wrote:

Stephen Hansen, 13.06.2010 21:05:

On 6/13/10 11:41 AM, Stefan Behnel wrote:

Take a look at a) NumPy and b) Cython. You can also use Cython with the
array module, but NumPy is a much more common way to deal with number
crunching routines, especially multi-dimentional arrays.


Does Cython support Py3k yet? The OP seemed to be concerned about using
numpy due to it not yet being ready for 3+.


I didn't read that from the post, but you may be right.

Cython supports Py 2.3-3.1+, but NumPy still does not support Py3k (they
are actually considering to rewrite parts of it in Cython to simplify
the migration ;).


The latest SVN of numpy works in Python 3.1 already. There are still some things 
to be fixed, but it's mostly done.


--
Robert Kern

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

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


Python OpenSSL library

2010-06-13 Thread astral
I am looking for Python OpenSSL library, for Python version 2.5.4 (on
Windows)
Which does not require to install Cygwin package. Need just to decrypt file,
then uninstall library.

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


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread Martin
On Jun 13, 6:15 pm, Thomas Jollans tho...@jollans.com wrote:
 Hi,

 I'm writing some buffer-centric number-crunching routines in C for
 Python code that uses array.array objects for storing/manipulating data.
 I would like to:

 1. allocate a buffer of a certain size
 2. fill it
 3. return it as an array.

 I can't see any obvious way to do this with the array module, but I was
 hoping somebody here might be able to help. My best shot would be to:

 1. create a bytearray with PyByteArray_FromStringAndSize(NULL, byte_len)
 2. fill its buffer
 3. initialize an array from the bytearray.

 The issue I have with this approach is that array will copy the data to
 its own buffer. I'd much rather create an array of a certain size, get a
 write buffer, and fill it directly -- is that possible?

 I expect that numpy allows this, but I don't really want to depend on
 numpy, especially as they haven't released a py3k version yet.

 -- Thomas

You want Numpy...

e.g.

import numpy as np
array = np.zeros(100, dtype=np.uint8)

then either something like this to fill it

for i in xrange(len(100)):
array[i] = 2

or

array = np.zeros(0)
for i in xrange(len(100)):
array = np.append(array, 2)


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


Python on Android Mobile?

2010-06-13 Thread Anthony Papillion
I know Python is growing in popularity and some of Palms devices
already let you run Python apps in a VM environment.  I'm wondering if
anyone knows (or can make an educated guess) if there are any plans
for Python to come to the Android environment?  I'm not talking
backend stuff here but full front and center like full GTK or WX
development for the devices?

Any thoughts?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a +b ?

2010-06-13 Thread Martin
On Jun 13, 5:46 pm, exar...@twistedmatrix.com wrote:
 On 04:25 pm, wuwe...@gmail.com wrote:





 Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
 No, I think your code is very simple. You can save a few lines by
 writing
 it like this:

 s = input('enter two numbers: ')
 t = s.split()
 print(int(t[0]) + int(t[1]))  # no need for temporary variables a and
 b

 Not that we're playing a round of code golf here, but this is a
 slightly nicer take on your version:

 one, two = input('enter two numbers: ').split()
 print(int(one) + int(two))

 I like names over subscripts, but that's just me :)

 Fore!

     print(sum(map(int, input('enter two numbers: ').split(

 Jean-Paul

Can't beat that for lack of syntax! I'd probably add a check just
because the OP did mention only two int's...

data = [int(i) for i in raw_input('Enter two integers:\n').split()]
if len(data) != 2:
print 'Only enter 2 integers!'
else:
print \n%d % sum(data)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python OpenSSL library

2010-06-13 Thread Michael Crute
On Sun, Jun 13, 2010 at 4:29 PM, astral
ast...@news.eternal-september.org wrote:
 I am looking for Python OpenSSL library, for Python version 2.5.4 (on
 Windows)
 Which does not require to install Cygwin package. Need just to decrypt file,
 then uninstall library.

You might want to take a look at m2crypto[0]. While I have not
personally run it on Windows (runs great on OS X and Linux) they do
provide pre-compiled Windows binaries.

[0] http://chandlerproject.org/bin/view/Projects/MeTooCrypto


-- 
Michael E. Crute
http://mike.crute.org

It is a mistake to think you can solve any major problem just with
potatoes. --Douglas Adams
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is the best implementation of LISP family of languages for real world programming ?

2010-06-13 Thread nanothermite911fbibustards
On Jun 12, 9:02 pm, Antti \Andy\ Ylikoski
antti.yliko...@gmail.com wrote:
 12.6.2010 22:54, Pascal J. Bourguignon kirjoitti:

  bolegagnuist...@gmail.com  writes:

  [PAIP]

  Is there anything in this old norvig book that makes it worth
  pursuing as a text ?

  Yes.

 I agree with his criticism that the book is old, mine stems from the
 year 1992.

 I bought and studied the Russell-Norvig books on Artificial
 Intelligence: A Modern Approach, ie. the 1th, 2nd (and in the future
 the 3rd edition), in order to learn modern AI theory.  They have
 discontinued the 3rd edition but I succeeded in ordering a copy anyway.
   I have read the 1st and the 2nd editions, but I have not yet received
 by mail the 3rd edition.

 But I only got the PAIP book to learn Common LISP, not in order to study
 modern AI.  This  is why I'm discussing this in the new:comp.lang.LISP
 newsgroup.

 Any good modern LISP textbooks out there?

 Can anyone point to me any other good modern textbooks on AI than the
 3rd edition of the Russell-Norvig book?  (Which is reputable.)

 kind regards, Antti Ylikoski
 Helsinki, Finland, the E.U.

Antti, did you forget to mention that in your love for the author and
publisher you paid an extra tip ;) ?

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


Re: Community (A Modest Proposal)

2010-06-13 Thread Anthony Papillion
 Why was the reaction so negative? Well i will admit some fault in the
 fact that i trashed Ruby pretty bad. I felt everything i said was true
 IMO then as is now (mostly). People should have a right to opinions.
 However since i was such an unknown and you could say a newbie,
 was this reaction warranted? I think not, and it speaks volumes to the
 negative attitudes within this community.

While I'm not new to software development in other languages, I'm
completely new to Python and the Python community.  I've only been
here about a week and have asked some pretty elementary questions
during that time only to be greeted respectfully and offered help.
From reading the posts on this group, it seems like the Python
community is much like any other programming (or even just volunteer
community): they're helpful if you show you're willing to do the work
yourself and if you show you've at least tried to solve the problem
yourself to a degree (even if you've failed).  Volunteer communities
have little patience for the 'do it for me' mindset as *everyone* is
busy with jobs, life, and their own pet projects.

Overall, I couldn't disagree with you more. I find most communities
(and the c.l.p community in particular) *very* accessible and very
helpful. On the other hand, I *could* see how your post could scare
off newbies from jumping in for fear of being 'attacked' as you say
you were. IMHO, your posts serves no purpose but to hurt the community
and scare away newbies.

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


Re: Python on Android Mobile?

2010-06-13 Thread geremy condra
On Sun, Jun 13, 2010 at 1:39 PM, Anthony Papillion papill...@gmail.com wrote:
 I know Python is growing in popularity and some of Palms devices
 already let you run Python apps in a VM environment.  I'm wondering if
 anyone knows (or can make an educated guess) if there are any plans
 for Python to come to the Android environment?  I'm not talking
 backend stuff here but full front and center like full GTK or WX
 development for the devices?

 Any thoughts?

There's the Android Scripting Environment, but it's not great, and its
a long way even from full Android development, let alone letting you
use things like GTK, which I doubt will ever happen. Last time I
looked you also couldn't build APKs with it, which basically rules it
out for use by people other than you.

There have also been a few ports of python to Android, including my
own basically wasted effort to bring Python3 to the platform and build
a complete wrapper for the necessary bits of Android. If you're bound
and determined to go with full Python on Android, this is the way to
go.

Having said that, Android has no dependency management, and so
you will have to distribute Python with your application and any other
application that wants to use it will be in the same boat. Since space
is limited on mobile devices, this isn't really an option.

Other approaches have been tried, but none that I know have been
successful- it turned out to be prohibitively difficult to teach Jython
to emit Dalvik bytecode, etc, etc.

Something I haven't seen is whether Cython could be used indirectly;
I don't have the knowledge or skill with it to do more than speculate,
but that might be a profitable avenue for investigation.

Wish I had better news for you,

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


Re: Python OpenSSL library

2010-06-13 Thread geremy condra
On Sun, Jun 13, 2010 at 1:29 PM, astral
ast...@news.eternal-september.org wrote:
 I am looking for Python OpenSSL library, for Python version 2.5.4 (on
 Windows)
 Which does not require to install Cygwin package. Need just to decrypt file,
 then uninstall library.

Evpy[1] is designed to be a very easy-to-use interface to OpenSSL,
although it is by design limited to doing things the right way, so it
may not meet your needs.

Full disclosure, I'm its author.

Geremy Condra

[1]: http://gitorious.org/evpy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python on Android Mobile?

2010-06-13 Thread Simon Brunning
On 13 June 2010 21:39, Anthony Papillion papill...@gmail.com wrote:
 I know Python is growing in popularity and some of Palms devices
 already let you run Python apps in a VM environment.  I'm wondering if
 anyone knows (or can make an educated guess) if there are any plans
 for Python to come to the Android environment?  I'm not talking
 backend stuff here but full front and center like full GTK or WX
 development for the devices?

Sadly, I gather that Google has no plans for this. But hey, it's open
source, right?

-- 
Cheers,
Simon B.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python OpenSSL library

2010-06-13 Thread astral

Michael Crute mcr...@gmail.com wrote in message
news:mailman.1395.1276462801.32709.python-l...@python.org...
 On Sun, Jun 13, 2010 at 4:29 PM, astral
 ast...@news.eternal-september.org wrote:
  I am looking for Python OpenSSL library, for Python version 2.5.4 (on
  Windows)
  Which does not require to install Cygwin package. Need just to decrypt
file,
  then uninstall library.

 You might want to take a look at m2crypto[0]. While I have not
 personally run it on Windows (runs great on OS X and Linux) they do
 provide pre-compiled Windows binaries.

 [0] http://chandlerproject.org/bin/view/Projects/MeTooCrypto


 -- 
 Michael E. Crute
 http://mike.crute.org

 It is a mistake to think you can solve any major problem just with
 potatoes. --Douglas Adams


which one is for windows, for Python version 2.5.4 ? And how to uninstall
when required?

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


Re: Python OpenSSL library

2010-06-13 Thread Michael Crute
On Sun, Jun 13, 2010 at 5:59 PM, astral
ast...@news.eternal-september.org wrote:
 You might want to take a look at m2crypto[0]. While I have not
 personally run it on Windows (runs great on OS X and Linux) they do
 provide pre-compiled Windows binaries.

 which one is for windows, for Python version 2.5.4 ? And how to uninstall
 when required?

I don't use windows so I can't help you with Windows specific
questions. The windows downloads are clearly marked for python 2.4,
2.5 and 2.6. Go back and read the entire page.

-- 
Michael E. Crute
http://mike.crute.org

It is a mistake to think you can solve any major problem just with
potatoes. --Douglas Adams
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python OpenSSL library

2010-06-13 Thread Stephen Hansen
On 6/13/10 2:59 PM, astral wrote:
 
 which one is for windows, for Python version 2.5.4 ? And how to uninstall
 when required?
 

You can try http://www.egenix.com/products/python/pyOpenSSL/ -- its
fairly low-level OpenSSL, but its pretty comprehensive.

And you uninstall it in Add  Remove Programs.  

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deformed Form

2010-06-13 Thread Ethan Furman

Stephen Hansen wrote:

On 6/12/10 12:50 PM, Dennis Lee Bieber wrote:


On Sat, 12 Jun 2010 14:42:27 -0400, Victor Subervi
victorsube...@gmail.com declaimed the following in
gmane.comp.python.general:



Interestingly,
ls -al
reveals *no* *.pyc files.



Which would seem to indicate that you have no user modules that are
imported into other modules when run. And that there is no sharing of
data between the modules you have.



Not really; pyc file generation is optional. Its a performance
enhancement, but if it doesn't work, there's no problem.

No pyc files indicates to me that the web process doesn't have *write*
access to this directory, which is actually entirely fine and dandy. I'd
just pre-compile them all first, because otherwise Python has to read
the original source, parse and build up bytecode for each file every
request.

I'd python -m compileall -f . whenever you edit a file and before testing.



I thought python (well, cpython, at least) didn't use .pyc files for the 
main script?


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


Re: efficiently create and fill array.array from C code?

2010-06-13 Thread geremy condra
On Sun, Jun 13, 2010 at 1:20 PM, Robert Kern robert.k...@gmail.com wrote:
 On 2010-06-13 14:17 , Stefan Behnel wrote:

 Stephen Hansen, 13.06.2010 21:05:

 On 6/13/10 11:41 AM, Stefan Behnel wrote:

 Take a look at a) NumPy and b) Cython. You can also use Cython with the
 array module, but NumPy is a much more common way to deal with number
 crunching routines, especially multi-dimentional arrays.

 Does Cython support Py3k yet? The OP seemed to be concerned about using
 numpy due to it not yet being ready for 3+.

 I didn't read that from the post, but you may be right.

 Cython supports Py 2.3-3.1+, but NumPy still does not support Py3k (they
 are actually considering to rewrite parts of it in Cython to simplify
 the migration ;).

 The latest SVN of numpy works in Python 3.1 already. There are still some
 things to be fixed, but it's mostly done.

This is excellent news, thanks for pointing this out.

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


Re: Deformed Form

2010-06-13 Thread Stephen Hansen
On 6/13/10 3:19 PM, Ethan Furman wrote:
 I thought python (well, cpython, at least) didn't use .pyc files for the
 main script?

You're right, it doesn't. I forgot about that interaction with CGI*.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

* Its been er, a decade, since I actually wrote a CGI script. Even my
throw-away little web scripts on my personal website aren't CGI. For
some reason, I do my throw-away junk in PHP, and only use Python for
full-scale web apps. (Hi, Pylons). Read into this what you will. :)



signature.asc
Description: OpenPGP digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python on Android Mobile?

2010-06-13 Thread Anthony Papillion
Thank you gentleman for your input. I'm starting to look at Python/GTK
for desktop development and was hoping there might also be something
for Android. Oh well, like Simon said (pardon the pun), it is open
source so... :-)

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


C interpreter in Lisp/scheme/python

2010-06-13 Thread bolega
I am trying to compare LISP/Scheme/Python for their expressiveness.

For this, I propose a vanilla C interpreter. I have seen a book which
writes C interpreter in C.

The criteria would be the small size and high readability of the code.

Are there already answers anywhere ?

How would a gury approach such a project ?

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


getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Vincent Davis
I just installed 2.6 and 3.1 from current maintenance source on Mac
OSx. When I am running as an interactive terminal session the up arrow
does not scroll thought the history of the py commands I have entered
I just get ^[[A. When I install from a compiled source it works fine.
Whats the fix for this?

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


Re: C interpreter in Lisp/scheme/python

2010-06-13 Thread geremy condra
On Sun, Jun 13, 2010 at 4:07 PM, bolega gnuist...@gmail.com wrote:
 I am trying to compare LISP/Scheme/Python for their expressiveness.

Try the programming languages shootout.

 For this, I propose a vanilla C interpreter. I have seen a book which
 writes C interpreter in C.

Good luck.

 The criteria would be the small size and high readability of the code.

 Are there already answers anywhere ?

Try the C language standard.

 How would a gury approach such a project ?

They would probably skip it, recognizing that undertaking this
project with the goal of comparing two languages was fraught
with methodological difficulties and likely to be a complete
waste of time. Assuming that by virtue of a wetware bug they
did decide to take it on, they would probably start by writing the
code and then post their take on the results rather than posting
first and waiting in breathless anticipation for the inevitably
snarky replies of their inferiors.

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


Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Vincent Davis
On Sun, Jun 13, 2010 at 5:28 PM, Gerry Reno gr...@verizon.net wrote:
 sounds like your keymapping got messed with.

 you could just:
 set -o vi
 python
 ESC, Ctrl-j
 and now ESC-k and ESC-j will take you back and forth in history (std vi
 editing)

This is done within python? Let make sure I am clear. This is only an
issue within the interactive python for the python dist I have built
from source not other pythons or terminal in general. I look into the
commands you suggested more but ESC-k and ESC-j don't sound very
appealing to me.

Thanks
Vincent

 -Gerry



 Jun 13, 2010 07:22:40 PM, vinc...@vincentdavis.net wrote:

 I just installed 2.6 and 3.1 from current maintenance source on Mac
 OSx. When I am running as an interactive terminal session the up arrow
 does not scroll thought the history of the py commands I have entered
 I just get ^[[A. When I install from a compiled source it works fine.
 Whats the fix for this?

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

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


Re: Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Gerry Reno

These command just allow you to use 'vi editing mode' within python. If you've ever navigated a file with vi to go up and down the document you'll immediately know how it works.-GerryJun 13, 2010 07:39:35 PM, vinc...@vincentdavis.net wrote:On Sun, Jun 13, 2010 at 5:28 PM, Gerry Reno  wrote: sounds like your keymapping got messed with. you could just: set -o vi python ESC, Ctrl-j and now ESC-k and ESC-j will take you back and forth in history (std vi editing)This is done within python? Let make sure I am clear. This is only anissue within the interactive python for the python dist I have builtfrom source not other pythons or terminal in general. I look into thecommands you suggested more but ESC-k and ESC-j don't sound veryappealing to me.ThanksVincent -Gerry Jun 13, 2010 07:22:40 PM, vinc...@vincentdavis.net wrote: I just installed 2.6 and 3.1 from current maintenance source on Mac OSx. When I am running as an interactive terminal session the up arrow does not scroll thought the history of the py commands I have entered I just get ^[[A. When I install from a compiled source it works fine. Whats the fix for this? Thanks Vincent -- http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: C interpreter in Lisp/scheme/python

2010-06-13 Thread Vinay

On 2010-06-13 16:07:54 -0700, bolega gnuist...@gmail.com said:


I am trying to compare LISP/Scheme/Python for their expressiveness.

For this, I propose a vanilla C interpreter. I have seen a book which
writes C interpreter in C.

The criteria would be the small size and high readability of the code.

Are there already answers anywhere ?

How would a gury approach such a project ?

Bolega


you could read scheme 9 from empty space. you can find it here 
http://www.t3x.org/


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


Re: Community (A Modest Proposal)

2010-06-13 Thread John Bokma
Someone Something fordhai...@gmail.com writes:

 Here's the thing. Python has one of the nicest communities of most
 software projects (except maybe ubuntu), try Perl or C. Unless you
 completely know what you're talking about, have spent atleast 1/2 an
 hour researching your problem, those guys will refrain from helping.

Not entirely true, but I do agree, as a long time Perl programmer, that
the Usenet Perl community has an above average share of asshats. I have
made several attempts to fix that, recent and in the past, but it's just
a small clique of regulars that consider themselves above a lot.

Compared to that I do consider this group (I read this via Usenet) a lot
more friendly.

On the other hand, I do agree that if one wants to learn a programming
language but considers looking in the obvious places (FAQ, perldoc,
etc.) already too much work that programming isn't for that person. And
that answering such questions will soon result in a vast stream of
questions by the same person, a lot of which could've been answered by a
few hours of self-study.


Anyway, thanks everybody here for keeping this place readable ;-)

Finally, regarding the readable thing: I prefer if people don't top
post, or at least don't quote the entire message at the bottom if they
consider their reply stand alone enough to warrant a top post.

-- 
John Bokma   j3b

Hacking  Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl  Python Development
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Sean DiZazzo
On Jun 13, 4:39 pm, Vincent Davis vinc...@vincentdavis.net wrote:
 On Sun, Jun 13, 2010 at 5:28 PM, Gerry Reno gr...@verizon.net wrote:
  sounds like your keymapping got messed with.

  you could just:
  set -o vi
  python
  ESC, Ctrl-j
  and now ESC-k and ESC-j will take you back and forth in history (std vi
  editing)

 This is done within python? Let make sure I am clear. This is only an
 issue within the interactive python for the python dist I have built
 from source not other pythons or terminal in general. I look into the
 commands you suggested more but ESC-k and ESC-j don't sound very
 appealing to me.

 Thanks
 Vincent



  -Gerry

  Jun 13, 2010 07:22:40 PM, vinc...@vincentdavis.net wrote:

  I just installed 2.6 and 3.1 from current maintenance source on Mac
  OSx. When I am running as an interactive terminal session the up arrow
  does not scroll thought the history of the py commands I have entered
  I just get ^[[A. When I install from a compiled source it works fine.
  Whats the fix for this?

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



There used to be a problem with readline support in Mac.  Not sure if
the problem still exists in Leopard/Snow Leopard.

Google for python mac readline and you will find some stuff.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Irmen de Jong

On 14-6-2010 1:19, Vincent Davis wrote:

I just installed 2.6 and 3.1 from current maintenance source on Mac
OSx. When I am running as an interactive terminal session the up arrow
does not scroll thought the history of the py commands I have entered
I just get ^[[A. When I install from a compiled source it works fine.
Whats the fix for this?

Thanks
Vincent


I'm guessing you don't have the readline module.

Compile and install GNU Readline, then type 'make' again in your Python 
source tree. It should now no longer report a missing 'readline' module.


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


Re: getting up arrow in terminal to scroll thought history of python commands

2010-06-13 Thread Gerry Reno

sounds like your keymapping got messed with.you could just:set -o vipythonESC, Ctrl-jand now ESC-k and ESC-j will take you back and forth in history (std vi editing)-GerryJun 13, 2010 07:22:40 PM, vinc...@vincentdavis.net wrote:I just installed 2.6 and 3.1 from current maintenance source on MacOSx. When I am running as an interactive terminal session the up arrowdoes not scroll thought the history of the py commands I have enteredI just get ^[[A. When I install from a compiled source it works fine.Whats the fix for this?ThanksVincent-- http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Mark built-in module as deprecated

2010-06-13 Thread moerchendiser2k3
PyErr_WarnEx(PyExc_DeprecationWarning, foo deprecated. use fuzz,
1);

But where can I write this? With Py_InitModule4 I can just
pass a list of functions but no real execution part which
is executed when a module is imported.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: C interpreter in Lisp/scheme/python

2010-06-13 Thread Gene
On Jun 13, 7:07 pm, bolega gnuist...@gmail.com wrote:
 I am trying to compare LISP/Scheme/Python for their expressiveness.

 For this, I propose a vanilla C interpreter. I have seen a book which
 writes C interpreter in C.

 The criteria would be the small size and high readability of the code.

 Are there already answers anywhere ?

 How would a gury approach such a project ?

Probably doesn't meet your intent, but this is a really impressive bit
of (whacky) art:

http://www.ioccc.org/1996/august.hint

and find the code at

http://www.ioccc.org/years-spoiler.html

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


Re: math.erfc OverflowError

2010-06-13 Thread D'Arcy J.M. Cain
On 13 Jun 2010 09:49:03 -0700
a...@pythoncraft.com (Aahz) wrote:
 Bug filed, http://bugs.python.org/issue8986.
 
 Please don't put extraneous punctuation on URLs.  That period is a valid
 URL character, but it's invalid for this URL, and it's not obvious to the
 reader whether the period should be part of the URL.  URLs in general
 should go on their own line, but at least separate them with whitespace
 (or use the icky angle-bracket hack supported by most mail/newsreaders).

Or get a proper mail/news reader.  That URL is perfectly fine.  Any
reader that can't figure out that URLs never end with a period should
be chucked.  This ain't the seventies where people had to format their
input exactly as the computer demanded.

-- 
D'Arcy J.M. Cain da...@druid.net |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Aahz
In article mailman.1409.1276477866.32709.python-l...@python.org,
D'Arcy J.M. Cain da...@druid.net wrote:
On 13 Jun 2010 09:49:03 -0700
a...@pythoncraft.com (Aahz) wrote:
 
 Please don't put extraneous punctuation on URLs.  That period is a valid
 URL character, but it's invalid for this URL, and it's not obvious to the
 reader whether the period should be part of the URL.  URLs in general
 should go on their own line, but at least separate them with whitespace
 (or use the icky angle-bracket hack supported by most mail/newsreaders).

Or get a proper mail/news reader.  That URL is perfectly fine.  Any
reader that can't figure out that URLs never end with a period should
be chucked.  This ain't the seventies where people had to format their
input exactly as the computer demanded.

What's your cite that URLs never end with a period?  AFAIK, that's
perfectly valid by the rules.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


The Python Web Authoring and Application Pages

2010-06-13 Thread travis
I've got five pages of information linked to from here:

http://www.subspacefield.org/~travis/

LWMLs
template systems
static web page generators
microframeworks
web app frameworks

It seems like many web app programmers and web authors know one
system, or possibly two, and so you don't often get good answers to
the questions like which one should I choose?, and what features
would make me choose one over the other?  I suppose this is because
most people just have to use whatever their employer is using, and few
are in the enviable position of being able to choose.

Man, that is a lot of work.  And it just keeps growing; as I track
down web app frameworks, for example, I discover new templating
systems, and have to go back and update _that_ information, and then
have to figure out if the other web app frameworks support it, and it
also references some more templating languages as influencing it, and
it just goes on and on...

If I hadn't scrapped the idea of covering this for all languages, ruby
and PHP would have given a combinatorial explosion beyond all
measure..

For those who'd like to see such information overload, my initial
attempt at this is here:

http://www.subspacefield.org/~travis/static_blog_generators.html
-- 
A Weapon of Mass Construction
My emails do not have attachments; it's a digital signature that your mail
program doesn't understand. | http://www.subspacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get blacklisted.


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


Re: Community (A Modest Proposal)

2010-06-13 Thread Steven D'Aprano
On Sun, 13 Jun 2010 22:14:34 +0200, Alf P. Steinbach wrote:

 * Steven D'Aprano, on 13.06.2010 19:57:
 On Sun, 13 Jun 2010 08:42:57 -0700, rantingrick wrote:

 i will start a fork.

 That is the most sensible thing you have said yet. Please do so, it
 will be a great thing for the Python community.
 
 Not nice to quote out of context, there was an if and a then earlier
 in Rick's sentence.

And regardless of the qualifications he gave, RantingRick starting his 
own fork will be a wonderful thing for oh so many reasons.


 I don't think he'll do it, or if he does, I don't think it will fly.

Please don't discourage him.

What the Python community needs more than anything else right now is for 
RantingRick to create a community of all those who share his vision for 
the future without all the negative energy from those who disagree with 
him. I encourage him to start immediately.


 I don't think it would be possible to establish a
 sufficiently large supportive community for something in direct
 competition with CPython.

The CPython developers (particularly Guido) are explicitly encouraging 
alternate implementations. I can't find the exact quote, but as I 
understand it, Guido's vision is to keep CPython as the reference 
implementation while encouraging people to use whatever implementation 
meets their specific needs, rather than trying to make CPython all things 
for all people.

For example, the moratorium on new features to the language was 
explicitly to give Jython, IronPython and other implementations time to 
catch up to CPython 3.1.

If RantingRick believes that CPython is not going in the direction that 
the community wants, he should create his own implementation. If he 
builds something the community wants, they will come.

If an alternative implementation is too much for him, even a repackaged 
distribution like Komodo or similar would be a great thing. Let him 
repackage CPython with whatever GUI toolkit he thinks the community wants.



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


  1   2   >