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.
Related
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.)
I have python 3.5 installed on my Windows 10 system. I am using Rodeo 2.5.2 as the interpreter. I had written a python code >800-900 lines on the same. When I try to select it all and trigger it, it just says "Unable to Execute" and shows nothing else whereas when I try to select ~100-200 lines and then run it chunk by chunk it works fine. I am not able to understand why this is happening & how to solve this.
Check if you have some functions which are not being used in the main function.
I had a similar issue and it was resolved as soon as I erased all the functions which were useless and didn't appear in my main function
Good Luck
I have a Raspberry Pi and I'm attempting to create a Python script. However the issue is that I'm unable to run the script from the Terminal, it throws syntax errors yet the same code works just fine in the Python 3.5.3 Shell.
I'm trying the simplest thing such as a printand I've tried various ways with the parentheses and quotation marks, yet no luck with executing the script in the terminal.
I'll include a simple Imgur link of a screenshot, showing how the code is successfully executed in the Shell but not in the terminal.
https://imgur.com/a/lLSnq
The code:
print ("test")
Any assistance is greatly appreciated in advance!
The error was that your terminal didn't know that the code you tried to execute was python, therefore it tried to execute it with the bash interpreter.
Adding the correct shebang to specify the use of the python interpreter fixed the problem.
#!/usr/bin/env python
print("test")
you can execute python scripts, i.e. the script boa.py from terminal by python boa.py
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
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.