1987: "Python Environment"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

Nakis
Posts: 2
Joined: Wed Nov 05, 2014 8:21 am UTC

1987: "Python Environment"

Postby Nakis » Mon Apr 30, 2018 3:45 pm UTC

Image

The Python environmental protection agency wants to seal it in a cement chamber, with pictoral messages to future civilizations warning them about the danger of using sudo to install random Python packages.

Seriously, Randall, virtualenv...

User avatar
pogrmman
Posts: 529
Joined: Wed Jun 29, 2016 10:53 pm UTC
Location: Probably outside

Re: 1987: "Python Environment"

Postby pogrmman » Mon Apr 30, 2018 3:57 pm UTC

If he’s anything like me, he probably only uses virtualenv for personal projects once his python path got so broken that he got weird errors...

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3567
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1987: "Python Environment"

Postby Soupspoon » Mon Apr 30, 2018 4:00 pm UTC

Code: Select all

#!/usr/bin/perl
use strict;
use warnings;
use Inline Python =>…

User avatar
rhhardin
Posts: 65
Joined: Fri Apr 09, 2010 2:11 pm UTC

Re: 1987: "Python Environment"

Postby rhhardin » Mon Apr 30, 2018 4:03 pm UTC

Favorite filenames

harmless.sh
oldtemp.sv

I myself use awk piped into sh for everything.

StCredZero
Posts: 19
Joined: Wed Jun 03, 2009 8:52 pm UTC

Re: 1987: "Python Environment"

Postby StCredZero » Mon Apr 30, 2018 4:06 pm UTC

It's all just a system to keep people "grounded."

https://xkcd.com/353/

StCredZero
Posts: 19
Joined: Wed Jun 03, 2009 8:52 pm UTC

Re: 1987: "Python Environment"

Postby StCredZero » Mon Apr 30, 2018 4:08 pm UTC

rhhardin wrote:Favorite filenames

harmless.sh


What if you have to make a derivative of the code? Would it be "Mostly Harmless?"

Mikeski
Posts: 1034
Joined: Sun Jan 13, 2008 7:24 am UTC
Location: Minnesota, USA

Re: 1987: "Python Environment"

Postby Mikeski » Mon Apr 30, 2018 4:09 pm UTC

StCredZero wrote:
rhhardin wrote:Favorite filenames

harmless.sh


What if you have to make a derivative of the code? Would it be "Mostly Harmless?"


I'm trying to decide if that file is required to have a "goto" in it, or if it's required not to.

Iv
Posts: 1207
Joined: Thu Sep 13, 2007 1:08 pm UTC
Location: Lyon, France

Re: 1987: "Python Environment"

Postby Iv » Mon Apr 30, 2018 4:16 pm UTC

Oh... Someone is getting into deep learning...

User avatar
cellocgw
Posts: 1932
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1987: "Python Environment"

Postby cellocgw » Mon Apr 30, 2018 4:49 pm UTC

Iv wrote:Oh... Someone is getting into deep learning...


s//learning//shit/ FTFY :mrgreen:
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

sparrow
Posts: 2
Joined: Tue May 01, 2018 12:44 am UTC

Re: 1987: "Python Environment"

Postby sparrow » Tue May 01, 2018 12:51 am UTC

Gosh. This is exactly every system I've ever run. Except I fix break it worse with a good smattering of symlinks to poorly named virtual envs themselves scattered across my filesystem.

I'm coming out of ten years of lurking on these boards. I hope it's not too late for me to join in. Hello community!

miket
Posts: 10
Joined: Wed Sep 18, 2013 5:58 am UTC

Postby miket » Tue May 01, 2018 1:19 am UTC

Two solutions:
1. Use your distribution's package manager and avoid the crazy dependency games of PIP/Pear/Packagist/NPM/RubyGems/CPAN or whatever.
2. Stick with Bash and AWK scripts or use a compiled language.

Python: just say no.

dbosst
Posts: 6
Joined: Fri Nov 18, 2011 6:09 pm UTC

Re: 1987: "Python Environment"

Postby dbosst » Tue May 01, 2018 1:44 am UTC

Forgot:

Install a package with the wrong virtual environment or as root, good luck trying to UNINSTALL the same package from a certain virtual environment / path.

User avatar
Rombobjörn
Posts: 145
Joined: Mon Feb 27, 2012 11:56 am UTC
Location: right between the past and the future

Re: 1987: "Python Environment"

Postby Rombobjörn » Tue May 01, 2018 4:49 am UTC

What the ...

/usr/local/opt?!

There is /opt, and there is /usr/local. What kind of confusion would cause someone to create /usr/local/opt?

sparrow
Posts: 2
Joined: Tue May 01, 2018 12:44 am UTC

Re: 1987: "Python Environment"

Postby sparrow » Tue May 01, 2018 4:52 am UTC

What kind of confusion would cause someone to create /usr/local/opt?


It's nice to symlink your entire fs into /usr/local/ for convenience :)

User avatar
orthogon
Posts: 2961
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1987: "Python Environment"

Postby orthogon » Tue May 01, 2018 8:34 am UTC

Rombobjörn wrote:What the ...

/usr/local/opt?!

There is /opt, and there is /usr/local. What kind of confusion would cause someone to create /usr/local/opt?

It's ok, because usr/local is a symlink to /.

I knew I was in trouble when I started wondering if I had the wrong version of Ruby Version Manager, and whether there was a tool for managing different versions of rvm.
xtifr wrote:... and orthogon merely sounds undecided.

Dylan
Posts: 13
Joined: Sat May 05, 2007 6:06 am UTC

Re: 1987: "Python Environment"

Postby Dylan » Tue May 01, 2018 10:41 am UTC

The question I have, of course, is if that's what the core install looks like, what does a diagram of the Virtual environments look like?

User avatar
cellocgw
Posts: 1932
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1987: "Python Environment"

Postby cellocgw » Tue May 01, 2018 11:04 am UTC

orthogon wrote:It's ok, because usr/local is a symlink to /.


Wait... if I cd to /usr/local, I get sent to /. ? :twisted:
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

User avatar
orthogon
Posts: 2961
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1987: "Python Environment"

Postby orthogon » Tue May 01, 2018 11:12 am UTC

cellocgw wrote:
orthogon wrote:It's ok, because usr/local is a symlink to /.


Wait... if I cd to /usr/local, I get sent to /. ? :twisted:

Your distro allows emoji in pathnames?
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3567
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1987: "Python Environment"

Postby Soupspoon » Tue May 01, 2018 11:28 am UTC

You first need to add /usr/local/bin/ :idea: to /etc/shells - then you can sudo chsh it. :mrgreen:

amitarvind
Posts: 1
Joined: Tue May 01, 2018 12:38 pm UTC

Re: 1987: "Python Environment"

Postby amitarvind » Tue May 01, 2018 12:39 pm UTC

Honestly, Randall, I'm feeling so attacked right now.

tgape
Posts: 61
Joined: Wed Oct 10, 2007 5:18 pm UTC

Re: 1987: "Python Environment"

Postby tgape » Tue May 01, 2018 2:32 pm UTC

Mikeski wrote:
StCredZero wrote:
rhhardin wrote:harmless.sh


What if you have to make a derivative of the code? Would it be "Mostly Harmless?"


I'm trying to decide if that file is required to have a "goto" in it, or if it's required not to.


I think the requirement is to use goto, but have rules to make it "safe". Like "every goto needs to be followed by a comment that says if the destination is above or below, and if the goto destination is above, it needs to be in a structure such that it's not actually a looping construct. Also, it's not legal to goto a line containing a goto." Or maybe just, "goto destinations need to be in structures such that they're not actually looping constructs."

Also, when someone points out that you can still make a loop by having a goto later on in that structure, you're required to hold your hands on your ears and sing "La la la" really loudly.

tgape
Posts: 61
Joined: Wed Oct 10, 2007 5:18 pm UTC

Re: 1987: "Python Environment"

Postby tgape » Tue May 01, 2018 2:40 pm UTC

Soupspoon wrote:

Code: Select all

#!/usr/bin/perl
use strict;
use warnings;
use Inline Python =>…


Code: Select all

#!env perl -T

use warnings;
use strict;
use Acme::Python;

ssss Ssss sssss Ssss sssssss Ssss ssss Ssss ssss Ssss ssssss Ssss sssss Ssss ssssss


I apologize for the novice handcoded Python code, I *think* that does what I want it to, but I haven't actually tested it to be certain. I'm pretty sure it does. I'd be really surprised if it didn't, because what I want it to do is generate code that won't actually compile, and that's usually pretty simple. I'm trying to get better at this, but I find Python to be a difficult environment to work with for some reason.

wumpus
Posts: 532
Joined: Thu Feb 21, 2008 12:16 am UTC

Re: 1987: "Python Environment"

Postby wumpus » Tue May 01, 2018 3:25 pm UTC

tgape wrote:
Mikeski wrote:
StCredZero wrote:
rhhardin wrote:harmless.sh


What if you have to make a derivative of the code? Would it be "Mostly Harmless?"


I'm trying to decide if that file is required to have a "goto" in it, or if it's required not to.


I think the requirement is to use goto, but have rules to make it "safe". Like "every goto needs to be followed by a comment that says if the destination is above or below, and if the goto destination is above, it needs to be in a structure such that it's not actually a looping construct. Also, it's not legal to goto a line containing a goto." Or maybe just, "goto destinations need to be in structures such that they're not actually looping constructs."

Also, when someone points out that you can still make a loop by having a goto later on in that structure, you're required to hold your hands on your ears and sing "La la la" really loudly.


Considering the level of spaghetti caused by Object Oriented code (gods help you if someone is using multiple inheritance), I can't imagine anyone really complaining about the "harm" that goto causes. The worst issue is how little you gain from your spaghetti code (compared to well constructed object orientation).

It is astonishing that the next generation coding scheme broke all things that modular coding was trying to repair, and broke them even harder. What is more astonishing was that it appears it is the right thing to do (data structures matter more than algorithms, make sure they are prioritized; avoid having code repetition.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3567
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1987: "Python Environment"

Postby Soupspoon » Tue May 01, 2018 4:35 pm UTC

Something I saw, just now, that I very nearly saved up for a future Fleeting Thought, but realised looks relevant (if fleeting!) to the latest turn.

https://en.wikipedia.org/wiki/Pair_prog ... tisfaction
Satisfaction
In an online survey of pair programmers, 96% of them stated that they enjoyed their work more than when they programmed alone and 95% said that they were more confident in their solutions when they pair programmed.[5]


At least 91% of coders are reckless loners who really would rather just do things their own way!

(No arguments here.)

User avatar
markfiend
Posts: 500
Joined: Fri Jul 06, 2007 9:59 am UTC
Location: UK (Leeds)

Re: 1987: "Python Environment"

Postby markfiend » Wed May 02, 2018 10:20 am UTC

miket wrote:Use your distribution's package manager and avoid the crazy dependency games

This this this!

OTOH I have a similar mess trying to run php5 and php7 on the same box...
advanced, forthright, signifficant
pronouns: he/him

User avatar
alexriehl
Posts: 127
Joined: Wed Sep 22, 2010 1:19 am UTC
Location: Auburn, AL
Contact:

Re: 1987: "Python Environment"

Postby alexriehl » Wed May 02, 2018 1:48 pm UTC

Looks like Randall plays Elite: Dangerous: "Anaconda Python" and "Another pip?" are pretty solid E:D references.
AMA about suitcases
Spoiler:
Image

User avatar
pogrmman
Posts: 529
Joined: Wed Jun 29, 2016 10:53 pm UTC
Location: Probably outside

Re: 1987: "Python Environment"

Postby pogrmman » Wed May 02, 2018 4:51 pm UTC

alexriehl wrote:Looks like Randall plays Elite: Dangerous: "Anaconda Python" and "Another pip?" are pretty solid E:D references.


Idk if Anaconda Python is a reference to the game because I don’t play it, but the obvious interpretation is that he’s referring to the Anaconda Python Distribution.

User avatar
alexriehl
Posts: 127
Joined: Wed Sep 22, 2010 1:19 am UTC
Location: Auburn, AL
Contact:

Re: 1987: "Python Environment"

Postby alexriehl » Thu May 03, 2018 9:01 pm UTC

"Another Pip" is absolutely an E:D reference, as a finite number of pips are used to divert power between ship systems (and there are upgrades that give you "one more" to distribute), and both "Anaconda" and "Python" are ships in the game. It's possible he was referencing both the game and the distribution in a typical bit of Munroe Meta-humor.
AMA about suitcases
Spoiler:
Image

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3567
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1987: "Python Environment"

Postby Soupspoon » Thu May 03, 2018 11:16 pm UTC

Anaconda and Python ships existed right from the ?1984? initial release of the classic Elite, as with several other snake-themed ship names, and kept in FE2, FFE and even Oolite.

It's extremely trivial to come up with the Anaconda name alongside something where Python is a thing. It could easily be all a direct reference to ED (especially if the Another Pip thing is 'a thing' there), but then again it could be something else. If Quentin Tarrantino hadn't themed his characters in the Deadly Viper Squad as he did (envenomating snakes, rather than constricting ones) we could have had copious .py puns arising from Kill Bill lore.

User avatar
Eternal Density
Posts: 5547
Joined: Thu Oct 02, 2008 12:37 am UTC
Contact:

Re: 1987: "Python Environment"

Postby Eternal Density » Wed May 09, 2018 7:36 am UTC

In a timely coincidence, my local Python User Group had a presentation about pipenv only days after this comic went up.
Play the game of Time! castle.chirpingmustard.com Hotdog Vending Supplier But what is this?
In the Marvel vs. DC film-making war, we're all winners.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: No registered users and 20 guests