Re: What YAML engine do you use?

2005-01-24 Thread Doug Holton
rm wrote:
Doug Holton wrote:
rm wrote:
this implementation of their idea. But I'd love to see a generic, 
pythonic data format.

That's a good idea.  But really Python is already close to that.  A 
lot of times it is easier to just write out a python dictionary than 
using a DB or XML or whatever.  Python is already close to YAML in 
some ways. 
true, it's easy enough to separate the data from the functionality in 
python by putting the data in a dictionary/list/tuple, but it stays 
source code.
Check out JSON, an alternative to XML for data interchange.  It is 
basically just python dictionaries and lists:
http://www.crockford.com/JSON/example.html

I think I would like this better than YAML or XML, and it looks like it 
already parses as valid Python code, except for the /* */ multiline 
comments (which boo supports).

It was mentioned in a story about JSON-RPC-Java:
http://developers.slashdot.org/article.pl?sid=05/01/24/125236
--
http://mail.python.org/mailman/listinfo/python-list


Re: What YAML engine do you use?

2005-01-22 Thread Doug Holton
Fredrik Lundh wrote:
A.M. Kuchling wrote:

IMHO that's a bit extreme.  Specifications are written to be detailed, so
consequently they're torture to read.  Seen the ReStructured Text spec
lately?

I've read many specs; YAML (both the spec and the format) is easily
among the worst ten-or-so specs I've ever seen.
What do you expect?  YAML is designed for humans to use, XML is not. 
YAML also hasn't had the backing and huge community behind it like XML.
XML sucks for people to have to write in, but is straightforward to 
parse.  The consequence is hordes of invalid XML files, leading to 
necessary hacks like the mark pilgrim's universal rss parser.  YAML 
flips the problem around, making it harder perhaps to implement a 
universal parser, but better for the end-user who has to actually use 
it.  More people need to work on improving the YAML spec and 
implementing better YAML parsers.  We've got too many XML parsers as it is.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What YAML engine do you use?

2005-01-22 Thread Doug Holton
Fredrik Lundh wrote:
and trust me, when things are hard to get right for developers, users will
suffer too.
That is exactly why YAML can be improved.  But XML proves that getting 
it right for developers has little to do with getting it right for 
users (or for saving bandwidth).  What's right for developers is what 
requires the least amount of work.  The problem is, that's what is right 
for end-users, too.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What YAML engine do you use?

2005-01-22 Thread Doug Holton
rm wrote:
this implementation of their idea. But I'd love to see a generic, 
pythonic data format.
That's a good idea.  But really Python is already close to that.  A lot 
of times it is easier to just write out a python dictionary than using a 
DB or XML or whatever.  Python is already close to YAML in some ways. 
Maybe even better than YAML, especially if Fredrik's claims of YAML's 
inherent unreliability are to be believed.  Of course he develops a 
competing XML product, so who knows.
--
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] XML design intent [was Re: What YAML engine do you use?]

2005-01-22 Thread Doug Holton
Peter Hansen wrote:
   Good question. The point is that an XML document is sometimes
   a file, sometimes a record in a relational database, sometimes an
   object delivered by an Object Request Broker, and sometimes a
   stream of bytes arriving at a network socket.
   These can all be described as data objects.

I would ask what part of that, or of the simple phrase
data object, or even of the basic concept of a markup language,
doesn't cry out data interchange metalanguage to you?
Actually I don't see any explicit mention that XML was meant to be 
limited to data interchange only.
data object has to do with more than data interchange.  There is data 
entry as well.  And people are having to hand enter XML files all the 
time for things like Ant, XHTML, etc.

I guess all those people who learned how to write web pages by hand were 
violating some spec and so they have no cause to complain about any 
difficulties doing so.  Tim Berners-Lee never intended people to have to 
type in URLs, either, but here we are.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What YAML engine do you use?

2005-01-22 Thread Doug Holton
Steve Holden wrote:
Yet again I will interject that XML was only ever intended to be wriiten 
by programs. Hence its moronic stupidity and excellent uniformity.
Neither was HTML, neither were URLs, neither were many things used the 
way they were intended.  YAML, however, is specifically designed to be 
easier for people to write and to read, as is Python.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What YAML engine do you use?

2005-01-22 Thread Doug Holton
You might like programming in XML then: http://www.meta-language.net/
Actually, the samples are hard to find, they are here:
http://www.meta-language.net/sample.html
Programming in XML makes Perl and PHP look like the cleanest languages 
ever invented.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Game programming in Python

2005-01-11 Thread Doug Holton
Baza wrote:
I'm looking for any books or on-line resources on game programming using
Python. Does anyone have any advice?
See http://pygame.org/
There is also a book called Game Programming with Python.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Windows GUIs from Python

2005-01-11 Thread Doug Holton
Bob Swerdlow wrote:
Anyone have opinions about whether we will be better off using PythonNet or 
wxPython for the GUI layer of our application on Windows?  Our code is all 
Python and is now running on Mac OS X with PyObjC and Cocoa, which works 
very well.  Our goal is not necessarily to move to a cross-platform 
solution, but rather to create a solid Windows version that looks and feels 
like a native application.  All the code that interacts with the user is 
factored out of our business logic, so it is a matter of find a good 
view/controller library and writing a thin glue layer.  And, of course, we 
want to build it as efficiently and robustly as we can.
I would also recommend wxPython.  It runs on Macs, too, so you can at 
least see how it compares to your PyObjC interface and keep primarily 
developing on your Mac.
You might also be interested in PyGUI although it doesn't have a native 
Windows implementation yet: 
http://nz.cosc.canterbury.ac.nz/~greg/python_gui/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Embedding a restricted python interpreter

2005-01-06 Thread Doug Holton
Rolf Magnus wrote:
Hi,
I would like to embed a python interpreter within a program, but since that
program would be able to automatically download scripts from the internet,
I'd like to run those in a restricted environment, which basically means
that I want to allow only a specific set of modules to be used by the
scripts, so that it wouldn't be possible for them to remove files from the
hard drive, kill processes or do other nasty stuff.
Is there any way to do that with the standard python interpreter?
Hi, there is a page on this topic here:
http://www.python.org/moin/SandboxedPython
The short answer is that it is not possible to do this with the CPython, 
but you can run sandboxed code on other virtual machines, such as Java's 
JVM with Jython, or .NET/Mono's CLR with Boo or IronPython.

In the future it may also be possible to do this with PyPy or Parrot.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How do I make Windows Application with Python ?

2005-01-05 Thread Doug Holton
BOOGIEMAN wrote:
Thanks all for very detailed answers. BTW I tried this one but it seems
that it doesn't use VS'es visual designer. Also it doesn't have build
option so it is basicly only usefull to higlight Python syntax.
Active Sate Komodo looks like much better choice
I don't know of any python IDE with a visual designer and a build to exe 
option.

But since you are familiar with Visual Studio and you are developing on 
Windows, you might check out the free SharpDevelop IDE: 
http://www.icsharpcode.net/OpenSource/SD/

Then unzip this boo add-in into the SharpDevelop folder under Program 
Files: http://coedit.net/boo/BooBinding.zip

Then you can start up SharpDevelop, create a new boo project, press the 
green play button, and your exe will be built and executed (the one 
below is only 4kb in size).  We are working on adding support for 
SharpDevelop's visual form designer soon.

To show a Windows message box instead of printing to the console like 
you were asking earlier, you can use code like this:

import System.Windows.Forms
MessageBox.Show(your message)
Or for a more complete windows app:
import System.Drawing
import System.Windows.Forms
class MainForm(Form):
def constructor():
self.Text = My Window

b = Button(Text: Click Me)
b.Location = Point(100,75)
b.Click += def():
MessageBox.Show(Button clicked)
#or:
#b.Click += OnButtonClick
self.Controls.Add(b)
def OnButtonClick():
MessageBox.Show(Button clicked)
f = MainForm()
Application.Run(f)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python evolution: Unease

2005-01-04 Thread Doug Holton
Istvan Albert wrote:
But if python
were to become overly complicated I'll find something else.
Three years ago I have not not used python at all, now I'm
using it for everything.
You're in luck, python 2.4 won't be significantly changing anytime soon.
PS. why can't decorators solve this optional type checking
problem? I clearly remember this as being one of the
selling points for having decorators in the first place...
Because they are quite obviously an ugly and overly complicated 
solution.  Even Guido understood this:
http://mail.python.org/pipermail/python-dev/2004-September/048518.html

A warning: some people have shown examples of extreme uses of
decorators. I've seen decorators proposed for argument and return type
annotations, and even one that used a decorator to create an object
that did a regular expression substitution. Those uses are cute, but I
recommend being conservative when deciding between using a decorator
or some other approach, especially in code that will see a large
audience (like 3rd party library packages). Using decorators for type
annotations in particular looks tedious, and this particular
application is so important that I expect Python 3000 will have
optional type declarations integrated into the argument list.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python evolution: Unease

2005-01-04 Thread Doug Holton
Istvan Albert wrote:
Doug Holton wrote:
application is so important that I expect Python 3000 will have
optional type declarations integrated into the argument list.

I think that *optional* part of the optional type declaration
is a myth.
It may be optional in the sense that the language will
accept missing declarations but as soon as the feature
is available it will become mandatory to use it
(peer pressure, workplace practices).
I didn't write that, Guido did.  I agree with you, and others who have 
made the same point you made.  I would have to think Guido is already 
aware of this issue (keep python simple).  I'm not sure what his 
motivations are for wanting to add static typing to python, not that I'm 
against it.

It doesn't matter a whole lot either way since Python 3000 is still 
years away and you can already do static typing now with Pyrex or boo, 
as well as many other things that people have requested for python from 
little things like ++i to bigger features like multi-line anonymous 
methods/closures.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What can I do with Python ??

2005-01-01 Thread Doug Holton
BOOGIEMAN wrote:
Thanks everybody, I downloaded latest windows version and
Python-Docs-2.4 archive. Is that enough for absolute beginner.
Is there any e-book, step by step guide ... etc for download,
or anything else important what I have to know before I start
learning Python ?
The main thing I would do is subscribe to the python-tutor list.  It is 
the best place by far to ask any questions when you are learning to use 
python: http://mail.python.org/mailman/listinfo/tutor

Second, here are some of the best tutorials specifically designed for 
people with little or no previous programming experience:
http://www.honors.montana.edu/~jjc/easytut/easytut/
http://www.freenetpages.co.uk/hp/alan.gauld/
http://www.dickbaldwin.com/tocpyth.htm
http://www.ibiblio.org/obp/pyBiblio/

And lastly, really a great way to learn is to look at what's already out 
there in python.  Try out some of the many 3rd party libraries and 
programs for python:
For games: http://pygame.org/
For GUI applications: http://www.wxpython.org/
and others: http://www.python.org/pypi
--
http://mail.python.org/mailman/listinfo/python-list


Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Doug Holton
Steven Bethard wrote:
Simo Melenius wrote:
map (def x:
 if foo (x):
 return baz_1 (x)
 elif bar (x):
 return baz_2 (x)
 else:
 global hab
 hab.append (x)
 return baz_3 (hab),
 [1,2,3,4,5,6])

I think this would probably have to be written as:
Right the comma plus other things make this difficult for a parser to 
handle correctly.  Other people have already come up with working solutions.

We have a special way to pass a multiline closure as a parameter to a 
function.  Put it outside the parameter list.

First, the single-line way using curly braces:
newlist = map({x as int | return x*x*x}, [1,2,3,4,5,6])
Then the multi-line way.  I had to add an overload of map to support 
reversing the order of parameters (list first, then the closure):

newlist = map([1,2,3,4,5,6]) def (x as int):
 return x*x*x
for item in newlist:
 print item
--
http://mail.python.org/mailman/listinfo/python-list


Re: argument type

2004-12-28 Thread Doug Holton
It's me wrote:
The argument I wish to pass is either one string, or a list of strings, or a
tuple of strings.
For instance, I have:
def abc(arg1, arg2, arg3)
Let say that I expect arg1 and arg3 to be a number, and arg2 can be either
one string, or a bunch of strings and I need to do something on each of the
strings passed down.  

def seq(x):
if hasattr(x,__iter__):
return x
else:
return (x,)

def abc (arg1, arg2, arg3):
for item in seq(arg2):
print item

abc(1,test1,2)
abc(1,[test1,test2],2)
abc(1,2,3)
abc(1,[2,3,4],5)
abc(1,(2,3,4),5)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Other notes

2004-12-28 Thread Doug Holton
[EMAIL PROTECTED] wrote:
for i in 1..12: pass
for c in a..z: pass

 @infix
 def interval(x, y): return range(x, y+1) # 2 parameters needed
 assert 5 interval 9 == interval(5,9)

 10) There can be something in the middle between the def statement and
 the lambda.
These will likely not appear in CPython standard, but Livelogix runs on 
top of the CPython VM and supports .. sequences and custom infix 
operators: http://logix.livelogix.com/tutorial/5-Standard-Logix.html

11) This is just a wild idea for an alternative syntax to specify a
global variable inside a function. From:
def foo(x):
global y
y = y + 2
(the last two lines are indented)
To:
def foo(x): global.y = global.y + 2
Beside the global.y, maybe it can exist a syntax like upper.y or
caller.y that means the name y in the upper context. upper.upper.y etc.
This will also likely never appear in Python.  I like your idea though. 
 I implemented the same exact thing a couple months ago.  One 
difference though, you only need to type out the full global.y if you 
want to differentiate it from a local variable with the same name.


15) NetLogo is a kind of logo derived from StarLogo, implemented in
Java.
Show that this language is only partially a toy, and it can be useful
to understand and learn nonlinear dynamics of many systems.
If you want to do something like Netlogo but using Python instead of 
Logo, see:  http://repast.sourceforge.net/
You can script repast in jython or you can script repast.net.

Also, you might request the NetLogo and StarLogo developers to support 
Jython (in addition to Logo) scripting in their next version (which is 
already in development and supports 3D).
--
http://mail.python.org/mailman/listinfo/python-list


Re: Optional Static Typing

2004-12-23 Thread Doug Holton
[EMAIL PROTECTED] wrote:
Adding Optional Static Typing to Python looks like a quite complex
thing, but useful too:
http://www.artima.com/weblogs/viewpost.jsp?thread=85551
Thanks for pointing out that article by Guido van Rossum.  Looks like it 
just came out today.  It is something that may be added to Python 3.0:
http://www.python.org/moin/Python3.0

Sometimes it can be useful to mix parts with static typing and parts
without it in the same module (because dynamic typing is very useful
sometimes), but some other times you want to be sure to have a full
typed and checked module. 
The closest option right now in CPython is to use Pyrex.
http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/
 Boo (http://boo.codehaus.org/) is a different language, but I like its
 as instead of : and -, to have:
 def min(a as iterable(T)) as T:
 Instead of:
 def min(a: iterable(T)) - T:
Right, you're first example is how Boo does it, and the 2nd is how Guido 
proposed to do it in Python 3.0.

Boo flips the problem around.  Instead of optional static typing, 
everything is statically typed by default (but with type inference so 
you do not always need to explicitly declare the type), and it has 
optional runtime typing that works like python's (duck typing).
http://svn.boo.codehaus.org/trunk/tests/testcases/integration/duck-2.boo?view=auto
http://svn.boo.codehaus.org/trunk/examples/duck-typing/XmlObject.boo?view=auto
http://svn.boo.codehaus.org/trunk/tests/testcases/integration/duck-5.boo?view=auto
http://boo.codehaus.org/Duck+Typing

And there are some disadvantages to doing it this way.  It means Python 
is more flexible to use than Boo, as I stated a couple months back:
http://groups-beta.google.com/group/comp.lang.python/messages/c57cf0e48827f3de,a750c109b8ee57c3,cf89205a5e93051e,cfb1c7453e1f3c07,58a2dedd1059783e,8a1ee82cc328d023,7a51cdc9ffecbc72,38304f35cb42bb63,fc5e4ae1cbae0248,2de118caa7010b30?thread_id=5a7018d37b7bf4b8mode=threadnoheader=1q=boo+python-like#doc_7a51cdc9ffecbc72
--
http://mail.python.org/mailman/listinfo/python-list


Re: regular expression: perl == python

2004-12-22 Thread Doug Holton
Fredrik Lundh wrote:
JZ [EMAIL PROTECTED] wrote:

import re
line = The food is under the bar in the barn.
if re.search(r'foo(.*)bar',line):
 print 'got %s\n' % _.group(1)

Traceback (most recent call last):
  File jz.py, line 4, in ?
print 'got %s\n' % _.group(1)
NameError: name '_' is not defined
He was using the python interactive prompt, which I suspect you already 
knew.
--
http://mail.python.org/mailman/listinfo/python-list


Re: newbie question

2004-12-22 Thread Doug Holton
Stephen Waterbury wrote:
Luis M. Gonzalez wrote:
Amyway, I wouldn't want to use this list to talk about Boo, because I
think that the best place to do it is comp.lang.boo.
However, since I think it is definetely python related (I know you
disagree, but others don't) I see no harm in mentioning it here
occasionally.

Luis, that is *exactly* Peter's position:
Peter Hansen wrote:
... If Doug wants to come in from time to time and mention Boo,
however, he's welcome to do so.  ...

... so there is no need for you to say you see no harm in it,
making it sound as though Peter *does* see harm in it.
You can defend Peter all you want, but you can't take back the other 
things he has said which you did not cite.

Quote:
I think doing this by defending Doug's postings, however, might weaken
the strength of your position just a little. (Okay, I mean a lot.) 
A flame.
Quote:
About the only time the word boo _does_ come up, it comes up
in one of Doug's posts, often in an apparent attempt to help
a Python newbie by pointing him in a misleading manner
A misrepresentation of my intentions.  If someone asks if python has 
interfaces, and I say first, pyprotocols has something similar, but boo 
does have support for real interfaces, then that is help and that is 
not misleading in the slightest.

Quote:
As a result of all the activity in the Boo who? thread, however, 
He failed to mention that he is the one who started and propagated this 
very thread, which devolved into nothing more than a flame-fest, which 
was his intention all along.

Quote:
I went and searched a bit to find out who this Doug character is. 
Another flame, and we are still in the same note by Peter Hansen, folks.
Quote:
It turns out that he's been mentioning Boo in postings *to newbies*
repeatedly over the last few months.
*to newbies* - oh my god, dare I mention the word boo to a newbie. 
Another mischaracterization of what I did.

Quote:
These are people trying
to use Python, having a question or difficulty about it, and he
launches into a sales job about some other language. 
I am not selling anything.  This is a subtle flame related to calling me 
an evangelist.  Does Peter Hansen make money using python?  Does he 
have something to sell at engcorp that uses CPython?

Quote:
Would you defend someone who came into this group and responded
(admittedly helpfully, sometimes, in other ways) to newbie
questions by constantly saying you can do this much more easily
in Perl of course, see www.perl.codehaus.org? 
Another complete mischaracterization of what I did.  When someone asks 
for something that they cannot do in python, then I noted alternative 
solutions, such as jython or boo or whatever tool is best for the job.

Quote:
Then downright offensive.
Another flame.
Quote:
What Doug has been doing is like standing at the door of
a mission run by a church a...
Yet again, another flame.
Quote:
he turns on them and accuses them
of religious persecution, and being unfriendly to boot. 
Another mischaracterization.  In fact, a complete lie.
I'm only halfway through his message.  It would take me all day to point 
out all his flames.
--
http://mail.python.org/mailman/listinfo/python-list


Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Steve Holden wrote:
 'Scuse me? This group has a long history of off-topic posting, and
 anyway who decided that CPython should be the exclusive focus? Even
 on-topic we can talk about Jython and PyPy as well as CPython.

 Off-topic we can talk about what we damned well please. Even boo :-)
Thankyou, that's the most intelligent thing you've said all week.
--
http://mail.python.org/mailman/listinfo/python-list


Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Ed Leafe wrote:
You've missed the obvious: it's 'criticism' or 'observation' when it 
comes from Doug, but it's a 'flame' when it is directed at Doug.

Unless there is something more substantial then whining, howzabout 
we all just ignore it and let it die a quick death?
It's amazing how many of you guys try this - spew some filth and then 
beg people to stop the thread right now.

Speaking of Ed Leafe:
You might want to check out Dabo, an application framework of which 
I am one of the authors.

What are you selling?
We offer one-on-one live phone, chat, or on-site support at an hourly 
rate, with a minimum charge of one hour plus phone charges or travel 
costs. Contact the authors (Ed Leafe and Paul McNett) for more information.
--
http://mail.python.org/mailman/listinfo/python-list


What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Steve Holden wrote:
'Scuse me? This group has a long history of off-topic posting, and 
anyway who decided that CPython should be the exclusive focus? Even 
on-topic we can talk about Jython and PyPy as well as CPython.
I agree with your point, although Hans Nowak and others may not. 
Anything related to python or from the perspective of a current or 
potential python user is on-topic for this list.  We can talk about 
logo, jython, java or other topics whenever and whereever we want.  If 
you can't accept free speech and different perspectives, you're going to 
be disappointed.  But please do not react by trying to intimidate and 
troll others here.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Nick Vargish wrote:
Doug Holton [EMAIL PROTECTED] writes:

If you can't accept free speech and different perspectives, you're
going to be disappointed.  But please do not react by trying to
intimidate and troll others here.

Weren't you the one telling the rest of us what's appropriate for this
group? Maybe you should try to lead by example, not decree.
I never did any such thing.  Logo was my example.  I was making a point 
in the logo example, which Steve Holden articulated.  Hans Nowak and 
others were the ones unsuccessfully trying to control what people could 
talk about here.
--
http://mail.python.org/mailman/listinfo/python-list


Re: newbie question

2004-12-21 Thread Doug Holton
Fredrik Lundh wrote:
have you harrassed a Pythoneer today?
/F 
Yes, you have.  I'll ask again that you stop.  Just because you make a 
living in part off of a CPython module, doesn't mean we cannot discuss 
python-related things on this list, or discuss things from the 
perspective of a python user, or suggest alternative solutions when 
someone asks for a feature that Python does not have.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Hans Nowak wrote:
Now you're trying to make it seem like I am against free speech on this 
list, and against people's rights to discuss whatever they want.  I 
never said that, and I in fact enjoy the fact that c.l.py posters are an 
eclectic bunch who have knowledge of, and like to talk about, a great 
number of topics.
You said that boo should not be mentioned on this newsgroup.  That is a 
fact.  You cannot and should not try to dictate any standard for what 
can and cannot be said in this forum, other than what I already 
suggested in the quote below:

 Anything related to python or from the perspective of a current or
 potential python user is on-topic for this list.  We can talk about
 logo, jython, java or other topics whenever and whereever we want. If
 you can't accept free speech and different perspectives, you're going
 to be disappointed.
Sorry to disappoint.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Hans Nowak wrote:
You said that boo should not be mentioned on this newsgroup.  

Please point me to the post where I said that.  Since everything is 
stored in Google Groups, it should be easy for you to come up with an 
URL... if such a post existed.
Quote:
this is comp.lang.python, not comp.lang.boo.
This is not comp.lang.logo, either, but discussing it from the point of 
view of a python user is perfectly acceptable.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Hans Nowak wrote:
Quote:
this is comp.lang.python, not comp.lang.boo.

Which is obviously not the same as Boo should not be mentioned on this 
newsgroup.  
I used the exact same phrase in another note except using the term 
logo instead of boo, and that is the exact interpretation I 
immediately received from others - they felt I was censuring the 
discussion here, as I felt you were.

 The discussion with Logo and other languages in it was off-topic too,
 but it wasn't offensive to anyone.
I'm not going to dignify that or the rest of your note with a response.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Hans Nowak wrote:
  The discussion with Logo and other languages in it was off-topic too,
  but it wasn't offensive to anyone.
I'm not going to dignify that or the rest of your note with a response.

No, by all means, let's ignore any pieces of a post that might lead to 
constructive discussion.

Well, it's been fun, but I really don't have time for this.  If we 
cannot end this thread with some kind of mutual understanding, then I 
will end it unilaterally.  You have the dubious honor of being the first 
person in my killfile since 1997.

You've yet again confirmed that your only point in this whole thread was 
to be disrepectful and complain about what offends you.  And you end it 
with yet more parting insults.  If you had better articulated what you 
really meant at the beginning, I never would have responded to you.
--
http://mail.python.org/mailman/listinfo/python-list


Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Doug Holton
Reinhold Birkenfeld wrote:
Non sequitur. The phrase's interpretation depends on the posting(s) it
refers to.
Exactly.  He was saying boo (and/or I) am offensive, but logo is not. 
And then he apologized for misleading me to believe he was censuring me 
instead of flaming me.
--
http://mail.python.org/mailman/listinfo/python-list


ANN: Python Multimedia Computing book and software

2004-12-20 Thread Doug Holton
This book is due to be published any day now:
Introduction to computing and programming with Python: A Multimedia 
Approach by Mark Guzdial, a CS professor at Georgia Tech.

It uses the Jython Environment for Students (JES).  You can use this to 
for example work with and manipulate images or sounds.

A similar book is available in preview form: Introduction to Media 
Computation: A Multimedia Cookbook in Python.

See this page for info on the books, the software, course notes, 
research papers, and more info: http://coweb.cc.gatech.edu/mediaComp-plan
--
http://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Doug Holton
Peter Hansen wrote:
Doug Holton wrote:
Peter Hansen wrote:
Virtually identical indeed. :-)

As noted on the website that I've pointed out to you multiple times 
now, the syntax of boo is indeed virtually identical to python.  The 
functionality however, is more like C#.

Sadly your second post hasn't reached my news server, which is
quite flaky.  Fortunately (checking Google Groups), I see it
added nothing of substance, as it merely points to the site again,
without addressing my comments about how syntactical similarity
or even identity doesn't justify the term virtually identical,
which implies that in all respects one thing is essentially
identical to another.
I gave such a short answer because the way you framed your questions 
and the context of your post made it clear you are a troll.  Your reply 
here was yet another troll.  You are one of the reasons why so-called 
newbies and others are being intimidated away from this list.
-Doug
--
http://mail.python.org/mailman/listinfo/python-list


Re: Web forum (made by python)

2004-12-20 Thread Doug Holton
Fredrik Lundh wrote:
ask yourself if that thing you read really was a vicious attack by bunch of 
nasty
trolls, or if, perhaps, you missed the point.
You still do not even acknowledge your behavior then?  If it is your 
wish that I never mention boo again, then I will not, even though you 
and not I are the one with a financial conflict of interest in the matter.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Doug Holton
Istvan Albert wrote:
Doug Holton wrote:
the syntax of boo is indeed virtually identical to python.  

All that boo does is borrows a few syntactical constructs
from python. Calling it virtually identical
is *very* misleading.
The syntax is indeed virtually identical to python.  You are yet another 
person who has trolled before.  See your obvious trolling reply here, 
for example:
http://groups-beta.google.com/group/comp.lang.python/messages/c57cf0e48827f3de,a750c109b8ee57c3,cf89205a5e93051e,cfb1c7453e1f3c07,58a2dedd1059783e,8a1ee82cc328d023,7a51cdc9ffecbc72,38304f35cb42bb63,fc5e4ae1cbae0248,2de118caa7010b30?thread_id=5a7018d37b7bf4b8mode=threadnoheader=1q=boo#doc_a750c109b8ee57c3

Do you have financial conflict of interest too like Fredrik?  Or is it 
just a psychological issue?  I have no stake in python or any other 
language changing or not changing.  You guys need to accept change 
rather than fear it.
--
http://mail.python.org/mailman/listinfo/python-list


Re: newbie question

2004-12-20 Thread Doug Holton

David Wurmfeld wrote:
I am new to python; any insight on the following would be appreciated, 
even if it is the admonition to RTFM (as long as you can direct me to 
a relevant FM)

Is there a standard approach to enumerated types? I could create a 
dictionary with a linear set of keys, but isn't this overkill? There 
is afterall a True and False enumeration for Boolean.
To actually answer your question, no, there is no standard for enums in 
python.  There are custom hacks for it that you can search for.

This is a good sugestion for Python 3.0, a.k.a. Python 3000:
http://www.python.org/cgi-bin/moinmoin/Python3.0
In the future you may be able to to this:
enum Color:
 Red
 Green
 Blue
However, Python 3.0 is likely years away.  If you want to know how to 
run this code today, consult Fredrik Lundh.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How about pure virtual methods?

2004-12-20 Thread Doug Holton
Doug Holton wrote:
Noam Raphael wrote:
even in the best solution that I know of,
there's now way to check if a subclass has implemented all the 
required methods without running it and testing if it works. 

I think there are some solutions like PyProtocols, see section 2.2 on 
this page: http://www.python.org/cgi-bin/moinmoin/MetaClasses
Let me rephrase the rest of my answer.
This is something we could use in Python.  You should add a feature 
request to have this in Python 3.0, a.k.a. Python 3000:
http://www.python.org/cgi-bin/moinmoin/Python3.0

You might have simple code such as:
inteface ICallable:
def Call(args)
However, Python 3.0 is likely years away.  If you want to know how to 
run code like this and have real interfaces, abstract classes and 
virtual methods today, consult Fredrik Lundh.
--
http://mail.python.org/mailman/listinfo/python-list


Re: atmosphere on c.l.py (WAS: How about pure virtual methods?)

2004-12-20 Thread Doug Holton
Doug Holton wrote:
Steven Bethard wrote:
I don't really have a good solution; despite the unnecessarily vicious 
comments, I don't feel like I can set my newsreader to ignore messages 
from, for example, Fredrik, because his answers, when not attacks, are 
often very insightful.  If you find a good solution to this problem, 
please let me know.

Thankyou for bringing it up.  It looks like it may have a positive effect.
Unfortunately, I may have jumped the gun on that one.  He does not even 
acknowledge his behavior outside of the three instances he referred to.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Doug Holton
Hans Nowak wrote:
Regardless of the merits of Boo, this is comp.lang.python, not 
comp.lang.boo.  The language may *look* like Python, but its inner 
workings are nothing like Python, as several people have correctly 
pointed out now.  (Just like Java's syntax may look like C or C++ in 
some areas, but the languages are nowhere near alike.)  Pointing out the 
difference is not trolling.
Let me say it again then, although I do not know why it threatens people 
so much: the syntax of boo is indeed virtually identical to python's. 
That is what I said and what is clear from the website.

I already stated that I will not mention boo again, to comply with 
Fredrik's wishes and yours.  I will refer to CPython, and CPython only. 
 But I will not be intimidated by the likes of Fredrik Lundh.  Trollers 
will be held accountable.  If it continues at this pace, then I suggest 
a weekly troll alert, to educate and prepare the so-called newbies for 
the behavior that occurs on this list.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Easy here documents ??

2004-12-20 Thread Doug Holton
Jim Hill wrote:
Is there a way to produce a very long multiline string of output with
variables' values inserted without having to resort to this wacky
v = %s%(variable)
No, it is currently not possible in Python without the hacks you have 
seen already.  Python is long overdue for simpler string interpolation 
as seen in many other scripting languages.

You should add a feature request to have this in Python 3.0, a.k.a. 
Python 3000: http://www.python.org/cgi-bin/moinmoin/Python3.0

Then you could simple do something like:
variable1 = 1
variable2 = 2
s = 
   v = ${variable1}
   v2's value is: ${variable2}

However, Python 3.0 is likely years away.  If you want to know how to 
run code like this today, consult Fredrik Lundh.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Easy here documents ??

2004-12-20 Thread Doug Holton
Bengt Richter wrote:
variable1 = 1
variable2 = 2
s = 
  v = ${variable1}
  v2's value is: ${variable2}

However, Python 3.0 is likely years away.  If you want to know how to 
run code like this today, consult Fredrik Lundh.

Or replace ${...} with equally simple %(...)s in the above and be happy ;-)
I'm afraid you are incorrect.  Simply replacing the $ with % in my 
example will not work in Python.
If you would like to use % instead of $, I recommend requesting that 
feature for Python 3.0: http://www.python.org/cgi-bin/moinmoin/Python3.0
--
http://mail.python.org/mailman/listinfo/python-list


Re: How about pure virtual methods?

2004-12-19 Thread Doug Holton
Fredrik Lundh trolled:
(I think you could create some kind of drinking game based on the number of
...times the nasty trolls pounce on this list?
No, I think the idea is to actually address the content of someone's 
question, politely and in the *holiday spirit*, not spirits.
--
http://mail.python.org/mailman/listinfo/python-list


Re: input record seperator (equivalent of $| of perl)

2004-12-19 Thread Doug Holton
[EMAIL PROTECTED] wrote:
Hi,
I know that i can do readline() from a file object.
However, how can I read till a specific seperator?
for exmple,
if my files are
name
profession
id
#
name2
profession3
id2
I would like to read this file as a record.
I can do this in perl by defining a record seperator;
is there an equivalent in python? 
thanks

To actually answer your question, there is no equivalent to $| in python.
You need to hand code your own record parser, or else read in the whole 
contents of the file and use the string split method to chop it up into 
fields.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Easy here documents ??

2004-12-19 Thread Doug Holton
Jim Hill wrote:
Is there a way to produce a very long multiline string of output with
variables' values inserted without having to resort to this wacky
v = %s%(variable)
No, not without the god-awful hacks you've already seen.
But it is possible in boo: : http://boo.codehaus.org/
See http://boo.codehaus.org/String+Interpolation
variable1 = 1
variable2 = 2
s = 
   v = ${variable1}
   v2's value is: ${variable2}

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


Re: Web forum (made by python)

2004-12-19 Thread Doug Holton
Gezer Punta wrote:
hi all
I am looking for a forum which was produced by python
If you want Zope-based, try Plone.  But probably you don't.
I am not aware of any standard python CGI-based forum software, but I am 
sure you could find one if you search sourceforge or google.

I am surprised no one else already answered this for you.  I guess your 
question was too simple to challenge the large egos here.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Web forum (made by python)

2004-12-19 Thread Doug Holton
Jp Calderone wrote:
  Part of fostering a friendly environment on python-list is not making
comments like these.  
Another part is actually answering the content of a person's question 
like I did, instead of trolling and flaming, like Fredrik and others 
here are want to do.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Boo who? (was Re: newbie question)

2004-12-19 Thread Doug Holton
Peter Hansen wrote:
Why?  If it's virtually identical, why would anyone bother even
visiting that site?  ;-)
But I suspect you mean that the syntax of the language is virtually
identical, while probably there are some significant differences.
Maybe in the richness of its standard library?  Or the size of
its community?  Or something else
That's why I wrote:
 See http://boo.codehaus.org/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Boo who? (was Re: newbie question)

2004-12-19 Thread Doug Holton
Peter Hansen wrote:
Virtually identical indeed. :-)
As noted on the website that I've pointed out to you multiple times now, 
the syntax of boo is indeed virtually identical to python.  The 
functionality however, is more like C#.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Web forum (made by python)

2004-12-19 Thread Doug Holton
Peter Hansen wrote:
None of which in any way invalidates Jp's point...
Neither does it invalidate mine.  What is up with the trollers today? 
They are out in force now that the holidays are here.
--
http://mail.python.org/mailman/listinfo/python-list


ANN: Python Multimedia Computing book and software

2004-12-19 Thread Doug Holton
This book is due to be published any day now:
Introduction to computing and programming with Python: A Multimedia 
Approach by Mark Guzdial, a CS professor at Georgia Tech.

It uses the Jython Environment for Students (JES).  It is completely 
free and open source.  You can use it for example to work with and 
manipulate images or sounds.

A similar book is available in preview form: Introduction to Media 
Computation: A Multimedia Cookbook in Python.

See this page for info on the books, the software, course notes, 
research papers, and more info: http://coweb.cc.gatech.edu/mediaComp-plan

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


Re: atmosphere on c.l.py (WAS: How about pure virtual methods?)

2004-12-19 Thread Doug Holton
Steven Bethard wrote:
Doug Holton wrote:
Fredrik Lundh wrote:
well, since I'm not in the ego-stroking business, what if I promise 
never to reply to posts by you, robert, and alex?

That's not fair to the rest of us though :)

That's not even fair to the non-rest of us. =)  As I noted, his answers 
... are often very insightful -- it would be a pity to lose them.

He was only acknowledging the problem to those 3 people who complained 
about it.  I was making the point that others do not like being trolled 
either.
--
http://mail.python.org/mailman/listinfo/python-list


Re: better lambda support in the future?

2004-12-18 Thread Doug Holton
Jason Zheng wrote:
I'm wondering why python still has limited lambda support. What's 
stopping the developers of python to support more lisp-like lambda 
function?
See boo and its support for closures: http://boo.codehaus.org/
http://boo.codehaus.org/Closures
It works with def or do, or single-line closures use {}.
x = def:
print hello
A closure with parameters:
c = def(x1 as int, x2 as string):
print x1, x2
Single line closures use {}
c = {print(hello)}
Single line with parameters
c = {item as string | print(item)}
#Passing closures to a method as a parameter:
def mymethod(c as callable):
c()
x = mymethod( {print(hello)} )
#passing a multi-line closure as a parameter:
x = mymethod() do():
print hello
#Adding a closure to an event handler:
button.Click += def ():
print(${button} was clicked!)
--
http://mail.python.org/mailman/listinfo/python-list


Re: BASIC vs Python

2004-12-16 Thread Doug Holton
abisofile wrote:
hi 

I'm new to programming.I've try a little BASIC so I want ask since 
Python is also interpreted lang if it's similar to BASIC.
Which BASIC did you try?  Realbasic? Visual Basic?
You should check out some of these beginner's python tutorials:
http://www.honors.montana.edu/~jjc/easytut/easytut.pdf
http://www.dickbaldwin.com/tocpyth.htm
http://www.freenetpages.co.uk/hp/alan.gauld/
and then if you have any questions at all about anything, people on the 
python-tutor list would be glad to help:
http://mail.python.org/mailman/listinfo/tutor

If you want to make applications with a graphical user interface (GUI), 
check out wxpython, although they haven't yet released a version that 
works with the new python 2.4 however: http://wxpython.org/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python good for graphics?

2004-12-15 Thread Doug Holton
Esmail Bonakdarian wrote:
First of all, I *really* like Python ;-)
I need some help with the graphical side of things. I would like to do
some basic graphics with Python, but I am not sure what the best/most
effective way for me to do what I want.
Basically, I would like to be able to create some basic animations
where I can help visualize various sorting algorithms (for instance
http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/sorting.html#insert_anim)
or graph searches (coloring nodes as each gets visited). (Something
like this: http://cs.smith.edu/~thiebaut/java/graph/Welcome.html)
Or to create and manipulate programmatically a simple 2-D block puzzle
(like this: http://www.johnrausch.com/SlidingBlockPuzzles/quzzle.htm).
Note, the ability to do this via the web would be nice, but definitely
is *not* required at the moment.
I'll tell you know it's not going to be so easy.  There isn't something 
in python like flash.  But here are some options:

See pyxel for python: http://bellsouthpwp.net/p/r/prochak/pyxel.html
and pygame: http://pygame.org/
Gato, the graph animation toolkit, is implemented in python and tkinter: 
http://www.zpr.uni-koeln.de/~gato/

You know you can use java with python, too.  It's called jython.  You 
could use jython to interface the open source physics toolkit, for 
example: http://www.opensourcephysics.org/
See also the Jython Environment for Students (JES).  A book about it is 
supposed to be published tomorrow actually.

And you can use a python-like language for .NET called boo with the 
Piccolo.NET structured graphics toolkit: http://www.cs.umd.edu/hcil/jazz/
or these graph drawing toolkits: http://netron.sourceforge.net/ewiki/
http://www.codeproject.com/cs/miscctrl/quickgraph.asp
--
http://mail.python.org/mailman/listinfo/python-list


Re: Suggestion for syntax error: ++i, --i

2004-12-14 Thread Doug Holton
Petr Prikryl wrote:
Hi,
Summary: In my opinion, the C-like prefix
increment and decrement operators (++i and --i)
should be marked as syntax error.
We have a patch for increment and decrement operators in boo ( 
http://boo.codehaus.org/ ), along with an operator overloading syntax 
like below.  See http://jira.codehaus.org/browse/BOO-223

def +:
pass
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.0

2004-12-14 Thread Doug Holton
Chris wrote:
Okay, color me stupid, but what is everyone referencing when they 
mention Python 3.0?  I didn't see any mention of it on the Python site.
http://www.python.org/moin/Python3.0
has more information than the PEP 3000, plus you can contribute to the page.
--
http://mail.python.org/mailman/listinfo/python-list


Re: how can I import a module without using pythonpath?

2004-12-13 Thread Doug Holton
Phd wrote:
Hi,
I'm using python 2.2, I want to import a module by referring to its 
relative location. The reason for this is that there is another module 
with the same name that's already in pythonpath( not my decision, but I 
got to work around it, bummer). So is there any easy way to do it?
import sys, os
sys.path.insert(0,os.path.abspath(relative path))
import module
sys.path.remove(os.path.abspath(relative path))
--
http://mail.python.org/mailman/listinfo/python-list


Re: Seeking Python + Subversion hosting.

2004-12-05 Thread Doug Holton
Tom Locke wrote:
Hi,
Anyone know of a good hosting company that offers both server-side
Python and a subversion repository?

With user-mode linux hosting you can have your own virtual root system 
with which you can run whatever python stuff you want as well as 
subversion or other server processes for about the price of standard 
shared (php+mysql) hosting.  I picked this option so that for example I 
could run mod_python.  The catch is that disk access is a little slower 
and RAM is more constricted, unless you pay for higher RAM.  See:
http://developers.coedit.net/UserModeLinux
--
http://mail.python.org/mailman/listinfo/python-list


Re: Time for : comp.lang.python.newbies ??

2004-12-05 Thread Doug Holton
gmduncan wrote:
Maybe a time for a new discussion group along that suggested
by the Subject line ?
http://mail.python.org/mailman/listinfo/tutor
Or is their increasing presence here a price we must pay for their
belated recognition of this wonderful language ?
Don't forget the price we pay for not having a 
comp.lang.python.cynicaloldfarts
--
http://mail.python.org/mailman/listinfo/python-list