feat: add none_test.py, subprocess_test.py

This commit is contained in:
2025-09-03 22:51:09 +08:00
parent e19df5c46c
commit 3cbd697e60
2 changed files with 23 additions and 0 deletions

10
none_test.py Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python3
if __name__ == "__main__":
b = None
print(b, ',', b is None, ',', b is not None, ',', b or False)
b = True
print(b, ',', b is None, ',', b is not None, ',', b or False)
s: str = None
print(s, ',', s is None, ',', s or "value::test")

13
subprocess_test.py Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import subprocess
if __name__ == "__main__":
result = subprocess.run(
['curl', 'https://hatter.ink/ip.action'],
capture_output=True,
text=True,
# timeout=30,
)
print('return code:', result.returncode)
print(result.stdout)