摘要:
The print function can also be used to write to a file. The output of print, that is by default, sent to the screen can be redirected to an open file.
阅读全文
posted @ 2024-07-30 15:12
ZhangZhihuiAAA
阅读(33)
推荐(0)
摘要:
'r' - read mode(default) 'w' - write mode 'a' - append mode 'x' - exclusive creation We know that the mode 'r' opens an existing file for reading only
阅读全文
posted @ 2024-07-30 14:45
ZhangZhihuiAAA
阅读(54)
推荐(0)
摘要:
Each module is loaded into memory only once during an interpreter session or during a program run, regardless of the number of times it is imported in
阅读全文
posted @ 2024-07-30 11:37
ZhangZhihuiAAA
阅读(40)
推荐(0)
摘要:
def func(s:str, i:int, j:int) -> str: return s[i:j] The parameter s is supposed to be a string, so we place a colon after the parameter name and then
阅读全文
posted @ 2024-07-30 11:17
ZhangZhihuiAAA
阅读(23)
推荐(0)
摘要:
Parameters in Function Definition A. def func(name): Match by position or by name B. def func(name=value): Default argument C. def func(*args): Collec
阅读全文
posted @ 2024-07-30 11:06
ZhangZhihuiAAA
阅读(29)
推荐(0)
摘要:
Unlike some other languages, in Python, the logical operators "and" and "or" do not return Boolean values True or False; they actually return the last
阅读全文
posted @ 2024-07-29 21:06
ZhangZhihuiAAA
阅读(41)
推荐(0)
摘要:
To select a random item from the list or shuffle the list, you can use the choice and shuffle functions from the random module of the standard library
阅读全文
posted @ 2024-07-29 20:05
ZhangZhihuiAAA
阅读(36)
推荐(0)
posted @ 2024-07-02 11:40
ZhangZhihuiAAA
阅读(15)
推荐(0)
摘要:
zzh@ZZHPC:/zdata/Github/mastering-go-expertise/stats_web/server$ go run . Ready to serve at :1234 zzh@ZZHPC:~$ curl localhost:1234/list d6 4 2.325000
阅读全文
posted @ 2024-06-26 17:41
ZhangZhihuiAAA
阅读(210)
推荐(0)
摘要:
services: stats_server: image: stats_server container_name: stats_server restart: always ports: - 1234:1234 networks: - stats networks: stats: driver:
阅读全文
posted @ 2024-06-25 22:24
ZhangZhihuiAAA
阅读(19)
推荐(0)