Hi gang,I wanted to play around with NSXMLDocument a bit, and figured PyObjC would be a good way to do it. Unfortunately, I get strange errors.>>> doc, error = Foundation.NSXMLDocument.alloc
().initWithContentsOfURL_options_error_(u"asdfkjsda.svg", 0)2005-11-10 11:03:20.618 python[1018] *** -[OC_P
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
Im
having a hard time figurin
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
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 in an Excel file, and
> 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
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
_
On Nov 10, 2005, at 2:15 AM, Jack Nutting wrote:Hi gang,I wanted to play around with NSXMLDocument a bit, and figured PyObjC would be a good way to do it. Unfortunately, I get strange errors.>>> doc, error = Foundation.NSXMLDocument.alloc ().initWithContentsOfURL_options_error_(u"asdfkjsda.svg", 0
>> 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
On 10-Nov-05, at 5:01 AM, <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]> wrote:
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:pythonmac-sig-
> [EMAIL PROTECTED] On Behalf Of Kirk Durston
> Sent: Thursday, November 10, 2005 2:00 AM
> To: pythonmac-sig@python.org
> Subject: [Pythonma
On Nov 10, 2005, at 10:05 AM, Dethe Elza wrote:
>
> On 10-Nov-05, at 5:01 AM, <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]> wrote:
>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:pythonmac-sig-
>> [EMAIL PROTECTED] On Behalf Of Kirk Durston
>> Sent: Thursday, November 10, 2005 2
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
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
> 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
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
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
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
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
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
18 matches
Mail list logo