Fwd: Re: [Tutor] Number Coercion: I swear, I never laid a hand on it!
kromag@nsacom.net
kromag@nsacom.net
Wed, 24 Oct 2001 13:13:46 -0700 (PDT)
Forwarded From: kromag@nsacom.net
> Remco Gerlich <scarblac@pino.selwerd.nl> said:
>
> > >
> > > menu_items={'edit': 'windowscommandedit.com',
> > > 'vim': 'vimvim57gvim.exe'}
> ^ ^ ^
> It's TWIG! I swear! :-)
>
> >
> > Note that this won't work; backslashes have a special meaning, they're
used
> > to escape things so you can put special characters in a string (like n
> > means newline).
>
> I actually put double backslashes in the script: my webmail program (twig)
> removes them for some reason. Sorry for the confusion!
>
> >
> > I don't know if this is a typo or what, but the way it is written, it runs
> > os.system('s%') first. 's%' is a command that probably doesn't exist, and
> > os.system will return some number.
>
> Simple ascii cannot express the depths of my self-loathing at this point.
> Yes, it was a typo.
>
> >
> > os.system('%s' % menu_items[choice])
> >
> > which happens to be exactly the same thing as
> >
> > os.system(menu_items[choice])
> >
> >
> > I think this reply is a bit obfuscated but I have to go, cooking :)
>
> Your reply is crystal. I don't know why I persist in placing my
substitutions
> outside of the parentheses. Sorry for all the trouble folks.
>
> d
>
> >
> > --
> > Remco Gerlich
> >
> > _______________________________________________
> > Tutor maillist - Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
>