Doublechecking, can a variable be used?

I recall being told that the answer is No, but just in case...
Is using a variable like the following possible?

"press number [<n>]":
Key("<n>"),

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Are you trying to do

Are you trying to do this:

"press number [<n>]": Key("%(n)d"),

reckoner wrote: Are you

reckoner wrote:

Are you trying to do this:

"press number [<n>]": Key("%(n)d"),

Yes, but that does not work here on my system.
Does that work for you?

              

                    "test press number [<n>]": Key("%(n)d"),

Works for me. I put the 'test' in there because I already use 'press' for something else.

To be complete:

    extras   = [
                Integer("n", 0, 100),]

That is very useful

Now it works for numbers zero through nine, but it will not print anything higher. I suppose obviously it has something to do with printing more than one digit. But even zero through nine will be very useful.
Thanks.

Try using Text() instead of

Try using Text() instead of Key()

Thanks again.

Thanks again.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content