Forums

Problems creating a list

Hi everyone! I'm new here and I'm having some trouble while trying to create a list on the interpreter...

The problem is that when trying to include the square brackets they don't appear on the interpreter, I mean, no matter how many times I tried they've never appeared (and yes, if anyone's thinking of that possibility, I'm pressing the right key).

Something weird related with that also happened to me when trying to use Python IDLE on my mac. When creating lists, just in the moment I pressed the key for the square brackets it suddenly closed and delete all my work... Of course, I cannot work without using lists, so please, could somebody help me? I would appreciate it!!

Does this ever happened to someone else? Or maybe square brackets only hate me?

Thanks!!!

I don't have any trouble using [], but then again I'm not using a mac. Have you considered using the list() command to create your list?

For instance I could create a list with the command:

x = ['a', 'b', 'c']

or the equivalent

x = list()
x.append('a')
x.append('b')
x.append('c')

Not necessarily ideal, but until you figure out your bracket issue it should keep you functioning.

Hi emy,

Which country are you in? I think we had a few problems with specific countries' keyboard layouts a while back.

All the best,

Giles

Thank you so much!

a2j, I'll try the option list( ). I've just seen it in the help( ) options. Hope I'm able to solve the problem, as using the square brackets it's clearer and easier. Anyway, thank you again! :)

I'm using it from Spain, could the problem be related to that?

Yeah, you REALLY need to be able to use square brackets when writing Python. This is actually a problem with Spanish Mac keyboards that other people have reported and it's very confusing. Because that key is supposed to send the correct key codes, and we should Just Work™ when we are sent the right key codes... but it definitely doesn't work. I've tried playing around by emulating a Spanish key layout which works fine. I guess we need buy a Spanish Mac. If anyone has an almost dead one lying around they want to donate... :-)

Hi emy !

I have same problem finding special characters on my mac (no square brackets & no curly braces). I am working with keyboard for Swiss characters (basically German & French combined).

At least the following keys do not work correctly in Finnish Mac:

` - dead key before backspace. Works, but adds two characters. First the accent and next the following key accented. eg. á
´ - same as above
~ - tilde has the same dead key issue, inserts the key and after it the accented char eg. ã
¨ - ditto
^- the same problem
| - entered alt + 7, does not input anything
\ - entered shift + alt + 7 ,does not input anything
[ - entered alt + 8, does not input anything
{ - entered shift + alt + 8, does not input anything
] - alt + 9, nothing
} - shift + alt + 9, nothing

I would also note that paste is difficult and only works from browser menu.

These problems also exist in other consoles, bash etc.

Ctrl+Shift+V works for pasting in Chrome. As does middle click in Linux.

We made a bit of a start on fixing these problems recently. But we really quickly ran into clashes. Which means to fix a QWERTZ layout would meaning making an AZERTY layout worse... stuff like that. The underlying problem is our VT100 emulator. It's not very good. We've decided that instead of adding hack upon hack we would switch to a better one. Current candidate is the hterm that Google has been developing as part of Chromium. So we are aware of the problem. Have decided on a solution. But still have some major technical hurdles to cross.

I just had a play around with the Chromium SSH (which uses hterm) and I was very impressed - it's really slick.

It just has a few problems on non-Chrome browsers -- but given that Chrome is 54% of our traffic right now, then we could roll out a version that works better on Chrome until that's fixed.

Hi, I still have problems with Swiss German Keyboard, High Sierra Mac, and square brackets and curly brackets in the bash console in python3.

Usual keystroke for [ and ] is ALT + 5, ALT + 6, for { } it is ALT 8 and ALT 9

It looks as ALT + numbers on the keyboard do not work in general. Also Backslash \ which is ALT+SHIFT+7 does not work.

Instead of the character, the console says (arg: 5)

Any solution to that?

hi there- would you like us to switch you to our experimental hterm consoles? that might help solve some of these problems.

hi conrad, yes please, if that solves the problem, that would be great.

ok- I've updated you to use hterm. If you refresh your console / start a new console you should get it.

Hi Conrad. Cool. That seems to have fixed it. Great and quick response. Much appreciated!

I got the same issue with HR (Croatian keyboard)...but why can I type it here []?

BTW it worked like 3-4 days ago...so i think it is due to some recent update (if there was any)

No, we have not had any updates in the last few days. If the behaviour has changed it is more likely to be something that changed on your machine.

We have an experimental console type that may work for you. I can switch your account to using it if you'd like to try it.

Dear glenn, please do so. It is really weird to me since it worked few days ago.

Thank you for your time and I hope experimental console will work, cheers!

No problem. I have enabled it for your account. Let us know how it works for you.

To get it for a particular console, you will need to reload the console page.

Hi, I'm sorry to bother but I'm having the same problem (with Portuguese Keyboard, also with High Sierra Mac) , I can't use square brackets or curly brackets in the bash console! Whenever I try to do it it just appears ''Unknown Command''. Could you please help? Thanks

Sure! I've switched you over to the experimental console that should support your keyboard better. If you refresh any pages where you're using consoles, you'll get it.

That fixed it, thank you so much!

That fixed it, thank you so much!

Great!

Hey guys, having the same problem here with Swiss German. Is this fixed yet? If not, can you put me on the experimental console as well? Cheers!

Hey guys, having the same problem here with Swiss German. Is this fixed yet? If not, can you put me on the experimental console as well? Cheers!

And: My post got posted twice, even though I only clicked once ;) You might want to delete one!

No problem. That's done.