passing arguments python script
<p>I am trying to know haw can I pass these files as arguments in a py file, and construct dataframe from these files</p>

<pre><code>pd.read_csv('C:/Users/Demonstrator/Downloads/file1.csv',delimiter=';', parse_dates=[0], infer_datetime_format = True)
df_energy2=pd.read_csv('C:/Users/Demonstrator/Downloads/file2.csv', delimiter=';', parse_dates=[0], infer_datetime_format = True)
</code></pre>

<p>Thank you</p>

<p>Passing arguments is simple. You can have a look at <a href="https://docs.python.org/3/library/argparse.html" rel="nofollow">https://docs.python.org/3/library/argparse.html</a></p>

<p>The most easiest way to pass argument to a python script is by adding these line to you python script and modifying them as per need:</p>

<pre><code>if __name__ == '__main__':
    import sys
    if len(sys.argv) != 2 # here I am expecting only one commandline agrument
        print("USAGE: &lt;Scriptname&gt; &lt;commandlineargument&gt;")

        sys.exit(1)
    commandlineValue = sys.argv[1] # sys.argv[0] contains the file name you are running
    # Do what ever you want to do with the commandlineValue, it will just print it
    print ("CommandlineValue Passed is : {}".format(commandlineValue))
</code></pre>

python pandas