Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Should also put in big bold letters at the top when the OP was last updated and keep it updated. IMO the problem with these huge threads/ops is that I click one one and see it posted in 20xx and think "hmm okay I'm just gonna assume everything is outdated."

Adbot
ADBOT LOVES YOU

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

I've been using Visual Studio Code a bunch for things lately, might be worth putting that in the IDEs section since it's the hotness and people might already be using it? They have a Python page and that Code Runner extension is real nice too

Proteus Jones
Feb 28, 2013



baka kaba posted:

I've been using Visual Studio Code a bunch for things lately, might be worth putting that in the IDEs section since it's the hotness and people might already be using it? They have a Python page and that Code Runner extension is real nice too

It's nice and I use it for quick and dirty edits when I don't want to load PyCharm, or I'm on a computer I don't have access to PyCharm.

I would probably not call it an IDE (especially for macOS). It's really more of a language aware editor.

Dominoes
Sep 20, 2007

VC Code feels like a faster Atom.

Dominoes fucked around with this message at 14:16 on Mar 6, 2017

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Boris Galerkin posted:

Should also put in big bold letters at the top when the OP was last updated and keep it updated. IMO the problem with these huge threads/ops is that I click one one and see it posted in 20xx and think "hmm okay I'm just gonna assume everything is outdated."

Just look at the last edited date?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Thermopyle posted:

Just look at the last edited date?

I know that and you know that, but it doesn't send out the message that the op is keeping the thread up to date (or, if it's a date far in the past, that they aren't doing so). Basically it adds confidence on the part of the reader who might not think to check the last edited date.

Space Kablooey
May 6, 2009


is the new thread going to be backwards compatible with this thread?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Hammerite posted:

I know that and you know that, but it doesn't send out the message that the op is keeping the thread up to date (or, if it's a date far in the past, that they aren't doing so). Basically it adds confidence on the part of the reader who might not think to check the last edited date.

Yes, I was giving the poster advice on how to solve the problem with threads that don't have what he asked for.

Dominoes
Sep 20, 2007

Thread's up.

Still looking for additions and edits.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

flosofl posted:

It's nice and I use it for quick and dirty edits when I don't want to load PyCharm, or I'm on a computer I don't have access to PyCharm.

I would probably not call it an IDE (especially for macOS). It's really more of a language aware editor.

Sure, I meant more as a 'stuff you can develop with' section - it has a decent amount going on though, I think for a lot of people it does what they'd want from PyCharm without being as overwhelming. Just a suggestion anyways!

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Dominoes posted:

Thread's up.

Still looking for additions and edits.

https://pymotw.com/3/

http://ironpython.net/ still technically exists!

VikingofRock
Aug 24, 2008




Dominoes posted:

Thread's up.

Still looking for additions and edits.

Maybe add some stuff about Python 2 vs. Python 3? Someone new to the language is bound to have questions about it, since it comes up fairly often in Python discussions, and there is still a lot of Python 2 code floating around out there (particularly in scientific circles). Even if the section is just "Python 3 is better and you should definitely use it and here is why", it's probably worth having that section IMO.

huhu
Feb 24, 2006
I have some Flask code:
code:
    {% for image in gallery %}
        <img src ="{{ url_for('static', filename = 'img/image') }}">
    {% endfor %}
gallery is a list containing a bunch of filenames (i.e. "a.jpg", "b.jpg") How do I pass image (i.e. "a.jpg") from the for loop into 'img/image' so that it appears as 'img/a.jpg' instead?

Edit - Is this the best way?
code:
    {% for image in gallery %}
        <img src ="{{ url_for('static', filename = 'img/')}}{{ image }}">
    {% endfor %}

huhu fucked around with this message at 03:14 on Mar 7, 2017

Tigren
Oct 3, 2003

huhu posted:

I have some Flask code:
code:
    {% for image in gallery %}
        <img src ="{{ url_for('static', filename = 'img/image') }}">
    {% endfor %}
gallery is a list containing a bunch of filenames (i.e. "a.jpg", "b.jpg") How do I pass image (i.e. "a.jpg") from the for loop into 'img/image' so that it appears as 'img/a.jpg' instead?

Edit - Is this the best way?
code:
    {% for image in gallery %}
        <img src ="{{ url_for('static', filename = 'img/')}}{{ image }}">
    {% endfor %}

I'm pretty sure anything inside {{}} is just Python, so normal string concatenation applies. Use a + for ease.

Dominoes
Sep 20, 2007

VikingofRock posted:

Maybe add some stuff about Python 2 vs. Python 3? Someone new to the language is bound to have questions about it, since it comes up fairly often in Python discussions, and there is still a lot of Python 2 code floating around out there (particularly in scientific circles). Even if the section is just "Python 3 is better and you should definitely use it and here is why", it's probably worth having that section IMO.
I deliberately omitted that; too political.If anything, it would be a note about missing features etc when working with old codebases.

Dominoes fucked around with this message at 10:43 on Mar 7, 2017

vikingstrike
Sep 23, 2007

whats happening, captain
Just use the short blurbs y'all sent me when I asked a couple of weeks ago. Super short, no politics, etc.

Eela6
May 25, 2007
Shredded Hen
I think it's important to mention that Python has a split userbase and, since a lot of codebases remain on python 2, many popular packages are available for 2.7. We can just say "this thread assumes you're talking about python 3 in unless you specify otherwise".

It seems like due diligence, and not overly political.

Dominoes
Sep 20, 2007

OK

VikingofRock
Aug 24, 2008




Dominoes posted:

I deliberately omitted that; too political.If anything, it would be a note about missing features etc when working with old codebases.

Fair enough--I didn't realize this was still a political issue within the python community. I figured most serious python programmers had switched over to 3 at this point unless they were working with a legacy codebase which used python 2. Are there large numbers of people who advocate 2 over 3?

QuarkJets
Sep 8, 2008

For some reason Enthought (their product Canopy is basically like Anaconda) only supports Python2. I've asked their sales people in the past why they haven't moved to Python3 and their answer was basically "we think scientists still prefer and use 2"

I don't think that it's political any longer, now it's just personal preference / legacy vs new code

VikingofRock
Aug 24, 2008




QuarkJets posted:

For some reason Enthought (their product Canopy is basically like Anaconda) only supports Python2. I've asked their sales people in the past why they haven't moved to Python3 and their answer was basically "we think scientists still prefer and use 2"

I don't think that it's political any longer, now it's just personal preference / legacy vs new code

Okay, that's more similar to how I thought it was (I'm also in science academia). Mostly to me it seems like academics use python 2 because that's what's provided by default by Mac OS, CentOS, and Ubuntu, and that's like 99% of what your code is going to be running on.

Dominoes
Sep 20, 2007

QuarkJets posted:

For some reason Enthought (their product Canopy is basically like Anaconda) only supports Python2.

Edited to reflect that!

Tigren
Oct 3, 2003
.

Nippashish
Nov 2, 2005

Let me see you dance!
The internet is very vocal about python 3 but there is a lot of python 2 development still going on. PyPI download statistics from ~1 year ago (apparently you can't get them anymore) puts python 2.7 somewhere in the ballpark of 10x more popular than all versions of python 3 combined. Pycharm's developer survey from last year is a bit better, but still comes out 60/40 in favor of 2.

QuarkJets
Sep 8, 2008

The point about Python2 coming packaged with many linux distros is also a good one. It's a little surprising, but there you have it. Someone starts off learning with their system python and eventually when they start looking at package managers like Anaconda the question of "do I use Python2 or Python3" has already been answered for them

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

VikingofRock posted:

Okay, that's more similar to how I thought it was (I'm also in science academia). Mostly to me it seems like academics use python 2 because that's what's provided by default by Mac OS, CentOS, and Ubuntu, and that's like 99% of what your code is going to be running on.

That's my experience as well in academia. Outside of a very narrow group of people and/or field I honestly don't think that academics even know there's a python 2 and python 3, all they know is there is a "python" with numpy and sympy etc and that's that. At the end of the day there's basically only two things that matter: 1) does my code work, and 2) does it run on my laptop and/or hpc cluster. Most people aren't going to care about writing reusable library code to do the things they need to do. They're perfectly fine with one giant script.py file where they manually go in and comment/uncomment out lines of code to run different scripts and such. Either that or old school style script_do_x.py and script_do_x_with_different_y.py, where they are just copies of each other save for some inputs.

That's non-CS academia for you.

9-Volt Assault
Jan 27, 2007

Beter twee tetten in de hand dan tien op de vlucht.
Love it that we now have 2 python threads. Feels just like real life!

VikingofRock
Aug 24, 2008




9-Volt Assault posted:

Love it that we now have 2 python threads. Feels just like real life!

Don't worry, I'm sure this thread will get end-of-lifed in five ten years.

Adbot
ADBOT LOVES YOU

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

9-Volt Assault posted:

Love it that we now have 2 python threads. Feels just like real life!

There's a joke about the GIL in there somewhere.

  • Locked thread