Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread [EMAIL PROTECTED]
Frank Millman wrote:
> Did you read my extract from the PostgreSQL docs -
>
> "Notice that because this is returning a session-local value, it gives
> a predictable answer whether or not other sessions have executed
> nextval since the current session did."
>

I totally missed it, my bad.  Thanks!

> For some reason Google Groups stuck a '>' at the beginning, so you may
> have thought that it related to a previous message

Probably due to the vagaries of mbox format which uses "From " at the
beginning of a line to indicate the start of a new message; lots of
mail systems prepend "From " at the start of a line in the body with
">".  :-/

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


Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread Frank Millman

[EMAIL PROTECTED] wrote:
> Frank Millman wrote:
> > Dale Strickland-Clark wrote:
> > > Now that OIDs have been deprecated in PostgreSQL, how do you find the key 
> > > of
> > > a newly inserted record?
> > >
>
> >
> > I used to use 'select lastval()', but I hit a problem. If I insert a
> > row into table A, I want the id of the row inserted. If it is a complex
> > insert, which triggers inserts into various other tables, some of which
> > may also be auto-incrementing, lastval() returns the id of the row last
> > inserted into any auto-incrementing table.
> >
> > I therefore use the following -
> > cur.execute("select currval('%s_%s_Seq')" % (tableid, columnid)
>
> Aren't both of these inherently racey?  It seems to me like you need
> some kind of atomic insert-and-return-id value; otherwise you don't
> know if another thread/process has inserted something else in the table
> in between when you call insert and when you select lastval/currval.
>

Did you read my extract from the PostgreSQL docs -

"Notice that because this is returning a session-local value, it gives
a predictable answer whether or not other sessions have executed
nextval since the current session did."

For some reason Google Groups stuck a '>' at the beginning, so you may
have thought that it related to a previous message, but it was actually
part of my reply and refers  specifically to 'select currval()'.

Frank

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Paddy

[EMAIL PROTECTED] wrote:
> Hi,
>
> I am a bit disapointed with the current Python online documentation. I
> have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
>
> That's why I have started a collaborative project to make a user
> contributed Python documentation. The wiki is online here:
> http://www.pythondocs.info
>
> This is a fresh new website, so there's not much on it, but I hope to
> make it grow quickly. Help and contributions are welcome; Please
> register and start posting your own documentation on it.
>
> Regards,
>
> Nicolas.
> -
> http://www.pythondocs.info

I wonder about what is going wrong here. On the one hand we have
http://www.awaretek.com/tutorials.html with its "more than 300
tutorials", and on the other we have maybe too many people disgruntled
with the main Python documentation.

It seems people want to make better Python documentation and are
willing to put in the effort.
Maybe there is something broken in the process for contributing to the
official documentation?

Personally, I thought it was OK back in 199 but I did program in
several other languages, including scripting languages, before Python.

- Paddy.

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


Re: tcl list to python list?

2006-09-16 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> I have a file that contains a "tcl" list stored as a string.  The list
> members are
> sql commands ex:
> { begin { select * from foo
>where baz='whatever'}
>  {select * from gooble } end
>  { insert into bar values('Tom', 25) } }
>
> I would like to parse the tcl list into a python list...
>
> Any suggestions ( I am running Tkinter...)
>
> Jerry
>

This is very similar to the Python list parser that comes with pyparsing. 
Adapted to your syntax, this looks something like:

tcl = """sql commands ex:
 { begin { select * from foo
where baz='whatever'}
  {select * from gooble } end
  { insert into bar values('Tom', 25) } }"""

from pyparsing import *

tcllist = Forward()
element = quotedString | Word(alphas,alphanums+"_") | \
  Combine(Word(nums) + "." + Optional(Word(nums)) ) | Word(nums) | \
  oneOf( list(r"(),[EMAIL PROTECTED]&*-|\?/><;:") ) | Group( '{' + 
tcllist 
+ '}' )
tcllist << OneOrMore( element )

import pprint
pprint.pprint( tcllist.parseString(tcl).asList() )

Giving:

['sql',
 'commands',
 'ex',
 ':',
 ['{',
  'begin',
  ['{', 'select', '*', 'from', 'foo', 'where', 'baz', '=', "'whatever'", 
'}'],
  ['{', 'select', '*', 'from', 'gooble', '}'],
  'end',
  ['{', 'insert', 'into', 'bar', 'values', '(', "'Tom'", ',', '25', ')', 
'}'],
  '}']]

The pyparsing home page is at pyparsing.wikispaces.com.

-- Paul


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


Re: tcl list to python list?

2006-09-16 Thread Paddy

[EMAIL PROTECTED] wrote:
> Hi,
>
> I have a file that contains a "tcl" list stored as a string.  The list
> members are
> sql commands ex:
>  { begin { select * from foo
> where baz='whatever'}
>   {select * from gooble } end
>   { insert into bar values('Tom', 25) } }
>
> I would like to parse the tcl list into a python list...
>
> Any suggestions ( I am running Tkinter...)
>
> Jerry
Well, if you know TCL then read the bit about how to write a python
list:
 (http://docs.python.org/tut/node5.html#SECTION00514)
Then write a TCL function to traverse your TCL list and write it out in
the python format.

Another suggestion might be to use CSV as an intermediary:
  http://tcllib.sourceforge.net/doc/csv.html
  http://docs.python.org/dev/lib/module-csv.html

Now if you know Python and not TCL ... :-)

- Paddy.

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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread alex23
[EMAIL PROTECTED] wrote:
> Has anyone tried this thing..
> http://www.regular-expressions.info/regexbuddy.html

For another free option, there's Kiki:

http://project5.freezope.org/kiki/

It has the advantage of being based on the actual python re module. It
also comes with SPE.

-alex23

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


Re: Python blogging software

2006-09-16 Thread Paul Rubin
"Eric S. Johansson" <[EMAIL PROTECTED]> writes:
> a wise person you are.  I've often thought that most of the pages
> generated by web frameworks (except for active pages) should be cached
> once rendered.

Fancy frameworks do use caching, but I think of that as a kludgy
workaround for lousy performance of the framework itself.  A fast
framework should not need caching, except maybe caching gzip output
for large blocks of contiguous text.  

> as to the comment system, I've been very disappointed by most blog
> comment capabilities because they actively hinder the ability for
> commenters to interact with each other.  what I would like to see is a
> short-life (i.e. three day) mailing list where the message history is
> stored as if it were blog comments.

Some comment systems are better than others, but transferring the
comments to email sounds horrible, at least for users who use web
boards to keep stuff OUT of their mailboxes.

> Yes, you could build a web form techniques but the main advantage of
> Web forms over mailing lists is that they fill your mailbox with
> messages telling you that you have a message instead of delivering the
> message itself.

Yeah, that combines the worst of both worlds.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Computer Vitals

2006-09-16 Thread my . chat . friends
http://computervitals.com

Hey guyz,
I welcome you yo Computer Vitals, Your Online Computer Helpline. A new
venture to help people with all sides of software and hardware. Pay a
visit and experience yourself. Lets get together and help eachother.

http://computervitals.com

Help sections include
Computer Maintainance & Upkeep
Security and Virus related information for Beginners and advanced
users
Operating Systems help (Winodws/Linux)
Information about updates and upgrades
Help with networkind hardware and software
Latest technological tips
Pern,CGI and PHP help
HTML help
Vbullitin forum help
Digital Photography, Video and Audio editing help
Photoshop, GIMp and other graphis programming
Games
A place to sell and buy within friends.

Give a try and Join today. It takes just a min to register
http://computervitals.com

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


Re: Python blogging software

2006-09-16 Thread Eric S. Johansson
Fuzzyman wrote:
> 
> Because it is client side (rather than running on the server), it has
> no built in comments facility. I use Haloscan for comments, but I'm
> always on the look out for a neat comments system to integrate with
> Firedrop.
> 
> I personally prefer the 'client side' approach, as it makes migrating
> content to another server trivially easy.

a wise person you are.  I've often thought that most of the pages 
generated by web frameworks (except for active pages) should be cached 
once rendered.

as to the comment system, I've been very disappointed by most blog 
comment capabilities because they actively hinder the ability for 
commenters to interact with each other.  what I would like to see is a 
short-life (i.e. three day) mailing list where the message history is 
stored as if it were blog comments.

The advantage of this technique is you can follow the comments without 
constantly checking in on the blog And you can actually build a 
community which interacts more easily than they do today.

Yes, you could build a web form techniques but the main advantage of Web 
forms over mailing lists is that they fill your mailbox with messages 
telling you that you have a message instead of delivering the message 
itself.

it would be interesting to see if one could build this capability 
into/out of mailman.  I really hate reinventing the wheel unless the 
wheel is square and I need a round one.  :-)

---eric


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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Brad Allen
Here is an idea for improving Python official documentation:

Provide a tab-based interface for each entry, with the overview/summary
at the top-level, with a row of tabs underneath:
1. Official documentation, with commentary posted at the bottom
(ala Django documentation)
2. Examples wiki
3. Source code browser with a folding/docstring mode
4. Bugs/To-Do

Of course, building this would take a lot of work, and I'm not offering
to build it myself...I just find that something like this is what I've
been longing for.

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


tcl list to python list?

2006-09-16 Thread jerry . levan
Hi,

I have a file that contains a "tcl" list stored as a string.  The list
members are
sql commands ex:
 { begin { select * from foo
where baz='whatever'}
  {select * from gooble } end
  { insert into bar values('Tom', 25) } }

I would like to parse the tcl list into a python list...

Any suggestions ( I am running Tkinter...)

Jerry

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


Re: eval(repr(object)) hardly ever works

2006-09-16 Thread Tal Einat

Matthew Wilson wrote:
> I understand that idea of an object's __repr__ method is to return a
> string representation that can then be eval()'d back to life, but it
> seems to me that it doesn't always work.
>
[snip]
>
> Any thoughts?
>

This is actually an interesting issue when you're working with Python
interpreters. For example, an object with a simple repr() which is code
to create an identical object is easy to use as a key in a dictionary.

I ran into this a while back when I was tinkering with IDLE's
auto-completion module, and ended up writing some code which checks if
an object's repr() is "reversible" or not.

- Tal
reduce(lambda m,x:[m[i]+s[-1] for i,s in enumerate(sorted(m))],
   [[chr(154-ord(c)) for c in '.&-&,l.Z95193+179-']]*18)[3]

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Thorsten Kampe
* [EMAIL PROTECTED] (2006-09-16 18:40 +0100)
> Wildemar Wildenburger wrote:
>> [EMAIL PROTECTED] wrote:
>>> I have read many messages of people complaining about the documentation,
>>> it's lack of examples and the use of complicated sentences that you
>>> need to read 10 times before understanding what it means.
>>  >
>> Where have you read that?
>>
>> wildemar
> 
> I don't mean to start a flame war about this but here are some
> reference of people, who like me, don't like the current python doc:
> http://xahlee.org/UnixResource_dir/writ/python_doc.html

*chuckle* *manic laughter* *cough cough* X L - you really made my
day...

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


Re: Is there a way to find IP address?

2006-09-16 Thread Tim Roberts
"Lad" <[EMAIL PROTECTED]> wrote:
>Fredrik Lundh wrote:
>> Lad wrote:
>>
>> > Normaly I can log user's IP address using os.environ["REMOTE_ADDR"] .
>> > If a user  is behind a proxy, I will log  proxy's IP address only.
>> > Is there a way how to find a real IP user's address?
>>
>> os.environ["HTTP_X_FORWARDED_FOR"]
>>
>> (but that can easily be spoofed, and is mostly meaningless if the user
>> uses local IP addresses at the other side of the proxy, so you should
>> use it with care)
>>
>Hello Fredrik,
>Thank you for your reply.
>How can be HTTP_X_FORWARDED_FOR easily  spoofed? I thought that  IP
>address is not possible change.

No, but HTTP headers are just text.  A client can put whatever it wants in
them.
-- 
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: UDP packets to PC behind NAT

2006-09-16 Thread John J. Lee
"Janto Dreijer" <[EMAIL PROTECTED]> writes:

> Steve Holden wrote:
> > Note that TCP and UDP port spaces are disjoint, so there's no way for
> > TCP and UDP to use "the same port" - they can, however, use the same
> > port number. Basically the TCP and UDP spaces have nothing to do with
> > each other.
> >
> > Most dynamic NAT gateways will respond to an outgoing UDP datagram by
> > mapping the internal client's UDP port to a UDP port on the NAT
> > gateway's external interface, and setting a converse mapping that will
> > allow the server to respond, even though technically there isn't a
> > "connection". The NAT table entries will typically be timed out after a
> > short period of non-use.
> 
> So are you saying one can't use TCP to punch a hole for UDP?

If server and client know what to do it's always possible to tunnel
anything over anything, but as Steve explained, there would be no need
for the UDP and TCP port numbers to match (and of course, tunneling
UDP over TCP is a slightly odd thing to be doing :-).


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


Re: high level, fast XML package for Python?

2006-09-16 Thread John J. Lee
Steven Bethard <[EMAIL PROTECTED]> writes:
[...]
> In Python 2.5, cElementTree and ElementTree will be available in the
> standard library as xml.etree.cElementTree and
> xml.etree.ElementTree. So learning them now is a great idea.

Only some of the original ElementTree software is going into 2.5,
apparently.  So you can get more on the effbot.org site than you get
from just downloading Python 2.5.  Probably future Python releases
will add more of Fredrik's XML code.


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


Re: Mechanoid Web Browser - Recording Capability

2006-09-16 Thread John J. Lee
"Seymour" <[EMAIL PROTECTED]> writes:

> I am trying to find a way to sign onto my Wall Street Journal account
> (http://online.wsj.com/public/us) and automatically download various
> financial pages on stocks and mutual funds that I am interested in
> tracking.  I have a subscription to this site and am trying to figure
> out how to use python, which I have been trying to learn for the past
> year, to automatically login and capture a few different pages.
[...]

Just to add: It's quite possible that site has an "no scraping"
condition in their terms of use.  It seems standard legal boilerplate
on commercial sites these days.  Not a good thing on the whole, I tend
to think, but you should be aware of it.


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


Re: Mechanoid Web Browser - Recording Capability

2006-09-16 Thread John J. Lee
"Seymour" <[EMAIL PROTECTED]> writes:
[...]
> struggling otherwise and have been trying to learn how to program the
> Mechanoid module (http://cheeseshop.python.org/pypi/mechanoid) to get
> past the password protected site hurdle.
> 
> My questions are:
> 1. Is there an easier way to grab these pages from a password protected
> site, or is the use of Mechanoid a reasonable approach?
[...]

Again, can't speak for mechanoid, but it should be straightforward
with mechanize (simplifiying one of the examples from the URL below):


http://wwwsearch.sourceforge.net/mechanize/

br = Browser()
br.add_password("http://example.com/protected/";, "joe", "password")
br.set_debug_http(True)  # Print HTTP headers.
br.open("http://www.example.com/protected/blah.html";)
print br.response().read()


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


Re: Mechanoid Web Browser - Recording Capability

2006-09-16 Thread John J. Lee
"Seymour" <[EMAIL PROTECTED]> writes:

> I am trying to find a way to sign onto my Wall Street Journal account
> (http://online.wsj.com/public/us) and automatically download various
> financial pages on stocks and mutual funds that I am interested in
> tracking.  I have a subscription to this site and am trying to figure
[...]
> My questions are:
> 1. Is there an easier way to grab these pages from a password protected
> site, or is the use of Mechanoid a reasonable approach?

This is the first time I heard of anybody using mechanoid.  As the
author of mechanize, of which mechnoid is a fork, I was always in the
dark about why the author decided to fork it (he hasn't emailed
me...).

I don't know if there's any activity on the mechanoid project, but I'm
certainly still working on mechanize, and there's an active mailing list:

http://wwwsearch.sourceforge.net/

https://lists.sourceforge.net/lists/listinfo/wwwsearch-general


> 2. Is there an easy way of recording a web surfing session in Firefox
> to see what the browser sends to the site?  I am thinking that this
> might help me better understand the Mechanoid commands, and more easily
> program it.  I do a fair amount of VBA Programming in Microsoft Excel
> and have always found the Macro Recording feature a very useful
> starting point which has greatly helped me get up to speed.

With Firefox, you can use the Livehttpheaders extension:

http://livehttpheaders.mozdev.org/


The mechanize docs explain how to turn on display of HTTP headers that
it sends.


Going further, certainly there's at least one HTTP-based recorder for
twill, which actually watches your browser traffic and generates twill
code for you (twill is a simple language for functional testing and
scraping built on top of mechanize):

http://twill.idyll.org/

http://darcs.idyll.org/%7Et/projects/scotch/doc/


That's not an entirely reliable process, but some people might find it
helpful.

I think there may be one for zope.testbrowser too (or ZopeTestBrowser
(sp?), the standalone version that works without Zope) -- I'm not
sure.  (zope.testbrowser is also built on mechanize.)  Despite the
name, I'm told this can be used for scraping as well as testing.

I would imagine that it would be fairly easy to modify or extend
Selenium IDE to emit mechanize or twill or zope.testbrowser (etc.)
code (perhaps without any coding, I used too many Firefox Selenium
plugins and now forget which had which features).  Personally I would
avoid using Selenium itself to actually automate tasks, though, since
unlike mechanize &c., Selenium drags in an entire browser, which
brings with it some inflexibility (though not as bad as in the past).
It does have advantages though: most obviously, it knows JavaScript.


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


Re: urllib en https

2006-09-16 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes:
[...]
> Does ActiveState do a unix distribution of Python now?
> 
> (The OP seemed to have a Unix-like system -- so probably he didn't
> install have the right rpm or whatever installed -- a very common
> problem with people trying to use SSL on linux distributions.)
> 
> 
> John

Hmm, so they do (maybe they always did?):

| ActivePython is ActiveState's quality-assured, ready-to-install
| distribution of Python, available for AIX, HP-UX, Linux, Mac OS X,
| Solaris, and Windows. The standard ActivePython distribution is
| available for free download.


Still, I suspect a missing system package is a more likely culprit.


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


Re: wxTimer problem

2006-09-16 Thread Bjoern Schliessmann
abcd wrote:

> thanks for NO help.

Know what? I knew you were going to answer like that.

Regards,


Björn

-- 
BOFH excuse #415:

Maintenance window broken

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


Re: How to get the "longest possible" match with Python's RE module?

2006-09-16 Thread Tim Peters
[Tim Peters]
>> [...]  The most valuable general technique [Friedl] (eventually ;-)
>> explained he called "unrolling", and consists of writing a regexp in
>> the form:
>>
>>normal* (?: special normal* )*
>>
>> where the sets of characters with which `normal` and `special` can
>> start are disjoint.  Under most "NFA" implementation, such a regexp is
>> immune to most bad behaviors, whether finding very long matches, or in
>> searching a very long string that happens not to contain any matches.

[Bryan Olson]
> So how general is that?

Between 6 and 7 ;-)

> The books just says "certain common expressions". I think the real
> answer is that one can unroll exactly the true regular expressions.

I'm sure he didn't have that much in mind; e.g., it's a real strain to
fit a fat alternation of fixed strings into that "pattern"
(cat|dog|wombat|weasel|...).'

> The unrolling is essentially resolving the states of a DFA by hand.

Oh yes, for those who've studied the theoretical underpinnings.  Most
people have not.  Much of what he gives as practical advice amounts to
ways to "trick" an "NFA" engine into doing what a "DFA" engine would
do, but explained from the POV of how a backtracking search engine
works.  And it makes /sense/ at that level too, divorced from any
knowledge of how a linear-time automaton might be constructed in
theory; e.g., you "want to" give the  search engine only one choice
because you want to avoid the possibility of needing to backtrack
later, not because you're picturing a theoretical linear-time
automaton and striving to mimic its behavior.

That explanation may not work for you, but it's effective for people
who haven't studied the theory here.  Such explanations also extend
naturally to gimmicks like backreferences,  which have no counterpart
in CompSci regexps.
-- 
http://mail.python.org/mailman/listinfo/python-list


Mechanoid Web Browser - Recording Capability

2006-09-16 Thread Seymour
I am trying to find a way to sign onto my Wall Street Journal account
(http://online.wsj.com/public/us) and automatically download various
financial pages on stocks and mutual funds that I am interested in
tracking.  I have a subscription to this site and am trying to figure
out how to use python, which I have been trying to learn for the past
year, to automatically login and capture a few different pages.
I have mastered capturing web pages on non-password sites, but am
struggling otherwise and have been trying to learn how to program the
Mechanoid module (http://cheeseshop.python.org/pypi/mechanoid) to get
past the password protected site hurdle.

My questions are:
1. Is there an easier way to grab these pages from a password protected
site, or is the use of Mechanoid a reasonable approach?
2. Is there an easy way of recording a web surfing session in Firefox
to see what the browser sends to the site?  I am thinking that this
might help me better understand the Mechanoid commands, and more easily
program it.  I do a fair amount of VBA Programming in Microsoft Excel
and have always found the Macro Recording feature a very useful
starting point which has greatly helped me get up to speed.

Thanks for your help/insights.
Seymour

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Rakotomandimby (R12y)
On Sat, 16 Sep 2006 12:30:56 -0700, Robert Hicks wrote:

> That said...the Python docs are open source. Just start going through
> them and adding examples.

ASPN (activestate) is a good place for examples...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Rakotomandimby (R12y)
On Sat, 16 Sep 2006 22:43:41 +0200, Daniel Nogradi wrote:
> Then how about running your site on python and not php?

PHP has "better" documentation... ;-)
More seriously, I can provide a CPS hosting to nicolasfr if he wants.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote:
> Hi,
> 
> I am a bit disapointed with the current Python online documentation. I
> have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
> 
> That's why I have started a collaborative project to make a user
> contributed Python documentation. The wiki is online here:
> http://www.pythondocs.info

And what's so wrong about
http://wiki.python.org/moin/ ?

I'm really not trying to put you down, I just feel that the closer the 
documentation is to the official website the more people will read it 
(or am I being too naive here?).

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


Re: 911 FORGERY bigger than the Protocols of the Learned Elders of Zion

2006-09-16 Thread JR North
LOOK OUT! He has a bomb strapped to him!
JR
Dweller in the cellar

[EMAIL PROTECTED] wrote:

> Do not bury your head in the sand ... Do not practice denial ... It
> will only bring you to terrible shame and grief ... Do not be afraid of
> saying the truth ... Do not be afraid of death ... God will take care
> of you and your kins as he took care of the flock of Abraham, Moses and
> Jesus.
> 
> Here you will find all the truth, movies, audios and proof for your
> eyes to see (even the swiss are beginning to doubt 911) :
> 
> www.scholarsfor911truth.org
> www.journalof911studies.org
> www.st911.org
> 
> also go to Alex Jones site:
> 
> infowars.com
> prisonplanet.com
> 
> Distribute fliers on the site at your churches and synagogues, in your
> schools. Call your elected officials. Mail anonymously to your local
> fire station chiefs and your local police
> sherrifs. Send, to any and all CIA, FBI, Military personell and Court
> Judges that you know.
> 
> We need to move fast and quick before the terrorists of 911 bring
> another false flag terrorism
> which may be biological, nuclear or what we cannot even imagine.
> 
> They dont care about the lives or the freedom of the american people.
> They only love their evil agendas.
> 
> God Bless you All
> 
> Search Keywords:
> Thermate
> Sulfur
> Potassium
> Manganese
> Aluminum
> Thermite
> Alex Jones
> Steven Jones
> Controlled Demolition
> Popular Mechanics
> Larry Silverstein
> Marvin Bush
> Stratcor
> Stratesec
> Ground Zero
> 


-- 
--
Home Page: http://www.seanet.com/~jasonrnorth
   If you're not the lead dog, the view never changes
 Doubt yourself, and the real world will eat you alive
  The world doesn't revolve around you, it revolves around me
 No skeletons in the closet; just decomposing corpses
--
Dependence is Vulnerability:
--
"Open the Pod Bay Doors please, Hal"
"I'm sorry, Dave, I'm afraid I can't do that.."
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread [EMAIL PROTECTED]
I would like to see more than one source..  Not that the documentation
is good or bad it is just that different people may come up with
different ways to explain the same thing and that is good in my view.
I would like to see the re module and the string module with as many
examples as humanly possible to overexplain it for me.  (I am currently
downloading a hole directory of re module stuff to try to overcome it)

http://www.dexrow.com




Leif K-Brooks wrote:
> [EMAIL PROTECTED] wrote:
> > I am a bit disapointed with the current Python online documentation. I
> > have read many messages of people complaining about the documentation,
> > it's lack of examples and the use of complicated sentences that you
> > need to read 10 times before understanding what it means.
> >
> > That's why I have started a collaborative project to make a user
> > contributed Python documentation. The wiki is online here:
> > http://www.pythondocs.info
>
> I agree that Python's docs could use improvement, and I love the idea of
> using a Wiki for the purpose. But maybe MediaWiki would be a better
> choice of software? Dokuwiki's syntax looks foreign and a little bit
> intimidating to me, but Wikipedia has made pretty much everyone familiar
> with MediaWiki's syntax. Less syntax to learn lowers the cost of entry,
> which should lead to more contributors.

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


Re: Unicode / cx_Oracle problem

2006-09-16 Thread John Machin
Richard Schulman wrote:
> On 10 Sep 2006 15:27:17 -0700, "John Machin" <[EMAIL PROTECTED]>
> wrote:
>
> >...
> >Encode each Unicode text field in UTF-8. Write the file as a CSV file
> >using Python's csv module. Read the CSV file using the same module.
> >Decode the text fields from UTF-8.
> >
> >You need to parse the incoming line into column values (the csv module
> >does this for you) and then convert each column value from
> >string/Unicode to a Python type that is compatible with the Oracle type
> >for that column.
> >...
>
> John, how am I to reconcile your suggestions above with my
> ActivePython 2.4 documentation, which states:
>
> <<12.20 csv -- CSV File Reading and Writing
> < ...
> < Also, there are currently some issues regarding ASCII NUL characters.
> Accordingly, all input should generally be printable ASCII to be safe.
> These restrictions will be removed in the future.>>
>

1. For "Unicode" read  "UTF-16".

2.  Unless you have \u in your Unicode data, encoding it into UTF-8
won't cause any ASCII NUL bytes to appear. Ensuring that you don't have
NULs in your data is a good idea in general.

3. There are also evidently some issues regarding ASCII LF characters
embedded in fields (like when Excel users do Alt-Enter (Windows
version) to put a hard line break in their headings); see
http://docs.python.org/dev/whatsnew/modules.html of which the following
is an extract:
"""
The CSV parser is now stricter about multi-line quoted fields.
Previously, if a line ended within a quoted field without a terminating
newline character, a newline would be inserted into the returned field.
This behavior caused problems when reading files that contained
carriage return characters within fields, so the code was changed to
return the field without inserting newlines. As a consequence, if
newlines embedded within fields are important, the input should be
split into lines in a manner that preserves the newline characters.
"""

4. Provided your fields don't contain any of  CR, LF, ctrl-Z (maybe),
and NUL, you should be OK. I can't understand the sentence
"Accordingly, all input should generally be printable ASCII to be
safe." -- especially the "accordingly". If it was running amok with
8-bit characters with ord(c) >= 128, there would have been loud shrieks
from several corners of the globe.

5. However, to be safe, you could go the next step and convert the
UTF-8 to base64  -- see
http://docs.python.org/dev/lib/module-base64.html -- BUT once you've
done that your encoded data doesn't even have commas and quotes in it,
so you can avoid the maybe unsafe csv module and just write your data
as ",".join(base64_encoded_fields).

HTH,
John



HTH,
John

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


Re: How to draw a rectangle with gradient?

2006-09-16 Thread Pontus Ekberg
Daniel Mark wrote:

> Hello all:
> 
> I am using PIL to draw a rectangle filled with color blue.
> 
> Is there anyway I could set the fill pattern so that the drawn
> rectangle could be filled with
> gradient blue?
> 
> 
> Thank you
> -Daniel

I don't think there is a built-in gradient function, but you could do
something like this:

>>> import Image
>>> import ImageDraw
>>> im = Image.new("RGB", (100, 100))
>>> draw = ImageDraw.Draw(im)
>>> for l in xrange(100):
... colour = (0, 0, 255 * l / 100)
... draw.line((0, l, 100, l), fill=colour)
...
>>> im.show()

You have to adjust for the size and colours you want of course, and change
the loop so that the gradient is in the right direction.

// Pontus



 And now a word from our sponsor --
For a quality mail server, try SurgeMail, easy to install,
fast, efficient and reliable.  Run a million users on a standard
PC running NT or Unix without running out of power, use the best!
  See http://netwinsite.com/sponsor/sponsor_surgemail.htm  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote:
> Rakotomandimby (R12y) wrote:
>> What you should have done first is to suggest to contribute to the
>> official Python doc.
> 
> I wrote an email a few months ago to the Python docs support email
> address to offer my help but never got any answer.
> 
What did that email say?
- "Your docs suck!"? (useless)
- "Your docs aren't the most useful. May I offer to help?" (better, but 
somewhat thin. And if the answer had just been "Yes." You'd be no wiser.)
- "Hey, I found this article explaining XY. I made a 
tutorial/how-to/documentation-chapter, and here it is. Hope you can use 
it." (fantastic/preferred)

http://www.python.org/dev/doc/ has info on how to participate.


> Everytime I am lookink at how to do this or that in Python I write it
> down somewhere on my computer. (For ex. Threading. After reading the
> official documentation I was a bit perplex. Hopefully I found an
> article an managed to implement threads with only like 20 lines of code
> in my script. That should have been in the docs first, not in an
> article elsewhere... Same problem for handling gzipped files. I wanted
> to know if the file I opened was a gzip archive or not. Not a clue in
> the docs...) I have just decided to share all this knowledge this with
> other. Community will decide if this wiki is of any interest. If not it
> will just remain my personnal notebook for Python tips...

Let me stress that contributing to the *official* docs is a lot more 
rewarding and (I think) sensible. I can't stop you and I appreciate your 
enthusiasm. You might however consider helping fix the dam than build 
one where no water water runs.

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Daniel Nogradi
> Everytime I am lookink at how to do this or that in Python I write it
> down somewhere on my computer. (For ex. Threading. After reading the
> official documentation I was a bit perplex. Hopefully I found an
> article an managed to implement threads with only like 20 lines of code
> in my script. That should have been in the docs first, not in an
> article elsewhere... Same problem for handling gzipped files. I wanted
> to know if the file I opened was a gzip archive or not. Not a clue in
> the docs...) I have just decided to share all this knowledge this with
> other. Community will decide if this wiki is of any interest. If not it
> will just remain my personnal notebook for Python tips...
>
> Anyway Python rocks, that's the important point!
>

Then how about running your site on python and not php?

Just a thought.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: UDP packets to PC behind NAT

2006-09-16 Thread Paul Rubin
"Janto Dreijer" <[EMAIL PROTECTED]> writes:
> > Most dynamic NAT gateways will respond to an outgoing UDP datagram by
> > mapping the internal client's UDP port to a UDP port on the NAT
> > gateway's external interface, and setting a converse mapping that will
> > allow the server to respond, even though technically there isn't a
> > "connection". The NAT table entries will typically be timed out after a
> > short period of non-use.
> 
> So are you saying one can't use TCP to punch a hole for UDP?

You might look at some of the Q2Q stuff that simulates TCP over UDP.

http://divmod.org/trac/wiki/DivmodVertex

http://twistedmatrix.com/users/moshez/q2q.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread nicolasfr

Rakotomandimby (R12y) wrote:
> What you should have done first is to suggest to contribute to the
> official Python doc.

I wrote an email a few months ago to the Python docs support email
address to offer my help but never got any answer.

> Then, if you encounter too much dumbs (and only in that case) you could
> fork docs.python.org and do your own project.
> That's the way free software works.

Everytime I am lookink at how to do this or that in Python I write it
down somewhere on my computer. (For ex. Threading. After reading the
official documentation I was a bit perplex. Hopefully I found an
article an managed to implement threads with only like 20 lines of code
in my script. That should have been in the docs first, not in an
article elsewhere... Same problem for handling gzipped files. I wanted
to know if the file I opened was a gzip archive or not. Not a clue in
the docs...) I have just decided to share all this knowledge this with
other. Community will decide if this wiki is of any interest. If not it
will just remain my personnal notebook for Python tips...

Anyway Python rocks, that's the important point!

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


Re: wxTimer problem

2006-09-16 Thread Morpheus
On Fri, 15 Sep 2006 12:47:30 -0700, abcd wrote:

> I have a python script which creates a wx.App, which creates a wx.Frame
> (which has a wx.Timer).
> 
> looks sorta like this:
> 
> class MyProgram:
> def __init__(self):
> self.app = MyApp(0)
> self.app.MainLoop()
> 
> class MyApp(wx.App):
> def OnInit(self):
> self.myframe= MyFrame()
> self.myframe.Show(True)
> self.SetTopWindow(self.myframe)
> return True
> 
> class MyFrame(wx.Frame):
> def __init__(self):
># do some other stuff here
> 
># setup the timer
> self.timer = wx.Timer(self)
> self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
> self.timer.Start(100)
> 
> def killTimer(self):
> self.Unbind(wx.EVT_TIMER)
> self.timer.Stop()
> self.timer = None
> 
> 
> that's the jist of it.
> 
> Anyhow, so I startup python and import my script, which loads up the
> wx.App, frame and all.
> 
> foo = MyProgram()
> 
> 
> Then I close the frame.  when the frame is closed it calls killTimer.
> This method gets called and no exceptions occur.
> 
> Then...I create a new instance of the app and try to load the frame
> again.
> 
> foo = MyProgram()
> 
> ...and I am getting this error:
> 
> "timer can only be started from the main thread"
> 
> how can I fix this??
> 
> FYI, my script is being started by a new thread each time, so
> ultimately we have
> 
> def startProgram():
> foo = MyProgram()
> 
> threading.Thread(target=startProgram).start()
> 
> 
> Thanks in advance.

You must not access wx from more than one thread. Read their wiki about
this and about the appropriate workaround.

Morpheus


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


Re: 911 FORGERY bigger than the Protocols of the Learned Elders of Zion

2006-09-16 Thread malibu

SteveF wrote:
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Do not bury your head in the sand ... Do not practice denial ... It
> > will only bring you to terrible shame and grief ... Do not be afraid of
> > saying the truth ... Do not be afraid of death ... God will take care
> > of you and your kins as he took care of the flock of Abraham, Moses and
> > Jesus.
> >
> > Here you will find all the truth, movies, audios and proof for your
> > eyes to see (even the swiss are beginning to doubt 911) :
> >
>
> [snip]
>
> I just want to know how long it takes you to type this out while wearing a
> strait jacket.  Do you hold the pencil in your mouth and peck away?  Or does
> your mouth get tired and you have someone stick the pencil up your nose?
>
> Steve.
Hey Steve
Did you just pull your head
out of your ass to type this?

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote:
> I am a bit disapointed with the current Python online documentation. I
> have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
> 
> That's why I have started a collaborative project to make a user
> contributed Python documentation. The wiki is online here:
> http://www.pythondocs.info

I agree that Python's docs could use improvement, and I love the idea of 
using a Wiki for the purpose. But maybe MediaWiki would be a better 
choice of software? Dokuwiki's syntax looks foreign and a little bit 
intimidating to me, but Wikipedia has made pretty much everyone familiar 
with MediaWiki's syntax. Less syntax to learn lowers the cost of entry, 
which should lead to more contributors.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: urllib en https

2006-09-16 Thread John J. Lee
Dennis Lee Bieber <[EMAIL PROTECTED]> writes:

> On Wed, 13 Sep 2006 23:03:08 +0200, Cecil Westerhof <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
> 
> > 
> > I found the problem. The first Python was compiled with ssl support enabled
> > and the second without ssl support enabled.
> 
>   A vision is forming in the crystal ball... I see... ActiveState...
> 
>   As I recall, ActiveState doesn't distribute the SSL package that the
> python.org package contains. But... It is possible to copy the SSL
> related files from a python.org package into the ActiveState
> installation.

Does ActiveState do a unix distribution of Python now?

(The OP seemed to have a Unix-like system -- so probably he didn't
install have the right rpm or whatever installed -- a very common
problem with people trying to use SSL on linux distributions.)


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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Robert Hicks

Christoph Haas wrote:
> On Saturday 16 September 2006 19:16, [EMAIL PROTECTED] wrote:

>
> I second that the Python documentation is lacking. There is no software
> that is adequately documented anyway. Show me a man page of a Perl module
> and it takes me minutes to use it.

I would say that Perl module documentation is really good. Most of them
have plenty examples on how to use the module itself.

That said...the Python docs are open source. Just start going through
them and adding examples. It shouldn't be too hard and will benefit
everyone who use them.

Robert

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Rakotomandimby (R12y)
On Sat, 16 Sep 2006 10:40:43 -0700, nicolasfr wrote:
>>> I have read many messages of people complaining about the documentation,
>>> it's lack of examples and the use of complicated sentences that you
>>> need to read 10 times before understanding what it means.
>> Where have you read that?
> http://xahlee.org/UnixResource_dir/writ/python_doc.html
> http://mail.python.org/pipermail/python-list/2005-May/280634.html
> I think the PHP documentation is a really good one in comparison.

What you should have done first is to suggest to contribute to the
official Python doc.
Then, if you encounter too much dumbs (and only in that case) you could
fork docs.python.org and do your own project.
That's the way free software works.

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Robert Hicks

[EMAIL PROTECTED] wrote:
> Wildemar Wildenburger wrote:
> > [EMAIL PROTECTED] wrote:
> > > I have read many messages of people complaining about the documentation,
> > > it's lack of examples and the use of complicated sentences that you
> > > need to read 10 times before understanding what it means.
> >  >
> > Where have you read that?
> >
> > wildemar
>
> I don't mean to start a flame war about this but here are some
> reference of people, who like me, don't like the current python doc:
> http://xahlee.org/UnixResource_dir/writ/python_doc.html
> http://mail.python.org/pipermail/python-list/2005-May/280634.html
>\

Please don't use Xah Lee as an example...please.

Robert

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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread vbgunz
> kodos does look good but I do not have the pyqt (maybe I am slightly
> off) interface to use it on my system..  with another graphic interface
> it would be a must try software.

on Ubuntu 6.06, the repos have this 'gtk2-engines-gtk-qt' and it makes
QT apps look really awesome on Gnome. Not sure about Windows *but* I am
sure something like it has to exist. Try looking into it. Good luck!

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


Re: XPN 0.6.5 released

2006-09-16 Thread Franz Steinh�usler
On Sat, 16 Sep 2006 17:43:28 GMT, Nemesis <[EMAIL PROTECTED]>
wrote:

>Mentre io pensavo ad una intro simpatica "Franz Steinhäusler" scriveva:
>
>> Ah, great. I changed, this was not working immediatly.
>> So I remembered, most often you have to restart the App, and so its is
>> working.
>
>Here is working fine.


I am on windows, is there maybe a difference (?).

>
>> Small Notice: There was the warning then: Another Instance is running,
>> I pressed yes.
>
>XPN uses the file xpn.lock to see if there is another istance running,
>if the program is not closed correctly it doesn't remove this file so
>you get the warning.

I see.

>
>>>that's an optimization I've thinking about for a while ... but at the
>>>moment I don't know how to implement it.
>> I see, you have to remember after refreshing the list the position and
>> the state of the folding. I can imagine, this is not trivial.
>
>That's right. You should also remember the open/closed threads ... at
>least the one with the article selected.
>

Anyway, not soo important.

>> I'm sure, I will discover some more useful things about your program!
>> In some cases, it already beats forte agent!
>
>Thank you. Agent is (was) a great software I've been using it for a long
>time.

Cool, we have both an equal starting-point. ;)

>>
>> Some remarks:
>
>> * threads are somtimes not assigned correctly, this means, that
>> one thread is divided into two.
>> I subscribed to wxPyhton mailing list in gmane, and there is:
>> One thread
>> Applications written in wxPyhton
>> and another
>> RE: Applications written in wxPyhton
>
>threading is based on the References header and then on the subject, you
>can have problems with mailing-lists cause mail-agents sometimes do not
>produce the References header but only the In-Reply-To.
>Another problem could be the date, before building the threads XPN
>reorders the articles by date ... but if the date in the article is
>wrong it can confuse the threads.

Aha, I don't understand all the details anyway, in Forte the same
thread was ordered in.


>
>> but this (is) or should be *one* thread.
>
>Yes.
>
>> * the enter key is not working in some dialogs (for example in search)
>> and Esc to cancel the dialog. (or is that a gkt issue?)
>
>It's a focus issue, in the search dialog the focus is set on the entry.
>The Esc key is not binded to any button by default.
>
That would be convenient, pressing "Enter" to perform the awaited 
process and cancel to abandon the dialogue.

>> * the find dialog is sometimes not working
>
>What exactly is not working?

Sorry, I think, I have made an error myself. That means I typed the
search string in "From", where I excpeted to look for headers search.

>
>> * to mark more than one article at one time (to be able to mark
>> multiple articles at one as read, ...)
>
>Yes but selecting more then one article introduces some difficulties I
>preferred to avoid for the moment ;-)

Ok.

If you don't mind, I will make a thorough test :-)
I don't want to bother more than necessary.
I want to make it happen, that XPN will be my "default" Newsreader!!!


Many thanks again for your answers and this wonderful piece of
sofware!


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


Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread Steve Holden
[EMAIL PROTECTED] wrote:
> Frank Millman wrote:
> 
>>Dale Strickland-Clark wrote:
>>
>>>Now that OIDs have been deprecated in PostgreSQL, how do you find the key of
>>>a newly inserted record?
>>>
> 
> 
>>I used to use 'select lastval()', but I hit a problem. If I insert a
>>row into table A, I want the id of the row inserted. If it is a complex
>>insert, which triggers inserts into various other tables, some of which
>>may also be auto-incrementing, lastval() returns the id of the row last
>>inserted into any auto-incrementing table.
>>
>>I therefore use the following -
>>cur.execute("select currval('%s_%s_Seq')" % (tableid, columnid)
> 
> 
> Aren't both of these inherently racey?  It seems to me like you need
> some kind of atomic insert-and-return-id value; otherwise you don't
> know if another thread/process has inserted something else in the table
> in between when you call insert and when you select lastval/currval.
> 
> Or does postgres have some transactional atomicity here?
> 
currval(sequence) is alleged to be connection-specific in the PostgreSQL 
documentation for currval: """Return the value most recently obtained by 
nextval for this sequence in the current session. (An error is reported 
if nextval has never been called for this sequence in this session.) 
Notice that because this is returning a session-local value, it gives a 
predictable answer whether or not other sessions have executed nextval 
since the current session did."""

> I'm very interested in an answer to the OP's question as well.  As far
> as I can tell, the best you can do is make the ID a primary key, select
> the nextval _before you insert, explicitly set it on insert, and then
> you'll get an error if you lost a race and you can select nextval, set
> it, and try again (repeat until success).
> 
> That's nasty and I'm sure there's a real solution but I haven't found
> it yet.
> 
The real solution has been given already: you just haven't brought 
yourself to believe it yet ;-)

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

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


Re: XPN 0.6.5 released

2006-09-16 Thread Franz Steinh�usler
On Sat, 16 Sep 2006 17:54:27 GMT, Nemesis <[EMAIL PROTECTED]>
wrote:

>Mentre io pensavo ad una intro simpatica "Franz Steinhäusler" scriveva:
>
>
>> For the find, I personally would prefer to jump default to "body",
>> but this is of course a matter of taste.
>
>Do you mean you would like the focus to be set on the "body" search
>field?

Yes, that I meant.

>
>> I dos prompt, all the time the prompt doesn't return anymore
>> (are there still open windows)?
>>
>>
>> I quit with ctrl-break:
>>
>> Traceback (most recent call last):
>>
>>   File "c:\Programme\xpn\xpn.py", line 507, in destroy
>>
>> self.purge_groups()
>>
>>   File "c:\Programme\xpn\xpn.py", line 2456, in purge_groups
>>
>> articles.update(articles_dict)
>>
>>   File "C:\Python24\lib\UserDict.py", line 147, in update
>>
>> self[k] = v
>>
>>   File "c:\Python24\lib\shelve.py", line 129, in __setitem__
>>
>> p.dump(value)
>>
>> KeyboardInterrupt
>
>I don't know how "CTRL+break" interact with XPN, it's better to close it
>with its exit function "CTRL+E".

Because it hanged. The dos prompt didn't return, so I have to 
type ctrl-c or ctrl-break to get the prompt back.

>
>> I changed the key Find message to ctrl f, and then I restart, I got:
>>
>>
>> Traceback (most recent call last):
>>   File "c:\Programme\xpn\xpn.py", line 2987, in ?
>> main=MainWin(options.use_home,options.custom_dir)
>>   File "c:\Programme\xpn\xpn.py", line 2917, in __init__
>> self.show_subscribed()
>>   File "c:\Programme\xpn\xpn.py", line 557, in show_subscribed
>> total=len(articles.keys())
>>   File "c:\Python24\lib\shelve.py", line 98, in keys
>> return self.dict.keys()
>>   File "C:\Python24\lib\bsddb\__init__.py", line 238, in keys
>> return self.db.keys()
>> DBPageNotFoundError: (-30988, 'DB_PAGE_NOTFOUND: Requested page not
>> found')
>> I cannot start the program anymore.
>>
>> maybe it has something to to with shortcuts.dat. 
>> (I don't know).
>
>No I don't think it is related to the shortcuts, it seems that
>your articles db is corrupted, it got broken when the application has
>been closed not in the right way.

Aha. I try again any further.
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread gene tani

[EMAIL PROTECTED] wrote:
> vbgunz wrote:
> > > > Has anyone tried this thing..
> > > > http://www.regular-expressions.info/regexbuddy.html
> >
> > I use kodos http://kodos.sourceforge.net/. I firmly agree using a tool
> > like this to learn regular expressions will not only save you a
> > ridiculous amount of time spent on trial and error *but* it's really
> > easy and makes learning re a joy.
> >
> > btw, kodos is specifically created with Python's re module in mind.
> > Good luck!
>
> kodos does look good but I do not have the pyqt (maybe I am slightly
> off) interface to use it on my system..  with another graphic interface
> it would be a must try software.

There's also Komodo's regex debugger, (I would guess WIng IDE has a
good one also) and these

http://www.weitz.de/regex-coach/
http://www.quanetic.com/regex.php

http://www.python.org/pypi/retest/0.6
http://www.python.org/pypi/Pyreb/0.1.5

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


Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread [EMAIL PROTECTED]
Frank Millman wrote:
> Dale Strickland-Clark wrote:
> > Now that OIDs have been deprecated in PostgreSQL, how do you find the key of
> > a newly inserted record?
> >

>
> I used to use 'select lastval()', but I hit a problem. If I insert a
> row into table A, I want the id of the row inserted. If it is a complex
> insert, which triggers inserts into various other tables, some of which
> may also be auto-incrementing, lastval() returns the id of the row last
> inserted into any auto-incrementing table.
>
> I therefore use the following -
> cur.execute("select currval('%s_%s_Seq')" % (tableid, columnid)

Aren't both of these inherently racey?  It seems to me like you need
some kind of atomic insert-and-return-id value; otherwise you don't
know if another thread/process has inserted something else in the table
in between when you call insert and when you select lastval/currval.

Or does postgres have some transactional atomicity here?

I'm very interested in an answer to the OP's question as well.  As far
as I can tell, the best you can do is make the ID a primary key, select
the nextval _before you insert, explicitly set it on insert, and then
you'll get an error if you lost a race and you can select nextval, set
it, and try again (repeat until success).

That's nasty and I'm sure there's a real solution but I haven't found
it yet.

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


Re: Unicode / cx_Oracle problem

2006-09-16 Thread Richard Schulman
On 10 Sep 2006 15:27:17 -0700, "John Machin" <[EMAIL PROTECTED]>
wrote:

>...
>Encode each Unicode text field in UTF-8. Write the file as a CSV file
>using Python's csv module. Read the CSV file using the same module.
>Decode the text fields from UTF-8.
>
>You need to parse the incoming line into column values (the csv module
>does this for you) and then convert each column value from
>string/Unicode to a Python type that is compatible with the Oracle type
>for that column.
>...

John, how am I to reconcile your suggestions above with my
ActivePython 2.4 documentation, which states:

<<12.20 csv -- CSV File Reading and Writing 
<>

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


Re: 911 FORGERY bigger than the Protocols of the Learned Elders of Zion

2006-09-16 Thread SteveF

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Do not bury your head in the sand ... Do not practice denial ... It
> will only bring you to terrible shame and grief ... Do not be afraid of
> saying the truth ... Do not be afraid of death ... God will take care
> of you and your kins as he took care of the flock of Abraham, Moses and
> Jesus.
>
> Here you will find all the truth, movies, audios and proof for your
> eyes to see (even the swiss are beginning to doubt 911) :
>

[snip]

I just want to know how long it takes you to type this out while wearing a 
strait jacket.  Do you hold the pencil in your mouth and peck away?  Or does 
your mouth get tired and you have someone stick the pencil up your nose?

Steve.


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


Re: Coding Nested Loops

2006-09-16 Thread Rich Shepard
On Sat, 16 Sep 2006, Dan Sommers wrote:

> No, they all work the same way (thank goodness!).  The "." between "wx"
> and "frame" is the same dot as is between "random" and "choice" (i.e.,
> random.choice is the same construct as wx.frame).

   Ah, yes. I totally forgot this.

Thanks for the reminder,

Rich

-- 
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: XPN 0.6.5 released

2006-09-16 Thread Nemesis
Mentre io pensavo ad una intro simpatica "Franz Steinhäusler" scriveva:


> For the find, I personally would prefer to jump default to "body",
> but this is of course a matter of taste.

Do you mean you would like the focus to be set on the "body" search
field?

> I dos prompt, all the time the prompt doesn't return anymore
> (are there still open windows)?
>
>
> I quit with ctrl-break:
>
> Traceback (most recent call last):
>
>   File "c:\Programme\xpn\xpn.py", line 507, in destroy
>
> self.purge_groups()
>
>   File "c:\Programme\xpn\xpn.py", line 2456, in purge_groups
>
> articles.update(articles_dict)
>
>   File "C:\Python24\lib\UserDict.py", line 147, in update
>
> self[k] = v
>
>   File "c:\Python24\lib\shelve.py", line 129, in __setitem__
>
> p.dump(value)
>
> KeyboardInterrupt

I don't know how "CTRL+break" interact with XPN, it's better to close it
with its exit function "CTRL+E".

> I changed the key Find message to ctrl f, and then I restart, I got:
>
>
> Traceback (most recent call last):
>   File "c:\Programme\xpn\xpn.py", line 2987, in ?
> main=MainWin(options.use_home,options.custom_dir)
>   File "c:\Programme\xpn\xpn.py", line 2917, in __init__
> self.show_subscribed()
>   File "c:\Programme\xpn\xpn.py", line 557, in show_subscribed
> total=len(articles.keys())
>   File "c:\Python24\lib\shelve.py", line 98, in keys
> return self.dict.keys()
>   File "C:\Python24\lib\bsddb\__init__.py", line 238, in keys
> return self.db.keys()
> DBPageNotFoundError: (-30988, 'DB_PAGE_NOTFOUND: Requested page not
> found')
> I cannot start the program anymore.
>
> maybe it has something to to with shortcuts.dat. 
> (I don't know).

No I don't think it is related to the shortcuts, it seems that
your articles db is corrupted, it got broken when the application has
been closed not in the right way.

-- 
You can tune a guitar, but you can't tuna fish.
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org

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


Re: Coding Nested Loops

2006-09-16 Thread Dan Sommers
On Sat, 16 Sep 2006 10:06:25 -0700 (PDT),
Rich Shepard <[EMAIL PROTECTED]> wrote:

> On Sat, 16 Sep 2006, Dan Sommers wrote:

>> When you import random, all you're doing is importing the module; you
>> have to specify any given attribute thereof:

>   I thought that was implied. For example, I use 'import wx' and can
> then instantiate wx.frame, wx.dialogbox, etc. without explicitly
> importing each one. Apparently different modules work differently.

No, they all work the same way (thank goodness!).  The "." between "wx"
and "frame" is the same dot as is between "random" and "choice" (i.e.,
random.choice is the same construct as wx.frame).

Don't be confused by from:  if you use "from wx import frame," then you
can access frame *without* the "wx." bit.  I don't have wx installed,
but that works with random, too:

>>> choice
Traceback (most recent call last):
  File "", line 1, in ?
NameError: name 'choice' is not defined
>>> import random
>>> random.choice
>
>>> from random import choice
>>> choice
>

HTH,
Dan

-- 
Dan Sommers

"I wish people would die in alphabetical order." -- My wife, the genealogist
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Christoph Haas
On Saturday 16 September 2006 19:16, [EMAIL PROTECTED] wrote:
> I am a bit disapointed with the current Python online documentation. I
> have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
>
> That's why I have started a collaborative project to make a user
> contributed Python documentation. The wiki is online here:
> http://www.pythondocs.info
>
> This is a fresh new website, so there's not much on it, but I hope to
> make it grow quickly. Help and contributions are welcome; Please
> register and start posting your own documentation on it.

I like your enthusiasm but it appears that what you plan is similar to the 
Python Quick Reference at http://rgruet.free.fr/

I second that the Python documentation is lacking. There is no software 
that is adequately documented anyway. Show me a man page of a Perl module 
and it takes me minutes to use it. The same in Python often means Google 
to find some examples on how to use a module. Many parts of the standard 
library are badly documented IMHO. There is often no way to know how to 
use a certain module without looking at its source. But why don't you and 
I rather provide patches to the current documentation rather than writing 
yet another incomplete resource. IMHO python.org should be completed. And 
at least you motivated me to look for ways to contribute to python.org. :)

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


Re: XPN 0.6.5 released

2006-09-16 Thread Nemesis
Mentre io pensavo ad una intro simpatica "Franz Steinhäusler" scriveva:

> Ah, great. I changed, this was not working immediatly.
> So I remembered, most often you have to restart the App, and so its is
> working.

Here is working fine.

> Small Notice: There was the warning then: Another Instance is running,
> I pressed yes.

XPN uses the file xpn.lock to see if there is another istance running,
if the program is not closed correctly it doesn't remove this file so
you get the warning.

>>that's an optimization I've thinking about for a while ... but at the
>>moment I don't know how to implement it.
> I see, you have to remember after refreshing the list the position and
> the state of the folding. I can imagine, this is not trivial.

That's right. You should also remember the open/closed threads ... at
least the one with the article selected.

> I'm sure, I will discover some more useful things about your program!
> In some cases, it already beats forte agent!

Thank you. Agent is (was) a great software I've been using it for a long
time.
>
> Some remarks:

> * threads are somtimes not assigned correctly, this means, that
> one thread is divided into two.
> I subscribed to wxPyhton mailing list in gmane, and there is:
> One thread
> Applications written in wxPyhton
> and another
> RE: Applications written in wxPyhton

threading is based on the References header and then on the subject, you
can have problems with mailing-lists cause mail-agents sometimes do not
produce the References header but only the In-Reply-To.
Another problem could be the date, before building the threads XPN
reorders the articles by date ... but if the date in the article is
wrong it can confuse the threads.

> but this (is) or should be *one* thread.

Yes.

> * the enter key is not working in some dialogs (for example in search)
> and Esc to cancel the dialog. (or is that a gkt issue?)

It's a focus issue, in the search dialog the focus is set on the entry.
The Esc key is not binded to any button by default.

> * the find dialog is sometimes not working

What exactly is not working?

> * to mark more than one article at one time (to be able to mark
> multiple articles at one as read, ...)

Yes but selecting more then one article introduces some difficulties I
preferred to avoid for the moment ;-)


-- 
Le donne spesso non sanno d'essere sedute sulla loro fortuna.
 
 |\ |   |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread nicolasfr

Wildemar Wildenburger wrote:
> [EMAIL PROTECTED] wrote:
> > I have read many messages of people complaining about the documentation,
> > it's lack of examples and the use of complicated sentences that you
> > need to read 10 times before understanding what it means.
>  >
> Where have you read that?
>
> wildemar

I don't mean to start a flame war about this but here are some
reference of people, who like me, don't like the current python doc:
http://xahlee.org/UnixResource_dir/writ/python_doc.html
http://mail.python.org/pipermail/python-list/2005-May/280634.html
...
You really can find dozens of such discussions on the net.

I think the PHP documentation is a really good one in comparison.

Nicolas.

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Steve Holden
[EMAIL PROTECTED] wrote:
> Hi,
> 
> I am a bit disapointed with the current Python online documentation. I
> have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
> 
> That's why I have started a collaborative project to make a user
> contributed Python documentation. The wiki is online here:
> http://www.pythondocs.info
> 
> This is a fresh new website, so there's not much on it, but I hope to
> make it grow quickly. Help and contributions are welcome; Please
> register and start posting your own documentation on it.
> 
While I am all in favor of improving Python's documentation I am not 
sure that fragmenting it in this way is a good idea. Couldn't you 
instead devote your efforts to improving the docs at docs.python.org? It 
is, after all, an open source project ...

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

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


Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote:
> I have read many messages of people complaining about the documentation,
> it's lack of examples and the use of complicated sentences that you
> need to read 10 times before understanding what it means.
 >
Where have you read that?

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


Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread nicolasfr
Hi,

I am a bit disapointed with the current Python online documentation. I
have read many messages of people complaining about the documentation,
it's lack of examples and the use of complicated sentences that you
need to read 10 times before understanding what it means.

That's why I have started a collaborative project to make a user
contributed Python documentation. The wiki is online here:
http://www.pythondocs.info

This is a fresh new website, so there's not much on it, but I hope to
make it grow quickly. Help and contributions are welcome; Please
register and start posting your own documentation on it.

Regards,

Nicolas.
-
http://www.pythondocs.info

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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread [EMAIL PROTECTED]

vbgunz wrote:
> > > Has anyone tried this thing..
> > > http://www.regular-expressions.info/regexbuddy.html
>
> I use kodos http://kodos.sourceforge.net/. I firmly agree using a tool
> like this to learn regular expressions will not only save you a
> ridiculous amount of time spent on trial and error *but* it's really
> easy and makes learning re a joy.
>
> btw, kodos is specifically created with Python's re module in mind.
> Good luck!

kodos does look good but I do not have the pyqt (maybe I am slightly
off) interface to use it on my system..  with another graphic interface
it would be a must try software.

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


Re: Coding Nested Loops

2006-09-16 Thread Rich Shepard
On Sat, 16 Sep 2006, Dan Sommers wrote:

> When you import random, all you're doing is importing the module; you have
> to specify any given attribute thereof:

Dan,

   I thought that was implied. For example, I use 'import wx' and can then
instantiate wx.frame, wx.dialogbox, etc. without explicitly importing each
one. Apparently different modules work differently.

>> ... 2) What are the differences between 'choice' and 'shuffle?'

> choice chooses one element of a given list and leaves the list itself
> alone; shuffle shuffles the list, presumably so that you can iterate
> through the elements yourself.

   OK. The former picks the element for you while with the latter we must
specify which element to pick.

   Thank you. This is all very good to know.

Rich

-- 
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863
-- 
http://mail.python.org/mailman/listinfo/python-list


911 FORGERY bigger than the Protocols of the Learned Elders of Zion

2006-09-16 Thread pope_ratzinger_benedict
Do not bury your head in the sand ... Do not practice denial ... It
will only bring you to terrible shame and grief ... Do not be afraid of
saying the truth ... Do not be afraid of death ... God will take care
of you and your kins as he took care of the flock of Abraham, Moses and
Jesus.

Here you will find all the truth, movies, audios and proof for your
eyes to see (even the swiss are beginning to doubt 911) :

www.scholarsfor911truth.org
www.journalof911studies.org
www.st911.org

also go to Alex Jones site:

infowars.com
prisonplanet.com

Distribute fliers on the site at your churches and synagogues, in your
schools. Call your elected officials. Mail anonymously to your local
fire station chiefs and your local police
sherrifs. Send, to any and all CIA, FBI, Military personell and Court
Judges that you know.

We need to move fast and quick before the terrorists of 911 bring
another false flag terrorism
which may be biological, nuclear or what we cannot even imagine.

They dont care about the lives or the freedom of the american people.
They only love their evil agendas.

God Bless you All

Search Keywords:
Thermate
Sulfur
Potassium
Manganese
Aluminum
Thermite
Alex Jones
Steven Jones
Controlled Demolition
Popular Mechanics
Larry Silverstein
Marvin Bush
Stratcor
Stratesec
Ground Zero

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


Re: high level, fast XML package for Python?

2006-09-16 Thread Stefan Behnel
Tim N. van der Leeuw wrote:
> Another option is Amara; also quite high-level and also allows for
> incremental parsing. I would say Amara is somewhat higher level than
> ElementTree since it allows you to access your XML nodes as Python
> objects (with some extra attributes and some minor warts), as well as
> giving you XPath expressions on the object tree.

Then you should definitely give lxml.objectify a try. It combines the ET API
with the lxml set of features (XPath, RelaxNG, XSLT, ...) and hides the actual
XML behind a Python object interface. That gives you everything at the same 
time.

http://codespeak.net/lxml/objectify.html

It's part of the lxml distribution:
http://codespeak.net/lxml/

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


Re: XPN 0.6.5 released

2006-09-16 Thread Franz Steinh�usler
On Sat, 16 Sep 2006 18:16:13 +0200, Franz Steinhäusler
<[EMAIL PROTECTED]> wrote:

 Sat Sep 16 18:23:04 2006  

For the find, I personally would prefer to jump default to "body",
but this is of course a matter of taste.
Could that be an option.

I dos prompt, all the time the prompt doesn't return anymore
(are there still open windows)?


I quit with ctrl-break:

Traceback (most recent call last):

  File "c:\Programme\xpn\xpn.py", line 507, in destroy

self.purge_groups()

  File "c:\Programme\xpn\xpn.py", line 2456, in purge_groups

articles.update(articles_dict)

  File "C:\Python24\lib\UserDict.py", line 147, in update

self[k] = v

  File "c:\Python24\lib\shelve.py", line 129, in __setitem__

p.dump(value)

KeyboardInterrupt

If I start next time I get "An Instance of XPN" is already running.

I think, there is a problem with the shutdown of the program.


I changed the key Find message to ctrl f, and then I restart, I got:


Traceback (most recent call last):
  File "c:\Programme\xpn\xpn.py", line 2987, in ?
main=MainWin(options.use_home,options.custom_dir)
  File "c:\Programme\xpn\xpn.py", line 2917, in __init__
self.show_subscribed()
  File "c:\Programme\xpn\xpn.py", line 557, in show_subscribed
total=len(articles.keys())
  File "c:\Python24\lib\shelve.py", line 98, in keys
return self.dict.keys()
  File "C:\Python24\lib\bsddb\__init__.py", line 238, in keys
return self.db.keys()
DBPageNotFoundError: (-30988, 'DB_PAGE_NOTFOUND: Requested page not
found')

I cannot start the program anymore.

maybe it has something to to with shortcuts.dat. 
(I don't know).

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


Re: Looking for a python IDE

2006-09-16 Thread Fabio Zadrozny
On 15 Sep 2006 23:31:27 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
HelloI am looking for a good IDE for Python. Commercial or Open Software.
  Check http://wiki.python.org/moin/IntegratedDevelopmentEnvironmentsI reccomend Pydev (open source) + Pydev extensions (commercial).
Cheers,Fabio
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Coding Nested Loops

2006-09-16 Thread Dan Sommers
On Sat, 16 Sep 2006 08:29:26 -0700 (PDT),
Rich Shepard <[EMAIL PROTECTED]> wrote:

>   Two questions germane to random: 1) Why wasn't choice available when
> I used 'import random,' ...

When you import random, all you're doing is importing the module; you
have to specify any given attribute thereof:

import random
random.choice( [ 1, 5, 7 ] )

> ... 2) What are the differences between 'choice' and 'shuffle?'

choice chooses one element of a given list and leaves the list itself
alone; shuffle shuffles the list, presumably so that you can iterate
through the elements yourself.

HTH,
Dan

-- 
Dan Sommers

"I wish people would die in alphabetical order." -- My wife, the genealogist
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: XPN 0.6.5 released

2006-09-16 Thread Franz Steinh�usler
On 15 Sep 2006 06:11:12 -0700, "Nemesis" <[EMAIL PROTECTED]>
wrote:

>Franz Steinhaeusler wrote:
>> A few other notes (or should I post into the feature requests on
>> sourceforge?)
>
>To be honest I do not check sourceforge forums very often. If you want
>you can also send me an email (the email is written in the readme
>file).

Ok. I have still a few suggestions! ;)

>
>> little point: I find it superfluos on the header pane, to always have
>> the term "Re:" before (it would probaly easier to read without this
>> text).
>
>Maybe that's true ... but I tend not to modify the informations I show,
>I like not to elaborate to much the articles.

Yes.

>
>> an option possibly (as in agent): if you click on the tree the "+" sign,
>> it would be more convenient (for me) to open *all* subbranches, this
>> means show all responses headers for this thread.
>
>I should change the behaviour of the expander and that's not a correct
>way of acting.
>You can expand the whole thread with the command "Expand Selected
>Subthread" in the "Subscribed Groups" menu (or on the Toolbar). If you
>want you can associate a shortcut to this function ... there is also a
>standard GTK shortcut for this function SHIFT+CTRL+NUMPAD_PLUS
>where NUMPAD_PLUS is the plus key on the numpad.

Ah, great. I changed, this was not working immediatly.
So I remembered, most often you have to restart the App, and so its is
working.

Small Notice: There was the warning then: Another Instance is running,
I pressed yes.


>
>> if you change the groups, it would be nice to remember the position of
>> the last readed thread in the header pane, which means changing forth
>> and back to a certain group (as option for example).
>
>that's an optimization I've thinking about for a while ... but at the
>moment I don't know how to implement it.

I see, you have to remember after refreshing the list the position and
the state of the folding. I can imagine, this is not trivial.

I'm sure, I will discover some more useful things about your program!
In some cases, it already beats forte agent!


Some remarks:

* I don't find any function to delete threads or single messages (for
spam messages for instance)

* It would be fine to have an option to switch in search for "case
insensitive" as default on.

* nice would be, if nothing is found in the search, a little message
box appear.

* threads are somtimes not assigned correctly, this means, that
one thread is divided into two.
I subscribed to wxPyhton mailing list in gmane, and there is:
One thread
Applications written in wxPyhton
and another
RE: Applications written in wxPyhton

but this (is) or should be *one* thread.

* the enter key is not working in some dialogs (for example in search)
and Esc to cancel the dialog. (or is that a gkt issue?)

* the find dialog is sometimes not working

* in the find, it would be nice to remember the last state.
I check (case insensitive on, and the next time, this option is of
again).

* After starting XPN, it would be good, to jump
either the last selected group or the first group immediatly
showing the headers.

* to mark more than one article at one time (to be able to mark
multiple articles at one as read, ...)

* If I press 'n' for next: the last message is reached in a group,
and I find it useful to jump to the next group and looks for the next
unread message. (Now it simply stops there).

If I am wrong about some things, please correct me.
It could be that I have overseen some things.

best regards,


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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread vbgunz
> > Has anyone tried this thing..
> > http://www.regular-expressions.info/regexbuddy.html

I use kodos http://kodos.sourceforge.net/. I firmly agree using a tool
like this to learn regular expressions will not only save you a
ridiculous amount of time spent on trial and error *but* it's really
easy and makes learning re a joy.

btw, kodos is specifically created with Python's re module in mind.
Good luck!

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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread Rich Shepard
On Sat, 16 Sep 2006, Thorsten Kampe wrote:

> PS Actually the author wrote the finest and best Windows Editor and I also
> use EditPad Pro under Linux (together with Wine) because of the lack of
> usables editors under Linux.

   Wow! That's really opned you up for flaming! Most of us choose emacs or
vi, and after 30 years of continued existence and improvements no one could
successfully argue that they are not usable editors for linux, *BSD, or any
other OS.

   Of course, there are many folks who prefer to enter text by
pointing-and-clicking, but that's the environment in which they were brought
up. I'm really happy that you found an editor that you like, but your
rationale will not sway many others.

Rich

-- 
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a python IDE

2006-09-16 Thread Rich Shepard
On Fri, 15 Sep 2006, [EMAIL PROTECTED] wrote:

> I am looking for a good IDE for Python. Commercial or Open Software.
> If possible with visual GUI designer.

   You can also evaluate boa constructor.

   I tried that for a week or so but went back to emacs with the python
language bindings. There are a bunch of alternatives available and only your
opinion will let you choose among them.

Rich

-- 
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread Ravi Teja

[EMAIL PROTECTED] wrote:
> Has anyone tried this thing..
> http://www.regular-expressions.info/regexbuddy.html
>
> If I had $30 would this be worth getting or should I just try to learn
> the manual.  (I was hopeing the essential refrence would clear things
> up but I am downloading a gilgillion pages on the re module to try to
> learn it)
>
> http://www.dexrow.com

The time spent on reading about regular expressions will reward you
many times over. A tool is no substitute for that.

However, a visual tool does help in constructing complex expressions.
Python includes one such. Search for redemo.py

On Windows
C:\Python24\Tools\scripts\redemo.py

There are also several good open source tools on Sourceforge. Try them
out.

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


Re: RegexBuddy (anyone use this?)

2006-09-16 Thread Thorsten Kampe
* [EMAIL PROTECTED] (2006-09-16 15:27 +0100)
> Has anyone tried this thing..
> http://www.regular-expressions.info/regexbuddy.html
> 
> If I had $30 would this be worth getting or should I just try to learn
> the manual.

Well, actually both is worth trying.

> (I was hopeing the essential refrence would clear things
> up but I am downloading a gilgillion pages on the re module to try to
> learn it)

If you just have problems getting the grip of Python style regular
expressions than it's probably overkill. I think [1] suffices. But if
you regularly deal with regexes then RegexBuddy is indispensable and
unique.

Thorsten

PS Actually the author wrote the finest and best Windows Editor and I
also use EditPad Pro under Linux (together with Wine) because of the
lack of usables editors under Linux.

[1] http://www.regular-expressions.info/python.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Coding Nested Loops

2006-09-16 Thread Rich Shepard
On Sat, 16 Sep 2006, Peter Otten wrote:

> As George hinted, I went a bit over the top with my itertools example.
> Here is a translation into static lists (mostly):

Peter,

   Thank you. This is clearer to me. While your original code certainly works
it reminded me of The C Users Journal's annual obfuscated C contests. :-)

> from random import choice

   Two questions germane to random: 1) Why wasn't choice available when I
used 'import random,' and 2) What are the differences between 'choice' and
'shuffle?'

> Of course nested loops will work, too. Use whatever you find easiest to
> maintain.

   I found the library page and will continue looking for more comprehensive
documentation.

Rich

-- 
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863
-- 
http://mail.python.org/mailman/listinfo/python-list


How to draw a rectangle with gradient?

2006-09-16 Thread Daniel Mark
Hello all:

I am using PIL to draw a rectangle filled with color blue.

Is there anyway I could set the fill pattern so that the drawn
rectangle could be filled with
gradient blue?


Thank you
-Daniel

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


Re: Catching toplevel move and resize

2006-09-16 Thread Tuomas
Pontus Ekberg wrote:
> You are probably looking for "configure_event".

That's it! Works fine, thanks.

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


Re: Catching toplevel move and resize

2006-09-16 Thread Pontus Ekberg
Tuomas wrote:

>  From a PyGTK component I would like to react moving and resizing the 
> toplevel window. I try to connect the toplevel 'frame-event' to my 
> callback, but the toplevel do not fire on moving or resizing. Any 
> suggestions?
> 
> Tuomas
> (Linux, Python 2.3, GTK 2.6.7)

You are probably looking for "configure_event".

// Pontus


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


RegexBuddy (anyone use this?)

2006-09-16 Thread [EMAIL PROTECTED]
Has anyone tried this thing..
http://www.regular-expressions.info/regexbuddy.html

If I had $30 would this be worth getting or should I just try to learn
the manual.  (I was hopeing the essential refrence would clear things
up but I am downloading a gilgillion pages on the re module to try to
learn it)

http://www.dexrow.com

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


ANN: pyfuzzylib 0.1.3 Released

2006-09-16 Thread nelson -
PyFuzzyLib is a library for fuzzy inference engine building. Using
pyfuzzylib you can add fuzzy logic to your programs. The program is in
it early stage of development, but it is still usable. Every sort of
feedback is appreciated!

the project homepage is

http://sourceforge.net/projects/pyfuzzylib


good afternoon,
   nelson
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: UDP packets to PC behind NAT

2006-09-16 Thread Grant Edwards
On 2006-09-16, Janto Dreijer <[EMAIL PROTECTED]> wrote:
> Steve Holden wrote:
>> Note that TCP and UDP port spaces are disjoint, so there's no way for
>> TCP and UDP to use "the same port" - they can, however, use the same
>> port number. Basically the TCP and UDP spaces have nothing to do with
>> each other.
>>
>> Most dynamic NAT gateways will respond to an outgoing UDP datagram by
>> mapping the internal client's UDP port to a UDP port on the NAT
>> gateway's external interface, and setting a converse mapping that will
>> allow the server to respond, even though technically there isn't a
>> "connection". The NAT table entries will typically be timed out after a
>> short period of non-use.
>
> So are you saying one can't use TCP to punch a hole for UDP?

Yes, that's what he's saying -- or at least that there's no
reason to expect it to work.

-- 
Grant Edwards
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter.Button(... command) lambda and argument problem

2006-09-16 Thread Dustan

James Stroud wrote:
> Dustan wrote:
> > Jay wrote:
> >
> >>Thanks for the tip, but that breaks things later for what I'm doing.
> >>
> >>[EMAIL PROTECTED] wrote:
> >>
> >>>In that case you don't need a lambda:
> >>>
> >>>import Tkinter as tk
> >>>
> >>>class Test:
> >>>def __init__(self, parent):
> >>>buttons = [tk.Button(parent, text=str(x+1),
> >>>command=self.highlight(x)) for x in range(5)]
> >>>for button in buttons:
> >>>button.pack(side=tk.LEFT)
> >
> >
> > Well, actually, that's wrong. You obviously don't understand why lambda
> > is necessary for event binding; in this case (and many others, for that
> > matter), the button gets bound to the event *returned* by
> > self.highlight(x), which, since nothing gets returned, would be None.
> > Then when you click the button, Tkinter calls None(), and out of the
> > blue, an error is raised.
> >
> > Lambda is the safe way around that error.
> >
> >
> >>>def highlight(self, x):
> >>>print "highlight", x
> >>>
> >>>root = tk.Tk()
> >>>d = Test(root)
> >>>root.mainloop()
> >>>
> >>>Bye,
> >>>bearophile
> >
> >
>
> Actually, lambda is not necessary for event binding, but a closure (if I
> have the vocab correct), is:

Of course. What I should have said was "lambda is the quickest and
easiest way". However, if you want your intent to be clear, lambda
isn't always the best option, but it is quite often the quickest.

>
> import Tkinter as tk
>
> def make_it(x):
>def highliter(x=x):
>  print "highlight", x
>return highliter
>
> class Test:
>  def __init__(self, parent):
>  buttons = [tk.Button(parent, text=str(x+1),
> command=make_it(x)) for x in range(5)]
>  for button in buttons:
>  button.pack(side=tk.LEFT)
>
> root = tk.Tk()
> d = Test(root)
> root.mainloop()
>
>
> --
> James Stroud
> UCLA-DOE Institute for Genomics and Proteomics
> Box 951570
> Los Angeles, CA 90095
> 
> http://www.jamesstroud.com/

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


Catching toplevel move and resize

2006-09-16 Thread Tuomas
 From a PyGTK component I would like to react moving and resizing the 
toplevel window. I try to connect the toplevel 'frame-event' to my 
callback, but the toplevel do not fire on moving or resizing. Any 
suggestions?

Tuomas
(Linux, Python 2.3, GTK 2.6.7)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: xmlrpc, extract data from http headers

2006-09-16 Thread Filip Wasilewski
Milos Prudek wrote:
> > Overload the _parse_response method of Transport in your
> > BasicAuthTransport and extract headers from raw response. See the
> > source of xmlrpclib.py in the standard library for details.
>
> Thank you.
>
> I am a bit of a false beginner in Python. I have written only short scripts. I
> want to read "Dive into Python" to improve my knowledge. Your advice is
> perfect. It is my fault that I need a little more guidance.
>
> I am not sure how the headers will be passed from Transport to the instance of
> ServerProxy. That is, if I change the _parse_response method, how do I
> retreive the headers using the ServerProxy command?

Erm, now I see that my previous response was incorrect, sorry. The
headers are not passed to the _parse_response method.

A better solution would be to extract cookies from headers in the
request method and return them with response (see the code below). I
still wonder if there is an easy way to use CookieJar from cookielib
with xmlrpclib.

class CookieTransport(xmlrpclib.Transport):
def request(self, host, handler, request_body, verbose=0):
h = self.make_connection(host)
if verbose:
h.set_debuglevel(1)

self.send_request(h, handler, request_body)
self.send_host(h, host)
self.send_user_agent(h)
self.send_content(h, request_body)

errcode, errmsg, headers = h.getreply()

if errcode != 200:
raise ProtocolError(
host + handler,
errcode, errmsg,
headers
)

self.verbose = verbose

cookies = self.get_cookies(headers)

try:
sock = h._conn.sock
except AttributeError:
sock = None

response = self._parse_response(h.getfile(), sock)
if len(response) == 1:
response = response[0]

return response, cookies

def _get_cookies(self, headers):
import Cookie
c = []
for v in headers.getheaders('set-cookie'):
c.append(Cookie.SimpleCookie(v))
return c

server = xmlrpclib.ServerProxy("http://localhost:8000";,
transport=CookieTransport())
result, cookies = server.something.call()


best,
fw

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


Re: strange result with json-server & zop

2006-09-16 Thread Gabriel Genellina

At Saturday 16/9/2006 08:40, asterocean wrote:


But this is not UTF-8; looks like UTF-16 with 0x00 converted to 0x20
(space). I'd look at where the body comes from, or ask on the Zope
list for the right way to use dtml-mime.


i've try with UTF-8 , error remains . when the script is called
directly from http request , it went well. so this should not be the
problem. the real problem is when it is called from a json-rpc, the
error happened


Try to look at what you *get* as the body from xmlrpc, if it comes 
wrong, will go wrong to the email.



Anyway, why are you using dtml-mime and such? Using the email package
is easier and a lot more powerful.

i'm using zope & jsonserver & maildrop to develop this part , so the
main problem how to send mail with json-rpc structure.


You can use the email package from inside Zope; an external method will do.



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


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

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread Jim
Frank Millman wrote:
> I therefore use the following -
> cur.execute("select currval('%s_%s_Seq')" % (tableid, columnid)
I use this also (although isn't it right that sometimes the name of the
sequence is not so straightforward? for instance, isn't there a limit
on the number of chars?).

Can anyone say what is an advantage of the two nextval() solutions
described earlier in this thread over the currval() solution listed
here?

Jim

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


Re: strange result with json-server & zope

2006-09-16 Thread Gabriel Genellina

At Saturday 16/9/2006 07:28, astarocean wrote:


[the script]
body_html = container.mime_mail(body_html=body_html)
container.MailHost.send(messageText=body_html, mto=to_email,
mfrom=from_email, subject=subject, encode=None)

[mime_mail is a dtml-method]





"utf8" is not the right spelling, should be UTF-8


[called from json-rpc]
Content-Type: text/html;
charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

< ! D O C T Y P E   H T M L   P U B L I C   " - / / W 3 C / / D T D   H
T M=
 L   4 . 0 1   T r a n s i t i o n a l / / E N "
 " h t t p : / / w w w . w 3 . o r g / T R / h t m l 4 / l o o s e . d
t d =
" >


But this is not UTF-8; looks like UTF-16 with 0x00 converted to 0x20 
(space). I'd look at where the body comes from, or ask on the Zope 
list for the right way to use dtml-mime.


Anyway, why are you using dtml-mime and such? Using the email package 
is easier and a lot more powerful.



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


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

Re: UDP packets to PC behind NAT

2006-09-16 Thread Janto Dreijer
Steve Holden wrote:
> Note that TCP and UDP port spaces are disjoint, so there's no way for
> TCP and UDP to use "the same port" - they can, however, use the same
> port number. Basically the TCP and UDP spaces have nothing to do with
> each other.
>
> Most dynamic NAT gateways will respond to an outgoing UDP datagram by
> mapping the internal client's UDP port to a UDP port on the NAT
> gateway's external interface, and setting a converse mapping that will
> allow the server to respond, even though technically there isn't a
> "connection". The NAT table entries will typically be timed out after a
> short period of non-use.

So are you saying one can't use TCP to punch a hole for UDP?

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


strange result with json-server & zope

2006-09-16 Thread astarocean
i'm using maildrophost to sendmail and wrote a script for it

when the script is called directly from web request , a letter
geneated with right things

but when the script is called from json-rpc, the letter generated
include a mess.
see the file with this letter

[the script]
body_html = container.mime_mail(body_html=body_html)
container.MailHost.send(messageText=body_html, mto=to_email,
mfrom=from_email, subject=subject, encode=None)

[mime_mail is a dtml-method]




[enviroment]
Zope Version
(Zope 2.9.4-final, python 2.4.3, linux2)
Python Version
2.4.3 (#1, Sep 11 2006, 19:52:33) [GCC 3.4.6 20060404 (Red Hat
3.4.6-3)]
System Platform
linux2

strangely at another server, everythin runs smoothly
[enviroment]
Zope Version
(Zope 2.9.2-, python 2.4.3, linux2)
Python Version
2.4.3 (#1, Mar 31 2006, 17:42:57) [GCC 3.4.4 20050721 (Red Hat
3.4.4-2)]

[called directly from web request ]
##To:[EMAIL PROTECTED]
##From:[EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="127.0.0.1.500.5494.1158303670.500.4"
Subject: You probably forgot your password for Ztooo.com
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Fri, 15 Sep 2006 15:01:10 -0500


--127.0.0.1.500.5494.1158303670.500.4
Content-Type: text/html;
charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

http://www.w3.org/TR/html4/loose.dtd";>



You probably forgot your password for
Ztooo.com!=E6=82=A8=E5=8F=AF=
=E8=83=BD=E9=81=97=E5=BF=98=E4=BA=86=E6=91=98=E7=BD=91=E7=9A=84=E5=AF=86=E7=
=A0=81!


=E6=82=A8=E5=8F=AF=E8=83=BD=E9=81=97=E5=BF=98=E4=BA=86=E6=91=98=E7=BD=
=91=E7=9A=84=E5=AF=86=E7=A0=81

=E6=82=A8=E7=9A=84=E5=AF=86=E7=A0=81=E6=98=AF

=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=AD=A4=E9=82=AE=E7=
=AE=B1=E5=90=8D=E4=BD=9C=E4=B8=BA=E7=94=A8=E6=88=B7=E5=90=8D=E5=92=8C=E6=AD=
=A4=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95=EF=BC=8C=E6=88=96=E8=80=85=E7=82=B9=
=E5=87=BB=E4=B8=8B=E9=9D=A2=E7=9A=84=E6=8C=89=E9=92=AE=E7=99=BB=E5=BD=95=EF=
=BC=9A

  http://web3.com/index.htm";
target=3D"_blank" enctype=3D"multipart/form-data">


   =20

   =20
  

=E7=99=BB=E5=BD=95=E5=90=8E=E6=82=A8=E5=8F=AF=E4=
=BB=A5=E4=BF=AE=E6=94=B9=E6=82=A8=E7=9A=84=E5=AF=86=E7=A0=81=E5=92=8C=E8=AE=
=BE=E7=BD=AE=E6=82=A8=E5=96=9C=E6=AC=A2=E7=9A=84=E7=AC=94=E5=90=8D=E3=80=82=


You probably forgot your password for Ztooo.com!

Your password is  , Use the mailboxname as username and this
passw=
ord to login , or click the button below:

  http://web3.com/index.htm";
target=3D"_blank" enctype=3D"multipart/form-data">


 
 =20
  

You could change your password and set your
favo=
rite pseudonym after that.




--127.0.0.1.500.5494.1158303670.500.4--

[called from json-rpc]
##To:[EMAIL PROTECTED]
##From:[EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="127.0.0.1.500.5494.1158303673.002.5"
Subject: You probably forgot your password for Ztooo.com
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Fri, 15 Sep 2006 15:01:13 -0500


--127.0.0.1.500.5494.1158303673.002.5
Content-Type: text/html;
charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

< ! D O C T Y P E   H T M L   P U B L I C   " - / / W 3 C / / D T D   H
T M=
 L   4 . 0 1   T r a n s i t i o n a l / / E N "
 " h t t p : / / w w w . w 3 . o r g / T R / h t m l 4 / l o o s e . d
t d =
" >
 < h t m l >
 < h e a d >
 < m e t a   h t t p - e q u i v =3D " C o n t e n t - T y p e "   c o
n t =
e n t =3D " t e x t / h t m l ;   c h a r s e t =3D u t f - 8 " >
 < t i t l e > Y o u   p r o b a b l y   f o r g o t   y o u r   p a s
s w =
o r d   f o r   Z t o o o . c o m !
=A8`=EFS=FD=80W=90=D8_=86NXdQ=7F=84v=C6=
[x! < / t i t l e >
 < / h e a d >
 < b o d y >
 < h 3 > =A8`=EFS=FD=80W=90=D8_=86NXdQ=7F=84v=C6[x< / h 3 >
 < h r   / >
 < p > & n b s p ; & n b s p ; & n b s p ; & n b s p ; =A8`=84v=C6[x/f
 < =
f o n t
 c o l o r =3D " b l u e " > < / f o n t >
=FF=7FO(udk=AE=90=B1{=

T\O:N(u7b
T=8CTdk=C6[x{vU_=FFb=80=B9p=FBQNb=97=84v   c=AE=94{vU_=FF< /=
 p >
 < d i v >
 < f o r m   m e t h o d =3D " p o s t "   a c t i o n =3D " h t t
p : =
/ / w e b 3 . c o m / i n d e x . h t m "
 t a r g e t =3D " _ b l a n k "   e n c t y p e =3D "
m u =
l t i p a r t / f o r m - d a t a " >
 < i n p u t   t y p e =3D " h i d d e n "   n a m e =3D " _ _
a c =
_ n a m e "   i d =3D " _ _ a c _ n a m e "
   s i z e =3D " 1 2 "   v a l u e =3D " a s t e r
o c =
e a n @ g m a i l . c o m " >
 < i n p u t   t y p e =3D " h i d d e n "   n a m e =3D " _ _
a c =
_ p a s s w o r d "   s i z e =3D " 1 2 "
   v a l u e =3D " " >

 & n b s p ; & n b s p ; & n b s p ; & n b s p ; < i n p u t   t y p e
=3D =
" s u b m i t "   v a l u e =3D " =B9p=FBQdkY{vU_" >

 < / f o r m >
 < / d i v >
 < p > & n b s p ; & n b s p ; & n b s p ; & n 

Re: something for itertools

2006-09-16 Thread Daniel Nogradi
> > In a recent thread,
> > http://mail.python.org/pipermail/python-list/2006-September/361512.html,
> > a couple of very useful and enlightening itertools examples were given
> > and was wondering if my problem also can be solved in an elegant way
> > by itertools.
> >
> > I have a bunch of tuples with varying lengths and would like to have
> > all of them the length of the maximal and pad with None's. So
> > something like
> >
> > a = ( 1, 2, 3 )
> > b = ( 10, 20 )
> > c = ( 'x', 'y', 'z', 'e', 'f' )
> >
> > should turn into
> >
> > a = ( 1, 2, 3, None, None )
> > b = ( 10, 20, None, None, None )
> > c = ( 'x', 'y', 'z', 'e', 'f' )
> >
> > Of course with some len( ) calls and loops this can be solved but
> > something tells me there is a simple itertools-like solution.
> >
>
> Not the most readable one-liner of all times, but here it goes:
>
> a,b,c = zip(*map(None,a,b,c))
>

Thanks, that does the trick.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: xmlrpc with Basic Auth

2006-09-16 Thread Milos Prudek
> i'm currently using xmlrpclib with basic auth and i use it like this:
> from xmlrpclib import Server
> s=Server("http://user:[EMAIL PROTECTED]/rpc.php")

Perfect! Thank you.


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


Re: xmlrpc, extract data from http headers

2006-09-16 Thread Milos Prudek

> Overload the _parse_response method of Transport in your
> BasicAuthTransport and extract headers from raw response. See the
> source of xmlrpclib.py in the standard library for details.

Thank you. 

I am a bit of a false beginner in Python. I have written only short scripts. I 
want to read "Dive into Python" to improve my knowledge. Your advice is 
perfect. It is my fault that I need a little more guidance.

I am not sure how the headers will be passed from Transport to the instance of 
ServerProxy. That is, if I change the _parse_response method, how do I 
retreive the headers using the ServerProxy command?


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


Re: Looking for a python IDE

2006-09-16 Thread Paddy

[EMAIL PROTECTED] wrote:
> Hello
>
> I am looking for a good IDE for Python. Commercial or Open Software.
>
> If possible with visual GUI designer.
>
> For the moment I am considering Komodo.
>
> Any suggestions?
>
> Thanks in advance
Hi, you have asked a very common question. Please search out previous
threads on this topic in comp.lang.python or search www.python.org, or
do a general google around. You should find a LOT of opinion.

- Paddy.

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


Re: Looking for a python IDE

2006-09-16 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Any suggestions?

Maybe BlackAdder
http://www.thekompany.com/products/blackadder/

-- 
Lawrence - http://www.oluyede.org/blog
"Nothing is more dangerous than an idea
if it's the only one you have" - E. A. Chartier
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a python IDE

2006-09-16 Thread Andrei
> I am looking for a good IDE for Python. Commercial or Open Software.
> If possible with visual GUI designer.
 > For the moment I am considering Komodo.

There is no Python IDE that has a fully-integraded approach like Delphi 
or VS with all bells and whistles. Tools tend to be somewhat separate 
and can be combined at will, using any editor you like with any GUI 
designer you like. Boa constructor is an attempt at buildings something 
like Delphi, but it's quirky and has an unclear maintenance status.

Some of the big names in Python IDEs are Spe, Eric, Idle, PythonWin and 
WingIDE. GUI designers you can use are wxGlade (for wxPython), Glade 
(for PyGTK) and QtDesigner (for Qt). Spe + wxGlade and Eric + QtDesigner 
are natural fits.

It's really a jungle out there - your personal taste and toolkit 
preferences will have to determine your choice. If I like wxGlade, it 
won't help you if you want to build Qt apps, Eric doesn't work if you 
run Windows, etc.

Yours,

Andrei

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


Re: REQ: Java/J2EE Developer 10 Months

2006-09-16 Thread Hendrik van Rooyen
"Tim Chase" <[EMAIL PROTECTED]> wrote:

8<
> Or, perhaps they just have their terminology off.  "Corba" is a 
> lot like "cobra" which is also a snake, like a Python.  ("We've 
> got Corba, right here in River City.  That starts with 'C' and 
> that rhymes with 'P' and that stands for Python!")
> 
> I've gotta stop with the musicals... :)
> 
> -tkc

Don't you dare!

LOL - Hendrik


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


Re: latex openoffice converter

2006-09-16 Thread Fabian Braennstroem
Hi to both,

thanks! I'll try them ...

* Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to use python to convert 'simple' latex
> documents into openoffice format. Maybe, anybody has done
> something similar before and can give me a starting point!?
> Would be nice to hear some hints!
>
> Greetings!
>  Fabian
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>

Greetings!
 Fabian

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


Re: Finding dynamic libraries

2006-09-16 Thread Robert Kern
MonkeeSage wrote:
> Bill Spotz wrote:
>> Is there a way to tell an executing python script where to look for
>> dynamically-loaded libraries?
> 
> If I understand, you want to tell an already running python process to
> import some extensions from arbitrary locations?

No, his extensions link against other shared libraries which are not Python 
extensions. Those shared libraries are in nonstandard locations because he is 
running his tests before installing the libraries and his Python code.

-- 
Robert Kern

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

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


Re: Tkinter.Button(... command) lambda and argument problem

2006-09-16 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes:
> Actually, lambda is not necessary for event binding, but a closure (if
> I have the vocab correct), is: ...
> 
> def make_it(x):
>def highliter(x=x):
>  print "highlight", x
>return highliter

For that version you shouldn't need the x=x:

 def make_it(x):
def highliter():
  print "highlight", x
return highliter

The reason is each time you call make_it, you're creating a new scope
where x has the correct value, and highliter keeps referring to that
scope even after make_it has returned.
-- 
http://mail.python.org/mailman/listinfo/python-list