I'm struggling to create a python script that will simply turn off all feature classes in the table of contents within my ArcGIS Pro project. I think part of my problem is the syntax change from ArcMap to Pro. I know that ESRI has a web page dedicated to that very issue (http://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm), but the diagram on that page just seems to confuse me more.
Here is my attempt at creating a script to to turn off feature classes in ArcGIS Pro.
import arcpy p = arcpy.mp.ArcGISProject("Current") for lyrx in arcpy.mp.ListLayers(p): print lyrx.name('') lyrx.visible = False
When I run the code above I receive the following message
File "<string>", line 4 print lyrx.name('') ^ SyntaxError: invalid syntax