There is a zip file (“TEST.gbd.zip”) containing a File Geodatabase with both feature classes from FTP County and I need it to download. What is the python script for this case? Please advise. Thank you.
For example, I pulled this part of script like this: but what about zip file?
<SPAN class="comment token"># List of Other files to download</SPAN>
<SPAN class="comment token"># Syntax: County file name with extension separated by colon, then</SPAN>
<SPAN class="comment token"># the FTP Folder name</SPAN>
CountyOtherFiles <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'pa_parceldata.dat'</SPAN><SPAN class="punctuation token">:</SPAN>r<SPAN class="string token">'GISdata/Pa_data/'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'pa_parceldata.txt'</SPAN><SPAN class="punctuation token">:</SPAN>r<SPAN class="string token">'GISdata/Pa_data/'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'pa_legal_ln.dat'</SPAN><SPAN class="punctuation token">:</SPAN>r<SPAN class="string token">'GISdata/Pa_data/'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'pa_legal_ln.txt'</SPAN><SPAN class="punctuation token">:</SPAN>r<SPAN class="string token">'GISdata/Pa_data/'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I am new to python script. I have been researched thru here and having difficult to find a right answer. I have compressed zipfile in FTP WinSCP.
I am trying to extract or unzip in python from FTP Winscp? It has compressed zip file in FTP. I have Winscp connect to FTP. I am not sure what is the right script for this case. I already have script set up that has been created by someone else. Please advise. Thank you.
I tried to use this script but I got an error.
<SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">ZipFile</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">.</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">extractall</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">(</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">path</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">=</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">'GISData/Pubshp'</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> members</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">'PaFiles.gdb.zip'</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">)</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"></SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">NameError</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">:</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> name </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">'ZipFile'</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">is</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;">not</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit; margin: 0px;"> defined</SPAN>
Python Geodatabase