Fixed some typos and added shellbang
This commit is contained in:
1 parent
c56b98fb7f
commit
8b6a31e963
1 file changed
+4
-2
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
# Currently the only possible value
|
# Currently the only possible value
|
||||||
@@ -52,7 +54,7 @@ def write_file(region_name: str, ip_address: str = "127.0.0.1", file_name: str =
|
|||||||
Example:
|
Example:
|
||||||
```py
|
```py
|
||||||
try:
|
try:
|
||||||
writeFile("Example server", "169.0.0.1", port=12345))
|
write_file("Example server", "127.0.0.1", port=12345))
|
||||||
print("Success!")
|
print("Success!")
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print(error)
|
print(error)
|
||||||
@@ -81,7 +83,7 @@ def content_from_stream(stream: bytearray) -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if (len(argv) < 2):
|
if (len(argv) < 2):
|
||||||
print('Usage: python main.py "Server name" 169.0.0.1')
|
print('Usage: python main.py "Server name" 127.0.0.1')
|
||||||
exit(1)
|
exit(1)
|
||||||
print(f"Creating file using arguments {argv[1:]}")
|
print(f"Creating file using arguments {argv[1:]}")
|
||||||
write_file(*argv[1:], log_bytes=True)
|
write_file(*argv[1:], log_bytes=True)
|
||||||
Reference in new issue
Block a user