<?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: Python Script reading another file in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Python-Script-reading-another-file/m-p/487020#M8701</link>
    <description>&lt;P&gt;Issue has been fixed, the scripts required the absolute file path since the python file is not running from the context of the folder it is stored in.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2020 17:05:32 GMT</pubDate>
    <dc:creator>mrlandis3</dc:creator>
    <dc:date>2020-04-28T17:05:32Z</dc:date>
    <item>
      <title>Python Script reading another file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-Script-reading-another-file/m-p/487019#M8700</link>
      <description>&lt;P&gt;I am using a Python scripted input that needs to read from a text file an encoded username and password. The script then writes the results from an API call to a JSON file. So the pseudocode looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;with open('key.txt', 'r') as file:
    set username and password

data = API call

with open('json', 'w') as file2:
    write data
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My script is throwing an error saying that the key.txt file does not exist when it is definitely in the same directory. Are there any permission issues that could be causing this?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-Script-reading-another-file/m-p/487019#M8700</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-06-07T18:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script reading another file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-Script-reading-another-file/m-p/487020#M8701</link>
      <description>&lt;P&gt;Issue has been fixed, the scripts required the absolute file path since the python file is not running from the context of the folder it is stored in.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 17:05:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-Script-reading-another-file/m-p/487020#M8701</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-04-28T17:05:32Z</dc:date>
    </item>
  </channel>
</rss>

