generated from pypa/sampleproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
devram2000
committed
May 5, 2023
1 parent
6ada5da
commit 0f8f975
Showing
8 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -203,4 +203,4 @@ def main() -> None: | |
print("\n") | ||
|
||
|
||
main() | ||
# main() |
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 |
---|---|---|
|
@@ -217,4 +217,4 @@ def main() -> None: | |
print("\n") | ||
|
||
|
||
main() | ||
# main() |
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 |
---|---|---|
|
@@ -329,4 +329,4 @@ def main() -> None: | |
print("\n") | ||
|
||
|
||
main() | ||
# main() |
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 |
---|---|---|
|
@@ -374,4 +374,4 @@ def main() -> None: | |
print("\n") | ||
|
||
|
||
main() | ||
# main() |
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
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,12 @@ | ||
print("") | ||
print("Cabinet is locked.") | ||
print("Would you like to change the priorities of actions?") | ||
print("") | ||
print("A - Try Unlocking Cabinet again") | ||
print("B – Wait 10 seconds") | ||
print("C – Call supervisor for remote unlock") | ||
print("") | ||
print("Which action should I take first? (type A, B, or C) _") | ||
print("Which action should I take second? (type A, B, or C) _") | ||
print("") | ||
print("") |
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,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>WebSocket Test</title> | ||
</head> | ||
|
||
<body> | ||
<script> | ||
// Create WebSocket connection. | ||
const socket = new WebSocket("ws://localhost:8765"); | ||
|
||
// Connection opened | ||
socket.addEventListener("open", (event) => { | ||
socket.send("Hello Server!"); | ||
}); | ||
|
||
// Listen for messages | ||
socket.addEventListener("message", (event) => { | ||
console.log("Message from server:", event.data); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
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,15 @@ | ||
#!/usr/bin/env python | ||
|
||
import asyncio | ||
from websockets.server import serve | ||
|
||
async def echo(websocket): | ||
async for message in websocket: | ||
print("Message from client:", message) | ||
await websocket.send("Hello client") | ||
|
||
async def main(): | ||
async with serve(echo, "localhost", 8765): | ||
await asyncio.Future() # run forever | ||
|
||
asyncio.run(main()) |