Hi,
I'm trying to get the following code running. This code is a copy from this link:
CreateSharingDraft—Sharing module | ArcGIS Desktop
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> os
<SPAN class="comment token"># Set output file names </SPAN>
outdir <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Project\Output"</SPAN>
service <SPAN class="operator token">=</SPAN> <SPAN class="string token">"MapServiceDraftExample"</SPAN>
sddraft_filename <SPAN class="operator token">=</SPAN> service <SPAN class="operator token">+</SPAN> <SPAN class="string token">".sddraft"</SPAN>
sddraft_output_filename <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>outdir<SPAN class="punctuation token">,</SPAN> sddraft_filename<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Reference map to publish </SPAN>
aprx <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mp<SPAN class="punctuation token">.</SPAN>ArcGISProject<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\Project\World.aprx"</SPAN><SPAN class="punctuation token">)</SPAN>
m <SPAN class="operator token">=</SPAN> aprx<SPAN class="punctuation token">.</SPAN>listMaps<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"World"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token">#