Hi~~~
I want the following text using the arcpy.
"OBJECTID", "EPOCH", "Shape_Length", "Shape_Area", "NAME", "PNAME"
thank you~~~
This is the data I've already seen.
The table is being sent to Excel to obtain field name from Excel.
It's not really clear what you want to do? Feature Class to Excel you can use table to excel tool?
The help files have good examples in both arcmap and arcgis pro
ListFields—ArcPy Functions | Documentation
featureclass = r"c:\path\to_your\data\Geology"
field_names = [f.name for f in arcpy.ListFields(featureclass)]
Since reading the StackExchange thread didn't appear to help you understand how ListFields works, I will point out directly that ListFields doesn't return a list of field names, it returns a list of field objects. If you want the names of the fields, you need to add the 2nd line of code in Dan's comment.