Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread has
Paul Berkowitz wrote: >[Excel's scripting interface is] definitely not very "English-like", which >AppleScript is meant to be, The 'English-like' aspect is superficial and somewhat by-the-by; the defining characteristic of the Apple Event Object Model is that it's query-driven. Excel and Word

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Paul Berkowitz
On 11/10/05 12:06 PM, "Kevin Walzer" <[EMAIL PROTECTED]> wrote: > Paul Berkowitz wrote: > >> It mirrors the VBA model, definitely, and its AppleScript syntax is thus a >> little, shall we say "obscure", > > > This is what I referring to. From Matt Neuburg's book, p. 331: > "instead of working o

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Kevin Walzer
Paul Berkowitz wrote: > It mirrors the VBA model, definitely, and its AppleScript syntax is thus a > little, shall we say "obscure", This is what I referring to. From Matt Neuburg's book, p. 331: "instead of working out an AppleScript scriptability implementation from scratch, they've simply t

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Bob Ippolito
On Nov 10, 2005, at 11:29 AM, Dethe Elza wrote: >> Excel on Mac is AppleScriptable through a weird path: Excel exposes >> the VBA object model to AppleScript. So, it's not AppleScriptable >> in the standard sense and I am not sure how you would access it >> from Python. > > Thanks for the info, K

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Paul Berkowitz
On 11/10/05 11:25 AM, "Kevin Walzer" <[EMAIL PROTECTED]> wrote: > Excel on Mac is AppleScriptable through a weird path: Excel exposes the > VBA object model to AppleScript. So, it's not AppleScriptable in the > standard sense and I am not sure how you would access it from Python. > Actually, that

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Dethe Elza
> Excel on Mac is AppleScriptable through a weird path: Excel exposes > the VBA object model to AppleScript. So, it's not AppleScriptable > in the standard sense and I am not sure how you would access it > from Python. Thanks for the info, Kevin. It sounds like downloading OpenOffice and

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Kevin Walzer
Dethe Elza wrote: > On 10-Nov-05, at 10:18 AM, Bob Ippolito wrote: >> I use this to convert excel to xml, and parse that from Python. >> http://www.andykhan.com/jexcelapi/ >> >> -bob > > Oops. Obviously I failed to note which list this question was posed > on, I assumed it was edu-sig for some

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Dethe Elza
On 10-Nov-05, at 10:18 AM, Bob Ippolito wrote: > I use this to convert excel to xml, and parse that from Python. > http://www.andykhan.com/jexcelapi/ > > -bob Oops. Obviously I failed to note which list this question was posed on, I assumed it was edu-sig for some reason. Sorry, didn't mean to

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Bob Ippolito
irk Durston >> Sent: Thursday, November 10, 2005 2:00 AM >> To: pythonmac-sig@python.org >> Subject: [Pythonmac-SIG] inputing multi-digit numbers >> >> I’m having a hard time figuring out how to input a list of numbers, >> each one of which can be 1, 2, or 3 digit

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Dethe Elza
onmac-sig@python.org > Subject: [Pythonmac-SIG] inputing multi-digit numbers > > I’m having a hard time figuring out how to input a list of numbers, > each one of which can be 1, 2, or 3 digits in length. First, I > select a column in an Excel file, and copy and past it into a Word > f

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Dethe Elza
>> Question: how do I get rid of the \n attached to each member in my >> list? > > Choose: > > map(int(map(string.strip, yourlist)) (Python 2.2) > > [ int(x.strip()) for x in yourlist ] (Python 2.3) > > ( int(x.strip()) for x in yourlist ) (Python 2.4) > You don't need strip(), int() ignores whi

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Craig Amundsen
Hi - > > Thank you. That gives me something closer to a list, but the output is now: > > ['939\n', '936\n', '937\n', '885\n', '886\n', '887\n', '171\n', '19\n', ...] You could do: inf = open(fileName) numbers = inf.read().splitlines() splitlines() is smarter than readlines() - Craig _

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Henning.Ramm
> Thank you. That gives me something closer to a list, but the output is now: > ['939\n', '936\n', '937\n', '885\n', '886\n', '887\n', '171\n', '19\n', ...] > Question: how do I get rid of the \n attached to each member in my list? Choose: map(int(map(string.strip, yourlist)) (Python 2.2) [ in

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Kirk Durston
Title: Re: [Pythonmac-SIG] inputing multi-digit numbers On 11/10/05 8:01 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: I’m  having a hard time figuring out how to input a list of numbers, each one of  which can be 1, 2, or 3 digits in length. First, I select a column i

[Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Kirk Durston
Title: inputing multi-digit numbers I’m having a hard time figuring out how to input a list of numbers, each one of which can be 1, 2, or 3 digits in length. First, I select a column in an Excel file, and copy and past it into a Word file. I then save it as a text file. I then open a new window

Re: [Pythonmac-SIG] inputing multi-digit numbers

2005-11-10 Thread Henning.Ramm
Title: Nachricht   -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kirk DurstonSent: Thursday, November 10, 2005 2:00 AMTo: pythonmac-sig@python.orgSubject: [Pythonmac-SIG] inputing multi-digit numbers I’m having a hard time