<?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 Re: How to get the path of files using python os library in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28507#M20301</link>
    <description>&lt;P&gt;Being a web developer I've used this:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; import os &amp;gt;&amp;gt;&amp;gt; os.path.abspath("C:/example/cwd/mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 10:53:52 GMT</pubDate>
    <dc:creator>Wistech_biz</dc:creator>
    <dc:date>2019-02-06T10:53:52Z</dc:date>
    <item>
      <title>How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28505#M20299</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;unable to find the path to directory with os library&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693f000007OoJdAAK"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2531i9769A657DFD92D0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693f000007OoJdAAK" alt="0693f000007OoJdAAK" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:29:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28505#M20299</guid>
      <dc:creator>sp3234</dc:creator>
      <dc:date>2018-08-31T13:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28506#M20300</link>
      <description>&lt;P&gt;Hi @sp3234​&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using the local file APIs to read and write to dbfs paths, you should reference using "/dbfs/..." rather than "dbfs/..."&lt;/P&gt;&lt;P&gt;Here's an example that compares the result of local file APIs to using the %fs magic keyword in a notebook cell.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="screen-shot-2018-08-31-at-103435-am.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2526i8797A050EB9DA33A/image-size/large?v=v2&amp;amp;px=999" role="button" title="screen-shot-2018-08-31-at-103435-am.png" alt="screen-shot-2018-08-31-at-103435-am.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reference documentation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 17:42:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28506#M20300</guid>
      <dc:creator>User16752239222</dc:creator>
      <dc:date>2018-08-31T17:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28507#M20301</link>
      <description>&lt;P&gt;Being a web developer I've used this:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; import os &amp;gt;&amp;gt;&amp;gt; os.path.abspath("C:/example/cwd/mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 10:53:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28507#M20301</guid>
      <dc:creator>Wistech_biz</dc:creator>
      <dc:date>2019-02-06T10:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28508#M20302</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am working with &lt;A target="_blank" href="https://"&gt;Magento 2 extensions&lt;/A&gt; development company and i am a python developer since 5 years here is my answer.&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt; Python program to explain os.getcwd() method &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;# importing os module &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;import&lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;os &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;# Get the current working &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;# directory (CWD) &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;cwd &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;=&lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;os.getcwd() &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;# Print the current working &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;# directory (CWD) &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;print&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;(&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;"Current working directory:"&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;) &lt;/CODE&gt;&lt;/PRE&gt; &lt;PRE&gt;&lt;CODE&gt;print&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;(cwd) &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 06:58:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28508#M20302</guid>
      <dc:creator>rickwilliam</dc:creator>
      <dc:date>2020-09-06T06:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28509#M20303</link>
      <description>&lt;P&gt;In my opinion, it's hard to get the path of files using python os library. As a programmer who is engaged in software development for small business, I'm interested in the answer too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 07:50:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28509#M20303</guid>
      <dc:creator>tomjenner</dc:creator>
      <dc:date>2020-09-07T07:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28510#M20304</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;os.getcwd() simply prints '/databricks/driver' for me irrespective of the location of the file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I would like to get "&lt;B&gt;/dbfs/FileStore/shared_uploads/krishna@company.com/Project_Folder&lt;/B&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 22:28:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28510#M20304</guid>
      <dc:creator>KrishZ</dc:creator>
      <dc:date>2022-12-15T22:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28511#M20305</link>
      <description>&lt;P&gt;Hi mate, did you get the answer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;os.getcwd() simply prints '/databricks/driver' for me irrespective of the location of the file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I would like to get "&lt;B&gt;/dbfs/FileStore/shared_uploads/krishna@company.com/Project_Folder&lt;/B&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 22:28:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28511#M20305</guid>
      <dc:creator>KrishZ</dc:creator>
      <dc:date>2022-12-15T22:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the path of files using python os library</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28512#M20306</link>
      <description>&lt;P&gt;@sp3234​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use this it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2529i89686AF1A381BC33/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:50:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-path-of-files-using-python-os-library/m-p/28512#M20306</guid>
      <dc:creator>Aviral-Bhardwaj</dc:creator>
      <dc:date>2022-12-16T15:50:26Z</dc:date>
    </item>
  </channel>
</rss>

