« first day (3147 days earlier)      last day (1792 days later) » 
00:00 - 14:0014:00 - 00:00

2:00 PM
With just ~2 it's a pretty slow process. For instance, I only barely know what osmosis is.
 
When I talk to my kids, I'm not lecturing on Ito's Lemma, I'm teaching them Newton. My passion will always be in science.
 
@cs95 smiles and waves at camera
 
That's not really the kind of question we answer in here
 
@Kevin as far as I can tell, our only power is being first in line when there is free food
@piRSquared you, sir, are doing it right
 
The best powers are the ones that aren't all that useful
 
@AndrasDeak keep fightin' the good fight.. and have fun (-:
@Kevin Learning via osmosis has always been a pet peeve of mine. Osmosis is a special case of diffusion. Simple diffusion is adequate for describing the humorous learning mechanism. High concentration of knowledge in book flows to low concentration of knowledge in brain. Why did we have to bring osmosis into it. If taken sorta literally, I believe the analogy suggests the brain has to flow out of the ear to consume the book.
 
@noob just to be clear, I kicked you which led to you being banned from the room for a minute, but the reason you've been suspended for 30 minutes is that users across chat have deemed one of your original messages inappropriate, and flagged it. Please drop the topic when you come back, we're not going to debate this.
 
I think the first time I heard the phrase "learning by osmosis", it was in a story where a character studied by sleeping with a physics textbook under his pillow. Perhaps in this specific context osmosis is appropriate, since pillows are semipermeable.
 
@piRSquared your ears and eyes are a semi-permeable membrane for knowledge
 
2:16 PM
Textbook covers too, to an extent.
 
It just requires transfer across a semi-permiable membrane to equalibriate chemical potential. I guess your eyes might be considered such a membrane but I'm not sure fact have chemical potential
 
sure they do
 
In brain activity?
 
any potential should do, not just a chemical one
 
The solvent crosses the membrane. What is the solvent in this analogy? The brain. Therefore the brain crosses to the membrane to equalize potential.
 
2:18 PM
Chemical potential is more or less the energy required to add or remove a single unit of the material. I can certainly verify that adding new knowledge can take a lot of energy :P
 
People often tell me how they feel potential chemistry when they look into my eyes B-)
 
Emphasis on "potential"
 
Hmmm. Osmosis is actually defined as the acquisition of knowledge. The phrase has always irked me too, but maybe they're to be considered distinct and learning by osmosis is not a metaphor
 
I'm pretty sure it's just a joke
it might accidentally be valid in some sense, but surely not on purpose
 
2:22 PM
@roganjosh Bologna! that is only there because of the ongoing use of the metaphor.
 
I might actually have been able to make peace with my mind, then, Andras :/
 
Maybe it has that definition by the same process that "literally" and "begging the question" are drifting away from their literal meanings
 
/sigh and get off my lawn
 
Ew, language
 
The original sense of "begging the question" hasn't got all that much day-to-day utility so I'm happy to use it in the sense of "causing a question to be asked" but "literally" is kind of an important concept so I would at least like a replacement term meaning "actually literally"
"Unironically" is fairly popular among The Youths of Today, I think
 
2:26 PM
@piRSquared I think we're safe etymonline.com/word/osmosis it was stolen from the scientific community
 
Kicking the can down the lane a bit with that, though. If unironically means "actually literally", then we need a word for "actually not ironic"
 
i vote for ununironically.
 
akchually
 
u12y, please
keypresses are not for free
 
Language only changes because those that use it, change it. Let's all hang out at junior high schools and use the word literally the way it was meant to be used. If we persist, we can make a difference.
 
2:30 PM
But the real question is; who bangs on about osmosis in the general public for it to have gained any traction as a general word?
 
or your willpower and resolve might osmosis the heck out of there with some of the new abbreviations folks have been using in high schools.
 
Mitosis is a similar word and could probably be used to describe some unrelated event we experience. Like the annoying friend that comes to the party and then starts inviting more, equally annoying, people. Never took off, though.
 
My five year old flattered me the other day when he told me "You're the best dad, bro."
 
@roganjosh Osmosis Jones etc.
 
"Bro, It was a disaster. Jake literally destroyed the party by mitosis"
 
2:39 PM
Hmm I had high aspirations for this personal project but now that I'm 10% done and have 90% of the features I require, maybe I'll just settle for the sub-par user experience I have now.
 
The pointy one?
 
User count of 1?
 
@AndrasDeak can honestly say I'd never heard of it. Thank you for bringing this transgression to my attention :)
 
I'm the primary user, although other people could theoretically have found it useful. It's a tool for finding an efficient route to collect all the Korok seeds in Breath of The Wild. But maybe "tool" is an overblown term for what I've got now, which is a single very large png of the overworld with dots and lines drawn on it.
I was going to have dragging and panning, and buttons to track progress like "I already got that one, find a different destination" and "I didn't get that one but the puzzle was too hard so let's come back to it later", and a 1:1 accurate reproduction of the map as it appears in the HUD radar in the game, and...
Nah. Don't need any of that. Huge png works.
 
It's simple. Just choose the project in which you maximize your marginal utility. Your 90% remaining effort could be better used elsewhere.
 
2:49 PM
Hey guys; is it (reasonably) safe to assume that any server that has Python 3 will also be able to run Python 2.6?
...
(kindda noob at Python here and I've developed some scripts to automate some stuff and the server that currently runs this has python 2.6 so I've targeted all my syntax and stuff to it... I'm just wondering how likely it would be for me to have rework when the server's upgraded (which it will soon))
 
are you fine with python 2.7 as well?
 
I'm going to put that 90% effort into playing the game most likely
 
python2.6 is really old
 
Mm...
dunno, you tell me :D
I only remember a single time that I had to "back" a command on the difference between 2.6 and 2.7
 
if are unsure about compatibility, jump the Python 3 train now
 
2:52 PM
I'm fairly confident that the majority of environments that can run Python 3 can also run Python 2.6.
 
(for a while that I was doing this I was targeting python 2.7 because that's what I assumed was in the server, only to find our later that it was 2.6 with some error)
 
AFAIK threading and multiprocessing have some subtle differences between 2.6 and 2.7
 
I wish I could jump to 3 now... my dev environment runs 3; but the server that needs to run this stuff has 2.6 and there's no way to change this
 
our RHEL7 servers all ship with Py3.4 and Py2.7
our RHEL6 servers still have Py2.6 by default
our RHEL5 servers just suck...
 
I have no need for threading or any sort of multiprocessing at the moment; this is really quite simple stuff, like file manipulation; SSH password stuff
 
2:53 PM
you may want to grab a pypy3 binary :D
 
I think our next gen servers will be SLES 12.... they were thinking of going for RedHat but there was some issue with the main tool version and Oracle 12c and some crappy old system that also needs to run on the same DB but is limited to Oracle 11... awful restrictions
 
if you are unsure about versions, I recommend using an IDE with compatibility inspections for multiple python versions
PyCharm allows checking compatibility from 2.6 up to 3.7 at the same time
 
ah, cool; will look into that; thanks a lot @MisterMiyagi , @Kevin
 
you may want to have a look at the future library as well
 
can't... I can't pip anything... built-in stuff only
 
2:57 PM
ouch :/
 
I'm already "pushing it" by using Python... hehehehe
corporations man...
funky rules made up by lawyers
 
I know that feeling. I had to write a powershell script the other day. It was horrible.
 
if I wanna use a library, I'd have to get a high-level manager to sponsor the request and go through all the corporate stuff, security "expert" reviews and things...
 
does anyone knows what "{{super()}}" does ?
is it a code in flask-bootstrap ?
 
f'{{super()}}'? Or something else?
 
3:01 PM
It's jinja2
 
i found it in an login example , yes its in the front end
 
I've found nothing on corporate policies that allow me even to run python; BUT it comes on the server and shell scripts are also not listed but are allowed so I've manged to push python with that logic :-D
fun-fact: I'm actually converting what used to be a powershell script to python so that it will run in our servers instead of our desktops...
 
super() in Javascript calls the parents constructor
if that's what you're wondering
 
That said, no, I haven't spent any time reading about it but it should be easy enough to search. I've come across it without looking for it
 
3:03 PM
It's not JS though, it's the templating language used in Flask
 
@rlemon thank you but that is actully called from Jinja's flask
that is why iam confused
 
But did you research it?
 
I saw client, template, and super() - assumed it was outputting to JS
my bad
 
quora.com/What-is-super-in-Flask <-- see Floyd Hightower's answer
 
i have suspicion that flask-bootstrap has something to do with it
{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{url_for('.static', filename='signin.css')}}">
{% endblock %}
 
3:05 PM
it's template inheritance; read the quora thinggy
 
Rather than suspicion, I asked whether you researched it?
 
@roganjosh i did , i found multiple answers in javascript and in pure python
i think i found it in jinja
Super Blocks
It’s possible to render the contents of the parent block by calling super. This gives back the results of the parent block:
{% block sidebar %}
    <h3>Table Of Contents</h3>
    ...
    {{ super() }}
{% endblock %}
 
Not answers, documentation. "Flask jinja super" gives several results, it's part of the template inheritance but one that I haven't used myself
 
that is the source.
i haven't used it either , i've just found it online and i have no idea how important is it.
idk , i think it's not that important , i excluded from the code and see what happends
 
The fact that I've never had to use it should be taken with a pinch of salt. I'm not sure exactly what situation would require it
 
3:14 PM
me neither
 
But it does look related to flask-bootstrap more than anything, which I don't use, so I guess that's why I don't have to worry about it
 
@roganjosh yea i've the same thought .and yea me nether , i prefer pure bootstrap as well
 
Did you remove it in your example? What happened?
 
@roganjosh nothing .. i'm still invistigating ... it could take a while
 
3:23 PM
I was looking at that but it's not overly clear. I think it is because header and footer are also in blocks, so it is for those?
 
anyone know howto activate the logging authlib? it's probably really simple...
 
@JRick Oh, we've been a bit short-sighted here
 
that is the example from a youtuber . i'm trying to implant some of his ideas on my system , that's why i'm not sure how long would it take :/
 
Look at the parent template in flask.pocoo.org/docs/0.12/patterns/templateinheritance. It defines a block named head. So does the child template. super is to change the values in the parent template by what is passed to the child template
It's not to do with flask-bootstrap, it's the fact that the header and footer also require Jinja2. I've just never had my header and footer in Jinja blocks so I've never had to use super()
 
3:31 PM
{% extends "bootstrap/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}
Login
{% endblock %}

{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{url_for('.static', filename='signin.css')}}">
{% endblock %}

{% block content %}
    <div class="container">

      <form class="form-signin" method="POST" action="/login">
        <h2 class="form-signin-heading">Please sign in</h2>
        {{ form.hidden_tag() }}
        {{ wtf.form_field(form.username) }}
        {{ wtf.form_field(form.password) }}
that is the full page example
i used jinja multiple times i never had to use super
 
But look at:
{% block title %}
Login
{% endblock %}
 
yea that is weird.
 
The parent template that you are extending will also have a block called "title" and you're passing the value "Login" in the child template you've just posted. So you want the parent template's "title" block to change too to become "Login"
 
ohh i see
i usually just do something like that
{% extends "layout.html" %}

{% block head %}  {% endblock %}


{% block body %} {% endblock %}
 
Ok, but it depends what blocks are defined in the parent template
 
3:38 PM
which parent template ?
 
layout.html
 
i have the same exact code in every html file i have
<!DOCTYPE html>
	<html>
		<head>

			<meta charset="utf-8">
  			<meta name="viewport" content="width=device-width">
  			<title>welcome bk</title>
  			{% block head %} {% endblock %}

		</head>
		<body>
			{% block body %} {% endblock %}
	        </body>
	</html>
 
So what is the purpose of {% block head %} {% endblock %} being in either template? Neither has any value
 
that is the layout.html
just an example ofc
 
That's not the point. What I'm saying is that you define two blocks with the same name, one in the parent template and one in the child template. Both are empty so you'd never know whether anything changes because neither blocks actually contain anything
In your child template (the one that contains {% extends "layout.html" %}), put {% block head %} TESTING {% endblock %}
Nothing should change, yet
 
3:44 PM
ahh i got it
wow , that was kinda crazy
 
Then do it again with {{ super() }}
So you can see the difference?
 
@roganjosh thanks a lot
yeah i do
 
I really should have known this already tbh so thank you for making me take a second look
 
wim
How can we persuade Ajax1234 to stop posting these kind of garbage one-liners stackoverflow.com/a/56364172/674039
comments don't help, downvoting doesn't help, chat doesn't help ..
 
@roganjosh my pleasure but i'm the one who had the most benefit out of it , so thank you
 
3:52 PM
@wim that's the only three things you can do, I'm afraid
 
wim
Is there any answer ban for regularly downvoted answerers? like there is with question ban?
@Arne not exactly correct, actually Python does have the concept of blocks
 
@wim Ajax has since deleted his answer, but what a train wreck! 7 answers, 6 deleted. :(
But to answer your question, IME Ajax will occasionally self-delete in response to a comment, but I can't remember him ever rewriting an answer to a more readable form, although he will change the code if you point out a corner case where it fails.
@wim I guess Arne meant that in Python a block doesn't create a new scope like it does in C.
 
4:14 PM
@wim yes, but it typically affects low-rep users
people spewing mediocre content never get banned
 
wim
thx PM
the question is not a very good match, but the answer is same.
 
No worries. On Physics.SE a user got a 1 year ban for persistently posting answers promoting his pet crackpot theory & misinterpretations of stuff said by Einstein. But that ban's just ended. :(
@wim Agreed, it's close enough, and should help the OP.
It might be an idea to search for closer matches to edit into the target list.
 
@PM2Ring next time it'll be 10 years
 
@AndrasDeak Indeed. One prominent Physics user has been banned for centuries. I don't know the details, but I gather he got rather nasty & insulting anyone who disagreed with him.
 
nice
 
4:23 PM
He's not a crackpot, although some of his views are on the fringe. Many of his answers are quite good, but I'm not comfortable using them as dupe targets.
 
@wim block meaning a section of code with its own scope?
Oh, pm already addressed it
 
FWIW, it's not easy to close dupes on Physics. Hardly anyone has a dupe hammer, and they don't really do cv-pls requests in the Physics chat.
 
wim
Apr 9 at 13:30, by Kevin
Hmm, moderately annoyed that the second highest answer to the canonical "how come for loops don't get their own scope?" post basically says "because Python doesn't have blocks" when in fact Python does have blocks and they are the fundamental basis of scoping
Apr 9 at 13:31, by Kevin
They're in paragraph 1 sentence 1 of https://docs.python.org/3/reference/executionmodel.html so it's not like the docs are trying to hide their existence
Kevin says paragraph 1 but if you ctrl+f for "block" you will actually see in virtually every paragraph :)
it's strange that the execution model also talks about frames. I would have thought that part would be CPython implementation detail
 
@wim Oh, ok. I was thinking that a block is any block of code with its own indentation level, eg the stuff following a colon.
 
wim
do other implementations have to implement frames?
 
4:34 PM
@wim No idea, but pypy & stackless appear to have frames, but I don't know if they're the same as CPython's.
 
so each block has its own scope right ?
 
jrh
Seems like the hardest part about going between Python, C#, and Javascript is remembering the for each (for x in y, for x of y, for each x in y) syntax and checking array length (count, len, .Length, .length(), size().....). I think I need to print out a cheat sheet or something. I keep wanting to use the wrong one. Funny that every language seemed to do it a slightly different way; interpolated strings too; f'{}', $"{}", `${}`
 
please. all of those languages can compile down to JS. 😉 clearly you have a winner
 
jrh
4:50 PM
those all compile down to assembly, heh
Matlab and Python rule most of the academic / research space
 
@rlemon twice you've gone back to JS. You should be careful here because I'll make a connection with your name the next time I'm floundering around on front-end work wishing the sky would fall :P
 
I mean. I'm a JS dev. so sure
 
he's here on the money of Big JavaScript
 
I only came in here from earlier flags
 
wim
@PM2Ring yeah trainwreck.. I think I downvoted most of them (and got hit with retaliation downvotes right afterward)
 
4:53 PM
never left
 
always right?
 
@AndrasDeak I do enjoy making money in JS. the cheques are wonderful. "pay to the order of rlemon in the sum of $2000.0000000000000000004"
 
wim
it should roomba in 10 days if nobody pity-upvotes the 1 remaining answer
one interesting effect I've noticed with these LQ questions is that those users who can answer them well also usually know better than to post on no-effort gimme teh codez questions in the first place. which means the answers that do arrive are coming from less competent users with often really bad code
 
@wim This is necessarily a consequence of how SO operates. My entire coding journey started on SO and there was some need to gain rep to hope that I might get some credibility if I have questions. If the high-rep people don't take action on such questions (i.e. to close) then newer users aren't muscled out by FGITW
In other words, the experienced users that could answer but abstain, but don't VTC leaves a sweet spot as a kinda proving ground for inexperienced users
 
wim
hmmm, interesting.
 
5:04 PM
What’s a VTC?
 
I know this because I was actively looking for them
Vote To Close
 
wim
I didn't vote-to-close it, FWIW
it's answerable, or dupe-able (couldn't be bothered to find the dupe)
but I will downvote anyone who tries to groupby such problems :)
 
Ohh, I was prone to answering LQ questions when I started but I abstain it from it now a days and either VTC or ask a clarification from the user
 
wim
that's good to hear
 
So a simple double for loop is enough for that question I guess
 
5:06 PM
It's the grey area in between what might be closed and what people think they should answer. You should expect opportunists in this space, and I don't think it's necessarily their fault. It looks like a good target to "have a go"
 
wim
@Antti: No it doesn't. I'm sorry, is this a 5 minute argument or a full half hour? — Martijn Pieters ♦ Sep 18 '14 at 7:30
^ amusing little comment exchange
 
@wim Yep. Which is why I'm sometimes tempted to answer them, just so newbies don't get the impression that the horrible code is good code. I'm not worried so much when the crap answers don't actually produce the desired output. But when people like Ajax post functional unreadable stuff, that concerns me.
 
Even I am conflicted sometimes between providing newbies who have put effort in their code to provide a fix, or give them a better solution but maybe more advanced for them, and I prefer the former most of the times
 
I'm sure that you noticed that they dropped into the room shortly after Wim asked his question about how to engage Ajax
 
I just saw a ref to this intriguing 3D display in a Physics question. digitaltrends.com/mobile/looking-glass-holographic-display It's a bit outside my budget (especially considering I'd need to buy a new computer to drive it), but it does look impressive.
 
5:14 PM
@roganjosh they're often here
 
So I assume that they don't really want to engage with anyone over these answers despite their repeated reprimands
 
I'm a little bit confused

is there is a way to use bootstrap ( not flask_bootstrap ) with WTForms ?
 
8 hours ago, by roganjosh
You can still set the class of form fields to boostrap classes
 
lol i know it didnt work , i have basic output
i think that is related to the fact that jinja renders before the html file ?
 
I don't know what that means
 
5:19 PM
ok nvm let me try another class
 
<div class="col-sm-10">
         {{ new_item_form.item_name(class="form-control") }}
         {% for error in new_item_form.item_name.errors %}
         <span style="color: red;">{{ error }}</span>
         {% endfor %}
      </div>
 
uhhh, anyone else getting a TLS error when trying to load SO?
 
@PM2Ring That is really cool. I wonder what type of content will get created first? Also, a problem or feature of true 3D content is that your viewing position now matters a lot.
 
@Aran-Fey nope
 
In particular, {{ new_item_form.item_name(class="form-control") }}, which then fits the HTML template I'm working with
 
wim
5:21 PM
@AndrasDeak not contributing though just lurking
 
yup
 
@roganjosh yea that worked lol thanks
 
@piRSquared It looks like they're currently targeting game creators. Even if the game itself is played on a 2D display it would be really handy for game devs & artists to be able to view the characters & objects in 3D.
 
5:38 PM
Anyone else getting this?
hmm...seems to be working in Chrome but not Firefox
 
Yes, Aran-Fey just a few messages up
 
I guess the SE devs are changing stuff in response to the recent security breach.
 
OK, now I can repro @Aran-Fey @Code-Apprentice
Even chat fell apart
 
5:58 PM
@AndrasDeak I saw the original tweet about their TLS certificates. Sounds like they resolved the issue for now.
 
6:24 PM
Guess they should've been using Let's Encrypt ;)
 
huh, the python tag apparently has 0 questions for me now.
Gosh, the 1.2 million questions popped up pretty quick. I guess Python has gained a sudden popularity :)
 
user10984358
6:59 PM
how can you click a button which doesn't have an id or class name using selenium??
 
user10984358
driver.find_element_by_xpath("//button[1]").click()

is this a proper way or are there others ??
 
user10984358
I just replace the button index with the button I want to click, it gets the job done but is there a proper way or a much more selenium way for this??
 
user10984358
its not my webpage so I cant change the html
 
user10984358
I was half expecting rogan to barge in and gimme a solution
 
roganjosh is fighting the awfulness of the main feed, and doesn't know Selenium
 
user10984358
7:03 PM
I did see your comment on some python question about permutation in a dict of dict
 
user10984358
awww that sucks, so I will leave it in here so any selenium masterminds can answer that for me
 
The one with the "you can do this" type answer from the user we were talking about earlier? stackoverflow.com/questions/56366661/…
 
user10984358
yeah thats it
 
user10984358
I see you like almost where I come in here, if you dont mind me asking are you a student or ??
 
user10984358
when*
 
7:06 PM
I'm flattered by your expectations, though. I've ended up being a bland breadth-first soup of libraries and technologies. Selenium is yet to be added to the mix. The other guys in here know way more about the technical side of things.
 
user10984358
well I have seen you suggesting devs on here with libraries for their queries so your self described state as bfs aint wrong :)
 
@TheNamesAlc Well, student in the sense that I continue to pick things up all the time. But no, I work in industry and generally have to adapt to a lot of different situations with no support team
 
user10984358
you learn something new everyday, now dont we
 
user10984358
heard of google feud??
 
user10984358
its a google autocomplete game, you have to to guess what google suggests when you type in something, analogous to a family feud question, I am tryna learn selenium so I was thinking of using selenium to actually search google and fill in the text so I can get a high score
 
7:11 PM
Tough challenge against Google's SEO
 
user10984358
so far I have gotten around selecting a category and successfully entering into textboxes, I have to learn how to open another tab so I can read from the actual google suggestions and fill it in there
 
user10984358
what's an SEO, pardon me for askin
 
user10984358
just googled nvm
 
user10984358
also to anyone who reads, this I use safari for running my scripts, and the test window that open when I run the code forces my normal browser size to change as well, its okay when i have to test but it get really annoying for when i have to manually resize after i am done, i know its not realted to pyhton but is there like a setting in which i can change this behavior?? on a macOS if that info is needed.
 
user10984358
also can you '@' me so I get a notification I might not be coming in here for a while and the chat might have rolled on to some other
 
7:29 PM
cbg. has anyone come across this problem before? I have a file called bananas.py and inside of it I am importing from bananas library that I installed with pip. When I debug, Python gets confused and thinks that I am importing from the current file bananas.py. Without renaming my amazing bananas.py, is there a way to force Python to import from the library bananas?
also, I am actually importing a class from bananas called blueberries. So I do not want to import the whole of bananas
 
SEO: Search Engine Optimisation. Making something more searchable using a bunch of useful tricks and hacks
 
What are the benefits of getting around what you recognise as the obvious problem?
 
@isquared-KeepitReal maybe there is a way with importlib or what not. but the far far far less painful solution is always to rename the file
 
While the proper solution would be to rename bananas.py, I'm still going to suggest something that's usually frowned upon: A sys.path hack. Just do sys.path.remove('').
 
why is this a bad solution Aran?
and why does it work? it removes an empty string from sys.path? which is the current loc?
@Arne that is what I did. But then I do not have name consistency with this bananas.py ;(
and I want bananas.py to be bananas.py
organic is the way
 
7:38 PM
Let me clarify: Instead of '' you need to write the location of the script, so something like os.path.dirname(__file__)
 
I will just keep bananas.py renamed for now ;(
 
I don't see why this is an unfortunate conclusion...
 
It's generally a bad thing because most sys.path hacks add something rather than take something away... and those problems have much better solutions
 
@isquared-KeepitReal the one times i hacked sys path it blew up in my face. I wanted my test suite to find the source code, but in the end the built package had path errors that I couldn't find in my tests because .. i had hacked the paths together back then.
since then i just treat sys.path as a thing the interpreter keeps around to know its environment and that I personally shouldn't touch
 
7:48 PM
And now it's time for my 2nd (hopefully) educational coding challenge: The task is to implement a clone of the @classmethod decorator. This one should be easier than the last one!
I'd love to give y'all a hint, but sadly I can't figure out how to do that without pretty much giving away the solution
 
I did not dig in to understand what @classmethod does. What exactly does it do?
 
alright, time to dive into the cozy intestines of python again
 
@isquared-KeepitReal That's exactly the kind of question I was trying to make you think about! :D
Once you're asked to implement something, that's when you realize "huh, I actually have to clue what exactly this thing really does"
 
haha :) ok :) I will have to have a look at some point :) I am occupied with my bananas at the moment ;)
 
wim
7:55 PM
@Aran-Fey bad!
 
Why?
 
wim
because you rely on the OP script as being imported from current working directory
that's not the only way, maybe it is imported because of PYTHONPATH for example
there is just no way around namespace collisions for sys.modules other than renames
@isquared-KeepitReal you can vendor the 3rd-party bananas as vendor/bananas_3rdparty for example
 
Hmm, I thought bananas.py was being executed, not imported?
 
wim
hmm, if bananas.py is just a dumb python script, then you can do the sys.path mutation but you should restore it after import bananas (context manager). it's still ugly.
 
hmm
 
wim
8:02 PM
    from contextlib import contextmanager

    @contextmanager
    def sys_path_prepend(path):
        sys.path.insert(0, path)
        try:
            yield
        finally:
            sys.path.remove(path)
 
sjs
hello, I'm running multiple processes using pool.starmap but the script its running isn't printing out to the console anymore (although I know its working)
 
wim
something like that, and instead of popping off "" it perhaps would be safer to temporarily inject site-packages to the front.
 
sjs
when i did it another way using p = multiprocessing.Process it used to print to the conolse just fine
does anyone know why? and if possible to get pool to behave in similar manner?
...maybe I have to do the flush sys.stdout.flush()
 
@wim reordering might be a good idea, but maybe it's still better to remove the script dir so that it properly throws an ImportError if the bananas module doesn't exist (instead of silently importing itself and then throwing a cryptic error)
 
@isquared-KeepitReal You should have a look at stackoverflow.com/questions/36250353/…
@Aran-Fey I think he's trying to do from bananas import blueberries, where bananas is a 3rd party library, in a script named bananas.py
 
sjs
8:13 PM
yay sys.stdout.flush() worked
 
@PM2Ring Yeah, but I wasn't sure if bananas.py itself was being imported or directly executed.
If it's being imported, messing with sys.path definitely isn't advisable
 
wim
you know, I never heard a good rationale for why python prepends the dir of the script when executing a script
this seems to cause nothing but problems - what's the advantage??
 
@sjs Interesting. sys.stdout is normally line-buffered, so you don't need to flush it unless you output stuff without a linefeed. I don't know multiprocessing, but I guess that it's possible that the output buffering could get complicated by having multiple processes sharing the same underlying stdout stream.
@wim If you have a simple setup with all your python scripts in one big directory, then any script can import any other.
 
wim
@PM2Ring that's a crap setup though
 
:whistles innocently:
 
wim
8:22 PM
people doing that should opt-in to the namespace muddle rather than it being on by default
 
yeah, I think the disadvantages outweigh the advantages there
 
wim
Surely there must be some better reason. If that's the only reason then Python makes me sad.
 
@PM2Ring I'm not bull'ing you. You posted that exactly at the point that the whistle blows right at the start of Paradise City. Spooky.
 
One use I can think of is "locally installing" a module by just dropping it into the same directory. It's a bit like a cheap virtual env.
 
@wim It probably made perfect sense to Guido et al 20 years ago. Long before virtual environments were a thing, and only people working on huge projects bothered with a version control system.
@wim That makes sense. It could be controlled by an env var, independent of PYTHONPATH
Well, sort of independent. ;)
 
wim
8:31 PM
PYTHONPATH should have been deprecated with py 3k
or at very least we should have got PYTHONPATH2 and PYTHONPATH3 instead
having the same var name seen by two backwards-incompat runtimes is asking for trouble
 
Or at least have a PYTHONPATH3 that takes precedence over plain PYTHONPATH
 
8:46 PM
hey , how can i say url_for('/') ?
i've tried url_for( 'index' ) which is the name of the function but it didnt work
 
You've become accustomed to answers immediately, which is possibly my fault. That question doesn't even state that it's Flask
On this one, I think it's best that I leave you to figure it out tbh
 
@roganjosh lol i do my search online a little before i came here
i'm only here whenever i am stuck in something really rare or really dum
iam not here all the time :)
 
The intensity of a search probably diminishes when you feel you can fall back on this room. url_for() is well-documented
 
it's well documented but it's not working with me for some reason
anyway i brb
 
I feel a little nasty but I really think this is one that you would be better figuring out yourself
 
8:51 PM
i'll google some more :)
i got it , i was changing href link of another button , lol
 
Glad you fixed it :)
 
thxx :)
 
 
1 hour later…
10:28 PM
should this question be closed? stackoverflow.com/questions/56362040/…
It can pretty much be answered by posting "yes", and the only reason why OP didn't come to the same conclusion is because they somehow managed to run an inconclusive check.
 
wim
pro-tip: use this as your front page instead of unfiltered!
 
wim
10:41 PM
@Arne No. Answered it to make people aware of some better options here.
 
@wim good, thanks
 
11:15 PM
grrrr
I want to set up a production version of my bot to run permanently but I just realized I don't have py3.6 when I used 15 million f-strings
waiting for python to update...
 
use 3.7 while you're at it
 
00:00 - 14:0014:00 - 00:00

« first day (3147 days earlier)      last day (1792 days later) »