12
rui902
19d

[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??

Comments
  • 5
    Also , not to mention the coinsCoins method xD
  • 14
    Mixing python 2 and 3
  • 5
    I'm fond of everything about that first line of coinsCoins

    @highlight
    print("print("stuff")
  • 6
  • 5
    Guys, 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!!
  • 0
  • 0
  • 0
    @groxx nice bot you made / found ahah
  • 1
    @rui902 nah, I'm just a fan of it :) check the bot's profile
  • 1
    @highlight wow that's cool
  • 0
  • 0
    @highlight it's so cool!
  • 1
  • 0
    @rui902 Wow, that really makes sense. But still it's a shitty code.
  • 1
    It'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.
  • 0
    @highlight \,,/d(-.+)b\,,/
  • 0
  • 1
    Well, start watching better tv shows. Mr robot first season was good, after that, it’s not ;p
    Here, from silicon valley
  • 0
    @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
  • 0
    @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)
  • 0
    @rui902 nope, not watching it. It's nice to hear that IT is portrayed realistically for once. 😉
Add Comment