MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/10ljyxj/ram_usage_100/
r/badcode • u/EPacifist • Jan 26 '23
7 comments sorted by
6
What's the issue here?
8 u/coloredgreyscale Jan 26 '23 Maybe op thinks subprocess.run is blocking?In which case you'd just start a new instance, without killing the old 2 u/dliwespf Jan 26 '23 subprocess.run indeed is blocking.
8
Maybe op thinks subprocess.run is blocking?
In which case you'd just start a new instance, without killing the old
2 u/dliwespf Jan 26 '23 subprocess.run indeed is blocking.
2
subprocess.run indeed is blocking.
5
Image Transcription: Code
def commandInput(*args, **kwargs): opt = input(*args, **kwargs) match opt: case "exit()": quit() case "restart()": subprocess.run(["python3", os.path.basename(__file__)]) quit() return opt
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
I didn't know python had a switch statement.
Neat
7 u/[deleted] Jan 26 '23 Yeah, from 3.10 under the moniker 'structural pattern matching'.Besides some debate around whether match and case are keywords, since you can use both of them as variable and function names, it's all pretty straight forwards.
7
Yeah, from 3.10 under the moniker 'structural pattern matching'.
Besides some debate around whether match and case are keywords, since you can use both of them as variable and function names, it's all pretty straight forwards.
1
Its the longest fork bomb I have seen
6
u/genericindividual69 Jan 26 '23
What's the issue here?
5
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jan 26 '23
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
5
u/LuckedLock Jan 26 '23
I didn't know python had a switch statement.
Neat
1
u/IceQub3 Jan 26 '23
Its the longest fork bomb I have seen