Why is print('\a') not working in my python code? - python

I am writing some code in a standard python 3.8 shell and I want to print('\a') which plays a ding sound on your computer. This works in a thonny python shell but will not work in any other python shell. Does anyone know why?

Printing '\a' is not supported by IDLE. (I think that '\r' and '\b' also do not work properly.)

Related

What Is the Use Of ( \r ) carriage return in python program?

I wrote,
print('C:\docs\rohit')
>>> C:\docsohit
You see rohit is my name but in result, I got docssohit
well basically it moves a sentence toward left but in my case specifically in IDLE it is
giving something else.
IDLE 3.8.0
Python IDLE does not properly handle control charcaters like \r,b etc.. Use Python console interpreter (python.exe,python3.exe) instead.
Use Visual Studio and install the python addons instead.

Pycharm errors that are not python errors

I just installed pyCharm(2016.2) community onto my macBook Pro running El Capitan. I have been using the same version of pyCharm on windows. I copied a simple program to the mac that runs successfully on windows. My mac is catching the following as an error. The error is:
')' expected
Statement expected, found Py:EQ)
The code:
print('See no new', end='')
similarly with
print('See','The','Separator', sep='\t') on the last parameter
where is does not like the end='' part. It wants a closing parenthesis. Windows does not capture this error, and it runs fine in Python 3.5. (My interpreter is set to Python 3.5). It also runs great on Wing IDE and Geany.
I don't understand the differences as I never made changes to Inspections on either machine. And, this is not a python error. I'm ready to immediately abandon PyCharm for another IDE. But I was really happy with it on Windows.
Thanks to anyone answering this question.
Al

Python console "EOF when reading a line" error using raw_input

Using Pyhton 2.7 and Ubuntu 15.10
I faced an annoying issue when using raw_input in a python console of some IDES like ninja-ide or genay (console plugin). They cast a "EOFError: EOF when reading a line" and don't allow to write.
Meanwhile developing a *.py file, the execution is correct and don't fail. Python, as executing from terminal, doesn't fail as well as console using IDLE.
Any solution? Thanks. I couldn't find exactly this issue neither in StackOverflow nor Internet.

Simple usage of pyDes in IDLE

I wrote the code mentioned in the example section of this page in the shell of IDLE, and it didn't execute and returned "SyntaxError: multiple statements found while compiling a single statement". What is wrong with it?
I have used pyDes some time ago (Python 2.7, Windows XP) and this worked fine for me.
Which Python are you using, and which is your OS?
IMHO, your syntax error is about a few indentation problems == missed tabs\spaces.
Check spaces and tabs in your code, rewrite code manually
I used IDLE 2.7.5+ and the code produced encrypted text and ran just fine. IDLE 3.3.2+ does not work with pyDes for some reason, at least on my OS: Ubuntu Linux.

How do I make backslash (\) work in IDLE?

I use a Mac and I use Shift + Alt + / when I want to type a \. I'm trying to learn Python and as you can see \ works fine, but not in IDLE.
How do I make backslash (\) work in IDLE?
Since this problem still persists on OSX 10.8 with python 2.7.5 and 3.3.2 and since this is the first google hit when searching for backslash idle here is a more practical solution instead of copy and pasting:
Go to:
idle->preferences->keys
Under Action-Keys replace:
expand-word <Option-Key-Slash>
with something you like for instance:
expand-word <Control-Option-Key-Slash>
This should fix it.
go to
idle -> preferences -> General -> default source encoding -> Locale-defined
Copy-Paste it from notepad.
or
Use command line python shell.
In IDLE, it worked with alt (option) + i.
Everyone i have an excellent solution to this problem.
Go to "Terminal":
Write
Python
Now it works because it's like using IDLE just in terminal and in terminal the backslash will work perfectly fine.

Categories