<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trouble with 'Python for Everyone' course in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238785#M18577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm doing the 'Python for Everyone' course from ESRI &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://training.esri.com/Courses/PythEveryone10_1/player.cfm" rel="nofollow" target="_blank"&gt;http://training.esri.com/Courses/PythEveryone10_1/player.cfm&lt;/A&gt;&lt;SPAN&gt; and my script isn't working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It says that &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;path = r"C:\Student\PythEveryone10_1\Creating Scripts\BismarckUpd.txt" file = open(path, 'w')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; will create and open a text file, however, when I run the script I get these errors returned:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript&lt;BR /&gt; exec codeObject in __main__.__dict__&lt;BR /&gt; File "C:\Student\PythEveryone10_1\CreatingScripts\BismarckShapefiles.py", line 11, in &amp;lt;module&amp;gt;&lt;BR /&gt; file = open(path, 'w')&lt;BR /&gt;IOError: [Errno 2] No such file or directory: 'C:\\Student\\PythEveryone10_1\\Creating Scripts\\BismarckUpd.txt'&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the whole script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#Assign variables to the shapefiles park = "nd_park520.shp" school = "ND_schools454.shp" sewer = "nd_sew454.shp"&amp;nbsp; #Create a list of shapefile variables shapeList = [park, school, sewer]&amp;nbsp; #Create and open new text file for updated shapefiles path = r"C:\Student\PythEveryone10_1\Creating Scripts\BismarckUpd.txt" file = open(path, 'w')&amp;nbsp; #Update the names of the shapefiles in shapefile list for shp in shapeList: &amp;nbsp;&amp;nbsp;&amp;nbsp; print shp &amp;nbsp;&amp;nbsp;&amp;nbsp; shp = shp.replace("nd", "ND") &amp;nbsp;&amp;nbsp;&amp;nbsp; print shp &amp;nbsp;&amp;nbsp;&amp;nbsp; file.write(shp +"\n")&amp;nbsp; file.close()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you could help me understand what I'm doing wrong or where something went wrong I'd appreciate it, thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Apr 2014 16:51:11 GMT</pubDate>
    <dc:creator>JoshuaHouston</dc:creator>
    <dc:date>2014-04-18T16:51:11Z</dc:date>
    <item>
      <title>Trouble with 'Python for Everyone' course</title>
      <link>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238785#M18577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm doing the 'Python for Everyone' course from ESRI &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://training.esri.com/Courses/PythEveryone10_1/player.cfm" rel="nofollow" target="_blank"&gt;http://training.esri.com/Courses/PythEveryone10_1/player.cfm&lt;/A&gt;&lt;SPAN&gt; and my script isn't working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It says that &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;path = r"C:\Student\PythEveryone10_1\Creating Scripts\BismarckUpd.txt" file = open(path, 'w')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; will create and open a text file, however, when I run the script I get these errors returned:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript&lt;BR /&gt; exec codeObject in __main__.__dict__&lt;BR /&gt; File "C:\Student\PythEveryone10_1\CreatingScripts\BismarckShapefiles.py", line 11, in &amp;lt;module&amp;gt;&lt;BR /&gt; file = open(path, 'w')&lt;BR /&gt;IOError: [Errno 2] No such file or directory: 'C:\\Student\\PythEveryone10_1\\Creating Scripts\\BismarckUpd.txt'&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the whole script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#Assign variables to the shapefiles park = "nd_park520.shp" school = "ND_schools454.shp" sewer = "nd_sew454.shp"&amp;nbsp; #Create a list of shapefile variables shapeList = [park, school, sewer]&amp;nbsp; #Create and open new text file for updated shapefiles path = r"C:\Student\PythEveryone10_1\Creating Scripts\BismarckUpd.txt" file = open(path, 'w')&amp;nbsp; #Update the names of the shapefiles in shapefile list for shp in shapeList: &amp;nbsp;&amp;nbsp;&amp;nbsp; print shp &amp;nbsp;&amp;nbsp;&amp;nbsp; shp = shp.replace("nd", "ND") &amp;nbsp;&amp;nbsp;&amp;nbsp; print shp &amp;nbsp;&amp;nbsp;&amp;nbsp; file.write(shp +"\n")&amp;nbsp; file.close()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you could help me understand what I'm doing wrong or where something went wrong I'd appreciate it, thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 16:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238785#M18577</guid>
      <dc:creator>JoshuaHouston</dc:creator>
      <dc:date>2014-04-18T16:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with 'Python for Everyone' course</title>
      <link>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238786#M18578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;IOError: [Errno 2] No such file or directory: 'C:\\Student\\PythEveryone10_1\\Creating Scripts\\BismarckUpd.txt'&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the key here. The file doesn't exist in that location. Try browsing to that file location and look for the file called BismarckUpd.txt. If it isn't there, then there is no way for python to open it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you are opening it in 'w' (write) mode, then I'd assume that the file path is the part that is incorrect. If the folders all existed, then python would have created an empty .txt file with the name BismarkUpd.txt in that folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 17:05:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238786#M18578</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2014-04-18T17:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with 'Python for Everyone' course</title>
      <link>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238787#M18579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This is the key here. The file doesn't exist in that location. Try browsing to that file location and look for the file called BismarckUpd.txt. If it isn't there, then there is no way for python to open it.&lt;BR /&gt;&lt;BR /&gt;Since you are opening it in 'w' (write) mode, then I'd assume that the file path is the part that is incorrect. If the folders all existed, then python would have created an empty .txt file with the name BismarkUpd.txt in that folder.&lt;BR /&gt;&lt;BR /&gt;- Doug&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Doug!&amp;nbsp; You were correct about my path! I had a typo. &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 17:45:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/238787#M18579</guid>
      <dc:creator>JoshuaHouston</dc:creator>
      <dc:date>2014-04-18T17:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with 'Python for Everyone' course</title>
      <link>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/1131494#M63428</link>
      <description>&lt;P&gt;You can try this &lt;A href="https://www.edureka.co/python-programming-certification-training" target="_self"&gt;Python course&lt;/A&gt; and it will definitely help you.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 05:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-with-python-for-everyone-course/m-p/1131494#M63428</guid>
      <dc:creator>SarfarazKhan</dc:creator>
      <dc:date>2022-01-07T05:41:52Z</dc:date>
    </item>
  </channel>
</rss>

