On Thursday 23 September 2004 09:06, Jeff Clites wrote:
> > Why? Not to be snarky here, I'm curious.
>
> Just that if I set a global "$foo = 5" in Perl, I'd want to be able to
> change it from Python as, "foo = 5". From Python, I can't set it using
> "$foo = 5", since that isn't syntactically valid in Python, and it's no
> fun at all to have to do something introspective like,
> 'setValueOfGlobal("$foo", 5)'.
The same problem occurs if one wants to access a Python variable in Perl.
I don't know if the syntax is correct, but it should work somehow along the 
lines:

my $foo = fetchGlobal( "foo" ) # fetch Python var

...

$foo = 123 # assign another value

Is there an equivalent way to do this in Python/Ruby?

jens

Reply via email to