I have a Python script that I want to execute as soon as I login into my Mac . I have tried various methods on the internet. But none of them seem to work .
I tried placing the com.username.scriptname.plist file in Library/LaunchAgents.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.username.scriptname</string>
  <key>Program</key>
  <string>/Users/username/scriptlocation/scriptname.py</string>
  <key>RunAtLoad</key>
  <true/>
  <key>StandardErrorPath</key>
  <string>/tmp/com.username.scriptname.err</string>
  <key>StandardOutPath</key>
  <string>/tmp/com.username.scriptname.out</string>
</dict>
</plist>
I placed my script in the location mentioned in the .plist file , and ran the following 
launchctl load /Library/LaunchAgents/com.username.scriptname.plist .
However nothing seems to happen . Am I missing any step  or doing anything wrong ? Do I need to change any setting ?
Error:
->grep com.username.scriptname /var/log/syslog
grep: /var/log/syslog: No such file or directory
->launchctl list com.username.scriptname
{
    "StandardOutPath" = "/tmp/com.username.scriptname.out";
    "LimitLoadToSessionType" = "Aqua";
    "StandardErrorPath" = "/tmp/com.username.scriptname.err";
    "Label" = "com.username.scriptname";
    "TimeOut" = 30;
    "OnDemand" = true;
    "LastExitStatus" = 19968;
    "Program" = "/Users/username/scriptname.sh";
};
Its weird how it shows scriptname.sh when I have a Python file in place !
