-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created api to add result of student by faculty
- Loading branch information
1 parent
1bdd8c2
commit 88955fe
Showing
5 changed files
with
102 additions
and
39 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import requests | ||
import json | ||
|
||
|
||
def result(): | ||
try: | ||
wa = " http:https://127.0.0.1:5000/addresult" | ||
facultyid = int(input("Enter faculty id: ")) | ||
type = input("Enter the type: ") | ||
type = type.lower() | ||
studentid = int(input("Enter student id/ roll no: ")) | ||
physicsmarks = int(input("Enter physics marks: ")) | ||
chemmarks = int(input("Enter chemistry marks: ")) | ||
mathsmarks = int(input("Enter maths marks: ")) | ||
englishmarks = int(input("Enter english marks: ")) | ||
data = { | ||
"facultyid": facultyid, | ||
"type": type, | ||
"studentid": studentid, | ||
"physicsmarks": physicsmarks, | ||
"chemmarks": chemmarks, | ||
"mathsmarks": mathsmarks, | ||
"englishmarks": englishmarks, | ||
} | ||
res = requests.post(wa, json=json.dumps(data)) | ||
print(res) | ||
data = res.json() | ||
ans = data["msg"] | ||
print(ans) | ||
|
||
except Exception as e: | ||
print(e) | ||
|
||
|
||
result() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import requests | ||
import json | ||
|
||
try: | ||
wa = " http:https://192.168.1.102:5000/check" | ||
id = int(input('Enter roll no: ')) | ||
password = input('Enter password: ') | ||
data = {'id':id, "password":password} | ||
res = requests.post(wa,json=json.dumps(data)) | ||
print(res) | ||
wa = " http:https://127.0.0.1:5000/check" | ||
id = int(input("Enter roll no: ")) | ||
password = input("Enter password: ") | ||
|
||
data = {"id": id, "password": password} | ||
res = requests.post(wa, json=json.dumps(data)) | ||
print(res) | ||
|
||
data = res.json() | ||
ans =data['msg'] | ||
print(ans) | ||
data = res.json() | ||
ans = data["msg"] | ||
print(ans) | ||
|
||
except Exception as e: | ||
print(e) | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.