Python Forum
Why can I not see the code correctly in Python IDLE.?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why can I not see the code correctly in Python IDLE.?
#9
(Mar-11-2024, 12:21 AM)deanhystad Wrote: # is the start of a line comment in Python. Everything following # in the line is a comment. Don't depend on syntax highlighting.

The error message told you where the error happened.
Error:
Traceback (most recent call last): File "D:/ArcPy_Ex/test.py", line 5, in <module> outfc = arcpy.GetParameterAsText(1) NameError: name 'arcpy' is not defined
Note the lack of a comment character in outfc = arcpy.GetParameterAsText(1)

That right. To resolve this problem and see the code correctly in the Python IDLE editor, you need to ensure that the comments are properly formatted with a single '#' symbol at the beginning of each comment line.
«spam link removed»
Gribouillis write Apr-04-2024, 08:31 AM:
Spam link removed, please read this
Reply


Messages In This Thread
RE: how to fix an error in comments? - by Trump - Mar-11-2024, 12:17 AM
RE: how to fix an error in comments? - by Trump - Mar-11-2024, 12:37 AM
RE: Why can I not see the code correctly in Python IDLE.? - by jonesphedra - Apr-04-2024, 07:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  hi need help to make this code work correctly atulkul1985 5 851 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  Launch Python IDLE Shell from terminal Pavel_47 5 1,315 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Python Idle won't start totalmachine 9 3,623 Oct-16-2022, 05:57 PM
Last Post: totalmachine
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 1,789 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Serializing Python data Correctly (JSON) JgKSuperstar 4 2,211 Nov-04-2021, 07:31 PM
Last Post: JgKSuperstar
  MAC Python IDLE issue shadow12 4 2,613 Oct-29-2021, 12:22 AM
Last Post: shadow12
  Python MYSQL connection does not work after 1h idle zazas321 9 7,002 Oct-07-2021, 12:02 PM
Last Post: ndc85430
  Customize Python Keywords for IDLE alanvers 0 2,031 Apr-03-2021, 10:56 AM
Last Post: alanvers
  Sublime Text + Anaconda not indenting Python code correctly Maxximiliann 0 2,022 Jun-13-2020, 06:09 PM
Last Post: Maxximiliann
  vs code interpreter vs IDLE feature tsmspace 4 4,300 Apr-01-2020, 10:45 PM
Last Post: kiliman13

Forum Jump:

User Panel Messages

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