diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ebcc356 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/python-tutorial.iml b/.idea/python-tutorial.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/python-tutorial.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..a35a6fe --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Test.py b/Test.py new file mode 100644 index 0000000..0afb070 --- /dev/null +++ b/Test.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +## Written by Peshal Oli +import mysql.connector +import json +import os +import subprocess +import requests +import sys +# response = requests.get("http://api.open-notify.org/this-api-doesnt-exist") +# print(response.status_code) +# response = requests.get("http://api.open-notify.org/astros.json") +# print(response.status_code) +# print(response.json()) +# f = os.popen('date') +# now = f.read() +# print ("Today is ", now) +# def jprint(obj): +# # create a formatted string of the Python JSON object +# text = json.dumps(obj, sort_keys=True, indent=4) +# print(text) +# jprint(response.json()) +#subprocess.call(["cat", "/etc/resolv.conf"]) +###MySQL### +# import mysql.connector +# from mysql.connector import errorcode +# try: +# cnx = mysql.connector.connect(user='scott', +# database='employ') +# except mysql.connector.Error as err: +# if err.errno == errorcode.ER_ACCESS_DENIED_ERROR: +# print("Something is wrong with your user name or password") +# elif err.errno == errorcode.ER_BAD_DB_ERROR: +# print("Database does not exist") +# else: +# print(err) +# else: +# cnx.close() + +#Home_Dir = /Users/peshal/Downloads +subprocess.call(["ls", "-l", "/Users/peshal/Downloads/"]) + +##For API +import urllib +import json + + + + +