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.?
#1
I am using Python IDLE 2.7.18.4 on Windows 10. I copied a code from a pdf in my editor and made it as comments. The code look like this in my editor:
[Image: view?usp=sharing]
but when I past the code here (in this forum), I see it correctly as I see some parts of the code are not as comments and thus I got an error:


##import arcpy
##infc = arcpy.GetParameterAsText(0)
##
outfc = arcpy.GetParameterAsText(1)
##
arcpy.Copy_management(infc, outfc)
and I get this 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


I wonder How I can see the code correctly in the Python IDLE editor?
Reply


Messages In This Thread
Why can I not see the code correctly in Python IDLE.? - by Trump - Mar-10-2024, 11:53 PM
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  hi need help to make this code work correctly atulkul1985 5 846 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  Launch Python IDLE Shell from terminal Pavel_47 5 1,309 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Python Idle won't start totalmachine 9 3,618 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,784 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Serializing Python data Correctly (JSON) JgKSuperstar 4 2,206 Nov-04-2021, 07:31 PM
Last Post: JgKSuperstar
  MAC Python IDLE issue shadow12 4 2,612 Oct-29-2021, 12:22 AM
Last Post: shadow12
  Python MYSQL connection does not work after 1h idle zazas321 9 6,993 Oct-07-2021, 12:02 PM
Last Post: ndc85430
  Customize Python Keywords for IDLE alanvers 0 2,027 Apr-03-2021, 10:56 AM
Last Post: alanvers
  Sublime Text + Anaconda not indenting Python code correctly Maxximiliann 0 2,020 Jun-13-2020, 06:09 PM
Last Post: Maxximiliann
  vs code interpreter vs IDLE feature tsmspace 4 4,295 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