Re: get each pair from a string.

2012-10-22 Thread wxjmfauth
Le mardi 23 octobre 2012 06:59:49 UTC+2, rusi a écrit : > On Oct 22, 9:19 pm, rusi wrote: > > > On 10/21/2012 11:33 AM, Vincent Davis wrote: > > > > > > > I am looking for a good way to get every pair from a string. For example, > > > > input: > > > > x = 'apple' > > > > output > > > > 'ap'

Re: get each pair from a string.

2012-10-22 Thread rusi
On Oct 22, 9:19 pm, rusi wrote: > On 10/21/2012 11:33 AM, Vincent Davis wrote: > > > I am looking for a good way to get every pair from a string. For example, > > input: > > x = 'apple' > > output > > 'ap' > > 'pp' > > 'pl' > > 'le' > > Maybe zip before izip for a noob? > > >>> s="apple" > >>> [a+

Re: Style help for a Smalltalk-hack

2012-10-22 Thread MRAB
On 2012-10-23 01:43, Travis Griggs wrote: I'm writing some code that does a structured read from formatted binary file. The code I came up with looks like: # get the first four bytes, the first gap field chunk = byteStream.read(4) while chunk: # interpret the gap bytes gap, = struct.u

Style help for a Smalltalk-hack

2012-10-22 Thread Travis Griggs
I'm writing some code that does a structured read from formatted binary file. The code I came up with looks like: # get the first four bytes, the first gap field chunk = byteStream.read(4) while chunk: # interpret the gap bytes gap, = struct.unpack('>I', chunk) # suck off the valveCou

Re: Compiler Error for build Python -3.3.0 (Suggestions)

2012-10-22 Thread Christian Heimes
Am 22.10.2012 23:31, schrieb Joe Davis: >The version of Python I have on my old Solaris boxes is old and > isn't supported and dosn't have all the modules that I need.I have > downloaded the new 3.3 version and have been trying to compile it and > have no luck: > > After running the ./conf

Re: Python 3.3 can't sort memoryviews as they're unorderable

2012-10-22 Thread Ian Kelly
On Mon, Oct 22, 2012 at 4:58 PM, Mark Lawrence wrote: >> http://docs.python.org/py3k/library/stdtypes.html#typememoryview only >> gives examples of equality comparisons and there was nothing that I >> could see in PEP3118 to explain the rationale behind the lack of other >> comparisons. What have

Re: Python 3.3 can't sort memoryviews as they're unorderable

2012-10-22 Thread Mark Lawrence
On 21/10/2012 12:24, Mark Lawrence wrote: http://docs.python.org/dev/whatsnew/3.3.html states "memoryview comparisons now use the logical structure of the operands and compare all array elements by value". So I'd have thought that you should be able to compare them and hence sort them, but this

Re: Compiler Error for build Python -3.3.0 (Suggestions)

2012-10-22 Thread MRAB
On 2012-10-22 22:31, Joe Davis wrote: The version of Python I have on my old Solaris boxes is old and isn't supported and dosn't have all the modules that I need.I have downloaded the new 3.3 version and have been trying to compile it and have no luck: After running the ./configure comm

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Ian Kelly
On Mon, Oct 22, 2012 at 1:03 AM, Chris Angelico wrote: > Python's system "just works" most of > the time, but can introduce yet another trap for the unsuspecting > newbie who doesn't understand the difference between rebinding and > mutating; I've not looked into multiple levels of closures but I

Re: Preventing crap email from google?

2012-10-22 Thread Ben Finney
Walter Hurry writes: > On Mon, 22 Oct 2012 13:51:35 +1100, Ben Finney wrote: > > > Walter Hurry writes: > >> It is Google bloody Groups which is the problem. I should have > >> plonked posts from there ages ago, and am about to remedy that > >> omission. > > > > What narrowly-defined, precise f

Re: SQLAlchemy: How to do Table Reflection and MySQL?

2012-10-22 Thread darnold
On Oct 20, 6:24 pm, Nick Sabalausky wrote: > Hi, I'm fairly new to Python, and I'm trying to figure out how to use > SQLAlchemy to connect to a MySQL DB and use table reflection to set up > SQLAlchemy's tables. But the  SQLAlchemy documentation is gigantic and > frankly kinda making my head spin,

Compiler Error for build Python -3.3.0 (Suggestions)

2012-10-22 Thread Joe Davis
The version of Python I have on my old Solaris boxes is old and isn't supported and dosn't have all the modules that I need.I have downloaded the new 3.3 version and have been trying to compile it and have no luck: After running the ./configure command I run "make" and it gives me the foll

RE: A desperate lunge for on-topic-ness

2012-10-22 Thread Prasad, Ramit
Roy Smith wrote: > Pet peeve of the day... > > Why do you have to write: > > global foo > foo = 4 > > when > > global foo = 4 > > would have been so much easier? To make it more annoying for people who use globals, duh. :) Ramit Prasad This email is confidential and subject to important dis

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Kevin Holleran
Tim, I am looking here: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BF9F6FB0-C999-4D19-BED0-144F77E2A9D6} Enumerating the keys for a BusType == 5, then grabbing the values of DriverDesc, DriverDate, & DriverVersion. So I am doing this: try: hKey = _winreg.OpenKey (keyPath

Re: Tkinter Create/Destory Button

2012-10-22 Thread Jason Swails
On Fri, Oct 19, 2012 at 4:11 PM, wrote: > I am trying to create a button in Tkinter and then when it is pressed > delete it/have it disappear. Does anyone know the simplest script to do > that with. Thanks for your help. > Note that there is a _big_ difference between having a button 'disappear'

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Tim Golden
On 22/10/2012 16:38, Kevin Holleran wrote: Thanks, I will look into that. WMI is enabled, but everything WMI query I wrote (& I am NOT a WMI expert or even close) gave me a bunch of NIC info, but not the info I am after in the registry (driver description, driver date, driver version for the

Re: get each pair from a string.

2012-10-22 Thread Daniel Nogues
Hello rusi This is a little bit faster: s = "apple" [s[i:i+2] for i in range(len(s)-1)] >>> timeit("""s = "apple" ... [a+b for a,b in zip(s, s[1:])]""",number=1) 0.061038970947265625 >>> timeit("""s = "apple" ... [s[i:i+2] for i in range(len(s)-1)]""",number=1) 0.0467379093170166 Reg

Re: Compiling extension module (linker error)

2012-10-22 Thread MRAB
On 2012-10-22 11:55, Paul Volkov wrote: I am trying to compile an extension module with C++ Builder 6 for Python 3.3. I converted python33.lib using coff2omf.exe and added this library into my project. I wonder why I get this error message while building: [Linker Error] Unresolved external '_PyM

Re: ANN: Central Python Events Calendar

2012-10-22 Thread Miki Tebeka
> ANNOUNCING > Central Python Events Calendars Thanks, a great idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: some godd python blog?

2012-10-22 Thread Mark Lawrence
On 22/10/2012 17:01, nepaul wrote: Try using a search engine for specific Python issues that you'd like to read up on. If you can't find what you want please ask a specific question, that way you're far more likely to get some answers. -- Cheers. Mark Lawrence. -- http://mail.python.org

Re: get each pair from a string.

2012-10-22 Thread rusi
On 10/21/2012 11:33 AM, Vincent Davis wrote: > I am looking for a good way to get every pair from a string. For example, > input: > x = 'apple' > output > 'ap' > 'pp' > 'pl' > 'le' Maybe zip before izip for a noob? >>> s="apple" >>> [a+b for a,b in zip(s, s[1:])] ['ap', 'pp', 'pl', 'le'] >>> --

ANN: Central Python Events Calendar

2012-10-22 Thread M.-A. Lemburg
[Please help spread the word by forwarding to other relevant mailing lists, user groups, etc. world-wide; thanks] ANNOUNCING Central Python Events Calendars maintained by the Python Softw

some godd python blog?

2012-10-22 Thread nepaul
-- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Kevin Holleran
Thanks, I will look into that. WMI is enabled, but everything WMI query I wrote (& I am NOT a WMI expert or even close) gave me a bunch of NIC info, but not the info I am after in the registry (driver description, driver date, driver version for the NICs). Thanks for your help. Kevin On Mo

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Tim Golden
On 22/10/2012 15:51, Kevin Holleran wrote: > Back at it this morning. The RPC was due to needing to run it under > another account (or so I think now...). However, the RemoteRegistry > service is not just STOPPED but DISABLED. > > I am trying to see if there is a call to actually set the state to

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Kevin Holleran
Back at it this morning. The RPC was due to needing to run it under another account (or so I think now...). However, the RemoteRegistry service is not just STOPPED but DISABLED. I am trying to see if there is a call to actually set the state to MANUAL. Then I can star the registry, grab what I n

Re: Preventing crap email from google?

2012-10-22 Thread D'Arcy J.M. Cain
On Mon, 22 Oct 2012 14:21:36 + (UTC) Grant Edwards wrote: > Same here. Here's the rule I have in slrn's .score file: Here is the procmail one that I use: :0 Hir * ^List-Id:.*python-list.python.org * ^From:.*@gmail.com * ^Newsgroups: /dev/null This still allows people using a gmail account

Re: Preventing crap email from google?

2012-10-22 Thread Walter Hurry
On Mon, 22 Oct 2012 14:35:58 +, HoneyMonster wrote: Sorry about the moniker on the above. I used it by accident - it's one I reserve for junk trapping. -- http://mail.python.org/mailman/listinfo/python-list

Re: Preventing crap email from google?

2012-10-22 Thread D'Arcy J.M. Cain
On Mon, 22 Oct 2012 07:07:20 -0700 (PDT) ru...@yahoo.com wrote: > Re the specific problem mentioned, I just paste the original > message into an emacs window, add the quote marks and paste back > into the GG compose window. If you are on Firefox you should check out the "It's All Text!" plugin. N

Re: Preventing crap email from google?

2012-10-22 Thread HoneyMonster
On Mon, 22 Oct 2012 14:21:36 +, Grant Edwards wrote: > On 2012-10-22, Walter Hurry wrote: >> On Mon, 22 Oct 2012 13:51:35 +1100, Ben Finney wrote: >> >>> Walter Hurry writes: >>> It is Google bloody Groups which is the problem. I should have plonked posts from there ages ago, and

Re: Preventing crap email from google?

2012-10-22 Thread Grant Edwards
On 2012-10-22, Walter Hurry wrote: > On Mon, 22 Oct 2012 13:51:35 +1100, Ben Finney wrote: > >> Walter Hurry writes: >> >>> It is Google bloody Groups which is the problem. I should have plonked >>> posts from there ages ago, and am about to remedy that omission. >> >> What narrowly-defined, pr

Re: program loaded in memory

2012-10-22 Thread Grant Edwards
On 2012-10-22, Steven D'Aprano wrote: > On Mon, 22 Oct 2012 02:02:27 +0200, Anatoli Hristov wrote: > >> Hello, >> >> I need an advice about a small script I run 24/24 7/7. >> >> It's a script converted to EXE using py2exe and this script takes - >> grows 30kb RAM on each loop which means that fo

Re: Preventing crap email from google?

2012-10-22 Thread rurpy
> On Fri, 19 Oct 2012 21:21:11 -0700 (PDT), ru...@yahoo.com declaimed the > following in gmane.comp.python.general: > >> [I posted the following in another thread yesterday...] >> >> When you post from Google Groups you will sometimes >> see a checkbox above the edit window that is a cc to >> the

Re: get each pair from a string.

2012-10-22 Thread Emile van Sebille
On 10/21/2012 9:19 PM, Ian Foote wrote: On 22/10/12 09:03, Emile van Sebille wrote: So, as OP's a self confessed newbie asking about slicing, why provide an example requiring knowledge of tee, enumerate, next and izip? Because not only the newbie will read the thread? I for one was interested

Re: Blue Screen Python

2012-10-22 Thread mikcec82
Il giorno venerdì 21 settembre 2012 16:04:48 UTC+2, mikcec82 ha scritto: > Hallo to all, > > > > I'm using Python 2.7.3 with Windows 7 @ 64 bit > > and an Intel Core i3 -2350M CPU @2.30GHz 2.3GHz. > > > > Sometimes, when I'm programming in Python on my screen compare this blue > screen: >

Re: Preventing crap email from google?

2012-10-22 Thread Walter Hurry
On Mon, 22 Oct 2012 13:51:35 +1100, Ben Finney wrote: > Walter Hurry writes: > >> It is Google bloody Groups which is the problem. I should have plonked >> posts from there ages ago, and am about to remedy that omission. > > What narrowly-defined, precise filter rule should be used for this > p

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Roy Smith
In article <5084e819$0$29897$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Mon, 22 Oct 2012 07:22:18 +1100, Chris Angelico wrote: > > > On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano > > wrote: > > >>> Ahh. I totally didn't see that, I'm way too used to reading past > >>>

Compiling extension module (linker error)

2012-10-22 Thread Paul Volkov
I am trying to compile an extension module with C++ Builder 6 for Python 3.3. I converted python33.lib using coff2omf.exe and added this library into my project. I wonder why I get this error message while building: [Linker Error] Unresolved external '_PyModule_Create2TraceRefs' referenced from 'D

Re: Python does not take up available physical memory

2012-10-22 Thread Barry Scott
On 21 Oct 2012, at 15:14, Pradipto Banerjee wrote: > I tried this on a different PC with 12 GB RAM. As expected, this time, > reading the data was no issue. I noticed that for large files, Python takes > up 2.5x size in memory compared to size on disk, for the case when each line > in the fil

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Chris Angelico
On Mon, Oct 22, 2012 at 5:30 PM, Steven D'Aprano wrote: > For languages without static types, what other reasons for declaring > variables are there? The main one is scope nesting. Compare a few different languages. Python: If you don't declare, it's global if you don't rebind it, but local if y