Find more than one error at once

2008-05-10 Thread Joseph Turian
Is it possible to coax python to find more than one error at once?

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


Re: People still using Tkinter?

2008-05-10 Thread Marc 'BlackJack' Rintsch
On Sat, 10 May 2008 00:20:33 -0500, Kenneth McDonald wrote:

 Any guesses as to how many people are still using Tkinter? And can  
 anyone direct me to good, current docs for Tkinter?

AFAIK `Tkinter` hasn't changed much over time, so old documentation is
still current.

Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list


Re: RELEASED Python 2.6a3 and 3.0a5

2008-05-10 Thread Martin v. Löwis
 I'm trying to install on the latest Ubuntu (8.04) and the following
 extension modules fail:
 
 _bsddb, _curses, _curse_panel, _hashlib, _sqlite3, _ssl, _tkinter,
 bz2, dbm, gdbm, readline, zlib
 
 All of them except for _tkinter are included in the preinstalled
 Python 2.5.2, so I guess the dependencies must be somewhere there.
 Does Ubuntu have any non-standard lib dir ?

You need to manually install the -dev packages (through aptitude)
before building Python.

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


Re: Property in derived class

2008-05-10 Thread Joseph Turian
On May 9, 9:05 pm, George Sakkis [EMAIL PROTECTED] wrote:
 Using the overridable property recipe [1],
 [1]http://infinitesque.net/articles/2005/enhancing%20Python's%20property...

Thanks, this is a great solution!

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


Re: anagram finder / dict mapping question

2008-05-10 Thread George Sakkis
On May 9, 11:19 pm, dave [EMAIL PROTECTED] wrote:
 On 2008-05-09 18:53:19 -0600, George Sakkis [EMAIL PROTECTED] said:



  On May 9, 5:19 pm, [EMAIL PROTECTED] wrote:
  What would be the best method to print the top results, the one's that

  had the highest amount of anagrams??  Create a new histogram dict?

  You can use the max() function to find the biggest list of anagrams:

  top_results = max(anagrams.itervalues(), key=len)

  --
  Arnaud

  That is the biggest list of anagrams, what if I wanted the 3 biggest
  lists?  Is there a way to specific top three w/ a max command??

  import heapq
  help(heapq.nlargest)
  Help on function nlargest in module heapq:

  nlargest(n, iterable, key=None)
      Find the n largest elements in a dataset.

      Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]

  HTH,
  George

 I both the 'nlargest' and the 'sorted' methods.. I could only get the
 sorted to work.. however it would only return values like (3,  edam)
 not the list of words..

 Here is what I have now.. Am I over-analyzing this?  It doesn't seem
 like it should be this hard to get the program to print the largest set
 of anagrams first...

 def anafind():
         fin = open('text.txt')
         mapdic = {}
         finalres = []                   # top answers go here
         for line in fin:
                 line = line.strip()
                 alphaword = ''.join(sorted(line))       #sorted word as key
                 if alphaword not in mapdic:
                         mapdic[alphaword] = [line]
                 else:
                         mapdic[alphaword].append(line)
         topans = sorted((len(mapdic[key]), key) for key in mapdic.keys())[-3:]
   #top 3 answers
         for key, value in topans:       #
                 finalres.append(mapdic[value])
         print finalres

Here is a working, cleaned up version:

from heapq import nlargest
from collections import defaultdict

def anagrams(words, top=None):
key2words = defaultdict(set)
for word in words:
word = word.strip()
key = ''.join(sorted(word))
key2words[key].add(word)
if top is None:
return sorted(key2words.itervalues(), key=len, reverse=True)
else:
return nlargest(top, key2words.itervalues(), key=len)

if __name__ == '__main__':
wordlist = ['live', 'evil', 'one', 'nose', 'vile', 'neo']
for words in anagrams(wordlist,2):
print words


By the way, try to generalize your functions (and rest of the code for
that matter) so that it can be reused easily. For example, hardcoding
the input file name in the function's body is usually undesirable.
Similarly for other constants like 'get top 3 answers'; it doesn't
cost you anything to replace 3 with 'top' and pass it as an argument
(or set it as default top=3 if that's the default case).

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


Re: Find more than one error at once

2008-05-10 Thread David
On Sat, May 10, 2008 at 8:38 AM, Joseph Turian [EMAIL PROTECTED] wrote:
 Is it possible to coax python to find more than one error at once?

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


Sounds like you want to catch and log exceptions.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Find more than one error at once

2008-05-10 Thread Ben Finney
Joseph Turian [EMAIL PROTECTED] writes:

 Is it possible to coax python to find more than one error at once?

Definitely, write unit tests and run the whole suite
URL:http://www.python.org/doc/lib/module-unittest. All errors found
by your unit test suite will be reported.

If you mean the Python parser and compiler, then the answer to this is
in the Zen of Python: In the face of ambiguity, refuse the temptation
to guess. An error in parsing or compiling leaves no clear
unambiguous path for finding further parsing or compilation errors.

-- 
 \  It's a good thing we have gravity or else when birds died |
  `\ they'd just stay right up there. Hunters would be all |
_o__) confused.  -- Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-10 Thread Waylen Gumbal
George Neuner wrote:
 On Thu, 8 May 2008 22:38:44 -0700, Waylen Gumbal [EMAIL PROTECTED]
 wrote:



  Not everyone follows language-neutral groups (such as
  comp,programming as you pointed out), so you actually reach more
  people by cross posting. This is what I don't understand - everyone
  seems to assume that by cross posting, one intends on start a
  flamefest, when in fact most such flamefests are started by
  those who cannot bring themselves to skipping over the topic that
  they so dislike.

 The problem is that many initial posts have topics that are misleading
 or simplistic.  Often an interesting discussion can start on some
 point the initial poster never considered or meant to raise.

Is this not a possibility for any topic, whether it's cross-posted or 
not?


-- 
wg 


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


firefox add-on to grab python code handily?

2008-05-10 Thread CM
I encounter a fair number of small Python scripts online, and usually
try them out by copying them to the clipboard, pasting into Notepad,
saving them, and either running them directly or opening them in
IDLE.

And so I was wondering if anyone knew of an extension/add-on/script
for Firefox which would allow a way to do something like this:

user highlights Python code on a webpage
right clicks
selects a menu item, Save as Python code
FF pops up a filename dialog or popup for filename
(and, though I don't know if this is possible, runs Python code)

Not an important thing by any means, but it would be a nice
convenience.
I know there are similar add-ons in FF for grabbing highlighted text
and
saving, but they are not good, as they don't seem to preserve line
breaks
properly or append the .py extension, etc.  I've Googled for this and
so far
it seems it doesn't exist.  Anyone know?


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


Re: anagram finder / dict mapping question

2008-05-10 Thread Arnaud Delobelle
Kam-Hung Soh [EMAIL PROTECTED] writes:

 On Sat, 10 May 2008 07:19:38 +1000, [EMAIL PROTECTED] wrote:

  What would be the best method to print the top results, the one's that
  had the highest amount of anagrams??  Create a new histogram dict?

 You can use the max() function to find the biggest list of anagrams:

 top_results = max(anagrams.itervalues(), key=len)

 --
 Arnaud

 That is the biggest list of anagrams, what if I wanted the 3 biggest
 lists?  Is there a way to specific top three w/ a max command??


 Built-in max() function only returns one result.

 My solution is to make a sorted list and return last three items:

 sorted((len(anagrams[key]), key) for key in anagrams.keys())[-3:]

Using the key= parameter of sorted() beats explicit DSU:

sorted(anagrams.itervalues(), key=len)[-3:]

Or even

sorted(anagrams.itervalues(), key=len, reverse=True)[:3]

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


Pythonicity of some algorithms

2008-05-10 Thread David
Hi list.

I have 2 questions about the Pythonicity of some algorithms. One
question is about generator usage, the other is about producer and
consumer threads

GENERATOR QUESTION

Usually for generators, the usage is like this:

for var in generator():
do_something(var)

I sometimes have cases where I want to use a generator, but I don't
want to stall the main program if the generator function doesn't have
any new data for me (maybe it's retrieving data from a device, but I
want to do other things with the same device if there isn't any data
yet).

So currently, some of my code looks something like this:

def get_serial_data():
while True:
block = request_a_packet_from_serial_device() # Get some raw data
parsed_list = parse_block(block) # Extract a list of records
from the packet
if parsed_list:
# The record contains 1 or more records
for record in parse_list:
yield record
else:
# Sometimes there aren't any records in the packet
yield None

def thread_function_for_handling_serial_device():
record_iter = iter(get_serial_data())
while True:
record = record_iter.next()
if record:
handle_record() # eg: add to a queue for the main thread to process
other_serial_logic1()
other_serial_logic2()
other_serial_logic3()

This works for me. But I'd like to know if this is considered
Pythonic, and if there are other, better ways of doing the above in
Python.

PRODUCER AND CONSUMER THREAD QUESTION

In some of my Python apps I use the producer/consumer model, where the
producer and consumer threads communicate through Queues.

Usually code (in the consumer thread function) looks something like this:

def consumer_thread():
while True:
record = some_queue.get()
process_record(record)

In some cases I'd like to do something unusual to threads consuming a
queue - interrupt them, make them terminate, etc. The problem is that
a lot of the time it's locking, waiting for a record from
some_queue.get()

A few things I've considered:

1) Add a timeout to some_queue.get(), so the loop has a chance to do
other things while waiting for new records. This is problematic
because most of the time there isn't other things for the thread to
do. Also, it won't be able to respond immediately to those events.

2) Add special values to the queue, the purpose of which is to notify
the consumers. This is problematic when you have multiple consumers.
You have to add the exact correct number of 'interrupt' objects to the
queue.

3) Make a custom thread-safe queue class, with an 'interrupt_get'
method. When your app calls queue.interrupt_get(), all threads
currently locking on a queue.get() will continue, but with a
GetInterrupted exception thrown.

Perhaps there is some other Python threading idiom I should be using
in this case. Any suggestions?

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


Re: Pythonicity of some algorithms

2008-05-10 Thread Martin v. Löwis
 This works for me. But I'd like to know if this is considered
 Pythonic, and if there are other, better ways of doing the above in
 Python.

From the Python point of view, it's fine. However, it uses busy-wait,
which I consider bad style (in any language).

 3) Make a custom thread-safe queue class, with an 'interrupt_get'
 method. When your app calls queue.interrupt_get(), all threads
 currently locking on a queue.get() will continue, but with a
 GetInterrupted exception thrown.

That's what I would do. I'd use the existing Queue class as a base
class, though, rather than starting from scratch.

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


Re: implementation for Parsing Expression Grammar?

2008-05-10 Thread Lars Rune Nøstdal

Hi,
Finite automata works for nested things.

http://en.wikipedia.org/wiki/Automata_theory

--
Lars Rune Nøstdal
http://nostdal.org/
--
http://mail.python.org/mailman/listinfo/python-list

Re: PyXml

2008-05-10 Thread kdwyer
Stefan Behnel wrote:

 Martin v. Löwis wrote:
 Can anyone recommend a Python validating parser that validates vs Xml
 Schema?
 
 The libxml bindings for Python can do that.
 
 ... although the OP will likely prefer using lxml, where it's three lines
 of Python (ok, plus an import), compared to quite a bit of code in the
 official libxml2 bindings.
 
 http://codespeak.net/lxml
 
 Stefan
 --
 http://mail.python.org/mailman/listinfo/python-list

Stefan, Martin,

Thanks for your replies.

Kev

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

Re: Pythonicity of some algorithms

2008-05-10 Thread castironpi
On May 10, 5:21 am, Martin v. Löwis [EMAIL PROTECTED] wrote:
  This works for me. But I'd like to know if this is considered
  Pythonic, and if there are other, better ways of doing the above in
  Python.

 From the Python point of view, it's fine. However, it uses busy-wait,
 which I consider bad style (in any language).

  3) Make a custom thread-safe queue class, with an 'interrupt_get'
  method. When your app calls queue.interrupt_get(), all threads
  currently locking on a queue.get() will continue, but with a
  GetInterrupted exception thrown.

 That's what I would do. I'd use the existing Queue class as a base
 class, though, rather than starting from scratch.

 Regards,
 Martin

Did you follow the links to Dev-C++?  It rules house.  I have
drizzle.c compiling in Windows GDI and SDL.  I'm poised to double-time
Dev-C++ and Windows GDI, if double-tasking is on the market.  Credit
up... what's standard?
--
http://mail.python.org/mailman/listinfo/python-list


Re: slicing lists

2008-05-10 Thread castironpi
On May 9, 3:17 pm, [EMAIL PROTECTED] wrote:
 On May 9, 10:11 am, Yves Dorfsman [EMAIL PROTECTED] wrote:





  [EMAIL PROTECTED] wrote:
   The only thing is, is there is another natural meaning to [a,b:c].

   Counting grids on the diagonals, the rational set is well defined:

   0: 0, 0
   1: 1, 0
   2: 0, 1
   3: 2, 0
   4: 1, 1
   5: 0, 2
   6: 3, 0
   7: 2, 1
   ...

   Thencefore ( 2, 0 ) : ( 3, 0 ) is well defined.  Thencefore,

   a,b:c,d

   is not; x[a,b:c,d]= x[a]+ x[b:c]+ x[d].

  I'm not sure what you mean here. Could you give me a simple piece of code to
  show an example ?

  Yves.http://www.SollerS.ca-Hide quoted text -

  - Show quoted text -

 Yves, sadly, simple piece of code is not the writer's forte.  I was
 merely advising against leaping in to syntax additions, changes even.
 The point was, even though a,b:c,d is shown ill-defined, a,b:c may not
 be.- Hide quoted text -

 - Show quoted text -

Now: In the case of enumerate( rationals ), list slicing can be plenty
fine.  Any use to the dirational enumerate?
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread castironpi
On May 10, 1:38 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
 On Sat, 10 May 2008 00:20:33 -0500, Kenneth McDonald wrote:
  Any guesses as to how many people are still using Tkinter? And can  
  anyone direct me to good, current docs for Tkinter?

 AFAIK `Tkinter` hasn't changed much over time, so old documentation is
 still current.

 Ciao,
         Marc 'BlackJack' Rintsch

Get synchronizing into wx.  CallAfter and CallLater both pull too
hard, but I didn't write it for money.  How are specs doing on coming
down?  Window size is important.  Does anyone else bounce around
resizability either?

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


Re: Find more than one error at once

2008-05-10 Thread Diez B. Roggisch

Joseph Turian schrieb:

Is it possible to coax python to find more than one error at once?


What kind of errors? Syntax-errors? Then use one of the python source 
code analyzers, such as pylint or pychecker.


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


Authoring SOAP and WSDL

2008-05-10 Thread Ken Starks

I would like to write SOAP services in python,
and have an environment that will then generate
a matching WSDL for me automatically.

Does such a thing exist in python?

Thanks in advance.

Ken.


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


Re: People still using Tkinter?

2008-05-10 Thread Guilherme Polo
2008/5/10 Kenneth McDonald [EMAIL PROTECTED]:
 Any guesses as to how many people are still using Tkinter? And can anyone
 direct me to good, current docs for Tkinter?


I will say no to the first question.

Now about the second question.. there are these links you may find interesting:

An Introduction to Tkinter --
http://www.pythonware.com/library/tkinter/introduction/index.htm
Tkinter reference: a GUI for Python --
http://infohost.nmt.edu/tcc/help/pubs/tkinter/index.html

There is also a book, http://www.manning.com/grayson/ and a wiki,
http://tkinter.unpythonic.net/wiki/
Also, stdlib docs at http://docs.python.org/lib/module-Tkinter.html

And there is a mail list too.

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




-- 
-- Guilherme H. Polo Goncalves
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-10 Thread Lew

Waylen Gumbal wrote:

George Neuner wrote:

On Thu, 8 May 2008 22:38:44 -0700, Waylen Gumbal [EMAIL PROTECTED]
wrote:





Not everyone follows language-neutral groups (such as
comp,programming as you pointed out), so you actually reach more
people by cross posting. This is what I don't understand - everyone
seems to assume that by cross posting, one intends on start a
flamefest, when in fact most such flamefests are started by
those who cannot bring themselves to skipping over the topic that
they so dislike.

The problem is that many initial posts have topics that are misleading
or simplistic.  Often an interesting discussion can start on some
point the initial poster never considered or meant to raise.


Is this not a possibility for any topic, whether it's cross-posted or 
not?


You guys are off topic.  None of the million groups to which this message was 
posted are about netiquette.


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


Simple question

2008-05-10 Thread Gandalf
I use to write code with PHP.

To ran script width PHP I need to open new file inside my WWW
directory and name it somethin.php and then to write my script inside
?php?  tags

how can i ran script with python


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


Re: Simple question

2008-05-10 Thread Bjoern Schliessmann
Gandalf wrote:

 how can i ran script with python

It depends on your web server configuration. To get your web server
execute Python code, there are several alternatives like

* CGI
* FastCGI
* mod_python

Regards,


Björn

-- 
BOFH excuse #93:

Feature not yet implemented

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


Re: Simple question

2008-05-10 Thread Gandalf
On May 10, 2:36 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
 Gandalf wrote:
  how can i ran script with python

 It depends on your web server configuration. To get your web server
 execute Python code, there are several alternatives like

 * CGI
 * FastCGI
 * mod_python

 Regards,

 Björn

 --
 BOFH excuse #93:

 Feature not yet implemented

my server is my computer and all i did way to install python on it.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to kill Python interpreter from the command line?

2008-05-10 Thread Thomas Bellman
Jean-Paul Calderone [EMAIL PROTECTED] wrote:

(Ctrl+Z which sends SIGSTOP and _cannot_ be masked
 or otherwise ignored)

Bzzt!  Ctrl-Z causes a SIGTSTP to be sent, not SIGSTOP, and
SIGTSTP can be both caught, ignored and masked.


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
You cannot achieve the impossible without   !  bellman @ lysator.liu.se
 attempting the absurd. !  Make Love -- Nicht Wahr!
--
http://mail.python.org/mailman/listinfo/python-list

Re: Simple question

2008-05-10 Thread Matt Nordhoff
Gandalf wrote:
 my server is my computer and all i did way to install python on it.

But what web server program are you using? Apache? IIS? Lighttpd?
-- 
--
http://mail.python.org/mailman/listinfo/python-list


Re: firefox add-on to grab python code handily?

2008-05-10 Thread Larry Bates

CM wrote:

I encounter a fair number of small Python scripts online, and usually
try them out by copying them to the clipboard, pasting into Notepad,
saving them, and either running them directly or opening them in
IDLE.

And so I was wondering if anyone knew of an extension/add-on/script
for Firefox which would allow a way to do something like this:

user highlights Python code on a webpage
right clicks
selects a menu item, Save as Python code
FF pops up a filename dialog or popup for filename
(and, though I don't know if this is possible, runs Python code)

Not an important thing by any means, but it would be a nice
convenience.
I know there are similar add-ons in FF for grabbing highlighted text
and
saving, but they are not good, as they don't seem to preserve line
breaks
properly or append the .py extension, etc.  I've Googled for this and
so far
it seems it doesn't exist.  Anyone know?




Since most of us keep Idle or some other Python IDE open nearly 100% of the time 
we just copy from webpage, paste into new Python document, and run in the IDE. 
While you could clearly write a plug-in for FF to achieve this, IMHO I doubt 
many people would actually use it.


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


Re: implementation for Parsing Expression Grammar?

2008-05-10 Thread Kay Schluehr
On 10 Mai, 07:52, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 In the past weeks i've been thinking over the problem on the practical
 problems of regex in its matching power. For example, often it can't
 be used to match anything of nested nature, even the most simple
 nesting. It can't be used to match any simple grammar expressed by
 BNF. Some rather very regular and simple languages such as XML, or
 even url, email address, are not specified as a regex.

Well formed XML cannot be fully specified within BNF as well because
it is context sensitive: in order to recognize a tag/endtag pair one
has to maintain a stack. That's not a big deal in practice if one
wants to write an XML parser but one can't use an arbitrary LL or LR
parser generator to produce a parse tree representing the XML.

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


Re: Simple question

2008-05-10 Thread Irmen de Jong

Gandalf wrote:

On May 10, 2:36 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:

Gandalf wrote:

how can i ran script with python

It depends on your web server configuration. To get your web server
execute Python code, there are several alternatives like

* CGI
* FastCGI
* mod_python

Regards,

Björn

--
BOFH excuse #93:

Feature not yet implemented


my server is my computer and all i did way to install python on it.



You might want to read a bit more about Python and how it can be used for web 
programming. Because your question is not easily answered.


I suggest the following at least:

http://wiki.python.org/moin/PythonVsPhp
(especially the Compared as Web Development Frameworks section)

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



Good luck.

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


Re: People still using Tkinter?

2008-05-10 Thread Zentrader
I like New Mexico Tech's site as well.  Also, take a look at the PMW
extension for additional widgets, and TkTable and/or TableListWrapper.
http://infohost.nmt.edu/tcc/help/pubs/tkinter/
--
http://mail.python.org/mailman/listinfo/python-list


Now, as for the jokes: Python!

2008-05-10 Thread castironpi
Dear Monty, Grail This.

The grail is unarmed and floating.  Stop posting the newsgroup.

Python is Monty Python.  In the sense of identity ascription, of
course.

Trivially not,

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


Re: Mathematics in Python are not correct

2008-05-10 Thread Lou Pecora
In article [EMAIL PROTECTED],
 Terry Reedy [EMAIL PROTECTED] wrote:

 Lou Pecora [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 | In article [EMAIL PROTECTED],
 | Terry Reedy [EMAIL PROTECTED] wrote:
 |
 |  Luis Zarrabeitia [EMAIL PROTECTED] wrote in message
 |  news:[EMAIL PROTECTED]
 |  | Btw, there seems to be a math problem in python with 
 exponentiation...
 |  |  0**0
 |  | 1
 |  | That 0^0 should be a nan or exception, I guess, but not 1.
 | 
 |  a**b is 1 multiplied by a, b times.  1 multiplied by 0 no times is 1.
 |  But there are unenlighted people who agree with you ;-)
 |  Wikipedia has a discussion of this.
 | 
 |  tjr
 |
 | I like that argument better.  But...
 |
 | I've also heard the very similar a**b is a multiplied by a b-1 times.
 
 Me too, in school, but *that* definition is incomplete: it excludes b=0 and 
 hence a**0 for all a.  It was the best people could do before 0 was known.
 But 0 was introduced to Europe just over 800 years ago ;-)

[cut some interesting examples]

Yes, I was also thinking about the b=0 case and then the case when b0.  
If you solve the b0 case, you solve the b=0 case for a !=0.  Define

a**b= a multiplied by 1/a |b-1| times when b0.  Then for b=0 we get 
a*(1/a)=1.

Of course, I can avoid all this mathematical dancing around by using 
some of the other simpler definitions like the original one.  :-)

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


Re: People still using Tkinter?

2008-05-10 Thread Guilherme Polo
2008/5/10 Zentrader [EMAIL PROTECTED]:
 I like New Mexico Tech's site as well.  Also, take a look at the PMW
 extension for additional widgets, and TkTable and/or TableListWrapper.
 http://infohost.nmt.edu/tcc/help/pubs/tkinter/

There is also Tile, or Ttk since Tk 8.5, if you are interested in
extensions too.
Apparently there are three Tile wrappers now, two are incomplete
(sorry for saying that):

http://bruno.thoorens.free.fr/ttk.html -- Missing Treeview, big part
of ttk styling, maybe other things and it is not only a ttk wrapper
(there are other things besides it)
http://bugs.python.org/file10010/Tile.py -- Missing several methods in
Treeview, big part of ttk styling and maybe something else.

And there is also one I'm doing, that I expect to be complete:

http://gpolo.ath.cx:81/projects/ttk_to_tkinter/

Documentation and samples are still lacking, but I'm working on them.
And I haven't tested it under Windows, so I invite you all to test it.

Regards,

-- 
-- Guilherme H. Polo Goncalves
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to call a file

2008-05-10 Thread Gary Herron

Chris Sprinkles wrote:
I'm still having trouble with calling a text file and I know its so 
simple here is the code


work = open('C:\Documents and Settings\Administrator\My 
Documents\Chris\Python\Python\work.txt', 'r')

for line in work.txt:
print line
-
Ok so I know that the directory is right cause I'm not a complete 
idiot but I keep getting an error? What am I missing here?

-Chris-


--
http://mail.python.org/mailman/listinfo/python-list
First of all, some terminology: You are not *calling* a file, you are 
*opening* it or reading.


Once you *open* the file, you store the resulting file object in a 
variable named work, then to use that object to request a line, thus:


for line in work:
 print line


Hint: When you say I keep getting an error,  you really have not 
provided mush useful information.   In the future, when you get an 
error, and you want help, spend the time to post the error message and 
traceback along with your question.   In this case, the problem was 
trivially easy to spot, but you'll get past these trivial problems 
soon.  Then you'll be more likely to find volunteers who will spend time 
to help *if* you spend the time to provide useful information.


Gary Herron

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


Re: People still using Tkinter?

2008-05-10 Thread Kevin Walzer

Kenneth McDonald wrote:
Any guesses as to how many people are still using Tkinter? And can 
anyone direct me to good, current docs for Tkinter?


Thanks,
Ken


I develop Tk applications commercially on Mac OS X, using Tcl and 
Python. Here's a screenshot of my Python app:


http://www.codebykevin.com/phynchronicity-running.png

This app is built on Python 2.5.1 and Tk 8.5.0. Tk 8.5 has a huge number 
of improvements over older versions of Tk:


http://www.tkdocs.com/resources/backgrounder.html

Most importantly, Tk 8.5 has a themed widget set that allows for 
platform-native appearance on Windows and Mac (not emulated, but hooking 
into system API's). The themed widget set also adds a lot of new 
widgets, such as combobox, tree, and others. The older widget set is 
still available as well and they can be freely matched. Tk also has a 
lot of lightweight, script-level widget libraries that can also enhance 
the appearance and usability of your app.


My own app uses widgets from Tk's traditional set, the new Tile/ttk set, 
the Tabelist widget, and the BWidget widget library. It uses the 
following Python wrappers for these widgets:


http://tkinter.unpy.net/wiki/TileWrapper
http://tkinter.unpy.net/wiki/TableListTileWrapper
http://tkinter.unpythonic.net/bwidget/

It also uses a few private wrappers/custom widgets.

In addition to the Python-specifc resources that others have provided, 
here's a new site that documents the latest-and-greatest Tk techniques, 
including Tile/ttk:


http://www.tkdocs.com/

The developer of this site is mainly interest in Tcl and Ruby, so 
examples of those are provided--I may provide some Python examples at 
some point. But there should be enough code snippets there for you to 
get started, especially if you already have some experience with 
Tk/Tkinter.


Tk still has some limitations, including a lack of cross-platform 
printing support (the canvas widget generates postscript, but that's not 
enough anymore) and an incomplete cross-platform drag-and-drop mechanism 
(works fine on Windows, it's buggy on *NIx because Xdnd is so 
inconsistent, and it was never developed for OS X). If you absolutely 
need these features, look at wxPython or PyQt. But coming to Python from 
a Tcl background, I'm very comfortable with Tk--it is lightweight, 
extremely flexible, and (as I hope you can see from my screenshot) it's 
possible to do sophisticated user interfaces with it. It fits my brain 
much better than wxPython, for instance. And the long effort by Tk's 
developers to modernize its appearance has finally paid off, I think.


Hope that helps,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread Kevin Walzer

Guilherme Polo wrote:

2008/5/10 Zentrader [EMAIL PROTECTED]:

I like New Mexico Tech's site as well.  Also, take a look at the PMW
extension for additional widgets, and TkTable and/or TableListWrapper.
http://infohost.nmt.edu/tcc/help/pubs/tkinter/


There is also Tile, or Ttk since Tk 8.5, if you are interested in
extensions too.
Apparently there are three Tile wrappers now, two are incomplete
(sorry for saying that):

http://bruno.thoorens.free.fr/ttk.html -- Missing Treeview, big part
of ttk styling, maybe other things and it is not only a ttk wrapper
(there are other things besides it)
http://bugs.python.org/file10010/Tile.py -- Missing several methods in
Treeview, big part of ttk styling and maybe something else.

And there is also one I'm doing, that I expect to be complete:

http://gpolo.ath.cx:81/projects/ttk_to_tkinter/

Documentation and samples are still lacking, but I'm working on them.
And I haven't tested it under Windows, so I invite you all to test it.

Regards,

I'm the maintainer of Tile.py. It may well be incomplete, as it was 
first developed by Martin Franklin a couple of years ago and I've been 
modifying it as my own needs require.


So you're doing your own implementation of ttk in Tkinter as a Google 
Summer of Code Project? Wonderful! Are you planning on submitting it for 
including in Tkinter's core, as I did? If yours proves to be the better 
implementation I'll gladly withdraw mine, as I'm not sure I have time to 
overhaul it extensively.


I'll follow your progress with interest!

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread Guilherme Polo
2008/5/10 Kevin Walzer [EMAIL PROTECTED]:
 Guilherme Polo wrote:

 2008/5/10 Zentrader [EMAIL PROTECTED]:

 I like New Mexico Tech's site as well.  Also, take a look at the PMW
 extension for additional widgets, and TkTable and/or TableListWrapper.
 http://infohost.nmt.edu/tcc/help/pubs/tkinter/

 There is also Tile, or Ttk since Tk 8.5, if you are interested in
 extensions too.
 Apparently there are three Tile wrappers now, two are incomplete
 (sorry for saying that):

 http://bruno.thoorens.free.fr/ttk.html -- Missing Treeview, big part
 of ttk styling, maybe other things and it is not only a ttk wrapper
 (there are other things besides it)
 http://bugs.python.org/file10010/Tile.py -- Missing several methods in
 Treeview, big part of ttk styling and maybe something else.

 And there is also one I'm doing, that I expect to be complete:

 http://gpolo.ath.cx:81/projects/ttk_to_tkinter/

 Documentation and samples are still lacking, but I'm working on them.
 And I haven't tested it under Windows, so I invite you all to test it.

 Regards,

 I'm the maintainer of Tile.py. It may well be incomplete, as it was first
 developed by Martin Franklin a couple of years ago and I've been modifying
 it as my own needs require.

 So you're doing your own implementation of ttk in Tkinter as a Google Summer
 of Code Project? Wonderful! Are you planning on submitting it for including
 in Tkinter's core, as I did?

Thanks ;)
And, yes Kevin, I'm planning to submit it for inclusion into Tkinter's core.

 If yours proves to be the better implementation
 I'll gladly withdraw mine, as I'm not sure I have time to overhaul it
 extensively.

 I'll follow your progress with interest!

Thanks for support it, and sorry for saying yours was incomplete.
I wasn't trying to sell my version by doing that, was just trying to
say there were some point on doing another wrapper. I also noticed
that there is some problem in getting Martin Franklin to fill the
contributors agreement, that was the second point on doing this
wrapper.


 --Kevin

 --
 Kevin Walzer
 Code by Kevin
 http://www.codebykevin.com


Regards,


-- 
-- Guilherme H. Polo Goncalves
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread Chuckk Hubbard
I am, but still isn't the word, I just started.  Good, *complete*
docs seem to be hard to find, but using a combination of the free
resources and going back and forth between them seems to work all
right so far.

-Chuckk

On Sat, May 10, 2008 at 8:20 AM, Kenneth McDonald
[EMAIL PROTECTED] wrote:
 Any guesses as to how many people are still using Tkinter? And can anyone
 direct me to good, current docs for Tkinter?

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




-- 
http://www.badmuthahubbard.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread Kevin Walzer

Guilherme Polo wrote:


Thanks ;)
And, yes Kevin, I'm planning to submit it for inclusion into Tkinter's core.


Excellent. I hope your effort is successful.


Thanks for support it, and sorry for saying yours was incomplete.
I wasn't trying to sell my version by doing that, was just trying to
say there were some point on doing another wrapper. I also noticed
that there is some problem in getting Martin Franklin to fill the
contributors agreement, that was the second point on doing this
wrapper.


No offense taken. Martin is pretty busy these days and doesn't have time 
to work on it further; frankly, I'm not sure I'd have time if a lot of 
changes were requested. So if your package proves to be the best, great! 
I'll switch over my own apps to it.


Good luck!

Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Am I missing something with Python not having interfaces?

2008-05-10 Thread Rhamphoryncus
On May 9, 1:53 pm, Daniel Marcel Eichler [EMAIL PROTECTED] wrote:
 Am Freitag 09 Mai 2008 10:19:45 schrieb Bruno Desthuilliers:

   very often sees do-nothing catch-all try/catch blocks in Java -
   which is way worse than just letting the exception propagate. I
   find all this totally pointless, because there's just no way for a
   compiler to check if your code is logically correct.

   But it's enough if the called method exists and returns the correct
   type. At least it prevents a crash.

The application has already failed.  You'd prefer it silently do the
wrong thing than get an explicit error message and stop?


   That's the point. Interfaces garantee that a duck is a duck, an
   not only a chicken that quack.

   Who cares if it's a chicken as long as it quacks when you ask her
   to ? Now *This* is the whole point of chicken^Mduck typing, isn't
   it ?-)

   Ducks can also swim and fly.  And if you need a really duck,

  If you're code expects something that quacks, swims and flies,
  anything that quacks, swims and flies is ok. You just don't care if
  it's a duck or a flying whale with a quacking device tied to it.

 Not the point.

It really is.  They're only going to give you something they expect to
work.  They might occasionally make a mistake and give you garbage,
but it's not worth the effort of trying to catch it early.

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


Now what!?

2008-05-10 Thread notbob
Grrr

I'm following A Byte of Python and into the while loops chap.  I cp/paste
while.py to a file and give 777 perms.  I mv while.py to while and run it 
(./while)
as a standalone script.  I get errors.

Here is the script:

while.py

http://www.ibiblio.org/swaroopch/byteofpython/read/while-statement.html


When I run it as.

$ python while

.it works perfect.  But, if I run it simply as.

$ ./while

.I get this:

$ ./while
number: illegal number: =
./while: line 6: running: command not found
./while: line 9: syntax error near unexpected token ('
./while: line 9: guess = int(raw_input('Enter an integer : '))'

Why does it work one way and not the other.  If I run the simple hello world
script the same way ($ ./helloworld) and it works fine.  Same shebang, same
dir, same permission, etc.  I even meticulously indented everything
perfectly by hand.  What am I missing?

BTW, anyone know a better cli news client/editor combo than slrn/jed (don't
even think vi!)?  When I cp/past code (or most anything else) to jed, all
the lines become stair-stepped.  This is no biggie for a most stuff, but for
idented code, it's unacceptable.  

nb

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


Re: Now what!?

2008-05-10 Thread Diez B. Roggisch

notbob schrieb:

Grrr

I'm following A Byte of Python and into the while loops chap.  I cp/paste
while.py to a file and give 777 perms.  I mv while.py to while and run it 
(./while)
as a standalone script.  I get errors.

Here is the script:

while.py

http://www.ibiblio.org/swaroopch/byteofpython/read/while-statement.html


When I run it as.

$ python while

.it works perfect.  But, if I run it simply as.

$ ./while

.I get this:

$ ./while
number: illegal number: =
./while: line 6: running: command not found
./while: line 9: syntax error near unexpected token ('
./while: line 9: guess = int(raw_input('Enter an integer : '))'

Why does it work one way and not the other.  If I run the simple hello world
script the same way ($ ./helloworld) and it works fine.  Same shebang, same
dir, same permission, etc.  I even meticulously indented everything
perfectly by hand.  What am I missing?


I'm pretty sure you misse the correct shebang - the shell tries to 
execute your script as shell-script, instead of invoking the interpreter.


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


Re: The Importance of Terminology's Quality

2008-05-10 Thread Sherman Pendley
Lew [EMAIL PROTECTED] writes:

 You guys are off topic.  None of the million groups to which this
 message was posted are about netiquette.

Netiquette has come up at one point or another in pretty much every
group I've ever read. It's pretty much a universal meta-topic.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
--
http://mail.python.org/mailman/listinfo/python-list


Re: People still using Tkinter?

2008-05-10 Thread Martin v. Löwis
 I am, but still isn't the word, I just started.  Good, *complete*
 docs seem to be hard to find, but using a combination of the free
 resources and going back and forth between them seems to work all
 right so far.

IMO, the trick really is to also have a Tk documentation around.
If you need to find out what option is supported by what widget,
there isn't really much point in duplicating that information in
Tkinter, IMO - the Tk documentation has it all.

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


Re: Now what!?

2008-05-10 Thread Matias Surdi

Diez B. Roggisch escribió:

notbob schrieb:

Grrr

I'm following A Byte of Python and into the while loops chap.  I cp/paste
while.py to a file and give 777 perms.  I mv while.py to while and run 
it (./while)

as a standalone script.  I get errors.

Here is the script:

while.py

http://www.ibiblio.org/swaroopch/byteofpython/read/while-statement.html


When I run it as.

$ python while

.it works perfect.  But, if I run it simply as.

$ ./while

.I get this:

$ ./while
number: illegal number: =
./while: line 6: running: command not found
./while: line 9: syntax error near unexpected token ('
./while: line 9: guess = int(raw_input('Enter an integer : '))'

Why does it work one way and not the other.  If I run the simple hello 
world
script the same way ($ ./helloworld) and it works fine.  Same shebang, 
same

dir, same permission, etc.  I even meticulously indented everything
perfectly by hand.  What am I missing?


I'm pretty sure you misse the correct shebang - the shell tries to 
execute your script as shell-script, instead of invoking the interpreter.


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



Add #!/path/to/bin/python on the first line of your script.

Also should work with:
#!/usr/bin/env python


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


Orlando Florida Python Tutor Needed

2008-05-10 Thread vbgunz
I will pay anyone for a face-to-face tutoring in the Orlando Florida
area. I will pay $20.00 per hour (minimum 2 hours needed). What I need
are lessons in Decorators and Class methods. If I can walk away with
at least 5 lessons taught in both subjects I will be happy to offer an
additional $20.00.

If you are interested in this offer feel free to either reply through
email OR here on this thread. There are no string attached, catches,
etc. I need to learn and if you can teach well, I will be happy to
learn.

Best Regards
Victor B. Gonzalez
--
http://mail.python.org/mailman/listinfo/python-list


Re: Simple question

2008-05-10 Thread Gandalf
Thanks guys I think you miss understood me. i have been mining to use
python to create a none web application.
And i found out that i can ran python scripts by calling them from CMD
or just raning them from windows
--
http://mail.python.org/mailman/listinfo/python-list


Re: Now what!?

2008-05-10 Thread notbob
On 2008-05-10, Diez B. Roggisch [EMAIL PROTECTED] wrote:
 notbob schrieb:

 script the same way ($ ./helloworld) and it works fine.  Same shebang, same
 dir, same permission, etc. 

 I'm pretty sure you misse the correct shebang - 

Sorry.  Both exactly the same.  I checked 5 times.

helloworld shebang:  #!/usr/bin/python
while shebang:   #!/usr/bin/python

(above yanked from respective scripts)

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


Re: Now what!?

2008-05-10 Thread Ivan Illarionov
On 10 май, 21:22, notbob [EMAIL PROTECTED] wrote:
 On 2008-05-10, Diez B. Roggisch [EMAIL PROTECTED] wrote:

  notbob schrieb:
  script the same way ($ ./helloworld) and it works fine.  Same shebang, same
  dir, same permission, etc.

  I'm pretty sure you misse the correct shebang -

 Sorry.  Both exactly the same.  I checked 5 times.

 helloworld shebang:  #!/usr/bin/python
 while shebang:   #!/usr/bin/python

 (above yanked from respective scripts)

 nb

Shebang is certainly broken, possible causes:
1. Wrong line endings (should be \n)
2. Whitespace before the shebang

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

Re: Newbie to python --- why should i learn !

2008-05-10 Thread Aahz
In article [EMAIL PROTECTED],
Gary Herron  [EMAIL PROTECTED] wrote:
   
With Python, you can program with a smile on your face.

+1 QOTW

(Truly, when I found Python, programming became fun again.)

Again?  Looking back over the years, after I learned Python I realized
that I never really had enjoyed programming before.
-- 
Aahz ([EMAIL PROTECTED])   * http://www.pythoncraft.com/

Help a hearing-impaired person: http://rule6.info/hearing.html
--
http://mail.python.org/mailman/listinfo/python-list


list object

2008-05-10 Thread Gandalf
my manual contain chapter about lists with python. when i try to copy
paste :

li = [a, b, mpilgrim, z, example] (1)


it i get this errore:

TypeError: 'list' object is not callable

i was wondering if their is  any special module I should import before
i use this function

i know i ask foolish questions it's my first day with python and i
have experience only with PHP and javascript, so please be patient

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


Re: list object

2008-05-10 Thread member thudfoo
On 5/10/08, Gandalf [EMAIL PROTECTED] wrote:
 my manual contain chapter about lists with python. when i try to copy
  paste :

  li = [a, b, mpilgrim, z, example] (1)


  it i get this errore:

  TypeError: 'list' object is not callable

  i was wondering if their is  any special module I should import before
  i use this function

  i know i ask foolish questions it's my first day with python and i
  have experience only with PHP and javascript, so please be patient

  thanks

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


Remove the (1)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Now what!?

2008-05-10 Thread notbob
On 2008-05-10, Ivan Illarionov [EMAIL PROTECTED] wrote:

 Shebang is certainly broken, possible causes:
 1. Wrong line endings (should be \n)

Nope.  Not it.

 2. Whitespace before the shebang

BINGO!  we have a winner.  ;)

I thought for sure that was not correct.  No white space before the
sheba  Wait a minute!  Howzabout a blank line above the shebang?  D0H!!

These are the minute details that bedevil the poor noob.  I've read dozens
of tutorials on different prog langs and have never read a single thing on
white space or blank lines preceding a shebang.  Till now.  I always get
frustrated and give up on learning programming, not really caring much for
coding, anyway.  But, dammit, I'm gonna stick with it this time.  I'll learn
python if it kills me!  that is, if you folks can stand all my dumb
questinons.  ;)

Thank you, Ivan, and other repondents.  

nb  back to while loops

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


Re: multiple Python versions, but on Windows (how to handle registry updates)

2008-05-10 Thread Terry Reedy

Banibrata Dutta [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
| given that I already have Python2.5 installed  will install Python2.4, 
will
| copying the ../Lib/site-packages/ from 2.5 into 2.4's, work ?
| i think the answer is no, but still asking. is it package specific ?

If a particular distribution consists of only Python code (no C dll's) and 
that code uses no 2.5 features and does not depend on any other 2.5 
changes, then it should work with 2.4.  Otherwise 



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


Is there a PyPI API?

2008-05-10 Thread Mike Driscoll
Hi,

I am experimenting on creating a GUI wrapper for easy_install and I
would like to be able to allow the user the browse PyPI topically.
However, I am having some trouble figuring out how to get the
information in a topical manner.

I can get the list of classifiers easily using urllib2 like so:

def getPyPiClassifiers():
print 'Get list of Topics from PyPI...'

url = 'http://pypi.python.org/pypi?%3Aaction=list_classifiers'
res = urllib2.urlopen(url)
page = res.read()

And there's a light-weight list of all the packages on PyPI here:
http://pypi.python.org/simple/

I just can't figure out how to get the metadata, I guess. I found Paul
Boddies SGMLParser example (http://www.boddie.org.uk/python/HTML.html)
which can get me some URLs, but what I really need is some kind of
dict of tuples or lists like this:

{'Framework':(('Buildout', 'bazaarrecipe', 'Buildout recipe for
Bazaar'),
   ('Buildout', 'buildout_script', 'zc.buildout
recipes for generating script and conf files from templates.')
)}

Any ideas on how best to approach this would be great. I'm still
learning HTML/XML parsing techniques and am having trouble wrapping my
mind around it.

Thanks!

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


Re: list object

2008-05-10 Thread Terry Reedy

member thudfoo [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
| On 5/10/08, Gandalf [EMAIL PROTECTED] wrote:
|  my manual contain chapter about lists with python. when i try to copy
|   paste :
| 
|   li = [a, b, mpilgrim, z, example] (1)
| 
| 
|   it i get this errore:
| 
|   TypeError: 'list' object is not callable

| Remove the (1)

The '(1)' was almost certainly an 'equation number' or 'line label' added 
so the author could refer it in the text, like 'type line (1) into the 
interpreter and... .  This is a standard mathematical idiom, but sometimes 
confusing when there is not enough space between the equation and the 
label, and especially when the equation label *could* be part of the 
equation, as with Python.




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


Re: People still using Tkinter?

2008-05-10 Thread Kenneth McDonald
The only trick it that sometimes it isn't obvious how to make the Tcl/ 
Tk call via Python.


Ken

On May 10, 2008, at 11:27 AM, Martin v. Löwis wrote:


I am, but still isn't the word, I just started.  Good, *complete*
docs seem to be hard to find, but using a combination of the free
resources and going back and forth between them seems to work all
right so far.


IMO, the trick really is to also have a Tk documentation around.
If you need to find out what option is supported by what widget,
there isn't really much point in duplicating that information in
Tkinter, IMO - the Tk documentation has it all.

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


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


Re: Is there a PyPI API?

2008-05-10 Thread Martin v. Löwis
 I just can't figure out how to get the metadata, I guess.

See

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

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


how to reference my own module ?

2008-05-10 Thread Stef Mientki

hello,

I've a library that I import as

   import ppygui.api as gui

the reason for this construct is that I've to use different libraries 
for different platforms.


Now I like to write some examples in the library (activated by if 
__name__ == '__main__' :)
and I would that these examples can be used in the user program just by 
copy / paste.


For calling a function / class in the user program I've to write:

   sizer = gui.VBox ()

So also write exactly the same sentence in the library examples,
but  gui is not recognized

Any ideas how I can realize the above ?

thanks,
Stef Mientki



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


Re: Now what!?

2008-05-10 Thread notbob
On 2008-05-10, notbob [EMAIL PROTECTED] wrote:

 BTW, anyone know a better cli news client/editor combo than slrn/jed (don't
 even think vi!)?  When I cp/past code (or most anything else) to jed, all
 the lines become stair-stepped.  This is no biggie for a most stuff, but for
 idented code, it's unacceptable.  

Whoo-hoo!  I just got emacs config'd to do python.  Let's see how that works.

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


Re: Is there a PyPI API?

2008-05-10 Thread Mike Driscoll
On May 10, 2:23 pm, Martin v. Löwis [EMAIL PROTECTED] wrote:
  I just can't figure out how to get the metadata, I guess.

 See

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

 Regards,
 Martin

Ah-so. Most helpful, Martin. Thanks a lot!

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


Any other UI kits with text widget similar to that in Tk?

2008-05-10 Thread Kenneth McDonald
I'm wondering if any of the other GUI kits have a text widget that is  
similar in power to the one in Tk. wxWindows, from what I can tell,  
doesn't offer nearly the options the Tk widget does. I'm less familiar  
with Qt. Any feedback would be most appreciated.


Thanks,
Ken

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


Re: Any other UI kits with text widget similar to that in Tk?

2008-05-10 Thread Stef Mientki

Kenneth McDonald wrote:
I'm wondering if any of the other GUI kits have a text widget that is 
similar in power to the one in Tk. wxWindows, from what I can tell, 
doesn't offer nearly the options the Tk widget does. I'm less familiar 
with Qt. Any feedback would be most appreciated.


Thanks,
Ken

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

Don't know what the power of tk is,
but wxPython has the powerfull Scintilla and a less sophisticated 
richtext on board.


cheers,
Stef
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematics in Python are not correct

2008-05-10 Thread wxPythoner
I am stunned that this simple misunderstanding of mine ended in a
mathematical clash of a sort. :)  You guys really blew me away wih
your mathematical knowledge. And also the 0**0 is a thing I've never
thought about trying, until now that is. If the mathematical rule is
that EVERYTHING raised to the power of 0 is 1, then we should accept
that, even in the case of 0**0. This is just the way it is.

I have two another interesting things to discuss about, for which I'll
open new posts on this group. Look for Python doesn't recognize quote
types and Python, are you ill?.
--
http://mail.python.org/mailman/listinfo/python-list


Python doesn't recognize quote types

2008-05-10 Thread wxPythoner
There's a thing that bugs me in Python. Look at this...

 print Testing\
SyntaxError: EOL while scanning single-quoted string


Please focus on the part of the error message that states while
scanning single-quoted string. How can Python claim it scanned a
single-quoted string when I fed it with a double-quoted string? Is
quote type (single quote and double quote) recognition not implemented
in Python?
--
http://mail.python.org/mailman/listinfo/python-list


Python, are you ill?

2008-05-10 Thread wxPythoner
If you are in the interactive prompt of the Python interpreter and you
do this

print Testing\   or   print '''Testing\'''

you get three dots [...] as if Python expects a code block. If you
press Enter, you get three dots again, and again, and again... You
can't get out of the code block with pressing the Enter key; you have
to press Ctrl+Z (if you're in Linux) in order to get out of that code
block, which then throws you back to the Linux command line, but
before that it prints this line

[1]+  Stopped python


If you do

print Testing\   or   print 'Testing\'

you get an error, but not of you use the triple quotes. Is that a bug
in the interpreter perhaps?
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python, are you ill?

2008-05-10 Thread Ludwig
This is not a bug, this is how it should work.

A triple quoted string ends only with another triple quoted string (which
can extend over multiple lines) In your example you are escaping the first
quote character at the end of the line, thus leaving just two quotes that do
not end the string.
Another  (triple quote) will terminate the string.

HTH


2008/5/10 [EMAIL PROTECTED]:

 If you are in the interactive prompt of the Python interpreter and you
 do this

 print Testing\   or   print '''Testing\'''

 you get three dots [...] as if Python expects a code block. If you
 press Enter, you get three dots again, and again, and again... You
 can't get out of the code block with pressing the Enter key; you have
 to press Ctrl+Z (if you're in Linux) in order to get out of that code
 block, which then throws you back to the Linux command line, but
 before that it prints this line

 [1]+  Stopped python


 If you do

 print Testing\   or   print 'Testing\'

 you get an error, but not of you use the triple quotes. Is that a bug
 in the interpreter perhaps?
 --
 http://mail.python.org/mailman/listinfo/python-list

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

Re: Python, are you ill?

2008-05-10 Thread John Machin
On May 11, 6:59 am, [EMAIL PROTECTED] wrote:
 If you are in the interactive prompt of the Python interpreter and you
 do this

 print Testing\   or   print '''Testing\'''

 you get three dots [...] as if Python expects a code block. If you
 press Enter, you get three dots again, and again, and again... You
 can't get out of the code block with pressing the Enter key; you have
 to press Ctrl+Z (if you're in Linux) in order to get out of that code
 block, which then throws you back to the Linux command line, but
 before that it prints this line

 [1]+  Stopped python

 If you do

 print Testing\   or   print 'Testing\'

 you get an error, but not of you use the triple quotes. Is that a bug
 in the interpreter perhaps?

No. This might clue you in:

 print Testing\
Testing


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


Re: Python, are you ill?

2008-05-10 Thread John Henderson
[EMAIL PROTECTED] wrote:

 If you are in the interactive prompt of the Python interpreter
 and you do this
 
 print Testing\   or   print '''Testing\'''
 
 you get three dots [...] as if Python expects a code block. If
 you press Enter, you get three dots again, and again, and
 again... You can't get out of the code block with pressing the
 Enter key; you have to press Ctrl+Z (if you're in Linux) in
 order to get out of that code block, which then throws you
 back to the Linux command line, but before that it prints this
 line
 
 [1]+  Stopped python
 
 
 If you do
 
 print Testing\   or   print 'Testing\'
 
 you get an error, but not of you use the triple quotes. Is
 that a bug in the interpreter perhaps?

 print testing\

testing

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


Re: Python, are you ill?

2008-05-10 Thread Nicolas Dandrimont
* [EMAIL PROTECTED] [EMAIL PROTECTED] [2008-05-10 13:59:37 -0700]:

 If you are in the interactive prompt of the Python interpreter and you
 do this
 
 print Testing\   or   print '''Testing\'''
 
 you get three dots [...] as if Python expects a code block. If you
 press Enter, you get three dots again, and again, and again... You
 can't get out of the code block with pressing the Enter key;

That is because Python expects you to end the triple-quoted string with
three unescaped quotes.

 you have to press Ctrl+Z (if you're in Linux) in order to get out of that code
 block, which then throws you back to the Linux command line, but
 before that it prints this line
 
 [1]+  Stopped python
 

That ^Z just suspends your Python interpreter. It has become a job you can
now bring to foreground again with fg. (but it's a feature of your
shell, not of Python)

 
 If you do
 
 print Testing\   or   print 'Testing\'
 
 you get an error, but not of you use the triple quotes. Is that a bug
 in the interpreter perhaps?

The fact is, that triple-quoted strings can span on multiple lines, and
that single-quoted strings cannot (without the line ending with a \).
So no, it's not a bug in the interpreter.

Regards,
-- 
Nicolas Dandrimont



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

Re: Python doesn't recognize quote types

2008-05-10 Thread Nicolas Dandrimont
* [EMAIL PROTECTED] [EMAIL PROTECTED] [2008-05-10 13:56:39 -0700]:

 There's a thing that bugs me in Python. Look at this...
 
  print Testing\
 SyntaxError: EOL while scanning single-quoted string
 
 
 Please focus on the part of the error message that states while
 scanning single-quoted string. How can Python claim it scanned a
 single-quoted string when I fed it with a double-quoted string? Is
 quote type (single quote and double quote) recognition not implemented
 in Python?

The single-quoted string (e.g. 'foo' or bar) is so named by 
opposition to triple-quoted (e.g.  '''foo''' or bar) strings.

Regards,
-- 
Nicolas Dandrimont



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

Special INFORMATION – a must read

2008-05-10 Thread law

Interesting information found at PASGOM. Just click on;
http://www.pasgom.org/traffic.html
http://www.pasgom.org/Stores.html
You may look at this important INFO, view the short but interesting
movies, and even share with others. Interestingly, Registration for
all these is FREE.
Nkaw
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python, are you ill?

2008-05-10 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote:
 You
 can't get out of the code block with pressing the Enter key; you have
 to press Ctrl+Z (if you're in Linux) in order to get out of that code
 block, which then throws you back to the Linux command line, but
 before that it prints this line
 
 [1]+  Stopped python

You can use Ctrl+C and Python will stop what it's doing and go back to
its main prompt.
-- 
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-10 Thread Lew

Sherman Pendley wrote:

Lew [EMAIL PROTECTED] writes:


You guys are off topic.  None of the million groups to which this
message was posted are about netiquette.


Netiquette has come up at one point or another in pretty much every
group I've ever read. It's pretty much a universal meta-topic.


Good, then please have the courtesy not to include comp.lang.java.programmer 
in the distribution for this thread any longer.


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


Re: Python doesn't recognize quote types

2008-05-10 Thread John Machin
On May 11, 6:56 am, [EMAIL PROTECTED] wrote:
 There's a thing that bugs me in Python. Look at this...

  print Testing\

 SyntaxError: EOL while scanning single-quoted string

 Please focus on the part of the error message that states while
 scanning single-quoted string. How can Python claim it scanned a
 single-quoted string when I fed it with a double-quoted string? Is
 quote type (single quote and double quote) recognition not implemented
 in Python?

Read this:
http://docs.python.org/ref/strings.html

Try each of these:
print 'Testing
print 'Testing\'
print 'Testing\'Testing
print 'Testing'
print 'Testing\''
print 'Testing\'Testing'

There's a wrinkle that's common to both your questions: \ causes the
 not to be regarded as (part of) the end marker but to be included as
a data character. Similarly with '. Examples:

 print She said \Hello!\
She said Hello!
 print 'His surname is O\'Brien'
His surname is O'Brien


In the error message, quoted is the past tense of the verb to
quote, meaning to wrap a string of characters with a leading string
and a trailing string to mark the contained string as a lexical item,
typically a string constant. The message is intended to convey that
the leading marker has been seen, but an EOL (end of line) was reached
without seeing the trailing marker.

A better error message might be something like String constant not
terminated at end of line.

Unfortunately the above-mentioned documentation uses le-quote as a
noun to describe characters -- IMHO this is colloquial and confusing;
it should call ' an apostrophe, not a single-quote, and all  a
quote, not a double-quote. The confusion is compounded by referring
to '''abc''' and xyz as triple-quoted strings ... so one might
expect 'abc' and xyz to be called single-quoted strings, and this
sense is what is being used in the error message.

HTH,
John


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


test

2008-05-10 Thread Colin J. Williams

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


test

2008-05-10 Thread Colin J. Williams

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


Re: how to reference my own module ?

2008-05-10 Thread Terry Reedy

Stef Mientki [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
| hello,
|
| I've a library that I import as
|
|import ppygui.api as gui
|
| the reason for this construct is that I've to use different libraries
| for different platforms.
|
| Now I like to write some examples in the library (activated by if
| __name__ == '__main__' :)
| and I would that these examples can be used in the user program just by
| copy / paste.
|
| For calling a function / class in the user program I've to write:
|
|sizer = gui.VBox ()
|
| So also write exactly the same sentence in the library examples,
| but  gui is not recognized
|
| Any ideas how I can realize the above ?

Put the import statement in the example so 'gui' *is* recognized ;-)

If I understand what you meant ...
xploro/test/begin.py
-
def start():
print('hello')

if __name__ == '__main__':
import xploro.test.begin as etb
etb.start()

prints 'hello'|

Import is a name-binding statement that also creates a module when it does 
not exist already.  Modules can be bound to multiple names just like any 
other object.

Terry Jan Reedy



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


Re: Now what!?

2008-05-10 Thread Grant Edwards
On 2008-05-10, Dennis Lee Bieber [EMAIL PROTECTED] wrote:

 These are the minute details that bedevil the poor noob.  I've
 read dozens of tutorials on different prog langs and have
 never read a single thing on white space or blank lines
 preceding a shebang.  Till now.  I always get

   Well... The shebang line is OS and shell specific

The #! is sort of a holdover from the magic number used
back in the day on Unix systems. Traditionally, the type of an
executable file on Unix systems was determined by a magic
number that was read from the first two bytes of a file:

  http://en.wikipedia.org/wiki/Magic_number_(programming)

Back then there was a text file somewhere that listed the
various 16-bit values and what they meant.  The file program
used that list to guess what a file was. It's gotten
considerably more complex since then, and the magic file has
syntax to specify fairly large/complex patterns that are used
to determine file types.  If you're curious, there's probably a
magic file somewhere on your system.  On Gentoo it's at
/usr/share/misc/file/magic, 
  
On a Linux system (and I presume on other Unixes), the kernel
itself (if built with the proper options) knows know how start
a script file that starts with the characters #!.  When the
kernel is told to execute a file whose first two bytes are #!
(0x32,0x21), it knows to read the newline terminated path of an
executable starting at the byte following the ! (the third
byte in the file).  The kernel then executes that file,
appending the name of the original script file to the argv
list.

-- 
Grant Edwards   grante Yow! My mind is making
  at   ashtrays in Dayton ...
   visi.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Find more than one error at once

2008-05-10 Thread Joseph Turian
On May 10, 8:13 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:

 What kind of errors? Syntax-errors? Then use one of the python source
 code analyzers, such as pylint or pychecker.

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


Re: Now what!?

2008-05-10 Thread Patrick Mullen
On Sat, May 10, 2008 at 3:57 PM, Grant Edwards [EMAIL PROTECTED] wrote:

 On a Linux system (and I presume on other Unixes), the kernel
 itself (if built with the proper options) knows know how start
 a script file that starts with the characters #!.  When the
 kernel is told to execute a file whose first two bytes are #!
 (0x32,0x21), it knows to read the newline terminated path of an
 executable starting at the byte following the ! (the third
 byte in the file).  The kernel then executes that file,
 appending the name of the original script file to the argv
 list.


Wow, thanks for the history lesson.  I was under the impression that this
was a bash thing, I had no idea it went as deep as the kernel!
--
http://mail.python.org/mailman/listinfo/python-list

Re: how to reference my own module ?

2008-05-10 Thread Stef Mientki

Terry Reedy wrote:
Stef Mientki [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

| hello,
|
| I've a library that I import as
|
|import ppygui.api as gui
|
| the reason for this construct is that I've to use different libraries
| for different platforms.
|
| Now I like to write some examples in the library (activated by if
| __name__ == '__main__' :)
| and I would that these examples can be used in the user program just by
| copy / paste.
|
| For calling a function / class in the user program I've to write:
|
|sizer = gui.VBox ()
|
| So also write exactly the same sentence in the library examples,
| but  gui is not recognized
|
| Any ideas how I can realize the above ?

Put the import statement in the example so 'gui' *is* recognized ;-)

If I understand what you meant ...
xploro/test/begin.py
-
def start():
print('hello')

if __name__ == '__main__':
import xploro.test.begin as etb
etb.start()

prints 'hello'|

Import is a name-binding statement that also creates a module when it does 
not exist already.  Modules can be bound to multiple names just like any 
other object.
  

Thanks Terry,
works like a charm,
why is the obvious often so difficult overlooked ;-)

cheers,
Stef

Terry Jan Reedy



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


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


Re: Now what!?

2008-05-10 Thread notbob
On 2008-05-10, Dennis Lee Bieber [EMAIL PROTECTED] wrote:

   So... in short, you'd need to have been reading a tutorial specific
 to shell scripting...

I have been.  I'm also trying to learn bash shell scripting, not to mention
sed/awk, php, etc.  I should have started this a long time ago, but I'm lazy
and, like I said, I'm not particularly fond of coding.  Yes, I have learned
basic C and basic , but never beyond intro.  Now, I'm doing it because I'm a
geezer and I figure my brain needs more exercise then just blabbing on
usenet.  Besides, I've been cruising while using linux for too long and have
remained low end intermediate.  Time to get serious.  Pass the cheat sheets!

nb


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


Initializing a subclass with a super object?

2008-05-10 Thread frankdmartinez
Class A inherits from class B.  Can anyone point me in the direction
of documentation saying how to initialize an object of A, a1, with an
object of B, b1?
--
http://mail.python.org/mailman/listinfo/python-list


Re: implementation for Parsing Expression Grammar?

2008-05-10 Thread Barb Knox
In article [EMAIL PROTECTED],
 Lars Rune Nøstdal [EMAIL PROTECTED] wrote:

 Hi,
 Finite automata works for nested things.

Only in the special case when the depth of nesting is bounded ahead of 
time.  If it's unbounded then there is an unbounded amount of stack 
information that the automaton needs to remember, therefore a finite 
automaton cannot do it.

pedantry
That should be Finite automata WORK ..., since automata is plural.
/pedantry

 http://en.wikipedia.org/wiki/Automata_theory

-- 
---
|  BBBb\ Barbara at LivingHistory stop co stop uk
|  B  B   aa rrr  b |
|  BBB   a  a   r bbb   |Quidquid latine dictum sit,
|  B  B  a  a   r b  b  |altum viditur.
|  BBBaa a  r bbb   |   
-
--
http://mail.python.org/mailman/listinfo/python-list

Re: Initializing a subclass with a super object?

2008-05-10 Thread Terry
On May 11, 7:22 am, [EMAIL PROTECTED] wrote:
 Class A inherits from class B.  Can anyone point me in the direction
 of documentation saying how to initialize an object of A, a1, with an
 object of B, b1?

This is called a 'factory'in design patterns. Search 'python factory',
you will get a lot of examples.

br, Terry
--
http://mail.python.org/mailman/listinfo/python-list


Re: Find more than one error at once

2008-05-10 Thread John Machin

Diez B. Roggisch wrote:

Joseph Turian schrieb:

Is it possible to coax python to find more than one error at once?


What kind of errors? Syntax-errors? Then use one of the python source 
code analyzers, such as pylint or pychecker.


I don't know about pylint, but PyChecker works in a combination of 
ways. First, it imports each module. If there is an import error, the 
module cannot be processed. -- so it fails on the first syntax error. 
For example:


C:\junktype syntaxerrors.py
if foo = bar:
pass
foo = unterminated
123 = foo

C:\junkpython -m pychecker.checker syntaxerrors.py
Processing syntaxerrors...
  SyntaxError: invalid syntax (syntaxerrors.py, line 1)
if foo = bar:
   ^

Warnings...

syntaxerrors:1: NOT PROCESSED UNABLE TO IMPORT

C:\junk


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


paypal wholesale, bape, air jordan ( paypal accept ) ( www.honest-shop.cn )

2008-05-10 Thread 128
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )









 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )








 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )










 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )









 paypal   wholesale,bape,air jordan   (paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan(paypal   accept  )
(www.honest-shop.cn   )
 paypal   wholesale,bape,air jordan   (paypal   accept  )
(

paypal wholesale, NBA,adidas ( paypal accept ) ( www.honest-shop.cn )

2008-05-10 Thread 128
paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )




paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )






paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  

paypal wholesale, NBA,adidas ( paypal accept ) ( www.honest-shop.cn )

2008-05-10 Thread 128
paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )




paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )






paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept )
(   www.honest-shop.cn  )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )





paypal wholesale, NBA,adidas   (  paypal accept)
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  ) (   www.honest-shop.cn
)
paypal wholesale, NBA,adidas   ( paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas  (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas   (  paypal accept  )
(   www.honest-shop.cn   )
paypal wholesale, NBA,adidas (  

Re: Mathematics in Python are not correct

2008-05-10 Thread Terry Reedy

[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
|I am stunned that this simple misunderstanding of mine ended in a
| mathematical clash of a sort. :)  You guys really blew me away wih
| your mathematical knowledge. And also the 0**0 is a thing I've never
| thought about trying, until now that is.

Anyone who defines a function should think about 'edge' and 'corner' cases.
Recursive definitions often help, since such cases are typically the base 
cases.
When learning a (computer) function, I often test such cases since they are 
a common place to mess up.

tjr



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


Re: Initializing a subclass with a super object?

2008-05-10 Thread frankdmartinez
Hi, Terry.
Yeah, no.  If we think of the inherited B as an object nested
within a1, I'm attempting to initialize that B with b1 by accessing
the B, say, via a function call.  I don't see how using a python
factory achieves this.
--
http://mail.python.org/mailman/listinfo/python-list


Re: multiple Python versions, but on Windows (how to handle registry updates)

2008-05-10 Thread Gabriel Genellina
En Sat, 10 May 2008 01:38:24 -0300, Banibrata Dutta [EMAIL PROTECTED] 
escribió:

 given that I already have Python2.5 installed  will install Python2.4, will
 copying the ../Lib/site-packages/ from 2.5 into 2.4's, work ?
 i think the answer is no, but still asking. is it package specific ?

 does it matter if the packages were egg drops ?

Packages containing only .py modules (pure packages) are OK; packages using C 
extensions (.dll, .pyd) have to be rebuilt (or you have to download the 
binaries for the other Python version).

-- 
Gabriel Genellina

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


Re: The Importance of Terminology's Quality

2008-05-10 Thread George Neuner
On Fri, 09 May 2008 22:45:26 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote:

George Neuner gneuner2/@/comcast.net wrote:

On Wed, 7 May 2008 16:13:36 -0700 (PDT), [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

• Functions [in Mathematica] that takes elements out of list
are variously named First, Rest, Last, Extract, Part, Take, 
Select, Cases, DeleteCases... as opposed to “car”, “cdr”, 
“filter”, “filter”, “pop”, “shift”, “unshift”, in lisps and
perl and other langs.

| Common Lisp doesn't have filter.

Of course it does! It just spells it REMOVE-IF-NOT!!  ;-}  ;-}

I know.  You snipped the text I replied to.  

Xah carelessly conflated functions snatched from various languages in
an attempt to make some point about intuitive naming.  If he objects
to naming a function filter, you can just imagine what he'd have to
say about remove-if[-not].

George
--
for email reply remove / from address
--
http://mail.python.org/mailman/listinfo/python-list


do you fail at FizzBuzz? simple prog test

2008-05-10 Thread globalrev
http://reddit.com/r/programming/info/18td4/comments

claims people take a lot of time to write a simple program like this:


Write a program that prints the numbers from 1 to 100. But for
multiples of three print Fizz instead of the number and for the
multiples of five print Buzz. For numbers which are multiples of
both three and five print FizzBuzz.

for i in range(1,101):
if i%3 == 0 and i%5 != 0:
print Fizz
elif i%5 == 0 and i%3 != 0:
print Buzz
elif i%5 == 0 and i%3 == 0:
print FizzBuzz
else:
print i


is there a better way than my solution? is mine ok?
--
http://mail.python.org/mailman/listinfo/python-list


Re: implementation for Parsing Expression Grammar?

2008-05-10 Thread George Neuner
On Fri, 9 May 2008 22:52:30 -0700 (PDT), [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

In the past weeks i've been thinking over the problem on the practical
problems of regex in its matching power. For example, often it can't
be used to match anything of nested nature, even the most simple
nesting. It can't be used to match any simple grammar expressed by
BNF. Some rather very regular and simple languages such as XML, or
even url, email address, are not specified as a regex. (there exist
regex that are pages long that tried to match email address though)

What's your point?  The limitations of regular expressions are well
known.

After days of researching this problem, looking into parsers and its
theories etc, today i found the answer!!

What i was looking for is called Parsing Expression Grammar (PEG).

PEG has its own problems - it's very easy with PEG to create subtly
ambiguous grammars for which quite legal looking input is rejected.
And there are no good tools to analyze a PEG and warn you of subtle
problems.

Chris Clark (YACC++) has posted at length about the merits, problems
and limitations of various parse techniques - including PEG - in
comp.compilers.  Before you consider doing anything with PEG I suggest
you look up his posts and read the related threads.


It seems to me it's already in Perl6, and there's also a
implementation in Haskell. Is the perl6 PEG is in a usable state?

Thanks.

  Xah
  [EMAIL PROTECTED]
? http://xahlee.org/

George
--
for email reply remove / from address
--
http://mail.python.org/mailman/listinfo/python-list


RE: firefox add-on to grab python code handily?

2008-05-10 Thread Ryan Ginstrom
 On Behalf Of Larry Bates
 Since most of us keep Idle or some other Python IDE open 
 nearly 100% of the time we just copy from webpage, paste into 
 new Python document, and run in the IDE. 
 While you could clearly write a plug-in for FF to achieve 
 this, IMHO I doubt many people would actually use it.

Not that I'm going to implement it, but it would be really neat to tie
something together with codepad[1]

[1] http://codepad.org/
(With the site owner's permission, of course!)

Regards,
Ryan Ginstrom

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


Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread John Machin

globalrev wrote:

http://reddit.com/r/programming/info/18td4/comments

claims people take a lot of time to write a simple program like this:


Write a program that prints the numbers from 1 to 100. But for
multiples of three print Fizz instead of the number and for the
multiples of five print Buzz. For numbers which are multiples of
both three and five print FizzBuzz.

for i in range(1,101):
if i%3 == 0 and i%5 != 0:
print Fizz
elif i%5 == 0 and i%3 != 0:
print Buzz
elif i%5 == 0 and i%3 == 0:
print FizzBuzz
else:
print i


is there a better way than my solution? is mine ok?


Try doing it using %3 and %5 only once each.
--
http://mail.python.org/mailman/listinfo/python-list


Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Kam-Hung Soh

On Sun, 11 May 2008 11:12:37 +1000, globalrev [EMAIL PROTECTED] wrote:


http://reddit.com/r/programming/info/18td4/comments

claims people take a lot of time to write a simple program like this:


Write a program that prints the numbers from 1 to 100. But for
multiples of three print Fizz instead of the number and for the
multiples of five print Buzz. For numbers which are multiples of
both three and five print FizzBuzz.

for i in range(1,101):
if i%3 == 0 and i%5 != 0:
print Fizz
elif i%5 == 0 and i%3 != 0:
print Buzz
elif i%5 == 0 and i%3 == 0:
print FizzBuzz
else:
print i


is there a better way than my solution? is mine ok?


Looks OK to me.

A different version, and I test for multiples of 3 and 5 first:

map(lambda x: (not x%3 and not x%5 and FizzBuzz) or (not x%3 and Fizz)  
or (not x%5 and Buzz) or x, xrange(1,101))


--
Kam-Hung Soh a href=http://kamhungsoh.com/blog;Software Salariman/a
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can I delete the namespace of a module that i import?

2008-05-10 Thread Gabriel Genellina
En Fri, 09 May 2008 11:06:49 -0300, gbin,Zhou [EMAIL PROTECTED] escribió:

I see from http://docs.python.org/tut/node11.html; that Name
 spaces are created at different moments and have different lifetimes.
 The namespace containing the built-in names is created when the Python
 interpreter starts up, and is never deleted. The global namespace for
 a module is created when the module definition is read in; normally,
 module namespaces also last until the interpreter quits.
So can I delete the namespace of a module that i import?

You can make Python forget a module by removing it from sys.modules; that 
way, next time you import it, Python will load it again from file.
Or you can use the built-in reload() function to get a fresh copy from file.
But any references to objects in the old module will still refer to the old 
objects (that means, by example, that existing instances of classes defined in 
the module will still refer to the old definition)

-- 
Gabriel Genellina

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


  1   2   3   >