Re: Using Classes

2010-06-25 Thread geremy condra
On Thu, Jun 24, 2010 at 9:04 AM, Alf P. Steinbach /Usenet wrote: > * Mag Gam, on 24.06.2010 13:58: >> >> I have been using python for about 1 year now and I really like the >> language. Obviously there was a learning curve but I have a programing >> background which made it an easy transition. I p

Re: Heuristic

2010-06-25 Thread MRAB
Terry Reedy wrote: On 6/24/2010 9:13 PM, Marcos wrote: I have a store, so I want to maximize the profit. I have all the suppliers with diferent prices, some providers can send products to a client an others not, this has a plus price. Some providers has a discount over the tansport if a quantity

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Paul Rubin
Nobody writes: > More generally, as a program gets more complex, "this will work so long as > we do X every time without fail" approaches "this won't work". QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread Mark Lawrence
On 24/06/2010 21:48, Christian Heimes wrote: I am attempting to install the GDAL bindings (GDAL-1.7.1) on a Windows XP Desktop with Python 2.6 and GDAL. During install, the script finishes with "error: Unable to find vcvarsall.bat". What dependencies am I missing? Visual Studio 2008 Christi

Re: How to send a non-standard IMAP command?

2010-06-25 Thread Xianwen Chen
On Jun 24, 2:23 pm, Michael Torrie wrote: > On 06/24/2010 03:47 AM, Xianwen Chen wrote: > > > , but I got error messages. Any hint please? > > Why not just use a proxy server: > > http://sourceforge.net/projects/imapidproxy/ Hi Michael Thanks a lot! Yes, it would be much more convenient. Actual

Re: How to send a non-standard IMAP command?

2010-06-25 Thread Xianwen Chen
On Jun 24, 2:25 pm, Tim Chase wrote: > On 06/24/2010 04:47 AM, Xianwen Chen wrote: > > > > > Thanks a lot for your reply! I thought it would be simpler if the > > problem was presented in a brief way. Unfortunately, not for this > > case. > > > Here is the detail. Free Yahoo! mail accounts can be

web application in django

2010-06-25 Thread Terry Talim
Hi I'm doing web application in django in which I have to make search option that will find on other web page some product(for example) and that product will have to been seen on my page.. now I don't know where to start with programming.. I know I must parse that other page but I don't have idea

Python 2.7, tkinter problem on OSX

2010-06-25 Thread Julien Pauty
Dear list, Last version of my software relies on ttk. Under windows and linux this is fine. But, OSX users are facing problems (I don't have access to a Mac myself for testing...). Those with OSX 10.6 can run the program. It seems that OSX 8.6 ships with Tk8.5. People with OSX 8.5 cannot run the

django csrf

2010-06-25 Thread Li Hui
When I add enctype="text/plain" to a post form like , there is a "CSRF verification failed." error. But when I remove it, all is right. Who can tell me why? -- Li Hui http://www.lihui.org -- http://mail.python.org/mailman/listinfo/python-list

Re: django csrf

2010-06-25 Thread Bruno Desthuilliers
Li Hui a écrit : > When I add enctype="text/plain" to a post form like method="post" enctype="text/plain">, there is a "CSRF verification > failed." error. > But when I remove it, all is right. > Who can tell me why? > http://groups.google.com/group/django-users http://catb.org/esr/faqs/smart-qu

Re: web application in django

2010-06-25 Thread Daniel Fetchinson
> I'm doing web application in django in which I have to make search option > that will find on other web page some product(for example) and that product > will have to been seen on my page.. now I don't know where to start with > programming.. I know I must parse that other page but I don't have i

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Tim Wintle
On Thu, 2010-06-24 at 21:52 -0500, Peng Yu wrote: > http://psyco.sourceforge.net/ > > The above package can improve python program on 32 bit library. But I > need to run on 64 bit library. Is there any other module that can help > improving the performance of python on 64 bit? As I understand it

Re: improving python performance by extension module (64bit)

2010-06-25 Thread geremy condra
On Fri, Jun 25, 2010 at 7:01 AM, Tim Wintle wrote: > On Thu, 2010-06-24 at 21:52 -0500, Peng Yu wrote: >> http://psyco.sourceforge.net/ >> >> The above package can improve python program on 32 bit library. But I >> need to run on 64 bit library. Is there any other module that can help >> improving

Re: Heuristic

2010-06-25 Thread Marcos
On 25 jun, 04:00, MRAB wrote: > Terry Reedy wrote: > > On 6/24/2010 9:13 PM, Marcos wrote: > >> I have a store, so I want to maximize the profit. I have all the > >> suppliers with diferent prices, some providers can send products to a > >> client an others not, this has a plus price. Some provide

How to get the date format from the users locale?

2010-06-25 Thread Fabio Zadrozny
I'm trying to get the locale-aware date format but it doesn't seem to be available through nl_langinfo in python 2.5.4 (windows vista). Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] onType "help", "copyright", "credits" or "license" for more information. >>> import l

reStructuredText format a part of a word

2010-06-25 Thread Slafs
Hi there! Is it possible to format a word using reStructuredText in a way that only a part of it is formatted (e.g. in bold)? I would like to do something like this: my l****ng word where all the "o"s are in bold but this doesn't work with rst2html Regards -- http://mail.python.org/ma

Re: reStructuredText format a part of a word

2010-06-25 Thread Thomas Jollans
On 06/25/2010 01:56 PM, Slafs wrote: > Hi there! > > Is it possible to format a word using reStructuredText in a way that > only a part of it is formatted (e.g. in bold)? > > I would like to do something like this: > > my l****ng word l\ ****\ nger word? > > where all th

Re: reStructuredText format a part of a word

2010-06-25 Thread Slafs
On 25 Cze, 14:06, Thomas Jollans wrote: > On 06/25/2010 01:56 PM, Slafs wrote:> Hi there! > > > Is it possible to format a word using reStructuredText in a way that > > only a part of it is formatted (e.g. in bold)? > > > I would like to do something like this: > > > my l****ng word > > l\

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Jorgen Grahn
On Fri, 2010-06-25, Lawrence D'Oliveiro wrote: > Just been reading this article > > which says that a lot of security holes are arising these days because > everybody is concentrating on unit testing of their own pa

Re: Pythonic Idiom For Searching An Include Path

2010-06-25 Thread Jorgen Grahn
On Thu, 2010-06-24, Nobody wrote: > On Wed, 23 Jun 2010 17:27:16 -0500, Tim Daneliuk wrote: > >> Given a program 'foo' that takes a command line argument '-I >> includefile', I want to be able to look for 'includefile' in a path >> specified in an environment variable, 'FOOPATH'. >> >> I'd like a

Re: Pythonic Idiom For Searching An Include Path

2010-06-25 Thread Tim Daneliuk
On 6/25/2010 7:25 AM, Jorgen Grahn wrote: > On Thu, 2010-06-24, Nobody wrote: >> On Wed, 23 Jun 2010 17:27:16 -0500, Tim Daneliuk wrote: >> >>> Given a program 'foo' that takes a command line argument '-I >>> includefile', I want to be able to look for 'includefile' in a path >>> specified in an en

Python dynamic attribute creation

2010-06-25 Thread WANG Cong
Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class dynamically by an assignment: >>> class test: pass ... >>> test.a = "hello" >>> test.a 'hello' >>> However, I still don't

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread anu python
Hi, I have a text file , a.txt this is a lcose button where u can observer "lcose" is not a valid word.It's typing mistake.Actual word is "close". How can i check that each word entered in txt file having correct meaningful words as per English Dictionary

Re: Python dynamic attribute creation

2010-06-25 Thread Richard Thomas
On Jun 25, 2:15 pm, WANG Cong wrote: > Hi, list! > > I have a doubt about the design of dynamic attribute creation by > assignments in Python. > > As we know, in Python, we are able to create a new attribute of > a class dynamically by an assignment: > > > > >>> class test: pass > ... > >>> test.a

Re: Python 2.7, tkinter problem on OSX

2010-06-25 Thread Kevin Walzer
There has been a lot of traffic on the MacPython list about this--see the list archives. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Thomas Jollans
On 06/25/2010 03:30 PM, anu python wrote: > Hi, > I have a text file , > a.txt > > > this is a lcose button > > where u can observer "lcose" is not a valid word.It's typing > mistake.Actual word is "close". > > How can i check that each word entered in tx

Re: Python dynamic attribute creation

2010-06-25 Thread Nathan Rice
You are thinking like a C programmer Why do you want the language to tie your hands? I want a language to give me the tools I need and get out of the way. The more assumptions that are baked into a language the more opportunities it has to be wrong. Furthermore, object oriented design is a

Re: deprecated string module issue

2010-06-25 Thread GrayShark
On Fri, 25 Jun 2010 01:29:22 +, Benjamin Peterson wrote: > GrayShark gmail.com> writes: > >> Sorry, I meant "from string import lowercase, uppercase" > > Technically, you should use ascii_lowercase and ascii_uppercase, though > I don't know if that's the cause of pylint's complaints. Thank

Re: Heuristic

2010-06-25 Thread Nathan Rice
I solve optimization problems like this all the time using branch and bound. Just arrange the possible scenarios into a state space tree, (ideally ordered by lowest average cost supplier) then prune any branch where the best case scenario given supplier cost plus shipping cost summed over all remai

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. So var+=increment can't be used because Python woul

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Shashwat Anand
why do you need that ? which platform are you onto ? On OSX you can use 'DictionaryServices' API eg., import sys import DictionaryServices word = " ".join(sys.argv[1:]) print DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word))) Gives the meaning of the input word (works with pyth

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:15 AM, Jorgen Grahn > wrote: > Am I missing something? If not, I can go back to sleep -- and keep > avoiding SQL and web programming like the plague until that community > has entered the 21st century. > You're not missing anything. Its been the accepted industry pract

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread kBob
On Jun 25, 1:26 am, Mark Lawrence wrote: > On 24/06/2010 21:48, Christian Heimes wrote: > > >>   I am attempting to install the GDAL bindings (GDAL-1.7.1) on a > >> Windows XP Desktop with Python 2.6 and GDAL. During install, the > >> script finishes with "error: Unable to find vcvarsall.bat". > >

Re: Python dynamic attribute creation

2010-06-25 Thread Bruno Desthuilliers
WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class dynamically by an assignment: class test: pass ... test.a = "hello" test.a 'hello' However, I still

python source code -> win/dos executable (on linux)

2010-06-25 Thread superpollo
hi. suppose i work in a linux environment, but i would like to ship a win/dos executable file from time to time, just for test purposes (my "testers" are windows users and don't want to go through the hassle of installing python on their win boxes). what is the best way to do that? (the appli

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread Christian Heimes
> I'll try my luck with Cygwin's ggc before I look into another C/C++ > compiler. Better grab a recent build of MinGW32. Python's build system has native support for mingw32. IIRC Cygwin's GCC is only supported for Cygwin builds of Python. Christian -- http://mail.python.org/mailman/listinfo/p

Re: python source code -> win/dos executable (on linux)

2010-06-25 Thread Grant Edwards
On 2010-06-25, superpollo wrote: > suppose i work in a linux environment, but i would like to ship a > win/dos executable file from time to time, just for test purposes (my > "testers" are windows users and don't want to go through the hassle > of installing python on their win boxes). what is t

os.system: string encoding

2010-06-25 Thread Peter Kleiweg
How do I set the string encoding for os.system to anything other then UTF-8? (peter) ~ echo $LANG nl...@euro (peter) ~ python3 Python 3.1.1 (r311:74480, Oct 2 2009, 11:50:52) >>> '\N{EURO SIGN}' '€' >>> import os >>> os.system('echo \N{EURO SIGN}') â?¬ 0 >>> -- Peter Kleiweg -- http://mai

Re: deprecated string module issue

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 7:02 AM, GrayShark wrote: > Thanks for the suggestion. I gave it a quick try. Same 'warning'. No, > using the string module is the issue. Perhaps I'll just ignore it. > Perhaps? Why perhaps? The warning is simply factually wrong-- therefore, there's no reason in the world

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Thu, Jun 24, 2010 at 7:52 PM, Peng Yu wrote: > http://psyco.sourceforge.net/ > > The above package can improve python program on 32 bit library. But I > need to run on 64 bit library. Is there any other module that can help > improving the performance of python on 64 bit? > This is a total as

Re: Heuristic

2010-06-25 Thread Marcos
What do you suggest Terry? I think this problem its similar to traveler salesman. Some people solve it with Heuristic and some with Linear programming or Stochastic programming. On 25 jun, 03:28, Terry Reedy wrote: > On 6/24/2010 9:13 PM, Marcos wrote: > > > I have a store, so I want to maximize

Continuously running scripts question

2010-06-25 Thread jyoung79
Currently, I have some scripts (in particular, applescript 'stay-open' scripts) that run continuously on a Mac through the day. They look in a certain folder every 30 seconds and perform the necessary work needed. I was curious if anyone here on the list does anything similar with Python? If

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread Max Erickson
kBob wrote: > On Jun 25, 1:26 am, Mark Lawrence > wrote: >> On 24/06/2010 21:48, Christian Heimes wrote: >> >> >>   I am attempting to install the GDAL bindings (GDAL-1.7.1) >> >> on a Windows XP Desktop with Python 2.6 and GDAL. During >> >> install, the If it suits your needs, you can wire

Re: Continuously running scripts question

2010-06-25 Thread Ian Kelly
On Fri, Jun 25, 2010 at 9:49 AM, wrote: > Currently, I have some scripts (in particular, applescript > 'stay-open' scripts) that run continuously on a Mac through > the day.  They look in a certain folder every 30 seconds and > perform the necessary work needed. > > I was curious if anyone here o

Re: Python dynamic attribute creation

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote: > Hi, list! > > I have a doubt about the design of dynamic attribute creation by > assignments in Python. > > As we know, in Python, we are able to create a new attribute of a class > dynamically by an assignment: > class test: pass > ..

Re: Continuously running scripts question

2010-06-25 Thread Tim Harig
On 2010-06-25, wrote: [order modified] > I was curious if anyone here on the list does anything similar > with Python? If so, do you use launchd, cron, etc in order to > start up your Python script at the appropriate time(s)? Or do > you just let your Python code run continuously? I'm curi

followup links (Re: Continuously running scripts question)

2010-06-25 Thread Tim Harig
On 2010-06-25, Tim Harig wrote: > It sounds to me, since your script is acting on an event, that it > would benefit from using something like inotify, or whatever your > system equivilant would be (FSEvents for Mac? FAM framework for general > POSIX. There are python modules available.), so that y

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 6:15 AM, WANG Cong wrote: > 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > this is and should be implemented by inherence. > Others have answered the rest fine, I just wanted to add: Who says we have to follow OOP principles, huh? If you want to follo

Re: Continuously running scripts question

2010-06-25 Thread Kushal Kumaran
- Original message - > Currently, I have some scripts (in particular, applescript > 'stay-open' scripts) that run continuously on a Mac through > the day.  They look in a certain folder every 30 seconds and > perform the necessary work needed. > Take a look at inotify. Maybe it fits

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. So var+=increment can't be used be

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 9:12 am, Alan G Isaac wrote: > On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: > > > It is NOT a numeric "variable" in Python realms. > > Sure, but why does it not behave more like one? > It seems both obvious and desirable, so I'm > guessing there is a good reason not to do it. This is

Re: Python 2.7, tkinter problem on OSX

2010-06-25 Thread Jeff Hobbs
On Jun 25, 1:54 am, Julien Pauty wrote: > Last version of my software relies on ttk. Under windows and linux > this is fine. But, OSX users are facing problems (I don't have access > to a Mac myself for testing...). Those with OSX 10.6 can run the > program. It seems that OSX 8.6 ships with Tk8.5.

Re: best way to increment an IntVar?

2010-06-25 Thread Emile van Sebille
On 6/25/2010 10:24 AM rantingrick said... On Jun 25, 9:12 am, Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a g

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue? http://bugs.python.org/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 17:25, Steven D'Aprano wrote: > On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote: > >> Hi, list! >> >> I have a doubt about the design of dynamic attribute creation by >> assignments in Python. >> >> As we know, in Python, we are able to create a new attribute of a class >> dynam

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 15:34, Bruno Desthuilliers wrote: > WANG Cong a écrit : >> Hi, list! >> >> I have a doubt about the design of dynamic attribute creation by >> assignments in Python. >> >> As we know, in Python, we are able to create a new attribute of >> a class dynamically by an assignment: >>

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 14:31, Richard Thomas wrote: > > If you desperately want to limit the attribute assignments that can be > performed on an object you can set the __slots__ attribute of its > type. However, the Python ethos has always been to restrict as little > as necessary to provide the tools it

Re: Python dynamic attribute creation

2010-06-25 Thread Ethan Furman
WANG Cong wrote: On 06/25/10 15:34, Bruno Desthuilliers wrote: WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class dynamically by an assignment: class

Re: Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-25 Thread small Pox
On Jun 22, 8:30 pm, small Pox wrote: > Jew Judges NEVER came out against the CRIMES of BUSH and CHENEY and > LARRY    S I L V E R    S T E I N   -   The main player in 911 > > Jews are coming out from the directions of Corporations, Mafias, > Legislators, and now Judge to SUBVERT the UNITED STATES

Re: How to get the date format from the users locale?

2010-06-25 Thread Chris Rebert
On Fri, Jun 25, 2010 at 4:39 AM, Fabio Zadrozny wrote: > I'm trying to get the locale-aware date format but it doesn't seem to > be available through nl_langinfo in python 2.5.4 (windows vista). There is the %x format specifier in the time module, but it doesn't actually tell you the format, it m

Re: Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-25 Thread small Pox
US Senators Urge Obama To Stand By Israel By Ma'an News 25 June, 2010 Ma'an News Bethlehem – Ma’an – In a letter, 87 American senators told President Barack Obama that the US "must continue" to stand with Israel. In a senate of 100 members, the group of 87 represents a strong majority. Declarin

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 11:03 AM, WANG Cong wrote: > On 06/25/10 17:25, Steven D'Aprano > wrote: > > > Yes, isn't it wonderful? In other languages, metaprogramming is deepest > > black magic, or even completely impossible. In Python it is so easy that > > anyone can do it, and it is something beg

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread John Nagle
On 6/25/2010 12:09 AM, Paul Rubin wrote: Nobody writes: More generally, as a program gets more complex, "this will work so long as we do X every time without fail" approaches "this won't work". Yes. I was just looking at some of my own code. Out of about 100 SQL statements, I'd used manu

(test - ignore)

2010-06-25 Thread John Nagle
Having posting problems - ignore -- http://mail.python.org/mailman/listinfo/python-list

[ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread John Nagle
We have just released a proof-of-concept implementation of a new approach to thread management - "newthreading". It is available for download at https://sourceforge.net/projects/newthreading/ The user's guide is at http://www.animats.com/papers/languages/newthreadingintro.html This is

Re: Python dynamic attribute creation

2010-06-25 Thread Ian Kelly
On Fri, Jun 25, 2010 at 12:51 PM, Stephen Hansen wrote: >> Using assignments to create an attribute hides metaprogramming behide, >> while using delattr() exposes it. > > I don't understand what you're saying here either. I think he's saying that when an attribute exists in the class dictionary,

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac I said "default", not "only" behavior. I suspect list provides an

Re: best way to increment an IntVar?

2010-06-25 Thread Terry Reedy
On 6/25/2010 10:12 AM, Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. tkinter was wri

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 12:36 pm, Emile van Sebille wrote: > IIRC, IDLE was written by Guido so that he could experience writing in > python (which he also wrote).  _You_ can either rewrite it or not, but > realize no one else is going to do it, so stop wasting your time asking > for it to be rewritten. I AM

Re: deprecated string module issue

2010-06-25 Thread Terry Reedy
On 6/25/2010 10:02 AM, GrayShark wrote: Thanks for the suggestion. I gave it a quick try. Same 'warning'. No, using the string module is the issue. Perhaps I'll just ignore it. And what about the next naive user of pylint? Submitting a bug report to the author of pylint would take much less t

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Terry Reedy
On 6/25/2010 9:30 AM, anu python wrote: Hi, I have a text file , a.txt this is a lcose button where u can observer "lcose" is not a valid word.It's typing mistake.Actual word is "close". How can i check that each word entered in txt file having correct

hex question

2010-06-25 Thread Sneaky Wombat
Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 12:46 pm, Alan G Isaac wrote: > On 6/25/2010 1:24 PM, rantingrick wrote: > > > the "if __name__ == '__main__' tests" use > > root.quit instead of root.destroy! > > Did you open an issue?http://bugs.python.org/ If *I* open an issue it will be ignored or quickly dismissed because the peo

[ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread John Nagle
We have just released a proof-of-concept implementation of a new approach to thread management - "newthreading". It is available for download at https://sourceforge.net/projects/newthreading/ The user's guide is at http://www.animats.com/papers/languages/newthreadingintro.html This is

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-25 Thread Xah Lee
On Jun 24, 11:12 am, Tassilo Horn wrote: > Xah Lee writes: > > Hi Xah, > > > also, besides emacs elisp, does anyone see the form feed char in other > > lang source code? > > It's quite often used in messages in newsgroups and mailing lists.  The > Gnus news- and mailreader creates nice "Next/Prev

Re: hex question

2010-06-25 Thread Emile van Sebille
On 6/25/2010 1:20 PM Sneaky Wombat said... Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? It's not happening. What you're seeing is the representation of the four bytes, and \x0a

Re: hex question

2010-06-25 Thread Ethan Furman
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? '\x0a' == '\n' -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Mark Lawrence
Please don't top post! On 25/06/2010 15:20, Shashwat Anand wrote: why do you need that ? which platform are you onto ? On OSX you can use 'DictionaryServices' API eg., import sys import DictionaryServices word = " ".join(sys.argv[1:]) print DictionaryServices.DCSCopyTextDefinition(None, word,

value of: None is None is None

2010-06-25 Thread Alan G Isaac
Surprising for a moment, if you don't immediatelyrecognize it as a chained comparison. (Just sharing.) Alan Isaac None is None is None True (None is None) is None False None is (None is None) False -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 3:52 PM, Dave Angel wrote: I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about. I have no idea what "default behavior" is supposed to mean. Mut

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Mark Lawrence
On 25/06/2010 16:34, Stephen Hansen wrote: Python's slow, sure. But its in practice fast enough for an extremely broad range of activities. What? Kindest regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Heuristic

2010-06-25 Thread Mark Lawrence
Please stop top posting!!! On 25/06/2010 15:14, Nathan Rice wrote: I solve optimization problems like this all the time using branch and bound. Just arrange the possible scenarios into a state space tree, (ideally ordered by lowest average cost supplier) then prune any branch where the best case

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:26 PM, rantingrick wrote: > On Jun 25, 12:46 pm, Alan G Isaac wrote: > > On 6/25/2010 1:24 PM, rantingrick wrote: > > > > > the "if __name__ == '__main__' tests" use > > > root.quit instead of root.destroy! > > > > Did you open an issue?http://bugs.python.org/ > > If *I

Re: improving IDLE

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! On Jun 25, 12:46 pm, Alan G Isaac wrote: Did you open an issue?http://bugs.python.org/ On 6/25/2010 4:26 PM, rantingrick wrote: If *I* open an issue it will be ignored

Re: Python dynamic attribute creation

2010-06-25 Thread Mark Lawrence
On 25/06/2010 19:03, WANG Cong wrote: [lots of snips] "Happily mixes them all together" doesn't mean it is elegant. :) Bollocks springs to my mind. :) Kindest regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: hex question

2010-06-25 Thread Matt McCredie
Sneaky Wombat gmail.com> writes: > > Why is python turning \x0a into a \n ? > > In [120]: h='\x0a\xa8\x19\x0b' > > In [121]: h > Out[121]: '\n\xa8\x19\x0b' > > I don't want this to happen, can I prevent it? 'h' is an ascii string. The ascii encoding for '\n' is the number(byte) 0x0A. When y

Re: Python dynamic attribute creation

2010-06-25 Thread Mark Lawrence
On 25/06/2010 19:23, WANG Cong wrote: On 06/25/10 14:31, Richard Thomas wrote: If you desperately want to limit the attribute assignments that can be performed on an object you can set the __slots__ attribute of its type. However, the Python ethos has always been to restrict as little as ne

importing modules from higher level directory

2010-06-25 Thread Nathan Huesken
Hi, Is it somehow possible to import modules from *.py files in a higher level directory? Intuitively I would do import ../module but that does not work. How does it work? Thanks! Nathan -- http://mail.python.org/mailman/listinfo/python-list

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence wrote: > On 25/06/2010 16:34, Stephen Hansen wrote: > > Python's slow, sure. But its in practice fast enough for an extremely >> broad >> range of activities. >> >> > What? > What, what? --S -- http://mail.python.org/mailman/listinfo/python-list

Re: deprecated string module issue

2010-06-25 Thread GrayShark
Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or worse luck, no one on the other side to create a wrong side? As to your comment about Logilab's pylint. I'v seen a ticket similar to this from three months back. I assume they're not fixing it because if you review 'string

Re: hex question

2010-06-25 Thread Dave Angel
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? You don't say what you do want. Currently, you have a literal that describes four characters. Were you tryin

Re: best way to increment an IntVar?

2010-06-25 Thread Mark Lawrence
On 25/06/2010 21:26, rantingrick wrote: On Jun 25, 12:46 pm, Alan G Isaac wrote: On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue?http://bugs.python.org/ If *I* open an issue it will be ignored or q

Re: importing modules from higher level directory

2010-06-25 Thread Nathan Rice
Add the parent directory to your sys.path... On Fri, Jun 25, 2010 at 5:20 PM, Nathan Huesken wrote: > Hi, > > Is it somehow possible to import modules from *.py files in a higher > level directory? > Intuitively I would do > > import ../module > > but that does not work. > How does it work? > > T

Re: deprecated string module issue

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 16:31:17 -0500, GrayShark wrote: > Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or > worse luck, no one on the other side to create a wrong side? I see only one person being rude here, and that's you. Terry made the very reasonable observation that yo

Re: best way to increment an IntVar?

2010-06-25 Thread Emile van Sebille
On 6/25/2010 1:07 PM rantingrick said... On Jun 25, 12:36 pm, Emile van Sebille wrote: IIRC, IDLE was written by Guido so that he could experience writing in python (which he also wrote). _You_ can either rewrite it or not, but realize no one else is going to do it, so stop wasting your time

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Mark Lawrence
On 25/06/2010 22:25, Stephen Hansen wrote: On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrencewrote: On 25/06/2010 16:34, Stephen Hansen wrote: Python's slow, sure. But its in practice fast enough for an extremely broad range of activities. What? What, what? --S Python is *NOT* slow,

Re: importing modules from higher level directory

2010-06-25 Thread Emile van Sebille
On 6/25/2010 2:20 PM Nathan Huesken said... Hi, Is it somehow possible to import modules from *.py files in a higher level directory? Intuitively I would do import ../module but that does not work. How does it work? IIRC, sys.path controls the search order. You could insert your preferred

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/25/2010 3:52 PM, Dave Angel wrote: I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about. I have no idea what "default behavior" is

Re: deprecated string module issue

2010-06-25 Thread Mark Lawrence
First up please don't top post. Second (although I'm sure Terry Reedy can speak for himself) said TJR has put more into Python than I've drunk pints of beer, and that's saying something, so you accusing him of being rude to me stinks!!! Please apologise or get off of this ng/ml. Disgusted.

  1   2   >