Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Cannot enter hard/ curved brackets in REPL

I use an MacBook Air (M1, 2020) with a German keyboard. When writing code in the teamtreehouse editor I can type [] or {} using the shortcuts on my German keyboard, e.g. "⌥ alt + 5" / "⌥ alt + 6". However, the REPL does not accept the shortcuts. The problem remains even after changing from German to US keyboard in the Mac system settings.

Does anybody know a workaround?

Chris Freeman
Chris Freeman
Treehouse Moderator 68,453 Points

Does your keyboard support alternate shortcuts? for my Linux POP_OS! laptop I can type the Unicode value to get the character.

For example, by typing

  • Ctrl-Shift-u 00bd I get the U+00BD character ½
  • Ctrl-Shift-u 007b I get the U*007B character {
  • Ctrl-Shift-u 007c I get the U*007D character }

Perhaps investigate inserting "Unicode characters" as an alternate shortcut if your OS supports it. Good luck!!

EDIT: as a last resort, I have sometimes have used another window with these characters available, then cut and past the character needed. Very sub-optimal since curly brackets are very common in Python, but sometimes faster than looking up the Unicode value every time.

1 Answer

Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

Hi John Blackburn

Unfortunately, workspaces does not support non-US keyboards. From another thread, it seems like the solution they ended up finding was to switch to a US keyboard in their Mac system and use a US-style physical keyboard.

Alternatively, you could follow along locally using an IDE like Visual Studio Code or Pycharm. Each piece of content has the files available for download under the download tab underneath the videos (like where the teacher's notes are).