Re: WxPython versus Tkinter.

2011-01-25 Thread Bob Martin
in 650595 20110124 192332 Bryan  wrote:
>On Jan 24, 12:05=A0pm, rantingrick  wrote:
>> On Jan 24, 12:00=A0pm, Bryan  wrote:
>>
>> > Accessibility, like internationalization, is something few programmers
>> > spend much time thinking about.
>>
>> Thats another uninformed statement by you we can add to the mountains
>> of useless cruft you have offered so far. Unicode IS
>> internationalization and Guido thought it was SO important that
>> Python3000 auto converts all strings to Unicode strings. Obviously he
>> is moving us toward full Unicode only in the future (AS SHOULD ALL
>> IMPLEMENTATIONS!). We need one and only one obvious way to do it. And
>> Unicode is that way.
>
>Ok, great. You've identified one programmer who thinks about
>internationalization. Not much of a compelling argument there.
>
>However, I think you missed my point. My point wasn't that people like
>Guido don't think of these topics. It's that the people in the
>trenches who use these tools don't think about these topics. How many
>of your co-workers actively think about internationalization and
>accessibility? I'm guessing none, but maybe you're lucking and work in
>a particularly enlightened team. I've perhaps worked closely with a
>few hundred programmers in my career, and very few of them thought of
>these subjects. In my experience it's just not something the
>programmer in the trenches thinks about. That is the point I was
>trying to make.

Sorry, but I have to disagree with you here.  I spent my working life as a 
programmer
with a very large multi-national IT company and all software had to be fully
"internationalized" (otherwise known as NLS) or it didn't get used.  
Do you think the whole world speaks US English? 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Stephen Hansen
On 1/24/11 10:44 PM, Octavian Rasnita wrote:
> Or is there a God law that tells that only Tk-based GUIs can be included
> in Python?

There is no other viable option at this time for inclusion in the
standard library; that's simple fact.

There are options for people to write GUI's in python that are
accessible. Those options do include the requirement of installing a
third-party library. That's not onerous.

Removing TK from the standard library at this point can't happen (at
least until a theoretical Python 4K): at least not without a 100%
compatible replacement which is functionally impossible (since it would
have to be compatible with TK addons, too).

Adding a secondary GUI framework would have to have an incredibly
compelling argument behind it: and developers pledging years of
maintenance in the python stdlib tree and with the python stdlib
development practices, because python-dev is overworked as it is. It
would need to be based on python 3.[2|3], need extensive tests and
documentation in a format compatible with python.org's documentation,
and solid cross-platform capability AND it be free of segfaultness, AND
the more code it is the harder it is to support its inclusion, as the
maintenance burden just becomes untenable-- and it would need to be
PEP-8 compliant-- and--

All of that doesn't hold for wxPython.

I use wxPython in my day job. I like wxPython a lot.

It belongs outside of the standard library.

If someone wants to devote man-years of development time to solve all of
the above to make it fit the stdlib, all power to you.

So far, it seems there maybe is two people who think it may be worth
their time.

I'm fine with installing wxPython as a third-party library.

-- 

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



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


Re: [Code Challenge] WxPython versus Tkinter.

2011-01-25 Thread Stephen Hansen
On 1/24/11 11:58 AM, Octavian Rasnita wrote:
>> From: "Ethan Furman" 
>> Please do not repost rr's crap in its entirety, or you'll find yourself 
>> added to many killfiles -- just like he is.
> I am not posting anyone's crap. I just informed why Tkinter is bad.
> And I also don't say that WxPython is ideal, but just that it has some very 
> important features that Tk doesn't offer.

Belatedly: The complaint was not that you had something to say in reply,
but that as you replied, you quoted the entire original post.

Netiquette holds that you should edit out your replies to include only
those things / statements you're actually responding to.

By just blanket replying and including the whole rant, you are posting
that whole rant. Needlessly, as its already been said.  If you cut it
down and only include the points that you're responding to, you include
the specific context needed to understand your statements, while
minimizing the need for people to parse through noise.

-- 

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



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


Re: Which is the best book to learn python

2011-01-25 Thread Mark Summerfield
On Jan 24, 5:09 pm, santosh hs  wrote:
> Hi All,
> i am beginner to python please tell me which is the best available
> reference for beginner to start from novice

If you want to learn Python 3 and have some prior programming
experience (in any modern procedural or object oriented language), you
might find
"Programming in Python 3" (http://www.qtrac.eu/py3book.html) to be a
good choice. (I'm biased though since I wrote it;-)
-- 
http://mail.python.org/mailman/listinfo/python-list


which scipy binary for Win32

2011-01-25 Thread Adam
Am looking at 
http://sourceforge.net/projects/scipy/files/scipy/0.8.0/
and I wonder which is the binary to install on WinXP ? 
As pointed to by this page, http://www.scipy.org/Download 

All I can see on that sourceforge page are the huge 
python2.6 and python2.7 Powerpacks, at 43megs or so 
each. The scipy-0.8.0.zip seems to require compilation. 


FYI: I'm installing Python 2.7, so have uninstalled all 
Python2.5 and Python2.6, including older numpy, scipy and 
matplotlib. 

Presently, prior to installation, I have; 
python-2.7.1.msi  (15.628 meg)
numpy-1.5.1-win32-superpack-python2.7.exe  (5.354 meg)
matplotlib-1.0.1.win32-py2.7.exe  (8.105 meg) 

Does the scipy 2.7 Powerpack include numpy anyway ? 

Any recommendations or pointers appreciated. Thanks. 


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


Re: WxPython versus Tkinter.

2011-01-25 Thread Littlefield, Tyler

RR,
I do hate to break the news to you, but I am -blind-, which is why I am 
using a screen reader. So I'm not parking anywhere--the DMV refuses to 
give me a license for some odd reason. What was that post about IQ you 
made earlier?...

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "rantingrick" 
Tyler's argument, which lacked greatly in compassion for people with
disabilities brought out my accusation. It was not an accusation meant
to merely insult just to invoke a flame war; which is the definition
of Godwins Law.

It is a fact that Tyler displayed despicable intolerance for people
who have disabilities and such a correlation to totalitarian regimes
was not only the correct response but in fact the only response to
such veiled hate speech. We cannot allow such displays to slip by
unchallenged by this community. And hopefully Tyler will see the
unjust position he has taken and beg for forgiveness.



Tyler is not intolerant. He is a blind person.
He is one that cares more to please the others that might help it more in its 
life than to advocate for the benefit of the entire world.

Octavian

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


Re: which scipy binary for Win32

2011-01-25 Thread Dave Hirschfeld
Adam  example.com> writes:

> 
> Am looking at 
> http://sourceforge.net/projects/scipy/files/scipy/0.8.0/
> and I wonder which is the binary to install on WinXP ? 
> As pointed to by this page, http://www.scipy.org/Download 
> 
> All I can see on that sourceforge page are the huge 
> python2.6 and python2.7 Powerpacks, at 43megs or so 
> each. The scipy-0.8.0.zip seems to require compilation. 
> 
> 
> Any recommendations or pointers appreciated. Thanks. 
> 
> 


I'd say the easiest thing to do would be to get one of the superpack binaries. I
would probably go for the 9.0rc
(http://sourceforge.net/projects/scipy/files/scipy/0.9.0rc1/) as it will likely
have fewer bugs that 8.0 and will make your code more future-proof in a fast
changing world. That said, not everyone likes living on the bleeding edge...

AFAIK the superpack binaries don't include numpy but are so big because they
contain several versions of scipy depending on whether your cpu supports
SSE1/SSE2 or not at all. The correct version will be detected and installed
automatically.

HTH,
Dave

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


Finding the right Python executable on Windows

2011-01-25 Thread Geoff Bache
Hi all,

I have a Python process on Windows and would like to start a Python
subprocess using the same interpreter. I wonder how to go about this?

First, I tried the obvious

subprocess.Popen([ sys.executable, "subproc.py", ... ])

but that fails, because my process has a "native launcher", (i.e. C:
\path\mylauncher.exe, which is just a wrapper around the Python
program) and hence sys.executable returns this path instead of the
interpreter location. It isn't appropriate to use the launcher for the
subprocess.

I also tried using sys.exec_prefix but there didn't seem to be any
standard location for the interpreter under this directory in any
case.

I feel certain there must be some way to do this as it seems a rather
basic thing somehow, can anyone give me a hint?

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Bryan
On Jan 25, 2:02 am, Bob Martin  wrote:
> in 650595 20110124 192332 Bryan  wrote:
>
>
>
>
>
> >On Jan 24, 12:05=A0pm, rantingrick  wrote:
> >> On Jan 24, 12:00=A0pm, Bryan  wrote:
>
> >> > Accessibility, like internationalization, is something few programmers
> >> > spend much time thinking about.
>
> >> Thats another uninformed statement by you we can add to the mountains
> >> of useless cruft you have offered so far. Unicode IS
> >> internationalization and Guido thought it was SO important that
> >> Python3000 auto converts all strings to Unicode strings. Obviously he
> >> is moving us toward full Unicode only in the future (AS SHOULD ALL
> >> IMPLEMENTATIONS!). We need one and only one obvious way to do it. And
> >> Unicode is that way.
>
> >Ok, great. You've identified one programmer who thinks about
> >internationalization. Not much of a compelling argument there.
>
> >However, I think you missed my point. My point wasn't that people like
> >Guido don't think of these topics. It's that the people in the
> >trenches who use these tools don't think about these topics. How many
> >of your co-workers actively think about internationalization and
> >accessibility? I'm guessing none, but maybe you're lucking and work in
> >a particularly enlightened team. I've perhaps worked closely with a
> >few hundred programmers in my career, and very few of them thought of
> >these subjects. In my experience it's just not something the
> >programmer in the trenches thinks about. That is the point I was
> >trying to make.
>
> Sorry, but I have to disagree with you here.  I spent my working life as a 
> programmer
> with a very large multi-national IT company and all software had to be fully
> "internationalized" (otherwise known as NLS) or it didn't get used.  
> Do you think the whole world speaks US English?

No, absolutely not. I don't see how you go from "I don't think all
developers think about i18n" to "I think everyone speaks english".

Most very large companies think about this a lot. Most hugely
successful software is probably internationalized. Together those two
groups make up a tiny fraction of all software. Think about all the
free software you use -- how much of it is internationalized and
optimized for accessibility? I bet not much. I wish I could say more
than half of all software is internationalized but I just don't
believe that to be true based on my own personal observation.

I definitely agree that many companies, both large and small, do the
right thing here. From my experience though, many != most. I hope I'm
wrong though, because that means the we're all headed in the right
direction.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Bob Martin
in 650672 20110125 115033 Bryan  wrote:
>On Jan 25, 2:02=A0am, Bob Martin  wrote:
>> in 650595 20110124 192332 Bryan  wrote:
>>
>>
>>
>>
>>
>> >On Jan 24, 12:05=3DA0pm, rantingrick  wrote:
>> >> On Jan 24, 12:00=3DA0pm, Bryan  wrote:
>>
>> >> > Accessibility, like internationalization, is something few programme=
>rs
>> >> > spend much time thinking about.
>>
>> >> Thats another uninformed statement by you we can add to the mountains
>> >> of useless cruft you have offered so far. Unicode IS
>> >> internationalization and Guido thought it was SO important that
>> >> Python3000 auto converts all strings to Unicode strings. Obviously he
>> >> is moving us toward full Unicode only in the future (AS SHOULD ALL
>> >> IMPLEMENTATIONS!). We need one and only one obvious way to do it. And
>> >> Unicode is that way.
>>
>> >Ok, great. You've identified one programmer who thinks about
>> >internationalization. Not much of a compelling argument there.
>>
>> >However, I think you missed my point. My point wasn't that people like
>> >Guido don't think of these topics. It's that the people in the
>> >trenches who use these tools don't think about these topics. How many
>> >of your co-workers actively think about internationalization and
>> >accessibility? I'm guessing none, but maybe you're lucking and work in
>> >a particularly enlightened team. I've perhaps worked closely with a
>> >few hundred programmers in my career, and very few of them thought of
>> >these subjects. In my experience it's just not something the
>> >programmer in the trenches thinks about. That is the point I was
>> >trying to make.
>>
>> Sorry, but I have to disagree with you here. =A0I spent my working life a=
>s a programmer
>> with a very large multi-national IT company and all software had to be fu=
>lly
>> "internationalized" (otherwise known as NLS) or it didn't get used. =A0
>> Do you think the whole world speaks US English?
>
>No, absolutely not. I don't see how you go from "I don't think all
>developers think about i18n" to "I think everyone speaks english".

I said "US English", not just English, and you didn't say 
"I don't think all developers think about i18n", you said "I'm guessing none".
Big difference.  I think your attitude to this is US-only.

>
>Most very large companies think about this a lot. Most hugely
>successful software is probably internationalized. Together those two
>groups make up a tiny fraction of all software. Think about all the
>free software you use -- how much of it is internationalized and
>optimized for accessibility? I bet not much. I wish I could say more
>than half of all software is internationalized but I just don't
>believe that to be true based on my own personal observation.

"I bet not much" - there you go again ;-)
You'll find that nearly all software used in Europe (and most other parts)
is internationalized or it wouldn't stand a chance.
 
>
>I definitely agree that many companies, both large and small, do the
>right thing here. From my experience though, many !=3D most. I hope I'm
>wrong though, because that means the we're all headed in the right
>direction.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread python
Mark,

> From my queries to some of the Tcl/Tk folks, it seems that while the 
> knowledge and expertise is not present in the core developer 
community, they would be more than happy to help people who do have some
knowledge in this area so that Tk could be made to be more accessible.

Some ideas here:

Linux: Linux users can use the free and small Tka11y library from the
site below. To use this library, one replaces "import Tkinter" with
"import Tka11y" - couldn't be easier!
http://tkinter.unpythonic.net/wiki/Tka11y

Mac OS X: Quoting Arndt Roger Schneider from this list: "I think Tk-aqua
(also 8.6) should work out-of-the-box with brail-lines, text-to-speech
and such; the older carbon built however won't." I'm not sure what is
involved in using an independent version of Tkinter that's newer than
the build of Tkinter that ships with the standard library?

Windows: While there appears(?) to be no built-in accessability for
Windows versions of Tkinter I've seen Windows Tkinter applications that
have used Windows native TTS functionality to provide a limited form of
accessability for users with poor vision.

> And if/when this does get done for Tk, I promise at least to make sure that 
> the tutorial at http:///www.tkdocs.com covers this topic

I really enjoyed your tkdocs.com site!! Based on the new ttk
functionality you covered on your site, my company actually began moving
GUI projects from wxPython back to Tkinter. How's that for an odd
trend?! :)

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Ethan Furman

-plonk-

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Littlefield, Tyler
>Wow! I, I, I, I... is there a sentence that doesn't talk about your 
self interests?
It is clear you have been taking lessons from RR; the word I does not 
convey self interest, in fact, it is the best word suited to speaking of 
oppinions (which is all that these are), in the first person. Lets move 
on, shall we?
>You haven't downloaded any inaccessible program made with Tkinter, you 
didn't have any problems, You can create an accessible program if you 
can't find
>an accessible one, you care only to please the other for working with 
you and so on.
No. I said, I can find a program that is accessible, if I find one that 
isn't. Totally different from making one, and any user at all has said 
power. Granted, there are conditions where this doesn't work, but my 
idea of -fixing- TKInter would solve a lot of problems.
>Don't you care that most programmers don't know about accessibility 
and they just don't create accessible programs not because they don't 
want, but because

>they don't know about this thing?
Of course I do. Non accessibility hurts you, as much as me, as much as 
anyone else when I have to take time away to try to make a program 
accessible. But, here is the thing; I have suggested work on TKInter to 
make such programs accessible, and I am perfectly willing to 
participate, as much as time allows, in such work. You are trying to 
make me come across as some evil cruel person because I don't submit to 
"hit them over the head with the hammer that is the ADA and force 
compliance," but rather I want to work with someone. At the end of the 
day, you lose, I win in general. People have made comments about the 
fact that all you did was parrot the evilness of TKInter to many 
threads, and now you've made comments on laws in existance that will 
help us. If you will note, no one even blinked at said laws. Now, the 
idea of fixing the problem (and not just switching libraries out of the 
STDLib, because as Ixokai already pointed out in another post, that 
won't happen), will get us much farther; whether or not Python, or 
anything else uses TKInter, it will be accessible, with some work put 
into talking to the community and I'll probably jump in the trenches 
myself and hammer out some code.

>Retorical question... It is obviously that you don't care.
Nope. I, as a blind person obviously don't care. Which is why I've spent 
so much time trying to push the idea of fixing TKInter. what a horrible 
horrible person I am.
>Ok, you don't care. There are very many like you. But do you think 
that this is the right atitude? To not care about the >others at all but 
only about your selfish interests because the alternative is a loss of 
time?
A loss of time? Where. I am not a proponent of forcing a lib into the 
STDLib while said library currently has problems (RR's segfaults, I'm 
"looking" at you). I know and accept the fact that Python is not going 
to become unstable with a library, in the hopes that some day people 
will start using wx since it's just there and voila, everything will be 
peaches and cream for us screen-reader using folks.
>Can't you see that this isn't normal? Can't you see that some people 
don't even believe you that you are blind but you >still promote the 
non-accessible programs?
RR's non-belief of me being blind or otherwise was to help his own 
argument, not because I'm promoting anything.
>But there could be an explanation for this too. You might look great 
in your gang if the other blind people you know are >not able to use 
some programs but you are able to create your own which are accessible. 
You will appear really special.
Yep. I'm talking about fixing a library to be more accessible so I can 
look great in my "gang" of sighted people I try so hard to blend in 
with, by daring to use such words as "watch."


You mentioned the millions of people that I may help by quoting 
accessibility laws at, and here I say, you over estimate your self 
importance. If I went into my school and started yelling about the ADA, 
I would possibly get somewhere, but they would end up doing the bear 
minimum in order to comply with such laws. As a result, I don't really 
get what I want, and someone walks away from the encounter with the idea 
that all the blind people are the same, which may be a problem for 
someone who wishes to get employed.


Now, on the other hand, if I were to walk into somewhere, say "hey, this 
is really unaccessible, and this is how we can fix it," from my 
experience, 9 times out of ten it will get fixed. That other 10% is 
where the ADA and other such laws come in. Through this encounter, 
someone walks away with a lot more respect for me, and if something 
should come up later, I can generally go talk to them.


You have this "pity me," "I don't want to be a part of the sighted 
community," attitude, which will get you nowhere. If you limit yourself 
(by not doing such things as watching tv, or using phones with 
touchpads), that is -your- own fault, and no 

Re: Finding the right Python executable on Windows

2011-01-25 Thread Brian Curtin
On Tue, Jan 25, 2011 at 04:25, Geoff Bache  wrote:

> Hi all,
>
> I have a Python process on Windows and would like to start a Python
> subprocess using the same interpreter. I wonder how to go about this?
>
> First, I tried the obvious
>
> subprocess.Popen([ sys.executable, "subproc.py", ... ])
>
> but that fails, because my process has a "native launcher", (i.e. C:
> \path\mylauncher.exe, which is just a wrapper around the Python
> program) and hence sys.executable returns this path instead of the
> interpreter location. It isn't appropriate to use the launcher for the
> subprocess.
>
> I also tried using sys.exec_prefix but there didn't seem to be any
> standard location for the interpreter under this directory in any
> case.
>
> I feel certain there must be some way to do this as it seems a rather
> basic thing somehow, can anyone give me a hint?
>
> Regards,
> Geoff Bache


If sys.executable doesn't work due to this "native launcher", you
could try something
like this:

>>> import os
>>> import sys
>>> full_path = None
>>> for path in sys.path:
... full = os.path.join(path, "python.exe")
... if os.path.exists(full):
... full_path = full
...
>>> full_path
'c:\\python31\\python.exe'
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: which scipy binary for Win32

2011-01-25 Thread David Cournapeau
On Tue, Jan 25, 2011 at 6:24 PM, Adam  wrote:
> Am looking at
> http://sourceforge.net/projects/scipy/files/scipy/0.8.0/
> and I wonder which is the binary to install on WinXP ?
> As pointed to by this page, http://www.scipy.org/Download
>
> All I can see on that sourceforge page are the huge
> python2.6 and python2.7 Powerpacks, at 43megs or so
> each. The scipy-0.8.0.zip seems to require compilation.

What make you think those are not the right ones ? The size is caused
by the presence of three architectures (sse2, sse3 and no sse support)
inside the binary installer.

> Does the scipy 2.7 Powerpack include numpy anyway ?

No, you need to install numpy first.

cheers,

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


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread Matthew Roth
On Jan 25, 4:30 am, Dennis Lee Bieber  wrote:
> On Mon, 24 Jan 2011 14:25:09 -0800 (PST), Matthew Roth
>  declaimed the following in
> gmane.comp.python.general:
>
>
>
> > I've explored various avenues all day to no avail. Can anyone offer a
> > solution or a direction to work towards. One avenue was ignorning the
> > check for posix, and having it run setup_windows, but this just brings
> > in problems with _winreg(?) seeing how I have a posix version of
> > python through cygwin.
>
>         Maybe you need the development headers for MySQL?
--
I do believe I have them. Perhaps I need to find the correct way to
point to them.
I believe it is looking for the dev headers for a linux client when I
am using a client for windows via cygwin.

Or perhaps I should look into installing a separate linux mysql client
in cygwin.
I read of a similiar problem with perl, but the documentation felt a
bit dated and several steps would no longer function correctly.

>
> > Lastly, for the bonus question.
> > Why MySQLdb why not something like this:
> > --
> > import os
> > cmd = 'mysql -uroot -pxxx db -e "SELECT * FROM tblxxx;"'
> > os.system(cmd)
>
>         Passing username/password to a shell command that might be parsed by
> some outside process? Security leak!
--
I do indeed see that. However, all my python calls will be done within
my local intranet.
But is this a reason to not use os module at all? fetching a
dirlisting or mkdir is still
a valid reason to use the os Module, correct?
>
>         Second -- MySQL is a server model DBMS; it doesn't have to be on the
> local machine.
--
unfortunately, for my use it does. We do have an old centOs box here,
but the mysql running on that is severely outdated and so too is the
python.
I have been discouraged from upgrading the former, and the latter I
was told only if I could do it through yum. Making an altinstall form
source seems to be
discouraged. Good news is I think they have decided to upgrade our
development box.
>
>         Third -- ever heard of TRANSACTIONS? How would you handle a
> transaction if every SQL statement was a totally independent process?
> --
No. quite to my embarrassment I haven't. But this is not to say I have
not used them. It sounds as if I have.
But, you can put more than one sql statement into a cmdline.
mysql = "mysql -uuser -ppass db -e \"SELECT CURTIME();
   CREATE TABLE tempTBL (
   freq INT,
   x INT,
   y VARCHAR(255),
   PRIMARY KEY(x, y);

   LOAD XML INFLE 'doc'
   INTO TABLE tempTBL
   ROWS IDENTIFIED BY '';

   INSERT INTO freqTbl(x,y,freq)
   SELECT x,y,freq FROM tempTBL
   ON DUPLICATE KEY UPDATE freq=tempTbl.freq+freqTbl.freq;

   SELECT CURTIME();\"
os.system(mysql)

I haven't tested that, but I know it works at the command line.
I do fully intend to use MySQLdb through python and conduct more of
the processing and parsing in python. It will be a learning
experience. I have a background in anthropology, not computer science.
But I love learning all this, and love that my place of employment
encourages me to learn this. Unfortunately with self-learning you can
sometimes miss out on important concepts and still accomplish tasks.

Thank you for your reply.


>         Wulfraed                 Dennis Lee Bieber         AF6VN
>         wlfr...@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish

On 25/01/2011 14:11, Littlefield, Tyler wrote:

My preaching done with, I'd like to urge everyone to put this in a bit of
perspective; essentially, what I don't want is someone walking away with
Octavian's attitude as a stariotype for us all.


I can't speak for everyone (I don't have that presumption), but to me, 
given the two data points, you are certainly coming across as more 
level-headed, and thus representative. Octavians posts sound more and 
more like rantingricks as time goes on, which is not a good thing.


This entire debate is silly, anyway; wx is doing perfectly well as a 
separate, but easily installed library, and I can't forsee a situation 
where it's inclusion in the standard library would happen. Even if a 
python newbie does start with TK, learning a second GUI toolkit 
shouldn't be that much of a struggle for them.


I think even more damaging to any python newcomers than choosing the 
'wrong' gui toolkit would be stumbling across this thread whilst looking 
for a toolkit; and thinking some of the behaviour here was 
representative of the python (or wx) community as a whole, which 
couldn't be further from the truth. I know that if I had found this 
thread when looking around I would certainly have been put off of wx 
(which is the toolkit I decided on when looking around).


Perhaps there is room for a balanced, adult discussion on the future of 
GUI toolkits in python; But I don't believe that this can happen here 
without substantial changes to a certain persons attitudes (or other 
peoples kill files).

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


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread Nitin Pawar
Nothing againest mysqlDB but I had tried using it sometimes and found it
little difficult to use when you left the connections open idle for sometime
.

I had used PySQLPool then to solve my issues.

Give it a try, I would recommend it.

Thanks,
nitin

On Tue, Jan 25, 2011 at 8:35 PM, Matthew Roth  wrote:

> On Jan 25, 4:30 am, Dennis Lee Bieber  wrote:
> > On Mon, 24 Jan 2011 14:25:09 -0800 (PST), Matthew Roth
> >  declaimed the following in
> > gmane.comp.python.general:
> >
> >
> >
> > > I've explored various avenues all day to no avail. Can anyone offer a
> > > solution or a direction to work towards. One avenue was ignorning the
> > > check for posix, and having it run setup_windows, but this just brings
> > > in problems with _winreg(?) seeing how I have a posix version of
> > > python through cygwin.
> >
> > Maybe you need the development headers for MySQL?
> --
> I do believe I have them. Perhaps I need to find the correct way to
> point to them.
> I believe it is looking for the dev headers for a linux client when I
> am using a client for windows via cygwin.
>
> Or perhaps I should look into installing a separate linux mysql client
> in cygwin.
> I read of a similiar problem with perl, but the documentation felt a
> bit dated and several steps would no longer function correctly.
>
> >
> > > Lastly, for the bonus question.
> > > Why MySQLdb why not something like this:
> > > --
> > > import os
> > > cmd = 'mysql -uroot -pxxx db -e "SELECT * FROM tblxxx;"'
> > > os.system(cmd)
> >
> > Passing username/password to a shell command that might be parsed
> by
> > some outside process? Security leak!
> --
> I do indeed see that. However, all my python calls will be done within
> my local intranet.
> But is this a reason to not use os module at all? fetching a
> dirlisting or mkdir is still
> a valid reason to use the os Module, correct?
> >
> > Second -- MySQL is a server model DBMS; it doesn't have to be on
> the
> > local machine.
> --
> unfortunately, for my use it does. We do have an old centOs box here,
> but the mysql running on that is severely outdated and so too is the
> python.
> I have been discouraged from upgrading the former, and the latter I
> was told only if I could do it through yum. Making an altinstall form
> source seems to be
> discouraged. Good news is I think they have decided to upgrade our
> development box.
> >
> > Third -- ever heard of TRANSACTIONS? How would you handle a
> > transaction if every SQL statement was a totally independent process?
> > --
> No. quite to my embarrassment I haven't. But this is not to say I have
> not used them. It sounds as if I have.
> But, you can put more than one sql statement into a cmdline.
> mysql = "mysql -uuser -ppass db -e \"SELECT CURTIME();
>   CREATE TABLE tempTBL (
>   freq INT,
>   x INT,
>   y VARCHAR(255),
>   PRIMARY KEY(x, y);
>
>   LOAD XML INFLE 'doc'
>   INTO TABLE tempTBL
>   ROWS IDENTIFIED BY '';
>
>   INSERT INTO freqTbl(x,y,freq)
>   SELECT x,y,freq FROM tempTBL
>   ON DUPLICATE KEY UPDATE freq=tempTbl.freq+freqTbl.freq;
>
>   SELECT CURTIME();\"
> os.system(mysql)
>
> I haven't tested that, but I know it works at the command line.
> I do fully intend to use MySQLdb through python and conduct more of
> the processing and parsing in python. It will be a learning
> experience. I have a background in anthropology, not computer science.
> But I love learning all this, and love that my place of employment
> encourages me to learn this. Unfortunately with self-learning you can
> sometimes miss out on important concepts and still accomplish tasks.
>
> Thank you for your reply.
>
>
> > Wulfraed Dennis Lee Bieber AF6VN
> > wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



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


Re: WxPython versus Tkinter.

2011-01-25 Thread Bryan
On Jan 25, 6:03 am, Bob Martin  wrote:
> in 650672 20110125 115033 Bryan  wrote:
> >> Do you think the whole world speaks US English?
>
> >No, absolutely not. I don't see how you go from "I don't think all
> >developers think about i18n" to "I think everyone speaks english".
>
> I said "US English", not just English, and you didn't say
> "I don't think all developers think about i18n", you said "I'm guessing none".
> Big difference.  I think your attitude to this is US-only.

Ah! Now I understand your comment. Yes, without realizing it I was
referring only to software developers in the US not having an
internationalization mindset. I should have been more clear, and
obviously I was making a poor generalization.

Do non-US-based developers focus a lot on accessibility too, since
that's what really started this whole sub-thread?


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


Re: WxPython versus Tkinter.

2011-01-25 Thread rusi
Just trying to sift the BS from the real issues

Heres a list of the issues relating to GUI toolkits


Look
Nativity-1 (as in apps look like other apps on the OS)
Nativity-2 (as in uses 'bare-metal' and not a separate interpreter)
Themeing (ttk)
Efficiency (extra interpreter)
Cross Platform
Stability (crashes on some OSes)
Programmability
Accessibility
i18n
Availability of gui builder
Licence
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Behaviour-based interface/protocol implementation?

2011-01-25 Thread Alan Franzoni
On Tue, Jan 25, 2011 at 7:55 AM, Chris Rebert  wrote:
> Not true actually:
>
> Python 2.7.1 (r271:86832, Dec  5 2010, 00:12:20)
> [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
 class MyContainer(object):# no special inheritance
> ...     def __len__(self):
> ...         return 42
> ...
 # didn't do any registration.
 from collections import Sized
 issubclass(MyContainer, Sized)
> True
 isinstance(MyContainer(), Sized)
> True

You're right, I forgot about subclass check. But that's really a
placebo, because it statically checks the object's *class* for such
method, not the actual instance:

from collections import Sized

class MyObj(object):
pass

mo = MyObj()
mo.__len__ = lambda: 1


print isinstance(mo, Sized)
False

> Not precisely that I know of, no. The `abc`/`collections` system comes
> closest, but it does not check method signatures; it merely verifies
> methods' existence.

It only verifies the method's existence on the class. It does nothing
of what I'd like at runtime.


> You could *definitely* write something like that by combining the
> `abc` and `inspect` modules though:
> http://docs.python.org/library/inspect.html#inspect.getargspec
> http://docs.python.org/library/abc.html#abc.ABCMeta.__subclasshook__

Yes, I'm experimenting with inspect for signature matching.

> Duck typing partisans would question what the point of such an
> elaborate mechanism would be when it won't change the fact that your
> type errors will still occur at run-time and be of essentially the
> same character as if you didn't use such a mechanism in the first
> place.

The point is that this way I might identify ducktypes - at runtime -
in a way that doesn't clutter code. getattr() blocks are simply
boring.

Of course the runtime exception-check approach might work as well
(call the method and see whether it crashes) and I may finally pick
that approach, but I'd like not to clutter my code with explicit
try...except blocks. The very same approach might help.

 The chance for signature mismatch is of course high when using
extreme runtime dynamic proxies (methods with *args, **kwargs
signature), but at least I won't try faking static typing. Anything I
fetch would just be runtime information.

-- 
Alan Franzoni
--
contact me at public@[mysurname].eu
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Bob Martin
in 650680 20110125 151901 Bryan  wrote:
>On Jan 25, 6:03=A0am, Bob Martin  wrote:
>> in 650672 20110125 115033 Bryan  wrote:
>> >> Do you think the whole world speaks US English?
>>
>> >No, absolutely not. I don't see how you go from "I don't think all
>> >developers think about i18n" to "I think everyone speaks english".
>>
>> I said "US English", not just English, and you didn't say
>> "I don't think all developers think about i18n", you said "I'm guessing n=
>one".
>> Big difference. =A0I think your attitude to this is US-only.
>
>Ah! Now I understand your comment. Yes, without realizing it I was
>referring only to software developers in the US not having an
>internationalization mindset. I should have been more clear, and
>obviously I was making a poor generalization.
>
>Do non-US-based developers focus a lot on accessibility too, since
>that's what really started this whole sub-thread?

I don't think so; it was never a requirement for the software I wrote,
though I know I had some blind users.  But NLS was a must and it has
to be designed in from the start - very difficult to add it later.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is the best book to learn python

2011-01-25 Thread John Pinner
On Jan 25, 8:56 am, Mark Summerfield  wrote:
> On Jan 24, 5:09 pm, santosh hs  wrote:
>
> > Hi All,
> > i am beginner to python please tell me which is the best available
> > reference for beginner to start from novice
>
> If you want to learn Python 3 and have some prior programming
> experience (in any modern procedural or object oriented language), you
> might find
> "Programming in Python 3" (http://www.qtrac.eu/py3book.html) to be a
> good choice. (I'm biased though since I wrote it;-)

You may be biased, but you're right :-)

Nice book.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Littlefield, Tyler" 
> >Wow! I, I, I, I... is there a sentence that doesn't talk about your 
> self interests?
> It is clear you have been taking lessons from RR; the word I does not 
> convey self interest, in fact, it is the best word suited to speaking of 
> oppinions (which is all that these are), in the first person. Lets move 
> on, shall we?

The opinions can also be about other people, not only about your own interests.
And in that case you might start by telling what *they* like, or what *they* 
need, or about *they* want or other things that involves *they* and not only 
you.

> >You haven't downloaded any inaccessible program made with Tkinter, you 
> didn't have any problems, You can create an accessible program if you 
> can't find
> >an accessible one, you care only to please the other for working with 
> you and so on.
> No. I said, I can find a program that is accessible, if I find one that 
> isn't. Totally different from making one, and any user at all has said 
> power. Granted, there are conditions where this doesn't work, but my 
> idea of -fixing- TKInter would solve a lot of problems.


The idea has no value when it is just an idea. Tk is a very old GUI so there 
may be many reasons why it is not accessible yet.
When it will be accessible, then we will be able to consider it useful, but 
until then... it is useful but not for everyone.

> >Don't you care that most programmers don't know about accessibility 
> and they just don't create accessible programs not because they don't 
> want, but because
> >they don't know about this thing?
> Of course I do. Non accessibility hurts you, as much as me, as much as 
> anyone else when I have to take time away to try to make a program 
> accessible. But, here is the thing; I have suggested work on TKInter to 
> make such programs accessible, and I am perfectly willing to 
> participate, as much as time allows, in such work. You are trying to 
> make me come across as some evil cruel person because I don't submit to 
> "hit them over the head with the hammer that is the ADA and force 
> compliance," but rather I want to work with someone. At the end of the 
> day, you lose, I win in general. People have made comments about the 
> fact that all you did was parrot the evilness of TKInter to many 
> threads, and now you've made comments on laws in existance that will 
> help us. If you will note, no one even blinked at said laws. Now, the 


What laws are you talking about? I have told only about the discrimination. Are 
you talking about another law, or do you really think that the discrimination 
is OK from your perspective if this opinion can help you to have a good image 
in a potential employer's eyes, in order to have a personal benefit?

> >Retorical question... It is obviously that you don't care.
> Nope. I, as a blind person obviously don't care. Which is why I've spent 
> so much time trying to push the idea of fixing TKInter. what a horrible 
> horrible person I am.


It is very good if you spend time to make Tkinter accessible, but until it will 
really be accessible, it is not accessible at all so your efforts have 
absolutely no value for those who try to use a program but can't do it because 
it is not accessible.
MS and Adobe also pretend that Silverlight and Flash are accessible, but who 
cares about they say when I have seen that they are not really accessible?

> >Ok, you don't care. There are very many like you. But do you think 
> that this is the right atitude? To not care about the >others at all but 
> only about your selfish interests because the alternative is a loss of 
> time?
> A loss of time? Where. I am not a proponent of forcing a lib into the 
> STDLib while said library currently has problems (RR's segfaults, I'm 
> "looking" at you). I know and accept the fact that Python is not going 
> to become unstable with a library, in the hopes that some day people 
> will start using wx since it's just there and voila, everything will be 
> peaches and cream for us screen-reader using folks.

Why do you think that WxPython won't work fine? WxPerl works very well and 
WxPython even has a better documentation than WxPerl.
Why do you think that WxPython can't be improved?

Why do you think that only Tkinter can be improved to be accessible, which mean 
a lot of changes, but WxPython can't be corrected to not give that segfault?

> >Can't you see that this isn't normal? Can't you see that some people 
> don't even believe you that you are blind but you >still promote the 
> non-accessible programs?
> RR's non-belief of me being blind or otherwise was to help his own 
> argument, not because I'm promoting anything.

Oh yes you are promoting Tkinter just because you see that the majority of 
Python users prefer Tkinter, because you are interested much more on adapting 
to the society than helping the society to know why it needs to change.
As you said, it is easier and much more effective of course.

> >But there could b

Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 9:13 am, Nicholas Devenish  wrote:

> I think even more damaging to any python newcomers than choosing the
> 'wrong' gui toolkit would be stumbling across this thread whilst looking
> for a toolkit; and thinking some of the behaviour here was
> representative of the python (or wx) community as a whole, which
> couldn't be further from the truth. I know that if I had found this
> thread when looking around I would certainly have been put off of wx
> (which is the toolkit I decided on when looking around).

Well then that would show how shallow and jealous you are. It would
also show how you have no ability to think for yourself. That you are
an emotional creature who refuses to use reason and logic in your
decision process. Stop jumping on the troll wagon and start thinking
for yourself!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 9:29 am, rusi  wrote:
> Just trying to sift the BS from the real issues
>
> Heres a list of the issues relating to GUI toolkits


Finally someone who knows what the argument is really about! Thanks
rusi!

> Look

There is no doubt wxPython has better look and feel. (+1 wx)

> Nativity-1 (as in apps look like other apps on the OS)

Again (+1 wx)

> Nativity-2 (as in uses 'bare-metal' and not a separate interpreter)

Well Tk uses a separate interpretor so (+1 wx)

> Themeing (ttk)

Yes Tk has themes now. Not sure about how useful they are and what wx
offers so (+0 both)

> Efficiency (extra interpreter)

Well wx is by far more efficient (+1 wx)

> Cross Platform

Wx is cross platform but has some warts. We need to create an
abstraction API to insulate the new users from segfaults and make wx a
safe cross platform GUI so (+1 Tkinter)

> Stability (crashes on some OSes)

Wx is stable but does has some warts as is. (+1 Tkinter)

> Programmability

Wx needs a better API whereas Tkinter is ok (+1 Tkinter)

> Accessibility

Well we know Tkinter in not accessable (+1 wx)

> i18n

(+1 wx)

> Availability of gui builder

+0 both

> Licence

Tkinter is completely open source and wx is LGPL. Some find this to be
a problem however i don't (+0 both)


Tkinter: 3
wxPython: 6

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 9:37 am, Bob Martin  wrote:

> I don't think so; it was never a requirement for the software I wrote,
> though I know I had some blind users.  But NLS was a must and it has
> to be designed in from the start - very difficult to add it later.

Thats the point i keep trying to make about accessibility. Those who
are affected directly by accessibility (the users) are not in control
of accessibilities inclusion. However those that are in control are
twice removed from the torments of needing accessibility.

What is wrong with this picture?

Well specifically, if the developers refuse (or are oblivious) to
include accessibility support then the users are just screwed! Plain
and simple. GUI library developers have a responsibility to include
support for accessibility because if they don't no one else can!

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


Re: [Python] how to tell if cursor is sqlite.Cursor or psycopg2.Cursor

2011-01-25 Thread dmaziuk
D'oh. You're right, of course.

Thank you
Dima
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Behaviour-based interface/protocol implementation?

2011-01-25 Thread Terry Reedy

On 1/25/2011 10:32 AM, Alan Franzoni wrote:


You're right, I forgot about subclass check. But that's really a
placebo, because it statically checks the object's *class* for such
method,


That is exactly the proper check. Instance *methods* are defined on the 
class.


> not the actual instance:

Function attributes of instances are not methods. This is especially 
true of special methods.



from collections import Sized

class MyObj(object):
 pass

mo = MyObj()
mo.__len__ = lambda: 1


print isinstance(mo, Sized)
False


This is correct!

print(len(mo))
TypeError: object of type 'MyObj' has no len()

--
Terry Jan Reedy

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


Re: Which is the best book to learn python

2011-01-25 Thread Tim Harig
On 2011-01-25, Mark Summerfield  wrote:
> On Jan 24, 5:09 pm, santosh hs  wrote:
>> Hi All,
>> i am beginner to python please tell me which is the best available
>> reference for beginner to start from novice
>
> If you want to learn Python 3 and have some prior programming
> experience (in any modern procedural or object oriented language), you
> might find
> "Programming in Python 3" (http://www.qtrac.eu/py3book.html) to be a
> good choice. (I'm biased though since I wrote it;-)

I am usually a big fan for O'reilly books and I started learning Python
from the first edition of _Learning Python_.  It's not a bad book and it
will get you started.  I cannot speak for the latest edition which seems to
contain quite a bit more then the version I read.

When Python 3 was released, I decided to try relearn Python 3 from scratch
rather then trying to simply figure out the differences between versions.  I
picked up Mr. Summerfield's book because it seemed to be the first book to
cover Python 3 excusively and I was rather impressed.  I would definitely
recommend it to others.

[OT] P.S. to Mark Summerfield.  You have been hanging around in the Go Nuts
mailing list.  Is that any indication that you might be considering writing
a book on Go?  If you do, you will have at least one customer.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Terry Reedy

On 1/25/2011 7:03 AM, Bob Martin wrote:


"I bet not much" - there you go again ;-)
You'll find that nearly all software used in Europe (and most other parts)
is internationalized or it wouldn't stand a chance.


I suspected that is true of today's Europe, but do you have any evidence 
that software written in Japan, for instance, is any more 
internationalized than US software? I would expect the opposite since 
they tend to use, and still use their Japanese-only encodings with their 
unique writing system.


--
Terry Jan Reedy

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


Re: documentation / reference help

2011-01-25 Thread Craig Leffel
Where does it return the value to?

What do I need to put in the calling function so that I can use that value?
I need a variable name to refer to. Shouldn't I have to define that variable
someplace?

"Littlefield, Tyler"  wrote in message
news:mailman.1103.1295811520.6505.python-l...@python.org...
> The return value simply returns a value to the calling function, which the
> function can handle, however it wants. so: for example
> def add(a, b):
>   return (a+b)
>
> That simply returns the value a+b, which you can use however you like,
> like so: i=add(2,3) will assign the return value to add.
>
> I recommend you check out the tutorial on python.org, which explains all
> of this; the documentation does not need updating, at least not in that
> respect.
> On 1/23/2011 11:41 AM, Scott Meup wrote:
>> I'm trying tolearn Python.  The documentation tells syntax, and other
>> things
>> about a command.  But for too many commands, it doesn't tell what it
>> does.
>> for instance, in VB the 'return' command tells the program what line to
>> execute after some event (usually an error). In Python it appears to
>> return
>> a value.  Where does it return it to?  I couldn't find anywhere on the
>> Python website to find out or to ask Python to upgrade their
>> documentation.
>> Can somebody please recommend a source.
>>
>>
>
>
> -- 
>
> Thanks,
> Ty
>



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


Re: WxPython versus Tkinter.

2011-01-25 Thread Terry Reedy

On 1/25/2011 10:29 AM, rusi wrote:

Just trying to sift the BS from the real issues

Heres a list of the issues relating to GUI toolkits


Look
Nativity-1 (as in apps look like other apps on the OS)
Nativity-2 (as in uses 'bare-metal' and not a separate interpreter)
Themeing (ttk)
Efficiency (extra interpreter)
Cross Platform
Stability (crashes on some OSes)
Programmability
Accessibility
i18n
Availability of gui builder
Licence


Good as far as it goes, but this list leaves out several requirements 
(already posted by me, Steve Hansen, and others) for a Python 3 new 
stdlib module. It does not matter for the stdlib if wxpython is 3 times 
as good as tkinter, by some measure, as long as it is ineligible.


--
Terry Jan Reedy

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


Re: documentation / reference help

2011-01-25 Thread Benjamin Kaplan
On Jan 25, 2011 1:19 PM, "Craig Leffel"  wrote:
>
> Where does it return the value to?
>
> What do I need to put in the calling function so that I can use that
value?
> I need a variable name to refer to. Shouldn't I have to define that
variable
> someplace?
>

Python functions are like mathematical functions. The function call itself
evaluates to a value (whatever is returned) which can be stored to a
variable.

y = f(x)

You can even use the result without directly storing it in a variable.

print f(g(x))


> "Littlefield, Tyler"  wrote in message
> news:mailman.1103.1295811520.6505.python-l...@python.org...
> > The return value simply returns a value to the calling function, which
the
> > function can handle, however it wants. so: for example
> > def add(a, b):
> >   return (a+b)
> >
> > That simply returns the value a+b, which you can use however you like,
> > like so: i=add(2,3) will assign the return value to add.
> >
> > I recommend you check out the tutorial on python.org, which explains all
> > of this; the documentation does not need updating, at least not in that
> > respect.
> > On 1/23/2011 11:41 AM, Scott Meup wrote:
> >> I'm trying tolearn Python.  The documentation tells syntax, and other
> >> things
> >> about a command.  But for too many commands, it doesn't tell what it
> >> does.
> >> for instance, in VB the 'return' command tells the program what line to
> >> execute after some event (usually an error). In Python it appears to
> >> return
> >> a value.  Where does it return it to?  I couldn't find anywhere on the
> >> Python website to find out or to ask Python to upgrade their
> >> documentation.
> >> Can somebody please recommend a source.
> >>
> >>
> >
> >
> > --
> >
> > Thanks,
> > Ty
> >
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is the best book to learn python

2011-01-25 Thread David Hutto
Building Skills In Python has been a great learning tool, and
reference(I don't exactly learn linearly):

homepage.mac.com/s_lott/books/python.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread CM
On Jan 25, 10:13 am, Nicholas Devenish  wrote:

Nicholas,

> I think even more damaging to any python newcomers than choosing the
> 'wrong' gui toolkit would be stumbling across this thread whilst looking
> for a toolkit; and thinking some of the behaviour here was
> representative of the python (or wx) community as a whole, which
> couldn't be further from the truth. I know that if I had found this
> thread when looking around I would certainly have been put off of wx
> (which is the toolkit I decided on when looking around).

I don't know--you sound too reasonable to extrapolate from this goofy
thread to a huge toolkit project that has been around for years and is
used in project such as Audacity (that's the wxWidgets version, but
close enough).  But yes, it almost at times seemed like--from what I
could manage to read--this thread was a "psy-ops" (psychological
operations) trick to turn off wxPython adopters by associating it with
juvenile nonsense, and yes, on a quick scan it could turn people
off.

Which would be a shame, because, as you, Andrea, and others have
noted, wxPython is a nice toolkit.  For those interested, download it
and make sure to download the Demo, that shows what can be done with
it.  (Very early in this discussion the screenshots on the website
came up; they are horrifically out of date and wxPython deserves
better and looks great on, say, Windows 7 or Ubuntuwell, it looks
native, and that's the point).

> Perhaps there is room for a balanced, adult discussion on the future of
> GUI toolkits in python; But I don't believe that this can happen here
> without substantial changes to a certain persons attitudes (or other
> peoples kill files).

It would be more likely that wxPython would be in the stdlib than
those attitudes will change.  :D

But what I would enjoy is a discussion about GUIs in terms of "develop
once, deploy many".  For example, pyjamas, since I think being able to
develop one GUI that works as desktop or web-based is kind of
exciting.  Unfortunately, it seems it is far off from anything easily
usable at this point.  Part of that might be it doesn't have a big
enough community of developers yet.  It's also just really difficult,
I'm sure.

Another interesting issue in this is mobile phone app development.  It
is frustrating to devote a lot of time to learning a desktop widget
toolkit and Python and while that is occurring the culture moves more
and more toward app use in which that is not too applicable.  Some of
that cannot be helped if Apple, e.g., restricts what can be used on
their phones.  I guess for Android one can already develop with PyQt
and it will run on desktop or phone?


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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 12:15 pm, Terry Reedy  wrote:
> On 1/25/2011 10:29 AM, rusi wrote:
>
>
>
>
>
>
>
>
>
> > Just trying to sift the BS from the real issues
>
> > Heres a list of the issues relating to GUI toolkits
>
> > Look
> > Nativity-1 (as in apps look like other apps on the OS)
> > Nativity-2 (as in uses 'bare-metal' and not a separate interpreter)
> > Themeing (ttk)
> > Efficiency (extra interpreter)
> > Cross Platform
> > Stability (crashes on some OSes)
> > Programmability
> > Accessibility
> > i18n
> > Availability of gui builder
> > Licence
>
> It does not matter for the stdlib if wxpython is 3 times
> as good as tkinter, by some measure, as long as it is ineligible.

Terry, i think rusi was just posting a general list of some likable
attributes of a 21st century GUI library. No were did he mention the
words "wx" or "python".

--
 The Sad Reality
--
Sadly the fact is that the "elite" have already made a decision. And
they don't care how bad "Tkinter" is for Python's stdlib or how good
"GUI library X" is for Python's stdlib. They do not want to make a
change. They are in bed with TclTk. They have lost all vision. This is
the reality.

---
 What can we do about it?
---
However, like all totalitarian regimes, when the peasants start
demanding equality and then storm the castle... then and only then
will the closed minded and selfish elite listen! So we need to make
noise, a lot of noise. And we need to be persistent. We need to demand
equality through accessibility. We need to demand feature rich
libraries that do not cripple us like Tkinter. We need to demand that
Pythons community re-establish a vision for the future. A vision that
is representative of ALL the people -- and not a few fat cats at the
top.


 From Dictatorship to Democracy

I have time and time again given examples of how python-dev can get a
real idea of what the wider community is thinking. One of these ideas
would be to send out a "Tkinter Removal Warning" that would be
displayed when the Python installer was run and every time Tkinter is
imported. The warning would show a website were people could vote to
keep Tkinter in the stdlib. This is the only way we can truly
understand what our community members are thinking about Tkinter.
Anything else is purely speculation.

---
 The silence of the peasants, and an awakening
---
Many folks out there share our views that Tkinter is a weight around
Python's neck, however they are too fearful to speak out for fear of
excommunication (the kill file!). However i must tell all of you that
just as other nations have risen against their own brutal governments
and survived, so to shall you IF you combine your voices as one. There
is power in numbers that no "elite theocracy" can deny. United we can
re-establish the original dream that build Python. Guido forged the
path and we must not let his work be in vain. But now the community
has been so overrun with trolls, naysayers, and negative mind sets
that infect any semblance of civility and remove good judgment from
our coffers. We are doomed unless we re-awake the dream.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread geremy condra
On Tue, Jan 25, 2011 at 11:16 AM, CM  wrote:

> Another interesting issue in this is mobile phone app development.  It
> is frustrating to devote a lot of time to learning a desktop widget
> toolkit and Python and while that is occurring the culture moves more
> and more toward app use in which that is not too applicable.  Some of
> that cannot be helped if Apple, e.g., restricts what can be used on
> their phones.  I guess for Android one can already develop with PyQt
> and it will run on desktop or phone?

No. It's very difficult to do real development on android unless
you're using Java, and even if that weren't the case Qt itself would
require an enormous effort to port. Perhaps you meant MeeGo?

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


Re: WxPython versus Tkinter.

2011-01-25 Thread CM
On Jan 25, 2:33 pm, geremy condra  wrote:
> On Tue, Jan 25, 2011 at 11:16 AM, CM  wrote:
> > Another interesting issue in this is mobile phone app development.  It
> > is frustrating to devote a lot of time to learning a desktop widget
> > toolkit and Python and while that is occurring the culture moves more
> > and more toward app use in which that is not too applicable.  Some of
> > that cannot be helped if Apple, e.g., restricts what can be used on
> > their phones.  I guess for Android one can already develop with PyQt
> > and it will run on desktop or phone?
>
> No. It's very difficult to do real development on android unless
> you're using Java, and even if that weren't the case Qt itself would
> require an enormous effort to port. Perhaps you meant MeeGo?

I think insted of Android I should have said "Nokia phones".  Is that
closer?  I am completely out of the mobile phones loop, so I have no
sense of any of this.  What is MeeGo?

At this point, can Python be used for app development on any mobile
phone (realistically)?

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Nicholas Devenish" 
> I can't speak for everyone (I don't have that presumption), but to me, 
> given the two data points, you are certainly coming across as more 
> level-headed, and thus representative. Octavians posts sound more and 
> more like rantingricks as time goes on, which is not a good thing.

Can you tell why? Because you probably don't care about those who can't use the 
programs made with Tkinter or because you consider the discrimination something 
normal, right?
And you said that it is not a good thing. Good thing for whom? For the blind 
people Tkinter is the worst thing possible. Or do you want to say that it is 
not true?

> This entire debate is silly, anyway; wx is doing perfectly well as a 
> separate, but easily installed library, and I can't forsee a situation 
> where it's inclusion in the standard library would happen. Even if a 
> python newbie does start with TK, learning a second GUI toolkit 
> shouldn't be that much of a struggle for them.

No, it shouldn't be, but I see that you don't understand after this long thread 
why Tkinter should be avoided.
WxPython shouldn't be the second choice. WxPython shouldn't be the first choice 
or the single choice. The single choices should be always only those who don't 
introduce discrimination. Don't you agree with this?
Well, for the moment only WxPython doesn't include discrimination if we are 
talking about portable GUIs.
Please tell me if I wasn't clear enough or what you don't agree with.

> I think even more damaging to any python newcomers than choosing the 
> 'wrong' gui toolkit would be stumbling across this thread whilst looking 
> for a toolkit; and thinking some of the behaviour here was 
> representative of the python (or wx) community as a whole, which 
> couldn't be further from the truth. I know that if I had found this 
> thread when looking around I would certainly have been put off of wx 
> (which is the toolkit I decided on when looking around).

Why? You are not clear at all. What damage generates this thread to WxPython?

> Perhaps there is room for a balanced, adult discussion on the future of 
> GUI toolkits in python; But I don't believe that this can happen here 
> without substantial changes to a certain persons attitudes (or other 
> peoples kill files).

The atitude that needs to be changed is the one that considerates the majority 
more important than a minority which is a minority because of health problems, 
a minority that is a minority without its will.

In my country there is a law that says that the society should adapt to the 
people with disabilities (and not viceversa), and that law is probably copied 
from the legislation of other european countries. That law is a very good one, 
but the problem is that nobody cares to respect it, because most of the people 
have Tyler's opinion.
Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
doesn't mean that my atitude need to be changed. The atitude that needs to be 
changed is the one that considers the discrimination something normal and the 
one that considers that the disabled people should adapt to the society even 
though most of them can't do that because of their health problems.

Octavian


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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Bryan" 
Do non-US-based developers focus a lot on accessibility too, since
that's what really started this whole sub-thread?

Almost nobody focuses on accessibility, and nobody should focus on 
accessibility.

If you target a program for your national population and your national 
population speak a single language, then no, you won't need to use I18N.

If you create a graphic design application so you evidently target it to the 
sighted people, it is obviously that you won't need to make an accessible 
application.

But if you make a program that could be used by the whole world then you should 
use I18N and that program should also be accessible to everyone, not only 
sighted, or only English-speakers, because otherwise that application creates 
discrimination.
Usually I18N is offered using gettext so the users that want that application 
translated in their language can do the translation themselves, but if the 
application uses Tkinter, those who need a screen reader cannot do absolutely 
anything to make it accessible.

And Tyler's idea that if he finds an inaccessible application he can try to 
makes its own is not a valid idea, because not all the millions of users are 
programmers.

Octavian



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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "rantingrick" 
> Availability of gui builder

+0 both



I thought that there are a few GUI builders for Wx. Isn't this true?

Octavian

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Terry Reedy" 
> Good as far as it goes, but this list leaves out several requirements 
> (already posted by me, Steve Hansen, and others) for a Python 3 new 
> stdlib module. It does not matter for the stdlib if wxpython is 3 times 
> as good as tkinter, by some measure, as long as it is ineligible.



Why is WxPython ineligible?
I ask because I want to be sure I understand. I remember just that reason that 
there are no enough maintainers in order to be a good default GUI for Python, 
which is a real problem if it is true.

Octavian


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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Bob Martin" 
...
>>Do non-US-based developers focus a lot on accessibility too, since
>>that's what really started this whole sub-thread?
> 
> I don't think so; it was never a requirement for the software I wrote,
> though I know I had some blind users.  But NLS was a must and it has
> to be designed in from the start - very difficult to add it later.




:-)
Remembering about MSAA (MS Active Accessibility), what you said makes me think 
to "Active Discrimination".

It seems that for comercial reasons those who need to use a screen reader are 
discriminated because it is not profitable to make the effort to make an 
accessible program.
This is a valid problem and the companies can't and shouldn't be forced to 
offer accessibility if this causes them financial damages.
That's why the prefered solutions for creating a GUI should be one which is 
relatively accessible out of the box, because in that case the programmers 
don't even need to think to accessibility, but it is offered.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "Terry Reedy" 
To: 
Sent: Tuesday, January 25, 2011 8:07 PM
Subject: Re: WxPython versus Tkinter.


> On 1/25/2011 7:03 AM, Bob Martin wrote:
> 
>> "I bet not much" - there you go again ;-)
>> You'll find that nearly all software used in Europe (and most other parts)
>> is internationalized or it wouldn't stand a chance.
> 
> I suspected that is true of today's Europe, but do you have any evidence 
> that software written in Japan, for instance, is any more 
> internationalized than US software? I would expect the opposite since 
> they tend to use, and still use their Japanese-only encodings with their 
> unique writing system.



Yes Terry, you are right. In the cases where the software is targetted only to 
japanese speakers (but I can't imagine an example) making only japanese 
applications is OK.
But as probably most of the software could be used by those who can't read 
hiragana/katakana/kanji if it would offer I18N, then it is not OK.

Nobody should be blamed for making a bad software. Not the americans, not the 
japanese and not the europeans (because in Europe there are also a lot of 
uni-lingual applications). 
The bad software which is not accessible for some people, (because the language 
is not accessible or because the interface is not accessible) is usually made 
because of commercial constraints, or because of time constraints, or simply 
because of lack of knowledge about these issues.

The people should be very well informed, and constantly, and not only on a 
single thread ona single mailing list and after many years or even generations, 
the things will change hopefully.

The ones that should be blamed are those who know about these inaccessibility 
problems but simply don't care.

Octavian




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


Re: WxPython versus Tkinter.

2011-01-25 Thread geremy condra
On Tue, Jan 25, 2011 at 11:40 AM, CM  wrote:
> On Jan 25, 2:33 pm, geremy condra  wrote:
>> On Tue, Jan 25, 2011 at 11:16 AM, CM  wrote:
>> > I guess for Android one can already develop with PyQt
>> > and it will run on desktop or phone?
>>
>> No. It's very difficult to do real development on android unless
>> you're using Java, and even if that weren't the case Qt itself would
>> require an enormous effort to port. Perhaps you meant MeeGo?
>
> I think insted of Android I should have said "Nokia phones".  Is that
> closer?  I am completely out of the mobile phones loop, so I have no
> sense of any of this.  What is MeeGo?

MeeGo is Nokia's next generation mobile OS, and Symbian is its current one.

> At this point, can Python be used for app development on any mobile
> phone (realistically)?

Python development on either Symbian or MeeGo is reasonably painless.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread geremy condra
On Tue, Jan 25, 2011 at 11:24 AM, Octavian Rasnita  wrote:

> Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
> doesn't mean that my atitude need to be changed.

There's a difference between having an opinion and having an attitude.
You have both, and it doesn't do you a lot of favors.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 1:40 pm, CM  wrote:

> At this point, can Python be used for app development on any mobile
> phone (realistically)?

No as long as Tkinter is in the stdlib (if your talking stdlib?)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 1:35 pm, "Octavian Rasnita"  wrote:
> From: "rantingrick" 
>
> > Availability of gui builder
>
> +0 both
>
> I thought that there are a few GUI builders for Wx. Isn't this true?

Oops! Yes it seems there are. I was unaware of them since i never use
GUI builders. So another +1 for wxPython!

Here are a few i found...

  http://wxglade.sourceforge.net/index.php#description
  http://boa-constructor.sourceforge.net/

Thanks for correcting me Octavian.
-- 
http://mail.python.org/mailman/listinfo/python-list


numpy/matlab compatibility

2011-01-25 Thread Matt Funk
Hi,

i am fairly new to python. I was wondering of the following is do-able
in python:

1) a = rand(10,1)
2) Y = a
3) mask = Y > 100;
4) Y(mask) = 100;
5) a = a+Y

Basically i am getting stuck on line 4). I was wondering if it is
possible or not with python?
(The above is working matlab code)

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 2:01 pm, geremy condra  wrote:
> On Tue, Jan 25, 2011 at 11:24 AM, Octavian Rasnita  wrote:
> > Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
> > doesn't mean that my atitude need to be changed.
>
> There's a difference between having an opinion and having an attitude.
> You have both, and it doesn't do you a lot of favors.

There is likewise a difference between reading someones words
(objectively) uninfluenced by emotions or personal prejudices, or not.
You understand?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread Matthew Roth
Thank you. I appreciate you explanation and tolerance of my
ignorance.

However unfortunate, this still does not solve my major issue.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 11:25 AM rantingrick said...



Classic insanity.

Emile



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


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 11:38 AM Octavian Rasnita said...

From: "Terry Reedy"

Good as far as it goes, but this list leaves out several requirements
(already posted by me, Steve Hansen, and others) for a Python 3 new
stdlib module. It does not matter for the stdlib if wxpython is 3 times
as good as tkinter, by some measure, as long as it is ineligible.




Why is WxPython ineligible?


I think Terry's point was compatibility with python3 -- which wx 
apparently isn't yet.


Emile

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


python challenges

2011-01-25 Thread David Hutto
Python is, of course, a language based on a lower level to allow
higher level interactivity and ease of use. So, to define the
challenges of python, are to define the challenges of what it  wraps
around. Moving from lower level to the higher level of python, what
needs to take place at each level of the hierarchy it's placed on in
order for it to become 'perfect'?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: numpy/matlab compatibility

2011-01-25 Thread Jerry Hill
On Tue, Jan 25, 2011 at 3:13 PM, Matt Funk  wrote:

> 1) a = rand(10,1)
> 2) Y = a
> 3) mask = Y > 100;
> 4) Y(mask) = 100;
> 5) a = a+Y
>
> Basically i am getting stuck on line 4). I was wondering if it is
> possible or not with python?
> (The above is working matlab code)
>

For those of us who don't know Matlab, what does that code do?

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


PyBluez for iPhone

2011-01-25 Thread Rouzbeh Torki
Hi,

My name is Rouzbeh. I work with Python and PyBluez on my laptop.
I have already installed Python on my iPhone.
But I want to work with iPhone-Bluetooth so I need Bluetooth Library
in Python ( like PyBluez ). Is there any Bluetooth library for iphone in
python or not ? where can I download the library ?

thank you

best regards

-- 
*** < Rouzbeh > ***
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita

> this thread was a "psy-ops" (psychological
operations) trick to turn off wxPython adopters by associating it with
juvenile nonsense

Do you think the need for accessibility is a nonsense?
Or do you think it is something juvenile?


Octavian

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Octavian Rasnita
From: "geremy condra" 
> On Tue, Jan 25, 2011 at 11:24 AM, Octavian Rasnita  wrote:
> 
>> Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
>> doesn't mean that my atitude need to be changed.
> 
> There's a difference between having an opinion and having an attitude.
> You have both, and it doesn't do you a lot of favors.


I don't understand. Please be more clear.
Have I said something wrong? Did I use bad words? Or what was it wrong?
I have just an opinion, but that opinion won't change until the opinion of 
those who pretend that the discrimination is something normal.
Do you think that this is not normal?

Or you recommend me to be just like Tyler that can't use all the apps he could 
use if they were accessible, but he doesn't care because he cares much more to 
play nice in order to be accepted in this not-right society?

Octavian

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


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread John Nagle

On 1/25/2011 7:05 AM, Matthew Roth wrote:

On Jan 25, 4:30 am, Dennis Lee Bieber  wrote:

On Mon, 24 Jan 2011 14:25:09 -0800 (PST), Matthew Roth
  declaimed the following in
gmane.comp.python.general:



 Second -- MySQL is a server model DBMS; it doesn't have to be on the
local machine.

--
unfortunately, for my use it does. We do have an old centOs box here,
but the mysql running on that is severely outdated and so too is the
python.


   You can install a MySQL server under Windows, and talk to the server
from the Cygwin environment.  That's a useful way to test.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Corey Richardson
On 01/25/2011 03:55 PM, Octavian Rasnita wrote:
> 
>> this thread was a "psy-ops" (psychological
>> operations) trick to turn off wxPython adopters by associating it with
>> juvenile nonsense
> 
> Do you think the need for accessibility is a nonsense?
> Or do you think it is something juvenile?
> 
> 
> Octavian
> 

Do you honestly think he was talking about the accessibility problem?
IMO that should move to another thread, because this one is simply
about, as the subject suggests, "WxPython versus Tkinter".
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Need GUI pop-up to edit a (unicode ?) string

2011-01-25 Thread Bryan
On Jan 22, 2:22 pm, Rikishi42  wrote:
> I'm in need for a graphical pop-up that will display a (unicode ?) string in
> a field, allow the user to change it and return the modified string.
>
> Maybe also keep the original one displayed above it.
>
> Something like this:
> +-+
> |   Please confirm or edit the following string   |
> |                                                 |
> |     Original_example_string                     |
> |                                                 |
> |  +---+  |
> |  |  Original_about_to_be_changed             |  |
> |  +---+  |
> |                                                 |
> |                     OK                          |
> |                                                 |
> +-+
>
> I've never used any kind of graphical interface programing before, so I
> don't have a clue where to start.
> This would, however, be the *only* GUI part in the app at this point.
>
> From what I can see the solution lays with PyQT, but the docs I find are
> courses that aim to teach the whole GUI tool. I only need a little pop-up to
> alow a user to edit part of a filename, for instance.
>
> I'm using Python 2.6.x on various Linux platforms (mainly openSUSE and Mint)
> and on Windows. Windows support is not important, in this case.

tkinter is likely the easiest solution. Here's a quick hack, assuming
you want a program with a single window, rather than dialog you can
pop up.  This has no cancel button since you didn't specify you wanted
one. It just pops up a window, and when you press ok,  or
dismiss via the window manager, the edited value will be printed to
stdout. It's not a perfect solution but it gives you a feel for how
easy it is to do with tkinter.

import Tkinter as tk

class App(tk.Tk):
def __init__(self, s):
tk.Tk.__init__(self)
self.wm_title("Edit the string")

# the main layout is composed of four areas:
# 1) the label / instructions
# 2) the original value
# 3) the edit field
# 4) a row of buttons
label = tk.Label(self, text="Please confirm or edit the
following string:")
oframe = tk.LabelFrame(text="Original:")
eframe = tk.LabelFrame(text="Edited:")
buttons = tk.Frame(self)

orig = tk.Entry(self, width=40)
edit = tk.Entry(self, width=40)
edit.insert(0, s)
orig.insert(0, s)
orig.config(state="disabled")
ok = tk.Button(self, text="Ok", command=self.ok,
default="active")

# this does all the layout
label.pack(side="top", fill="both", expand=True)
oframe.pack(side="top", fill="both", expand=True, padx=4)
eframe.pack(side="top", fill="both", expand=True, padx=4,
pady=(4,0))
orig.pack(in_=oframe, side="top", fill="x", padx=4, pady=4)
edit.pack(in_=eframe, side="top", fill="x", padx=4, pady=4)
buttons.pack(side="bottom", fill="x", pady=4)
ok.pack(in_=buttons, expand=True)

edit.select_range(0, "end")
edit.bind("", lambda event: self.ok)
self.wm_protocol("WM_DELETE_WINDOW", self.ok)
edit.focus()

# keep a reference so self.ok can access it
self.edit = edit

def ok(self):
value = self.edit.get()
print value
self.destroy()

if __name__ == "__main__":
import sys
try:
s = sys.argv[1]
except:
s = "Hello, world"
app = App(s)
app.mainloop()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: numpy/matlab compatibility

2011-01-25 Thread Matt Funk
Hi,

thank you Andrea. That is exactly what i was looking for. Great.
Andrea explained what the Matlab code does below. Sorry about the
confusion.
I was under the impression that numpy was leaning very heavily on Matlab
for its syntax and thus i assumed that
Matlab was mostly known for those using numpy.

Andrea:
you are right about the value 100. It should have been 0.5.
The original code has a different vector which is tested against 100. I
tried to simply reproduce the functionality with a random vector.
Thus the confusion.

Again, thanks for the input.
matt


On 1/25/2011 2:36 PM, Andrea Ambu wrote:
>
>
> On Tue, Jan 25, 2011 at 9:13 PM, Matt Funk  > wrote:
>
> Hi,
>
> i am fairly new to python. I was wondering of the following is do-able
> in python:
>
> 1) a = rand(10,1)
> 2) Y = a
> 3) mask = Y > 100;
> 4) Y(mask) = 100;
> 5) a = a+Y
>
>
> No. Not like that. 
>
> You do literally:
> a = rand(10, 1)
> Y = a
> mask = Y>100
> Y = where(mask, 100, Y)
> a = a+Y
>
>
> More Pythonically:
> a = rand(10, 1)
> a = where(a > 100, a + 100, a + a)
>
>
> For those who don't speak Matlab:
>
> 1) a = rand(10,1) ; generates a 10x1 matrix for random number 0 < n < 1
> 2) Y = a 
> 3) mask = Y > 100; similar to: mask = [i>100 for i in Y]
> 4) Y(mask) = 100; sets to 100 elements of Y with index i for which
> mask[i] = True
> 5) a = a+Y ; sums the two matrices element by element (like you do in
> linear algebra) 
>
>
> Anyway... rand generates number from 0 up to 1 (both in python and
> matlab)... when are they > 100? 
>
>  
>
> Basically i am getting stuck on line 4). I was wondering if it is
> possible or not with python?
> (The above is working matlab code)
>
> thanks
> matt
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>

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


Re: numpy/matlab compatibility

2011-01-25 Thread Steven D'Aprano
On Tue, 25 Jan 2011 13:13:02 -0700, Matt Funk wrote:

> Hi,
> 
> i am fairly new to python. I was wondering of the following is do-able
> in python:
> 
> 1) a = rand(10,1)
> 2) Y = a
> 3) mask = Y > 100;
> 4) Y(mask) = 100;
> 5) a = a+Y
> 
> Basically i am getting stuck on line 4). I was wondering if it is
> possible or not with python?
> (The above is working matlab code)

Not everybody here uses Matlab. Considering that this is a Python list, 
not a Matlab list, it may be that the only person who understands what 
the above code does is you. (Unlikely, but not *that* unlikely.)

If you want us to help you, you should help us by telling us what the 
above code does, and what you've tried (if anything), and what error you 
get when you try.

Alternatively, you could try a Matlab forum, and ask for help converting 
it to Python there, or much more likely to succeed, a specialist numpy 
mailing list. You're very likely to find people with experience in both 
numpy and Matlab there.



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


Re: python challenges

2011-01-25 Thread Steven D'Aprano
On Tue, 25 Jan 2011 12:40:31 -0800, David Hutto wrote:

> Python is, of course, a language based on a lower level to allow higher
> level interactivity and ease of use. So, to define the challenges of
> python, are to define the challenges of what it  wraps around. Moving
> from lower level to the higher level of python, what needs to take place
> at each level of the hierarchy it's placed on in order for it to become
> 'perfect'?

Define "perfect".



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


Re: numpy/matlab compatibility

2011-01-25 Thread Nicholas Devenish

On 25/01/2011 20:13, Matt Funk wrote:

1) a = rand(10,1)
2) Y = a
3) mask = Y>  100;
4) Y(mask) = 100;
5) a = a+Y

Basically i am getting stuck on line 4). I was wondering if it is
possible or not with python?
(The above is working matlab code)


I don't understand this matlab code completely (I would expect rand to 
return in the range 0-1, so would expect (Y > 100) to match nothing). 
Nonetheless, to achieve line 4 I believe you are looking for:


>>> Y[mask] = 100

However, you can also do directly:

>>> Y[Y>100] = 100

This won't work exactly as you anticipate, because presumably in matlab 
the line 'Y = a' makes a copy of 'a' (it has been a long time since I 
used matlab). In python, Y and a will still refer to the same object, so 
altering Y will also alter a. The *most literal* translation to python 
of your sample is probably:


>> import numpy
>> a = numpy.random.rand(10,1)
>> Y = a.copy()
>> mask = Y > 100
>> Y[mask] = 100
>> a = a + Y

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


A http server

2011-01-25 Thread Back9
Hi,
I'm trying to set up a http server to handle a single POST request.
That POST request is to upload a huge file and the server is supposed
to handle it with the just POST request.
With my python sample code, multiple post requests are working well,
but that is not my solution.
I need a single POST request handling in the http server side.
Does anyone have a good idea for this case or sample code?
TIA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: numpy/matlab compatibility

2011-01-25 Thread Robert Kern

On 1/25/11 2:13 PM, Matt Funk wrote:

Hi,

i am fairly new to python. I was wondering of the following is do-able
in python:

1) a = rand(10,1)
2) Y = a
3) mask = Y>  100;
4) Y(mask) = 100;
5) a = a+Y

Basically i am getting stuck on line 4). I was wondering if it is
possible or not with python?
(The above is working matlab code)


You will want to ask numpy questions on the numpy-discussion mailing list 
instead of here.


  http://www.scipy.org/Mailing_Lists

When asking how to replicate a particular MATLAB behavior, please describe (and 
preferably also *show*) what the given MATLAB code does. We're not all familiar 
with MATLAB, and even if we are, we may not know which specific aspect of the 
code you want us to replicate.


You will also want to check out this page:

  http://www.scipy.org/NumPy_for_Matlab_Users

To answer your specific questions:

1) a = numpy.random.random_sample([10, 1])
2) Y = a.copy()
  # In Python assignment to a new name does not copy the object. You seem to 
want a copy in this case. numpy arrays have a .copy() method, though most Python 
objects don't.

3) mask = Y > 0.5
  # Note that Y only has values in [0..1) at this point, so using 100 here will 
create a boolean mask with only False entries. This is probably not what you 
wanted to show, so I used 0.5 instead.

4) Y[mask] = 100
5) a = a + Y
  # Or "a += Y" if you want to modify "a" in-place.

--
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: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish


On 25/01/2011 19:24, Octavian Rasnita wrote:

Can you tell why? Because you probably don't care about those who can't use the 
programs made with Tkinter or because you consider the discrimination something 
normal, right?
And you said that it is not a good thing. Good thing for whom? For the blind 
people Tkinter is the worst thing possible. Or do you want to say that it is 
not true?
No, it shouldn't be, but I see that you don't understand after this long thread 
why Tkinter should be avoided.
WxPython shouldn't be the second choice. WxPython shouldn't be the first choice 
or the single choice. The single choices should be always only those who don't 
introduce discrimination. Don't you agree with this?
Well, for the moment only WxPython doesn't include discrimination if we are 
talking about portable GUIs.
Please tell me if I wasn't clear enough or what you don't agree with.
The atitude that needs to be changed is the one that considerates the majority 
more important than a minority which is a minority because of health problems, 
a minority that is a minority without its will.

In my country there is a law that says that the society should adapt to the 
people with disabilities (and not viceversa), and that law is probably copied 
from the legislation of other european countries. That law is a very good one, 
but the problem is that nobody cares to respect it, because most of the people 
have Tyler's opinion.
Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
doesn't mean that my atitude need to be changed. The atitude that needs to be 
changed is the one that considers the discrimination something normal and the 
one that considers that the disabled people should adapt to the society even 
though most of them can't do that because of their health problems.


Octavian, we get it - you are on the warpath about accessibility. And 
this is, in a way, a good thing, because, yes, programmers should in 
general think more about accessibility when designing their programs. 
But nobody was ever persuaded to consider a complicated and subtle issue 
by hostile holier-than-thou arrogance, which is what rantingricks posts 
started out with, and what your posts have been slowly turning into. 
This is what is 'not a good thing', in case you genuinely didn't 
understand the context of my previous message. Look at the response your 
earlier posts got, with experienced developers showing an interest in 
actually trying out accessibility tools. Compare this with the defensive 
replies you have been getting more recently.


But this thread is not about that, and the accessibility issue is mostly 
a red herring that rantingrick has grabbed hold of to swing around like 
a battleaxe, because nobody is going to say that accessibility doesn't 
matter. Discrimination in many forms, is a real problem in our 
societies, and one that is not going to be solved overnight, much as you 
might wish it. Stigmatizing perfectly repectful people who haven't 
encountered your needs before, or don't agree that accessibility is the 
only thing that matters, is not going to solve any issues.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread geremy condra
On Tue, Jan 25, 2011 at 1:03 PM, Octavian Rasnita  wrote:
> From: "geremy condra" 
>> On Tue, Jan 25, 2011 at 11:24 AM, Octavian Rasnita  
>> wrote:
>>
>>> Yes, I know, that's life, which is not right, that's faith, bla bla, but it 
>>> doesn't mean that my atitude need to be changed.
>>
>> There's a difference between having an opinion and having an attitude.
>> You have both, and it doesn't do you a lot of favors.
>
>
> I don't understand. Please be more clear.

There's a difference between what you say and how you say it. If a
friend came up to you and said "give me $100 right now!", you probably
wouldn't do it. If the same friend came up to you and said "I know
this is a big thing to ask, but I really need $100 and I can't
guarantee I'll be able to pay you back. Could you please help me?" I
don't know very many people who would refuse if they were able to
help. The reason is simple: the first does not acknowledge the value
of the person doing the favor, and the second does.

More concretely, you have an opinion that not supporting accessibility
is discrimination. Tyler has an opinion that not supporting
accessibility is a bug. Are you going to demand that he change his
opinion? Or are you going to ask that he consider yours?

> Have I said something wrong? Did I use bad words? Or what was it wrong?

I think it was uncivil. It was rude, unkind, and generally
disagreeable. I lost respect for you, and by proxy, for your point of
view. In other words, you lost support not because fewer people agree
with your position, but because fewer people want to agree with you.

> I have just an opinion, but that opinion won't change until the opinion of 
> those who pretend that the discrimination is something normal.
> Do you think that this is not normal?

I didn't ask you to change your opinion. I told you that you would be
more effective if you changed your attitude. Like rantingrick, you're
free to ignore that advice, but it is good advice for both you and the
community, and I urge you to take it.

> Or you recommend me to be just like Tyler that can't use all the apps he 
> could use if they were accessible, but he doesn't care because he cares much 
> more to play nice in order to be accepted in this not-right society?

I would recommend that you learn to be civil to those you disagree
with. The alternative is to be surrounded by them.

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


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread Matthew Roth
On Jan 25, 9:34 pm, John Nagle  wrote:
> On 1/25/2011 7:05 AM, Matthew Roth wrote:
>
> > On Jan 25, 4:30 am, Dennis Lee Bieber  wrote:
> >> On Mon, 24 Jan 2011 14:25:09 -0800 (PST), Matthew Roth
> >>   declaimed the following in
> >> gmane.comp.python.general:
> >>          Second -- MySQL is a server model DBMS; it doesn't have to be on 
> >> the
> >> local machine.
> > --
> > unfortunately, for my use it does. We do have an old centOs box here,
> > but the mysql running on that is severely outdated and so too is the
> > python.
>
>     You can install a MySQL server under Windows, and talk to the server
> from the Cygwin environment.  That's a useful way to test.
>
>                                         John Nagle

Right, that is precisely what I have. I am able to talk to it from
cygwin, however, during the installing of the MySQLdb module it cannot
find the mysql_config. This is because It is not installed? The setup
sees that I am on a posix system not windows, as python is installed
in cygwin, a virtual posix system. I am trying to bulid a mysql client
from source for cygwin, however, I am running into an error there.

Unless, can I talk to the windows mysql_config? if so, what does that
look like

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish

On 25/01/2011 19:16, CM wrote:

On Jan 25, 10:13 am, Nicholas Devenish  wrote:

I don't know--you sound too reasonable to extrapolate from this goofy
thread to a huge toolkit project that has been around for years and is
used in project such as Audacity (that's the wxWidgets version, but
close enough).  But yes, it almost at times seemed like--from what I
could manage to read--this thread was a "psy-ops" (psychological
operations) trick to turn off wxPython adopters by associating it with
juvenile nonsense, and yes, on a quick scan it could turn people
off.


Personally, no, it probably wouldn't have caused me not to use wx. But 
it certainly would have put a mental tick in the against box, because a 
frameworks community matters. As a little aside, a personal example is 
Django, whose tutorial contained what to my un-django-trained eye looked 
like an inconsistency bug, without explanation. I filed a bug report, 
and apparently many other people have had the same misassumption 
(indicating a problem with the tutorial). The bug was closed with words 
effectively equivalent to "Stupid newbie". Ignoring the fact that 
documentation being consistently misinterpreted should indicate a real 
problem, why should I put my time and effort into learning a framework 
with a community that is so hostile, when there are plenty of alternatives?



Which would be a shame, because, as you, Andrea, and others have
noted, wxPython is a nice toolkit.  For those interested, download it
and make sure to download the Demo, that shows what can be done with
it.  (Very early in this discussion the screenshots on the website
came up; they are horrifically out of date and wxPython deserves
better and looks great on, say, Windows 7 or Ubuntuwell, it looks
native, and that's the point).


I actually chose wxPython partly on the strength of it's native-ness - 
it looks like other mac applications, and doesn't run through X11, but I 
was also extremely impressed by the comprehensive wxPython demo. That, 
and installation seemed to be pretty easy, whereas GTK looked a little 
like a minefield (QT I have a personal bias against, because for 
whatever reason I associate it with KDE and in general dislike kde's 
'look' and design philosopy).



But what I would enjoy is a discussion about GUIs in terms of "develop
once, deploy many".  For example, pyjamas, since I think being able to
develop one GUI that works as desktop or web-based is kind of
exciting.  Unfortunately, it seems it is far off from anything easily
usable at this point.  Part of that might be it doesn't have a big
enough community of developers yet.  It's also just really difficult,
I'm sure.


I was only aware of pyjamas as a "Python to Javascript" compiler, and 
didn't know you could write desktop applications in it too. One to watch!

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


Re: Need GUI pop-up to edit a (unicode ?) string

2011-01-25 Thread rantingrick
On Jan 25, 3:54 pm, Bryan  wrote:

> tkinter is likely the easiest solution. Here's a quick hack,

[...snip code...]

Well this is nice Bryan however it should be much easier than this.
Basically your code is creating most of the functionality that should
be wrapped up in a Dialog class. Tkinter has the tkSimpleDialog from
which one can inherit and build custom dialogs like the one you have
here however it has a major flaw! Fredrick choose not give the class a
show method and instead just threw all the code that should be in a
"show" method into the __init__ method. This is not a good idea. And
i'll explain why...

What Fredrick was trying to do was to make noob programmers life
easier. And he accomplished this in a specific way! However by NOT
creating a show method he has at the same time handicapped these same
people! The proper way to use a dialog class is...

 * Subclass a built-in in Dialog class and insert some widgets.
   class MyDialog(tkSimpleDialog.Dialog): blah

 * Create and instance of your custom dialog.
   dlg = MyDialog(blah)

 * Configure any widget values (if needed!)
   dlg.origText['text'] = unicodestring

 * and show the dialog
  dlg.show(blah)

This design pattern promotes reuse-ability and encapsulation. However
with Fredricks design you cannot configure the contained widgets after
creating the instance because the dialog has entered a local event
loop brought on by "self.wait_window(self)" which is in the DAMN
INITIAL METHOD! This is a major flaw in the design and i would be
happy to fix the flaw. However our "friend" Fredrick decided to
copyright the module to himself! What a jerk! Which is quite
disgusting considering that Tkinter, and TclTk are completely open
source!

And i don't want to hear any arguments about invoking the __init__
method because if you read the source you will see why doing that is
completely ridiculous because of Fredericks design. This is another
example of how few people actually use Tkinter. If many people where
using the module obviously bad code such as this would not exist for
14 years! Someone would have complained.

If Frederic wants some pointers for how to create a proper dialog he
should contact me, or we should have a discussion here. The sad thing
is that this dialog has not been fixed since 1997. And you people
wonder why i hate Tkinter!

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


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread David Robinow
On Tue, Jan 25, 2011 at 5:59 PM, Matthew Roth  wrote:
> On Jan 25, 9:34 pm, John Nagle  wrote:
...
>>     You can install a MySQL server under Windows, and talk to the server
>> from the Cygwin environment.  That's a useful way to test.
>>
>>                                         John Nagle
>
> Right, that is precisely what I have. I am able to talk to it from
> cygwin, however, during the installing of the MySQLdb module it cannot
> find the mysql_config. This is because It is not installed? The setup
> sees that I am on a posix system not windows, as python is installed
> in cygwin, a virtual posix system. I am trying to bulid a mysql client
> from source for cygwin, however, I am running into an error there.
>
> Unless, can I talk to the windows mysql_config? if so, what does that
> look like
 The obvious answer is to use a Windows python. You haven't explained
why you think you need to run a cygwin python. Can you explain that?
-- 
http://mail.python.org/mailman/listinfo/python-list


Using select.kqueue to monitor garageband transcode completion

2011-01-25 Thread harijay
I want to automate a series of functions in python that trigger when
the OSX application Garagband finishes writing to a file called
"todays_recording.mp3".

A Typical transcode process takes 20 minutes , and I fancy starting
the python program immediately after I start the transcode and then
walking away.

For the present moment I have a silly implementation that does
something like the code pasted below.

I was looking online for smarter I/O monitoring and I came across the
kqueue classes inside of the select module which could be used to
monitor the kernel events in BSD - so it should work on OSX. However
being a newbie , I cannot understand how to setup the select.kqueue
event to look for garageband closing , i.e finish writing the
transcoded mp3 file.

I did see some code on comp.lang.python about this in a post from
Ritesh Nadhani (pasted below as well). But I dont understand what the
events mean  . Looking for help to monitor the file closing using
select.kqueue.


Thanks
Hari



My Pseudocode for clunky monitoring of file i/o completion:

while True:
   try:
   today_file = open("todays_recording.mp3","r")
   my_custom_function_to_process_file(today_file)
   except IOError:
   print "File not ready yet..continuing to wait"

###
Some source code I came across on comp.lang.python ( courtesy Ritesh
Vadvani) related to this
##

import select26 as select
import os

kq = select.kqueue()
fd = os.open("/tmp/a.txt", os.O_RDONLY)

# I dont understand this line below
ev = [select.kevent(fd, filter=select.KQ_FILTER_VNODE,
flags=select.KQ_EV_ADD | select.KQ_EV_ENABLE | select.KQ_EV_ONESHOT,
   fflags=select.KQ_NOTE_WRITE | select.KQ_NOTE_DELETE
| select.KQ_NOTE_EXTEND)]
kq.control(ev, 0, 0)

try:
   while True:
   evts = kq.control(ev, 1, None)
   if len(evts):
   print evts
except KeyboardInterrupt:
   pass
else:
   kq.close()
   os.close(fd)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python challenges

2011-01-25 Thread Ben Finney
David Hutto  writes:

> Python is, of course, a language based on a lower level to allow
> higher level interactivity and ease of use. So, to define the
> challenges of python, are to define the challenges of what it wraps
> around.

That seems like a framing of the issue designed to get a particular kind
of answer. Why frame it that way?

Why is the above forumlation better than, for example:

Python is, of course, a language based on the English language. So,
to define the challenges of Python is to define the challenges of
the English lexis and grammar.

For one thing, I don't agree that Python is “a language based on a lower
level”. A lower level of what? Python doesn't have any particular “lower
level”. Its *implementations* do – each implementation wraps around
different lower levels – but you're talking about the language, aren't
you?

> Moving from lower level to the higher level of python, what needs to
> take place at each level of the hierarchy it's placed on in order for
> it to become 'perfect'?

Perhaps you'd like to present what you think the answer to this question
is, and we can discuss that.

-- 
 \   “If we listen only to those who are like us, we will squander |
  `\   the great opportunity before us: To live together peacefully in |
_o__)a world of unresolved differences.” —David Weinberger |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 3:41 pm, Corey Richardson  wrote:

> Do you honestly think he was talking about the accessibility problem?
> IMO that should move to another thread, because this one is simply
> about, as the subject suggests, "WxPython versus Tkinter".

Corey again (like many) you lack a global perspective. Anybody who has
read along with his thread knows we are covering some pretty big
issues here. WxPython is just the vehicle. The big picture is simply:
Tkinter is old and in many ways insufficient for 21st century GUIs. We
need to decide what should come next. I believe wxPython is our best
hope. Wx may not be the best it can be, but it is the best we have at
this time. There is more than "meets the eye" Corey!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 4:45 pm, Nicholas Devenish  wrote:

> But this thread is not about that, and the accessibility issue is mostly
> a red herring that rantingrick has grabbed hold of to swing around like
> a battleaxe, because nobody is going to say that accessibility doesn't
> matter.

Stop trying to exacerbate the situation Nick. You are one of the folks
that has no fact based arguments to present so now you are plating the
victim of my fact based argument. You are losing, and losing sucks!
Stop trying to gain ground simply by hiding facts from the voters.
Losers hate fact, because a fact based argument will dissolve BS
faster than the speed of light. Get off the troll wagon and start
contributing to the discussion in a positive way.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 12:55 PM Octavian Rasnita said...



this thread was a "psy-ops" (psychological

operations) trick to turn off wxPython adopters by associating it with
juvenile nonsense

Do you think the need for accessibility is a nonsense?
Or do you think it is something juvenile?


Are third party installations nonsense? Or should python come with all 
libraries for all potential applications? And then always keep up with 
best of breed?


Emile

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 4:55 pm, geremy condra  wrote:

> There's a difference between what you say and how you say it. If a
> friend came up to you and said "give me $100 right now!", you probably
> wouldn't do it.

What if someone was extorting him and he really needed the money
"right now"?

> If the same friend came up to you and said "I know
> this is a big thing to ask, but I really need $100 and I can't
> guarantee I'll be able to pay you back. Could you please help me?" I
> don't know very many people who would refuse if they were able to
> help. The reason is simple: the first does not acknowledge the value
> of the person doing the favor, and the second does.

No i see what this is about. YOU ARE PART OF THE ELITE and WE are part
of the piss on peasants. We need to grovel at your feet and stroke
your ego before you will give us an audience. We are nothing, we are
pathetic, and you are all knowing. Ok, NOW i get it!

> I would recommend that you learn to be civil to those you disagree
> with. The alternative is to be surrounded by them.

That sounds like a veiled threat to me Geremy! Your scare tactics are
not working so go home.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 5:01 pm, Nicholas Devenish  wrote:

> why should I put my time and effort into learning a framework
> with a community that is so hostile, when there are plenty of alternatives?

That is exactly the point i have been making about this community (at
c.l.py) We are not as noob friendly as we should be. If anyone dares
commit ideas and they are not "accepted" yet, then that person will be
pounced on and beaten. I have seen it time and time again. I have
experienced this firsthand!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: trouble installing MySQLdb (cygwin) + Bonus question

2011-01-25 Thread Matthew Roth
On Jan 25, 6:20 pm, David Robinow  wrote:
> On Tue, Jan 25, 2011 at 5:59 PM, Matthew Roth  wrote:
> > On Jan 25, 9:34 pm, John Nagle  wrote:
> ...
> >>     You can install a MySQL server under Windows, and talk to the server
> >> from the Cygwin environment.  That's a useful way to test.
>
> >>                                         John Nagle
>
> > Right, that is precisely what I have. I am able to talk to it from
> > cygwin, however, during the installing of the MySQLdb module it cannot
> > find the mysql_config. This is because It is not installed? The setup
> > sees that I am on a posix system not windows, as python is installed
> > in cygwin, a virtual posix system. I am trying to bulid a mysql client
> > from source for cygwin, however, I am running into an error there.
>
> > Unless, can I talk to the windows mysql_config? if so, what does that
> > look like
>
>  The obvious answer is to use a Windows python. You haven't explained
> why you think you need to run a cygwin python. Can you explain that?


Good question. There isn't a solid explanation. heretofore, I have
been using a lot of bash scripting in combination with awk sed and
some perl. I was directed to look into python. My tasks were becoming
increasingly complex and memory intensive. I started with a desire to
connect to a mysql server. For that I needed to install the MySQLdb
module. I am having difficultly in acomplishment of this task. I
suppose for the time it has taken, using windows python would have
been the simpler route.


Anyway, I have done some tinkering and have moved passed the
mysql_config problem. Thanks to Davids reminder that I have mysql on
windows. Meaning when setup.py called setup_posix.py It was
essentially calling mysql_config. Well mysql_config was in a far off
folder. I setup a symbolic link and that worked. However I was then
presented with a new problem. In direct relation to that far off
folder. Dreaded spaces. (i headed the log)

--
 running build
 running build_py
 copying MySQLdb/release.py -> build/lib.cygwin-1.7.7-i686-2.6/MySQLdb
 running build_ext
 building '_mysql' extension
 creating build/temp.cygwin-1.7.7-i686-2.6
 gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
prototypes -Dversion_info=(1,2,3,'final'
 ,0) -D__version__=1.2.3 -I/usr/include/python2.6 -c _mysql.c -o build/
temp.cygwin-1.7.7-i686-2.6/_mysql.
 o "-I/cygdrive/c/Program Files/MySQL/MySQL Server 5.5/include" "/MT"
"/Zi" "/O2" "/Ob1" "/D" "NDEBUG" "-
 DDBUG_OFF"
 gcc: "-I/cygdrive/c/Program: No such file or directory
--

there is much more, but obviously the problem is " gcc: "-I/cygdrive/c/
Program: No such file or directory"

what I need to do is have it point to /cygdrive/c/Program\ Files/MySQL/
MySQL\ Server\ 5.5/include and not cygdrive/c/Program Files/MySQL/
MySQL Server 5.5/include.

I am currently trying to track that down. I think I am going to leave
work and go grab some dinner. perhaps I will solve this later tonight.

Best,
Matt

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


adding "Print" menu in wxPython

2011-01-25 Thread Akand Islam
To make a simple editor using wxPython, sample code is available in
wxPython's tutorial page (http://wiki.wxpython.org/
WxHowtoSmallEditor). However, in addition I want to add "print" menu
which will print the contents of editor (i.e. whatever written in
editor). I will appreciate if someone please show me how to add
printing option.

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


Fwd: numpy/matlab compatibility

2011-01-25 Thread Andrea Ambu
I replied to Matt only ARGH!


-- Forwarded message --
From: Andrea Ambu 
Date: 25 January 2011 22:36
Subject: Re: numpy/matlab compatibility
To: Matt Funk 




On Tue, Jan 25, 2011 at 9:13 PM, Matt Funk  wrote:
>
> Hi,
>
> i am fairly new to python. I was wondering of the following is do-able
> in python:
>
> 1) a = rand(10,1)
> 2) Y = a
> 3) mask = Y > 100;
> 4) Y(mask) = 100;
> 5) a = a+Y
>

No. Not like that.
You do literally:
a = rand(10, 1)
Y = a
mask = Y>100
Y = where(mask, 100, Y)
a = a+Y

More Pythonically:
a = rand(10, 1)
a = where(a > 100, a + 100, a + a)

For those who don't speak Matlab:
1) a = rand(10,1) ; generates a 10x1 matrix for random number 0 < n < 1
2) Y = a
3) mask = Y > 100; similar to: mask = [i>100 for i in Y]
4) Y(mask) = 100; sets to 100 elements of Y with index i for which
mask[i] = True
5) a = a+Y ; sums the two matrices element by element (like you do in
linear algebra)

Anyway... rand generates number from 0 up to 1 (both in python and
matlab)... when are they > 100?

>
> Basically i am getting stuck on line 4). I was wondering if it is
> possible or not with python?
> (The above is working matlab code)
>
> thanks
> matt
> --
> http://mail.python.org/mailman/listinfo/python-list




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


Re: WxPython versus Tkinter.

2011-01-25 Thread Martin v. Loewis
> You'll find that nearly all software used in Europe (and most other parts)
> is internationalized or it wouldn't stand a chance.

You mean, in lines of code? I very much doubt that. A lot of software
gets written, in particular for web servers, that is only German, around
here. Nobody thinks this is wrong, since the audience is expected to
speak German, anyway.

I think all the shell scripts that people write every day account for
more lines of code than operating systems, office software, server
applications, web frameworks combined. And these one-time use pieces
of software are certainly not internationalized - not even in companies
that have a policy that all software must support i18n.

If you want examples, here are some:

http://www.heise.de/ct/foren/ (web forum)
http://arztsuche.spiegel.de/ (medical directory)
http://portal.mytum.de/termine/index_html (university calendar - the
software itself is bilingual; the content is not at all)
etc.

Regards,
Martin


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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 5:47 pm, Emile van Sebille  wrote:

> Are third party installations nonsense?

Of course not.

> Or should python come with all
> libraries for all potential applications?

Again, of course not. No one has suggested such bombastic ideas in
this thread, you are the first.

> And then always keep up with
> best of breed?

Yes, Python should be as close to the "cutting edge" as possible. What
does that mean exactly? Well we don't wont to be so close that we cut
a finger (web interfaces). However at the same time we don't want to
find ourselves two decades behind in evolution (Tkinter). There must
be some middle ground. I believe some form of modified wxPython IS
that middle ground. Five to tens years from now, web/mobile interfaces
may be the middle ground.

How much longer are we going to wait? How much longer can we wait
without making a move? The Tkinter module is like a scared rabbit,
frozen with fear, and unable to move. So too are we.


Change with the times are get left behind!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 3:33 PM rantingrick said...


Tkinter is old and in many ways insufficient for 21st century GUIs. We
need to decide what should come next. I believe wxPython is our best
hope. Wx may not be the best it can be, but it is the best we have at
this time.


Then you should immediately volunteer to bring wxPython to python3 
compatibility -- as it is, it's not even close...


Start thinking about upping your game from ranting to doing.

Emile


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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 6:14 pm, Emile van Sebille  wrote:
> On 1/25/2011 3:33 PM rantingrick said...
>
> > Tkinter is old and in many ways insufficient for 21st century GUIs. We
> > need to decide what should come next. I believe wxPython is our best
> > hope. Wx may not be the best it can be, but it is the best we have at
> > this time.
>
> Then you should immediately volunteer to bring wxPython to python3
> compatibility -- as it is, it's not even close...

Thats the kind of advice i want to hear. Now we are engaging in
positive discussion. Now we (you and I) are acting like fellow members
of the same community. Thank You Emile. With this sort of positive
outlook we can move forward.

But how do "you" feel about wxPython. If "you" had a choice would
"you" volunteer for wxPython and move it towards Python 3 standards?
If not, then what would "you" do. I think we can both agree that there
is room to grow beyond the capabilities of Tkinter.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Ian
On Jan 25, 4:01 pm, Nicholas Devenish  wrote:
> Personally, no, it probably wouldn't have caused me not to use wx. But
> it certainly would have put a mental tick in the against box, because a
> frameworks community matters. As a little aside, a personal example is
> Django, whose tutorial contained what to my un-django-trained eye looked
> like an inconsistency bug, without explanation. I filed a bug report,
> and apparently many other people have had the same misassumption
> (indicating a problem with the tutorial). The bug was closed with words
> effectively equivalent to "Stupid newbie". Ignoring the fact that
> documentation being consistently misinterpreted should indicate a real
> problem, why should I put my time and effort into learning a framework
> with a community that is so hostile, when there are plenty of alternatives?

Speaking as a Django user and occasional developer, I'm sorry to hear
that you had a bad experience with the Django community.  I have
generally found it to be friendly and helpful, at least on the mailing
list and the IRC channel.  The ticket triagers have 1800+ open tickets
to organize, so they can get ornery about duplicates at times.

Are you referring to ticket #14081?  I expect the reason this hasn't
been addressed is because nobody has submitted a patch or suggested an
improved wording.  If you were to make a suggestion, I doubt that
anybody would be hostile to the idea of improving the tutorial.

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


Re: Which is the best book to learn python

2011-01-25 Thread Luis M . González
On Jan 24, 2:09 pm, santosh hs  wrote:
> Hi All,
> i am beginner to python please tell me which is the best available
> reference for beginner to start from novice

If you are a complete beginner to programming, I suggest start with a
tutorial such as "A Byte of Python" (google this).
I learned my first steps with Josh Cogliati's "Non-Programmers
Tutorial For Python" 
http://www.oopweb.com/Python/Documents/easytut/VolumeFrames.html
.

The suggestions above are very good if you are new to programming en
general (not only to python).
If you have some experience, you may look to something more advanced,
such as "Dive into Python".
All these resources are available online for free.

If you want to but a book, I like "Beginning Python: From Novice to
Professional".

Hope this helps...
Luis

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


Re: adding "Print" menu in wxPython

2011-01-25 Thread rantingrick
On Jan 25, 5:52 pm, Akand Islam  wrote:
>
> I will appreciate if someone please show me how to add
> printing option.

Hello Akand,

Well the first step would be to create a stub "OnPrint" method and add
a command to the File menu named "Print" that calls the "OnPrint"
method. Can you do this part yourself? All the answers you need are in
the source you linked to. Give it your best shot and then post some
code with a specific question if you get stuck.





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


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 3:49 PM rantingrick said...

On Jan 25, 5:01 pm, Nicholas Devenish  wrote:


why should I put my time and effort into learning a framework
with a community that is so hostile, when there are plenty of alternatives?


That is exactly the point i have been making about this community (at
c.l.py) We are not as noob friendly as we should be. If anyone dares
commit ideas and they are not "accepted" yet, then that person will be
pounced on and beaten. I have seen it time and time again. I have
experienced this firsthand!



Oh, that everyone should blindly accept you as is and without regard for 
established protocols -- we certainly should all jump to your slightest 
whim.


Get a fucking clue.

Emile


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


Re: WxPython versus Tkinter.

2011-01-25 Thread Emile van Sebille

On 1/25/2011 3:57 PM rantingrick said...

On Jan 25, 5:47 pm, Emile van Sebille  wrote:


Are third party installations nonsense?


Of course not.



So install wxPython and move on.  Or start doing.  Join one of the many 
GUI projects that would like to be in the standard library and do more 
than make a smelly breeze.


Emile

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 6:55 pm, Emile van Sebille  wrote:

> Oh, that everyone should blindly accept you as is and without regard for
> established protocols

What protocols? Where is this standard posted? Can you give me a link?
I would like to know what is expected of me.

> -- we certainly should all jump to your slightest
> whim.
>
> Get a [CENSORED] clue.

Thats not very nice Emile.

What is it going to take for you (and others) to take me seriously? I
have been within this group for more than four years and you still do
not accept me. I have been ridiculed, brow beaten, laughed at,
trolled, and any negative thing that can be done to someone. Heck, in
my very first post i was crucified by the community. I'll admit that I
have made some mistakes -- and i have apologized for them. Maybe you
need to be a little more accepting of me. Maybe this group IS not a
homogeneous block as you would like. Maybe we ALL need to be a little
more humble to each other.

What do you think Emile?

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


Re: WxPython versus Tkinter

2011-01-25 Thread Nicholas Devenish

On 26/01/2011 00:40, Ian wrote:

Are you referring to ticket #14081?  I expect the reason this hasn't
been addressed is because nobody has submitted a patch or suggested an
improved wording.  If you were to make a suggestion, I doubt that
anybody would be hostile to the idea of improving the tutorial.


Actually, it was that ticket, good hunting.

It's not so much that it was marked as duplicate, but that the bug it's 
marked "Yet another" duplicate of is marked 'invalid', implying that the 
Django developers consider it not a bug (i.e. user error, and not 
something to be patched or reworded). If it was open, even as a 
long-term low-priority documentation bug, then closing and marking the 
duplicate report wouldn't have felt prickly at all.


I did some digging at the time, and there were indeed several more 
instances of this confusion arising (that I failed to find in my cursory 
search before posting the report); if intelligent people are getting 
confused over the tutorial, (a document specifically designed for people 
unfamiliar with the framework), then it sure sounds like a documentation 
bug. Especially as, in some of the tickets, the responder explained the 
issue (so, a need to explain) before closing the ticket.


Essentially, if people are hostile to the idea of accepting a 
documentation problem, surely they might react the same way to a patch 
for it.


And this is the first impression I got of the django community; because 
I am only a casual user, I subsequently didn't feel any need to 
potentially 'fight against the system' over the issue. I'll take your 
encouraging comments on the general friend-and-helpful-ness of the 
Django community onboard.


Thanks,

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


Re: WxPython versus Tkinter.

2011-01-25 Thread rantingrick
On Jan 25, 7:06 pm, Emile van Sebille  wrote:
> On 1/25/2011 3:57 PM rantingrick said...
>
> > On Jan 25, 5:47 pm, Emile van Sebille  wrote:
>
> >> Are third party installations nonsense?
>
> > Of course not.
>
> So install wxPython and move on.  

See you are missing the point again. The point behind this whole
challenge is that Tkinter is antiquity and Tkinter is making Python
into antiquity simply by being in the stdlib. That is the entire
point. Also, i have said many times that NO GUI library is TRULY 21st
century however wxPython would be a far better base to start from than
Tkinter. TclTk is never going to scale properly. The TclTk folks do
not have a vision for the future. We need to move Python forward. And
Tkinter is not forward. Tkinter is stagnation. 1990's stagnation. This
is 2011. THAT, is my point.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On Sun, 23 Jan 2011 09:21:57 -0800, rantingrick wrote:
> Wait a minute, i am confused? What language is Python written in? Oh
> thats right Lisp! I am so dumb. How did i even get this job? :-)

What job is this?  Inquiring minds wish to know.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WxPython versus Tkinter

2011-01-25 Thread rantingrick
On Jan 25, 7:10 pm, Nicholas Devenish  wrote:

> Essentially, if people are hostile to the idea of accepting a
> documentation problem, surely they might react the same way to a patch
> for it.

This is my very point about writing any code. Only a fool would spend
years developing a code base if he had no assurances anyone would use
it. First, a smart developer will test the waters through discussion.
This is the first step. First garner support. Then code. Then publish.
Then maintain. These are the essential steps for productivity.

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


Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On 01/23/2011 02:11 PM, Littlefield, Tyler wrote:
> I hardly think that your tone, attitude and arguments are going to help 
> you in your battle to prove that WXPython is superior to anything at 
> all, if you can't manage to provide cross-platform bug-free code. 

Sadly you're wasting your breath.  He just doesn't understand what you
are saying.  Further he honestly does not think he has an attitude or
fallacious arguments.  I find his posts fascinating, really.  In the
meantime I suppose we can reply for sport (not a fair fight really), or
just leave him be.
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >