Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Ian Kelly
On Tue, Jun 21, 2011 at 11:58 PM, Chris Torek wrote: > I was curious about implementing prime factorization as a generator, > using a prime-number generator to come up with the factors, and > doing memoization of the generated primes to produce a program that > does what "factor" does, e.g.: This

Re: Don't understand SequenceMatcher from difflib

2011-06-22 Thread Antoon Pardon
On Tue, Jun 21, 2011 at 03:02:57PM -0400, Terry Reedy wrote: > On 6/21/2011 9:43 AM, Antoon Pardon wrote: > > > matcher = SequenceMatcher(ls1, ls2) > ... > >What am I doing wrong? > > Read the doc, in particular, the really stupid signature of the class: > > "class difflib.SequenceMatcher(isju

Re: Unicode codepoints

2011-06-22 Thread Vlastimil Brom
2011/6/22 Saul Spatz : > Hi, > > I'm just starting to learn a bit about Unicode. I want to be able to read a > utf-8 encoded file, and print out the codepoints it encodes.  After many > false starts, here's a script that seems to work, but it strikes me as > awfully awkward and unpythonic.  Have

coverage.py: Highlight hot spots in source code

2011-06-22 Thread Thomas Guettler
Hi, I just used coverage.py for the first time, and like it very much. Is it possible to display how many times a line was executed? I want to see lines which are executed very often red and lines which are executed not often green. I know there are other tools like hotshot, but AFAIK they don'

Re: Unicode codepoints

2011-06-22 Thread Peter Otten
Saul Spatz wrote: > Hi, > > I'm just starting to learn a bit about Unicode. I want to be able to read > a utf-8 encoded file, and print out the codepoints it encodes. After many > false starts, here's a script that seems to work, but it strikes me as > awfully awkward and unpythonic. Have you a

Re: Python 2.7.2 for Windows reports version as 2.7.0?

2011-06-22 Thread Gabriel Genellina
En Sun, 19 Jun 2011 12:35:38 -0300, escribió: The version info comes from the DLL - I wonder if the DLL being found is somehow old? Make sure: >>> import sys >>> win32api.GetModuleFileName(sys.dllhandle) Is the DLL you expect. After uninstalling and reinstalling for the current user only

Re: Unicode codepoints

2011-06-22 Thread jmfauth
That seems to me correct. >>> '\\u{:04x}'.format(ord(u'é')) \u00e9 >>> '\\U{:08x}'.format(ord(u'é')) \U00e9 >>> because >>> u'\U00e9' File "", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-5: end of string in escape sequence >>> u'\U00e9' é

Re: Using django ORM from web browser and from command line apps

2011-06-22 Thread bruno.desthuilli...@gmail.com
On Jun 22, 2:21 am, News123 wrote: > Out of curiousity: Do you know whether the imports would be executed for > each potential command as soon as I call manage.py or only > 'on demand'? Why would you care ? Just importing the module shouldn't have any side effect. -- http://mail.python.org/mailm

Re: Emails backup in python 3.2

2011-06-22 Thread TheSaint
Michael Hrivnak wrote: > Do you have a special reason for wanting to implement > your own email storage? Learning python :) It seems very easy to get my mails with the poplib help. Usually I work with Kmail which imports mbox files. I'm not prone to set up a SMTP server on my PC. -- goto /dev/

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Anny Mous
Chris Torek wrote: > Now that the exercise has been solved... > > Instead of "really short code to solve the problem", how about > some "really long code"? :-) > > I was curious about implementing prime factorization as a generator, > using a prime-number generator to come up with the factors, a

Re: Tkinter/scrollbar/canvas question

2011-06-22 Thread agb
Saul Spatz wrote: > > You need to do the update_idletasks to force the canvas to be mapped > before you figure out the bounding box. Until the canvas is mapped to the > screen, the bounding box is (0,0,1,1) so there no scrolling possible. > (You can call update_ideltasks through any widget.)

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Chris Angelico
On Wed, Jun 22, 2011 at 10:01 PM, Anny Mous wrote: >            prime = table[i] >            del table[i] > I don't fully understand your algorithm, but I think these two lines can be rewritten as: prime=table.pop(i) Interesting algo. A recursive generator, not sure I've seen one of those befor

free computer ebooks updated 5 ebooks every day or more

2011-06-22 Thread basio basio
Denodev eBook - Blog PDF eBook. Free download eBook. Newest eBooks updated everyday. All eBooks are completely free. Come and stay here. subscribe for newsletters. subscribe for rss. www.denodev.com -- http://mail.python.org/mailman/listinfo/python-list

User Authentication

2011-06-22 Thread Anurag
Hi All, I am working on application which needs to do a authentication against LDAP, if LDAP not installed then local system account (administrator user in windows and root user in Linux). This should work on both Windows and Linux. Which library I should use for that. Regards, Anurag -- http:/

Re: Unicode codepoints

2011-06-22 Thread Saul Spatz
Thanks. I agree with you about the generator. Using your first suggestion, code points above U+ get separated into two "surrogate pair" characters fron UTF-16. So instead of U=10 I get U+DBFF and U+DFFF. -- http://mail.python.org/mailman/listinfo/python-list

Re: User Authentication

2011-06-22 Thread Tim Golden
On 22/06/2011 14:34, Anurag wrote: Hi All, I am working on application which needs to do a authentication against LDAP, if LDAP not installed then local system account (administrator user in windows and root user in Linux). This should work on both Windows and Linux. Which library I should use

Re: User Authentication

2011-06-22 Thread Adam Tauno Williams
On Wed, 2011-06-22 at 06:34 -0700, Anurag wrote: > Hi All, > > I am working on application which needs to do a authentication against > LDAP, if LDAP not installed then local system account (administrator > user in windows and root user in Linux). This should work on both > Windows and Linux. See

Python Regular Expressions

2011-06-22 Thread Andy Barnes
Hi, I am hoping someone here can help me with a problem I'd like to resolve with Python. I have used it before for some other projects but have never needed to use Regular Expressions before. It's quite possible I am following completley the wrong tack for this task (so any advice appreciated). I

Re: Unicode codepoints

2011-06-22 Thread Saul Spatz
Thanks very much. This is the elegant kind of solution I was looking for. I had hoped there was a way to do it without even addressing the matter of surrogates, but apparently not. The reason I don't like this is that it depends on knowing that python internally stores strings in UTF-16. I e

Re: Python Regular Expressions

2011-06-22 Thread Andy Barnes
to expand. I have parsed one of the lines manually to try and break the process I'm trying to automate down. source: Theurgic Lore, Lore, n/a, 105, 70, 30, Distil Mana output: TheurgicLore [label="{ Theurgic Lore |{Lore|n/a}|{105|70|30}}"]; DistilMana -> TheurgicLore; This is the steps I would t

Re: Python Regular Expressions

2011-06-22 Thread Neil Cerutti
On 2011-06-22, Andy Barnes wrote: > to expand. I have parsed one of the lines manually to try and break > the process I'm trying to automate down. > > source: > Theurgic Lore, Lore, n/a, 105, 70, 30, Distil Mana > > output: > TheurgicLore [label="{ Theurgic Lore |{Lore|n/a}|{105|70|30}}"]; > Disti

Re: Python Regular Expressions

2011-06-22 Thread Peter Otten
Andy Barnes wrote: > Hi, > > I am hoping someone here can help me with a problem I'd like to > resolve with Python. I have used it before for some other projects but > have never needed to use Regular Expressions before. It's quite > possible I am following completley the wrong tack for this task

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread MRAB
On 22/06/2011 06:58, Chris Torek wrote: Now that the exercise has been solved... Instead of "really short code to solve the problem", how about some "really long code"? :-) I was curious about implementing prime factorization as a generator, using a prime-number generator to come up with the fa

what happens inside?

2011-06-22 Thread Chetan Harjani
why tuples are immutable whereas list are mutable? why when we do x=y where y is a list and then change a element in x, y changes too( but the same is not the case when we change the whole value in x ), whereas, in tuples when we change x, y is not affected and also we cant change each individual e

Re: what happens inside?

2011-06-22 Thread Andrew Berg
On 2011.06.22 10:45 AM, Chetan Harjani wrote: > why tuples are immutable whereas list are mutable? Tuples are more efficient and more appropriate for a list of items that doesn't need to change. > why when we do x=y where y is a list and then change a element in x, y > changes too( but the same is

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Ian Kelly
On Wed, Jun 22, 2011 at 6:01 AM, Anny Mous wrote: > def sieve(): >    """Yield prime integers efficiently. > >    This uses the Sieve of Eratosthenes, modified to generate the primes >    lazily rather than the traditional version which operates on a fixed >    size array of integers. >    """ >  

Re: running an existing script

2011-06-22 Thread Adam Chapman
On Jun 21, 9:12 pm, Adam Chapman wrote: > On Jun 21, 8:00 pm, Ethan Furman wrote: > > > > > > > > > > > Adam Chapman wrote: > > > Thanks Ethan > > > > No way could I have worked that out in my state of stress! > > > > For your second idea, would I need to type that into the python command > > > l

Re: what happens inside?

2011-06-22 Thread Noah Hall
On Wed, Jun 22, 2011 at 4:45 PM, Chetan Harjani wrote: > why tuples are immutable whereas list are mutable? Because an immutable data type was needed, and a mutable type was also needed ;) > why when we do x=y where y is a list and then change a element in x, y > changes too( but the same is not

Re: what happens inside?

2011-06-22 Thread Tim Rowe
On 22 June 2011 16:53, Andrew Berg wrote: > On 2011.06.22 10:45 AM, Chetan Harjani wrote: >> why tuples are immutable whereas list are mutable? > Tuples are more efficient and more appropriate for a list of items that > doesn't need to change. And also it sometimes useful to be sure that somethin

Re: running an existing script

2011-06-22 Thread Chris Rebert
On Wed, Jun 22, 2011 at 8:54 AM, Adam Chapman wrote: > I've added the python directories to the environment variable "path" > in my computer (http://showmedo.com/videotutorials/video? > name=96&fromSeriesID=96), which means I can now call python from > the windows DOS-style command prompt. >

Re: running an existing script

2011-06-22 Thread Ethan Furman
Adam Chapman wrote: On Jun 21, 9:12 pm, Adam Chapman wrote: On Jun 21, 8:00 pm, Ethan Furman wrote: Adam Chapman wrote: Thanks Ethan No way could I have worked that out in my state of stress! For your second idea, would I need to type that into the python command line interface (the

Re: running an existing script

2011-06-22 Thread Adam Chapman
On Jun 22, 4:54 pm, Adam Chapman wrote: > On Jun 21, 9:12 pm, Adam Chapman > wrote: > > > > > > > > > > > On Jun 21, 8:00 pm, Ethan Furman wrote: > > > > Adam Chapman wrote: > > > > Thanks Ethan > > > > > No way could I have worked that out in my state of stress! > > > > > For your second idea,

Re: running an existing script

2011-06-22 Thread Ethan Furman
Adam Chapman wrote: On Jun 22, 4:54 pm, Adam Chapman wrote: On Jun 21, 9:12 pm, Adam Chapman wrote: On Jun 21, 8:00 pm, Ethan Furman wrote: Adam Chapman wrote: Thanks Ethan No way could I have worked that out in my state of stress! For your second idea, would I need to type that i

Re: Rant on web browsers

2011-06-22 Thread Thomas 'PointedEars' Lahn
[I am biting only because this is my field of expertise, and I am really getting tired reading from people not having a shadow of a trace of a minimum clue what these languages that I like can and can't do.] Chris Angelico wrote: > Random rant and not very on-topic. Feel free to hit Delete and

Re: running an existing script

2011-06-22 Thread Adam Chapman
On Jun 22, 5:51 pm, Ethan Furman wrote: > Adam Chapman wrote: > > On Jun 22, 4:54 pm, Adam Chapman > > wrote: > >> On Jun 21, 9:12 pm, Adam Chapman > >> wrote: > > >>> On Jun 21, 8:00 pm, Ethan Furman wrote: > Adam Chapman wrote: > > Thanks Ethan > > No way could I have worked that

Re: running an existing script

2011-06-22 Thread Adam Chapman
On Jun 22, 5:51 pm, Adam Chapman wrote: > On Jun 22, 5:51 pm, Ethan Furman wrote: > > > > > > > > > > > Adam Chapman wrote: > > > On Jun 22, 4:54 pm, Adam Chapman > > > wrote: > > >> On Jun 21, 9:12 pm, Adam Chapman > > >> wrote: > > > >>> On Jun 21, 8:00 pm, Ethan Furman wrote: > > Adam

Re: Unicode codepoints

2011-06-22 Thread jmfauth
On 22 juin, 16:07, Saul Spatz wrote: > Thanks very much.  This is the elegant kind of solution I was looking for.  I > had hoped there was a way to do it without even addressing the matter of > surrogates, but apparently not.  The reason I don't like this is that it > depends on knowing that py

Re: running an existing script

2011-06-22 Thread Ethan Furman
Adam Chapman wrote: Thanks a lot, must be getting close now... I changed the indentation one lines 136-168, and put in the command window: nfold.py --booster=Adaboost --folds=5 --data=spambase.data -- spec=spambase.spec --rounds=500 --tree=ADD_ALL --generate no syntax errors this time, it just

Re: Security test of embedded Python

2011-06-22 Thread Irmen de Jong
On 22-6-2011 4:44, Chris Angelico wrote: > Followup: The test box has been administratively taken offline after > about an hour of testing. Thank you to everyone who participated; it > seems we have a lot of changes to make! > > Monty failed the test. But it was an incredibly successful test. And

doing cross platform file work

2011-06-22 Thread Tim Hanson
Thanks for your responses to my student question about using OS paths in Python. For the more general case, I am a Linux user interested in making my scripts platform neutral, which would include Linux, Unix (including Mac), and Windows. I have looked at the python.org os segment and didn't ge

Re: sorry, possibly too much info. was: Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Irmen de Jong
On 22-6-2011 5:02, John Salerno wrote: > Thanks. So far they are helping me with Python too, but definitely not > as much as more general exercises would, I'm sure. The part about > writing the code is fun, but once that's done, I seem to end up stuck > with an inefficient implementation because I

Re: doing cross platform file work

2011-06-22 Thread John Gordon
In Tim Hanson writes: > For the more general case, I am a Linux user interested in making my scripts > platform neutral, which would include Linux, Unix (including Mac), and > Windows. I have looked at the python.org os segment and didn't get an answer. > Is there a library (bonus would be

Re: running an existing script

2011-06-22 Thread Adam Chapman
On Jun 22, 6:13 pm, Adam Chapman wrote: > On Jun 22, 5:51 pm, Adam Chapman > wrote: > > > > > > > > > > > On Jun 22, 5:51 pm, Ethan Furman wrote: > > > > Adam Chapman wrote: > > > > On Jun 22, 4:54 pm, Adam Chapman > > > > wrote: > > > >> On Jun 21, 9:12 pm, Adam Chapman > > > >> wrote: > > >

Re: running an existing script

2011-06-22 Thread Ethan Furman
Adam Chapman wrote: Thanks again Ethan, It did begin to run nfold.py this time, after I added the environment variable "CLASSPATH" to my system. It threw back a java error, but I guess this isn;t the right place to be asking about that C:\Users\Adam\Desktop\JBOOST\jboost-2.2\jboost-2.2\scripts>n

connect windows share

2011-06-22 Thread Travis Altman
I want to be able to connect to a windows share via python. My end goal is to be able to recursively search through windows shares. I want to do this in Linux as well. So given a share such as \\computer\test I would like to search through the test directory and any sub directories for any file

python 3 constant

2011-06-22 Thread sidRo
How to declare a constant in python 3? -- http://mail.python.org/mailman/listinfo/python-list

Re: connect windows share

2011-06-22 Thread Tim Golden
On 22/06/2011 19:38, Travis Altman wrote: I want to be able to connect to a windows share via python. My end goal is to be able to recursively search through windows shares. I want to do this in Linux as well. So given a share such as \\computer\test I would like to search through the test dir

writable iterators?

2011-06-22 Thread Neal Becker
AFAICT, the python iterator concept only supports readable iterators, not write. Is this true? for example: for e in sequence: do something that reads e e = blah # will do nothing I believe this is not a limitation on the for loop, but a limitation on the python iterator concept. Is thi

Re: writable iterators?

2011-06-22 Thread Ethan Furman
Neal Becker wrote: AFAICT, the python iterator concept only supports readable iterators, not write. Is this true? for example: for e in sequence: do something that reads e e = blah # will do nothing I believe this is not a limitation on the for loop, but a limitation on the python itera

Re: writable iterators?

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 12:31 PM, "Neal Becker" wrote: > > AFAICT, the python iterator concept only supports readable iterators, not write. > Is this true? > > for example: > > for e in sequence: > do something that reads e > e = blah # will do nothing > > I believe this is not a limitation on the for l

Re: connect windows share

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 11:44 AM, "Travis Altman" wrote: > > I want to be able to connect to a windows share via python. My end goal is to be able to recursively search through windows shares. I want to do this in Linux as well. So given a share such as \\computer\test I would like to search through th

Re: python 3 constant

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 12:03 PM, "sidRo" wrote: > > How to declare a constant in python 3? > -- You don't. Python doesn't have declarations (other than global and nonlocal). Convention is that anything in all caps should be considered a constant but there's no language-level enforcement of it. -- http

Re: python 3 constant

2011-06-22 Thread Noah Hall
On Wed, Jun 22, 2011 at 7:54 PM, sidRo wrote: > How to declare a constant in python 3? There aren't true constants in Python, but instead we use a standard defined by PEP 8, which states constants are in all caps, for example, PI = 3.14, as opposed to pi = 3.14 which could change (according to PE

Re: writable iterators?

2011-06-22 Thread Steven D'Aprano
On Wed, 22 Jun 2011 15:28:23 -0400, Neal Becker wrote: > AFAICT, the python iterator concept only supports readable iterators, > not write. Is this true? > > for example: > > for e in sequence: > do something that reads e > e = blah # will do nothing > > I believe this is not a limitation o

Re: writable iterators?

2011-06-22 Thread Mel
Steven D'Aprano wrote: > On Wed, 22 Jun 2011 15:28:23 -0400, Neal Becker wrote: > >> AFAICT, the python iterator concept only supports readable iterators, >> not write. Is this true? >> >> for example: >> >> for e in sequence: >> do something that reads e >> e = blah # will do nothing >> >

Re: Unicode codepoints

2011-06-22 Thread Vlastimil Brom
2011/6/22 Saul Spatz : > Thanks.  I agree with you about the generator.  Using your first suggestion, > code points above U+ get separated into two "surrogate pair" characters > fron UTF-16.  So instead of U=10 I get U+DBFF and U+DFFF. > -- > http://mail.python.org/mailman/listinfo/python

PyPad 2.7.1 Update 4

2011-06-22 Thread Jon Dowdall
Hi All, I'm pleased to announce that PyPad 2.7.1 (Update 4), a simple python environment for the iPad / iPhone, is now available in the iTunes store. It can be found at: http://itunes.apple.com/au/app/pypad/id428928902?mt=8 Update 4 adds the ability to create multiple modules and import them

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Terry Reedy
On 6/22/2011 1:32 AM, Paul Rubin wrote: Terry Reedy writes: If the best C program for a problem takes 10 seconds or more, then applying the same 1 minute limit to Python is insane, and contrary to the promotion of good algorithm thinking. The Euler problems are not the only algorithm probl

Re: what happens inside?

2011-06-22 Thread Terry Reedy
On 6/22/2011 11:45 AM, Chetan Harjani wrote: why tuples are immutable whereas list are mutable? Because tuples do not have mutation methods, which lists do. Tuple and lists both have .__getitem__ but tuples do not have .__setitem__ or .__delitem__ (or .append, .extend, .sort, or .reverse).

Re: writable iterators?

2011-06-22 Thread Neal Becker
Steven D'Aprano wrote: > On Wed, 22 Jun 2011 15:28:23 -0400, Neal Becker wrote: > >> AFAICT, the python iterator concept only supports readable iterators, >> not write. Is this true? >> >> for example: >> >> for e in sequence: >> do something that reads e >> e = blah # will do nothing >> >

Re: writable iterators?

2011-06-22 Thread Chris Kaynor
You could probably implement something like this using generators and the send method (note the example is untested and intended for 2.6: I lack Python on this machine): def gen(list_): for i, v in enumerate(list_): list_[i] = yield v def execute(): data = range(10) iterator = gen(data)

Re: writable iterators?

2011-06-22 Thread Thomas 'PointedEars' Lahn
Mel wrote: > Steven D'Aprano wrote: >> I *guess* that what you mean by "writable iterators" is that rebinding e >> should change seq in place, i.e. you would expect that seq should now >> equal [42, 42]. Is that what you mean? It's not clear. >> >> Fortunately, that's not how it works, and far fr

Re: writable iterators?

2011-06-22 Thread MRAB
On 23/06/2011 00:10, Neal Becker wrote: Steven D'Aprano wrote: On Wed, 22 Jun 2011 15:28:23 -0400, Neal Becker wrote: AFAICT, the python iterator concept only supports readable iterators, not write. Is this true? for example: for e in sequence: do something that reads e e = blah # wil

Why are my signals being ignored?

2011-06-22 Thread Anthony Papillion
Hello Everyone, So I figured out the last problem about why I couldn't load my UI files but now I've got something that has be totally stumped. I've worked on it most of the day yesterday, Google'd it, and fought with it today and I'm admitting defeat and coming to the group with hat in hand askin

Re: writable iterators?

2011-06-22 Thread Steven D'Aprano
On Thu, 23 Jun 2011 09:10 am Neal Becker wrote: > Steven D'Aprano wrote: > >> On Wed, 22 Jun 2011 15:28:23 -0400, Neal Becker wrote: >> >>> AFAICT, the python iterator concept only supports readable iterators, >>> not write. Is this true? >>> >>> for example: >>> >>> for e in sequence: >>> d

Re: writable iterators?

2011-06-22 Thread Steven D'Aprano
On Thu, 23 Jun 2011 09:30 am Thomas 'PointedEars' Lahn wrote: > Mel wrote: > >> Steven D'Aprano wrote: >>> I *guess* that what you mean by "writable iterators" is that rebinding e >>> should change seq in place, i.e. you would expect that seq should now >>> equal [42, 42]. Is that what you mean?

Re: Handling import errors

2011-06-22 Thread Guillaume Martel-Genest
I did not think about using a global variable, and the top-level try...except solution is interesting. After further thinking, I have to reformulate my initial question: How do I manage to run code before my imports? For example, I want to make sure that I can use the logging module in the case a

How to run a function in SPE on Python 2.5

2011-06-22 Thread bill lawhorn
I have a program: decrypt2.py which contains this function: def scramble2Decrypt(cipherText): halfLength = len(cipherText) // 2 oddChars = cipherText[:halfLength] evenChars = cipherText[halfLength:] plainText = "" for i in range(halfLength): plainText = plainText + ev

Re: How to run a function in SPE on Python 2.5

2011-06-22 Thread MRAB
On 23/06/2011 03:19, bill lawhorn wrote: I have a program: decrypt2.py which contains this function: def scramble2Decrypt(cipherText): halfLength = len(cipherText) // 2 oddChars = cipherText[:halfLength] evenChars = cipherText[halfLength:] plainText = "" for i in range

Re: writable iterators?

2011-06-22 Thread Carl Banks
On Wednesday, June 22, 2011 4:10:39 PM UTC-7, Neal Becker wrote: > AFAIK, the above is the only python idiom that allows iteration over a > sequence > such that you can write to the sequence. And THAT is the problem. In many > cases, indexing is much less efficient than iteration. Well, if yo

Re: How to run a function in SPE on Python 2.5

2011-06-22 Thread FunAt Work
Not tried SPE. But in PyScripter, as simple as that. import sys def scramble2Decrypt(cipherText): halfLength = len(cipherText) // 2 oddChars = cipherText[:halfLength] evenChars = cipherText[halfLength:] plainText = "" for i in range(halfLength): plainText = plainText +

Re: parse date string having "EDT"

2011-06-22 Thread Tim Roberts
Ben Finney wrote: >Tim Roberts writes: > >> Right, because strptime doesn't support %Z. > >Au contraire: > >Support for the %Z directive is based on the values contained in >tzname and whether daylight is true. Because of this, it is >platform-specific except for recognizing UTC and

Re: writable iterators?

2011-06-22 Thread FunAt Work
Don't relate it anyhow to foreach of perl I would say, although the behaviour may be same in some aspect -- http://mail.python.org/mailman/listinfo/python-list

Re: User Authentication

2011-06-22 Thread Anurag
On Jun 22, 7:01 pm, Adam Tauno Williams wrote: > On Wed, 2011-06-22 at 06:34 -0700, Anurag wrote: > > Hi All, > > > I am working on application which needs to do a authentication against > > LDAP, if LDAP not installed then local system account (administrator > > user in windows and root user in L

Re: what happens inside?

2011-06-22 Thread FunAt Work
Do the same thing with an interconversion of tuple and list and you will be off to the older way: a=(1,2,3) b=list(a) b[0]=11 print a print b Output: (1, 2, 3) [11, 2, 3] -- http://mail.python.org/mailman/listinfo/python-list

Re: connect windows share

2011-06-22 Thread FunAt Work
On my cygwin system I just do the following for my network drive 'q' import commands print commands.getoutput('ls /cygdrive/q') Run it as - python fileList.py Here is the output: DataTables Functions Object_Repositories Recovery_Scenarios Scripts -- http://mail.python.org/mailman/listinfo/pyth

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Tim Roberts
Mel wrote: > >It certainly can be done faster. I ran it against the factor finder that I >wrote, and it popped up the answer > >mwilson@tecumseth:~$ bin/factors.py 600851475143 >71 839 1471 ... > >before I could glance at my watch. factors.py works, as does yours, by >testing for small factors

Python 2.7 and cmd on Windows 7 64 (files lost)

2011-06-22 Thread Michel Claveau - MVP
Hi! (sorry for my bad english...) On Win 7 64 bits: Command-Line CD \Python27 dir C:\Windows\System32\SoundRecorder.exe:==> OK Python.exe >>> import os >>> os.system("dir C:\\Windows\\System32\\SoundRecorder.exe") ==> Do not found the file !!! and os.system("cmd /k") then "dir

Re: python 3 constant

2011-06-22 Thread Waldek M.
Dnia Wed, 22 Jun 2011 22:17:49 +0100, Noah Hall napisał(a): > On Wed, Jun 22, 2011 at 7:54 PM, sidRo wrote: >> How to declare a constant in python 3? > > There aren't true constants in Python, but instead we use a standard > defined by PEP 8, which states constants are in all caps, for example,

Need help about for loop in python 3.2

2011-06-22 Thread kkiranmca
Hi i am new for this version and could please help me . -- http://mail.python.org/mailman/listinfo/python-list