Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
rui9024215yGuys, spoilers below:
Just scrolling through some reddit stuff and actually a few comments made sense
For those who already watched S4E08, he is having a breakdown, sleep and all happening to him right now I guess, that's why it's all fucked up!
I always try to pay attention to these stuff as it it usually correct and I learn a few things ahah not this time, just get some sleep!! -
VaderNT16185yIt's "movie code". It doesn't make sense.
- line 13(?) uses os.system() to call curl, while line 20 uses subprocess.check_output().
- line 16 is syntactically incorrect, and even the highlighter is confused: The string ends right at "print(", but the rest of the line up to the closing parens is highlighted as one continuous string.
- line 18 opens a text file, stores the handle in variable f... and instead of writing to it, line 19 overwrites sys.stdout so you can call print() to write to the file. wtf.
- Usage of ' and " as string delimiters is inconsistent.
- line 21 vs line 22 are Python 2 vs Python 3 syntax (the former hat 'print' as keyword, whereas in the latter print() is a global function). So this code works in neither.
- the function name "coinsCoins" makes no sense, but all function names (coinsConversion, cleanCoins) are rather un-pythonic anyway. You would, at the very least, write them as coins_conversion, clean_coins etc. -
rui9024215y@NoToJavaScript Saw that already ahah
Mr. Robot is actually pretty incredible, by far my favorite, I was just wondering if it was a thing to learn or just the guy having a mental breakdown, we all have them anyway ahah -
rui9024215y@VaderNT Not sure if you watch this show, but it's actually pretty much 100% accurate, except this episode where he was having trouble coding because of a kind of mental breakdown, the guy was fucking devastated so it makes sense to have all those errors (i explained above in a comment after figuring out)
-
VaderNT16185y@rui902 nope, not watching it. It's nice to hear that IT is portrayed realistically for once. 😉
Related Rants
[No spoilers, Mr. Robot, I hope] I saw this screen, and I'm truly curious about one thing:
What does line 21 and 22 do (double print statement)?
Is it an error or is it actually doing something that I don't understand?
I saw he is redirecting stdout to the file, but why the "print out" and "print(out)", does it make anything different that I'm not aware of??
question
redirection
mr robot
python