Uh, by workaround, I mean the one that gets me
KeyValuePair, not the workaround to print
the key and value--one can easily do that with the
properties of DictionaryEntry :)
Thanks,
Ray
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
Hello,
I'm trying to print the contents of a Dictionary. In C# I can do this:
foreach (KeyValuePair pair in myDict)
{
Console.WriteLine(pair.ToString());
}
However, in IP, typing this:
>>> myDict = Dictionary[int, str]()
>>> # ... do stuff here ...
>>> for pair in myDict:
... print str
Hello,
I'm playing around with list in IronPython 0.9.2, when
I found that error messages regarding the (wrong)
number of arguments passed into a function always
tells you that the function takes 0 argument:
>>> horsemen = ["Pestilence", "War", "Famine",
"WebSphere"]
>>> horsemen.count()
Traceba
Please ignore my earlier post about this, I kinda know
what caused the problem now. It seems that when I say
this:
doc = ieApp.Document
IP goes and searches for the type of this thing in the
type library--so it didn't really hang, it just took a
long time for it to find it and return, seemingly.
Hello,
I need to automate IE, but I'm not very familiar with
the object model yet, so I want to try out things
interactively--hence Python. I can do this using win32
extension for CPython, but there's no auto completion,
everything is just a ">".
So I thought, hey, IP has auto completion, and I
Thanks for the clarification, Fredrik!
Cheers,
Ray
"generators" != "generator expressions"
the former is an execution mechanism which lets a
function or method incrementally "yield" a sequence of
values, instead of returning a single value
(introduced in Python 2.2); the latter is syntactic
suga
Hi Martin,
Thanks, you spotted the source of the problem. When I
removed GetType() from around Int32, my solution
works:
from System import Array, Convert, Int32
pyList = [9, 7, 8, 4, 6, 3, 6, 8, 4, 1]
toBeSorted = Array.CreateInstance(Int32, len(pyList))
for index, item in enumerate(pyList):
Hi Martin!
Thanks! I think last time you mentioned that IP
already had generators--were you referring to 0.9.2 or
some other version in the future?
Also... regarding the Array, is there any workaround?
I tried this:
from System import Array, Convert, Int32
pyList = [9, 7, 8, 4, 6, 3, 6, 8, 4, 1]
Hello,
I'm using Iron Python 0.9.1. I wonder why won't these
run?
fileBeforeSort = file("READ_ME_AND_SORT_ME.txt", "r")
afterSort = sorted(int(line.rstrip('\n')) for line in
fileBeforeSort)
fileBeforeSort.close()
IronPython tripped on the 2nd line, it said:
SyntaxError: unexpected token for a
> We already have generators, but yes. for 1.0 we are
> tragetting 2.4 compatibility (I may even implement
> few of the 2.5 upcoming features such as the new
> 'with' statement).
That is way cool, Martin. Thanks!
Regards,
Ray
>
> Martin
___
Hello,
I wonder, what's the targeted CPython version
compliance when Iron Python is released? Is it 2.4? So
we'll have generators and stuff?
Thanks,
Ray
__
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.
Hi Martin,
Thanks! It's great to hear you're planning to support
both. I'm planning to jot down my experience with Iron
Python and put it up in my site, but to make this more
useful for .NET developers, I want to focus on "you
have a concept. you express it this way in C#. now,
here's how you expr
Hello,
I wanted to say how great it is to hear about Iron
Python because that means I can develop for .NET in my
favourite language, just like I can write Java program
in it as well, but... let me just ask my question :)
I found that in Iron Python 0.9, a lot of modules that
we've come to expect
13 matches
Mail list logo