Python Forum
code works in python shell, but not in a terminal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code works in python shell, but not in a terminal
#3
in the example you show here lines 2-5 are indented 5 spaces, I guess you use 4 spaces by default, like at lines 6-7
also check the line just before the line where the error is shown (75), maybe it's there (e.g. missing bracket)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: code works in python shell, but not in a terminal - by buran - Sep-08-2018, 06:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,166 Nov-15-2023, 06:56 PM
Last Post: jst
  Help creating shell scrip for python file marciokoko 10 1,461 Sep-16-2023, 09:46 PM
Last Post: snippsat
  invoking python in Terminal Euler 2 668 Aug-25-2023, 06:17 AM
Last Post: perfringo
  Code works but doesn't give the right results colin_dent 2 762 Jun-22-2023, 06:04 PM
Last Post: jefsummers
  Launch Python IDLE Shell from terminal Pavel_47 5 1,317 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 1,161 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  Code used to work 100%, now sometimes works! muzicman0 5 1,530 Jan-13-2023, 05:09 PM
Last Post: muzicman0
  Can a program execute code in iPython shell and get result? deanhystad 3 1,797 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  batch file for running python scipt in Windows shell MaartenRo 2 1,957 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Pyspark - my code works but I want to make it better Kevin 1 1,823 Dec-01-2021, 05:04 AM
Last Post: Kevin

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020