« first day (4274 days earlier)      last day (657 days later) » 

Avv
12:08 AM
Hello Guys
I have the following code to run 4 servers with 4 different ports on pyzmq using multiprocessing library and then let clients do 5 requests each from each server. However, the code stops after 5 requests:
Any suggestions please?
 
Avv
12:37 AM
No need to answer this question. Thank you.
 
1:01 AM
>99% of the time, all I want is a tool that generates an __init__ method for me

Have you tried `namedtuple`?
I agree that the batteries are leaking, though.
 
stackoverflow.com/q/72794080 recommendation/opinion
 
 
5 hours later…
5:36 AM
There is a command like this - script.py -t "test+cmd=OK"
How split this and pass OK and argument to a desired function, whereas "test+cmd=OK" was stored as a key in dictionary
 
5:52 AM
stackoverflow.com/questions/72280288 any duplicate for this problem (trying to use a function in the global namespace before its def)?
 
@Jordan thats just a string, you should be able to use split or other string operations to manipulate it as you see fit. perhaps .split("=") to start with
 
@KarlKnechtel it's not at all related to that. it is different
@ParitoshSingh u mean to say, i shud assign "script.py -t "test+cmd=OK"" to a seperate variable and split
 
@Jordan Sorry, I don't get the problem. What is the input – is it an argv of ['script.py', '-t', '"test+cmd=OK"'] or a string of 'script.py -t "test+cmd=OK"'? What is the desired result – the string "OK"? Should "and argument" be "as argument"? How does this relate to storing things as a dict key?
 
6:11 AM
@Jordan I know; I wasn't replying to you
 
@MisterMiyagi i have a multiple functions defined and all functions are assigned to a key in dictionary as example: d={'TEST+MKDIR=OK' : mkdir}. Here mkdir function takes one argument. I execute the script as 'script.py -t "TEST+MKDIR=OK"'. Then 'OK' should go as an argument to function
 
@KarlKnechtel There are some highly-voted and good Q&A on forward declarations of functions. Those should cover the same idea, but perhaps not the same approach. E.g. stackoverflow.com/questions/1590608/… stackoverflow.com/questions/3754240/… stackoverflow.com/questions/58306444/…
@Jordan That doesn't really answer my question. At the point where your issue is, are you dealing with d or are you already inside mkdir, or somewhere else?
How does the script relate to the dictionary?
Where does the function come into play here – is it the mkdir?
Basically you have shown three separate things and I don't know which of these you are having problems with.
 
6:27 AM
Hell0
 
@MisterMiyagi mkdir is function
 
if your dictionary is d={'TEST+MKDIR=OK' : mkdir}, dont you already know that if this ever matches, the argument is OK? something isnt adding up.
you could turn it into d={'TEST+MKDIR=OK' : lambda: mkdir('OK')} and just call that , making this whole thing seem kind of pointless. is this what you actually want?
 
7:03 AM
@KarlKnechtel That's absolutely the wrong tool for the job. I don't want my classes to have a __len__, __iter__ or __getitem__ or be tuples
 
While i havent used it myself, i've always heard of attrs for all the things that dataclasses couldnt do. does that have some kind of simple inheritance friendly version of dataclass?
 
I tried it once and it also didn't support inheritance in the way I needed, can't remember the details though. May have been multiple inheritance or may have been inheritance from a non-attrs class
 
7:46 AM
How do you guys interpret this? survey.stackoverflow.co/2022/#section-company-info-company-size This is the first really interesting datapoint for me in the survey. I wonder if some bias is going on or if there is something psychological at work like dunberts number seems to be kinda encoded here, but especially the different bumps weird me out. Is it tax reasons or other reasons? I wonder what are your guys theories for this anomalous looking graph?
 
sorry, i didnt follow, what about it seems weird?
 
That it's not a normal distribution
also the dip at 500-999
 
@Hakaishin people have no clue, for one
And do a chi square test or whatever to see if it's significantly non-normal at that sample size
 
8:06 AM
@Aran-Fey Fittingly enough, I like having these for "dumb" record like types that dataclasses is primarily meant to create. Unpacking and destructuring is one honking great thing.
 
@AndrasDeak--СлаваУкраїні People who answered the survey or people in this chat?
@AndrasDeak--СлаваУкраїні That would mean I would have to have a formal definition of what I expect the thing to look like, but I don't really, just a feeling that I didn't expect it to look like that :D
 
8:39 AM
400 is, in my experience the point at which the company is going to make a break out or fizzle in tech
After that point, the funding rounds get really serious to sustain growth. You still have to be paying these people while the company is making a loss
 
8:58 AM
Hey everyone, can someone tell me what format this is, please. I am trying to access the attribute id, but when I search for the type of object the answer is string.
 
9:09 AM
Looks like JSON.
 
@roganjosh there is some high level pandas action going on here, will try to understand how this works, thanks, btw you mentioned "In between model runs", so I am assuming you are an AI / ML guy?
 
9:39 AM
@AndrasDeak--СлаваУкраїні Missed you reply last night, but thanks for the message and hello again!
 
@JRichardSnape oh right... it's fine to miss my reply but not Andras' hey? /me goes sulk in the corner :p
 
10:01 AM
@Jake Data Scientist but more in operations research
I should really have added code comments to that snippet. I might be able to go back later and add them to help understand how it works
 
@JonClements Sorry @JonClements - how could I miss the small bark of the puppy master? I think the notification system must have assumed I saw it yesterday when I didn't. Thank you too and hello again!
 
I might accept that apology if one is bearing scooby snacks? /me does puppy dog eyes... :p
 
I'm going to be panda(s)-wrangling and finding out how to write a GUI app, but I'm sure I can find some snacks /looks in pocket and finds... cabbage?....
Hmm...
Aha! 🍪🍪🍪
 
JRS is the best - I've always said it :)
 
🦴
:d
:D
Soooo, as I'm going to be here a bit more, how do review queues look these days? slouches off, hands in pockets, whistling
 
10:19 AM
oh... they're gorgeous... whistles...
 
 
1 hour later…
11:21 AM
@roganjosh Probably. I'd have to ask the previous maintainer to know for sure.
 
11:50 AM
The other day a user commented on an answer that I wrote in 2014. I wrote a reply today. I wonder how often that sort of thing happens.
 
I find my skillset to be saturated and more worried about job aspects. Feel like giant hobo who doesnt have any job prospects at all
 
I imagine the commenter as a lonely DenverCoder figure, wandering the ancient* ruins, searching for wisdom. He's developed a habit of talking to the curiosities he finds, as if the creators were still around. How surprised he must be when a pile of rags in the corner replies to him, and sits upright, revealing itself to be the ancient* creator (me).
(*eight years counts as ancient, in Internet time)
 
@Kevin Once every 8 years or less?
 
hello, does anyone here use python in autodesk maya?
 
@Lawrence3DPK hi. I wouldn't bet, but you should ask your question and if anyone can help, they hopefully will.
 
11:57 AM
@and
@AndrasDeak--СлаваУкраїні sure thing, i need to select all the faces on the negative y axis of a model composed of an array of cubes, i remember using some code before that worked in older versions of maya but not in 2022 for some reason, i can share
 
@MisterMiyagi I like the idea that it happens exactly once per eight years. There's a long line of ancients and DenverCoders waiting to write posts and comment on posts, and we can only go one at a time.
 
this is what used to work in older versions, any help would be really appreciated :)
 
@Lawrence3DPK please see our code formatting guide to chat, there's also a sandbox where you can practice
tl;dr you either have to edit and press the "fixed font" button, or ctrl+k usually works too
 
import re
from maya import cmds
from pymel.core.datatypes import Vector, Matrix, Point

obj = 'pCube2363'
# Get the world transformation matrix of the object
obj_matrix = Matrix(cmds.xform(obj, query=True, worldSpace=True, matrix=True))
# Iterate through all faces
for face in cmds.ls(obj + '.f[*]', flatten=True):
    # Get face normal in object space
    face_normals_text = cmds.polyInfo(face, faceNormals=True)[0]
    # Convert to a list of floats
    face_normals = [float(digit) for digit in re.findall(r'-?\d*\.\d*', face_normals_text)]
 
12:05 PM
Are there any warning or error messages when you try to run this in maya 2022? Note that there is a difference between "no messages have been brought to my attention" and "I know where maya tends to emit these kinds of messages, and when I looked there, there weren't any"
 
@Kevin good question, appologies, yes the error is very generic # Error: invalid syntax #
 
I'm distrustful of fancy design environments because Visual Studio likes to bury essential error messages in the "output" panel instead of the "error" panel. If I had a nickel for every time my project failed to compile while it says "zero errors found."...
 
@Lawrence3DPK that's a very odd error. Are you sure it comes from maya/pymel?
Is there any traceback to go with it?
 
# is valid syntax in Python. Perhaps your script is being run by a different language. Now and again, I've seen Bash try and fail to run a .py file as if it were a Bash file.
forums.autodesk.com/t5/maya-shading-lighting-and/… implies that # Error: invalid syntax # is an error generated by maya, and it can happen even if there's no Python involved.
 
i'm trying to run this straight from maya's python console ( has worked in previous versions ) the original source of the code is fom this stack question https://stackoverflow.com/a/48707258/4022834
i don't have enough reputation to comment on the post so came here
@Kevin ahhh good shout, maybe i've forgotten to import pymel in preferences, let me check that quick!
 
12:14 PM
stackoverflow.com/a/39114781/953482 says you can get more information about the error if you toggle certain options under "Maya's Script Editor History menu"
 
@MisterMiyagi I'm on the fence about unpacking, but I certainly don't want it having a length and indexing and being a tuple subclass. That's just too much and too likely to cause weird bugs
 
12:34 PM
@Hakaishin hm, well the bins arent equal sizes right, so that should be the first thing to correct if we want to see whether its normal or not. And secondly, i feel like companies are more likely to stay small, or balloon up, it's rare to find medium size companies that stay that way? (all this is speculation though, just assuming)
my initial impression is i'd expect the distribution to look kind of like how its presented, so this doesnt strike me as particularly odd.
 
@ParitoshSingh good catch
it's missing your line ending
you probably have carriage return issues
file created on linux and run on windows perhaps
not sure where the rest of the from maya import went..
@Lawrence3DPK time to read the formatting guide I linked
 
# Error: invalid syntax
#   File "<maya console>", line 2
#     import re from maya
#                  ^
# SyntaxError: invalid syntax #
 
@AndrasDeak--СлаваУкраїні my appologies, will keep code snippets seperate
 
No worries. Chat is finnicky.
 
12:41 PM
Like line endings :)
 
Half-joking suggestion: put a semicolon at the end of all your import statements
 
@Lawrence3DPK could you please run this python snippet in vanilla python, setting your example script's name instead of tmp.in?
with open('tmp.in', 'rb') as f:
    print(repr(f.read()))
to me the result starts like this: b"import re\nfrom maya import cmds\nfrom pymel.core.datatypes import Vector, Matrix, Point\n\n, I think yours will differ
unless it should differ, I have no idea how this works in windows
@Kevin could you please try saving the original snippet and checking if '\r' is added?
no point in a check that doesn't show anything...
 
Both \r\n and \n seem to work fine
...in CPython. Not sure what Maya uses
 
yes, I expect maya not to use universal newlines
@Aran-Fey my question was whether saving that example and reading it with python in binary mode will preserve the carriage returns
 
That depends on the text editor you use, no?
 
12:50 PM
Probably?
But I would expect windows programs to do similar stuff. Not sure why but I guess I'm hopelessly optimistic.
 
laurel
Aran is spot on there, it will depend on what editor you use. the good ones seem to try turning everything into \n if youre programming even on windows these days
 
Well, in any case I'm out of ideas.
 
side note, i looked at some data i had on employee numbers for tech companies (around 1.2k), it doesnt have a normal distribution at all. scipy stats normaltest says the p value is 1.9e-74
I think another thing that may happen with this survey specifically is that it may overrepresent large companies because there may be pockets of users for SO within these companies
which, i mean, it's correct in terms of what question the survey asked, but dangeous if we try to assume distribution about company sizes itself from the survey here
 
1:06 PM
@AndrasDeak--СлаваУкраїні good catch, the new line breaking point was one issue, i am now getting the following error, i'll have a look on maya's forum for this
# Error: No module named 'pymel'
# # Traceback (most recent call last):
# #   File "<maya console>", line 3, in <module>
# # ModuleNotFoundError: No module named 'pymel'
 
@Lawrence3DPK separate package, needs pip install pypi.org/project/pymel
 
ok, thank you for everyones help with this, i didn't have pymel installed ( new machine ) my oversight.. https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2022/ENU/Maya-Scripting/files/GUID-2AA5EFCE-53B1-46A0-8E43-4CD0B2C72FB4-htm.html
thank you again, all info pointed in the correct direction!
 
1:29 PM
@AndrasDeak--СлаваУкраїні Let's see. I get b"import re\r\nfrom maya import cmds\r\nfrom pymel.core.datatypes import Vector etc etc. Of course, we can't say for certain where those "\r"s were added. Could have been done by Firefox, or my copy-paste buffer, or Notepad++, or Python, or Windows.
 
excellent, thanks
I don't need to know how the sausage is made anyway
 
In any case, the Python parser seems happy to accept either kind of line ending:
>>> exec("import os\nimport math")
>>> exec("import os\r\nimport math")
>>>
No syntax errors here.
 
yeah, python's had universal line endings for a long time docs.python.org/3/glossary.html#term-universal-newlines
assuming that's relevant
 
Sorry about my late reply, btw. My computer burst into flames and I had to go buy a fire extinguisher
 
I didn't mean to shock it with so much work :P
no worries of course
 
1:36 PM
Should have just used water
 
It was already under intense load thanks to the 136 field groupby I ran yesterday. Poor thing.
 
(ps, just in case for others, thats a joke, and also a terrible idea! do not mix water with electronics)
 
Turn off computer, open case, remove any internal batteries (being careful not to touch the fire), douse in water, let sit in rice overnight
 
@ParitoshSingh in theory pure water would be fine... as long as there isn't too much ionic dirt around the system
 
pure water means distilled water?
 
1:39 PM
I've seen an experimental fission reactor that had a light bulb hanging into the water to illuminate the core area.
@ParitoshSingh 100% water, yes.
 
gotcha, yeah you're spot on with that
 
hypothetically deionized water could work too but I'd risk that even less :P
 
66% H, 33% O, 1% artificial flavorings and preservatives
 
I believe they use distilled water for cleaning circuit boards specifically because of its properties, though ofcourse the whole thing still scares me
 
What if the circuit board just happens to be covered in table salt
 
1:42 PM
then you're in for a very bad time
 
Water is too good at dissolving things into ions. We need something that dissolves nothing.
 
it's only good for cleaning as long as there's no ions involved
 
new invention, liquid plastic.
 
@ParitoshSingh cleaning? I thought we were putting out fires. Horrible scope creep!
 
1:43 PM
Perfect. blast the circuit board with high velocity salt, job's done
 
then 400 years later all our water is contaminated, the thing is everywhere, and we will never get rid of it
@AndrasDeak--СлаваУкраїні laurel, dang it you're right!
@Kevin you know, there could be one thing better
they say fire is a great cleanser after all
 
Hard vacuum? But arguably it doesn't count as a "thing"
Hard vacuum is the nothing that is better than salt at not dissolving things
 
it's very hard to blast vacuum at something though
 
"hey, what's the best way to clean electronics?". "Oh, nothing."
 
And stuff definitely evaporates in vacuum. Even your circuit board.
probably not a lot though...
 
1:46 PM
Perhaps a ludicrously powerful pressure wave... high pressure in the front, zero pressure in the back
 
2:09 PM
After rebooting my computer, Visual Studio is now unresponsive to mouse clicks... But only when it's on my rightmost monitor. It's fine on the other two. Bravo Windows.
 
You used water, didn't you?
 
<_<
 
@Kevin High pressure Xenon?
Or a very high pressure but very small volume of nitric acid to just clean off the top layer of...everything.
 
Ola, I have trouble using environment markers in my setup.cfg correctly. I have following line in my install_requires section: pywin32==225; platform_system=="Windows". I'm on Linux, but it still tells me: ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: none)
ERROR: No matching distribution found for pywin32>=223
 
2:19 PM
According to this: stackoverflow.com/questions/44878440/… I seem to be using it correctly. Any ideas?
oh wait, it's only added in 3.10?
 
no
the usual "no matching version" reason is too new python with no wheels to go with it
But that's not the case here.
 
Oh, status rejected: peps.python.org/pep-0496
 
Ah, I see. I've seen something like that in requirements, hmm.
 
Do environment markers exist and I just got the wrong/old pep or are they just in the idea phase currently? EDIT: I've got the wrong pep, here it is: peps.python.org/pep-0508
 
2:32 PM
Yes
from setuptools import setup


setup()
Haha ok nvm it was another package, there is pywin32 and pypiwin32 and the pypiwin32 was needing pywin32 but pypiwin32 didn't have the env marker, thus it told me it can't find pywin32 even tough that one had the marker :D Omg
 
2:52 PM
Also, what a django conundrum. strtobool returns ints which works well when relaying variables from django to js, but then you have some other logic which actually places a bool into a var, js complains that True is not a type and you have to use {{ var | lower }}. Has there ever been a push to make strtobool actually return a bool? It's kinda suprising for a function which is named TOBOOL to return an int xD
Ok, I see it's removed in 3.12, but what's the replacement?
I see people rolling their own or using github.com/symonsoft/str2bool, so is that the recommended way?
 
What str(to|2)bool where you originally referring to?
 
3:08 PM
the distutils one
 
3:18 PM
whatever_to_bool functions in Python are allowed to return ints, because bool is a subclass of int. No, I will not clarify what I mean by "allowed to".
Knowing nothing of Django idioms, I'd be inclined to relay JS-friendly bools by using json.dumps
 
@Kevin well spock comes to mind
 
The alien, or the framework?
 
haha the alien and his quote: When an act is morally praiseworthy but not morally obligatory
 
3:37 PM
RFC 2219 needs an OPTIONAL_YET_PRAISEWORTHY term, in between OPTIONAL and SHOULD
 
4:28 PM
anything like that in distutils was probably not ever intended for general use
 
It would come in handy in my Oracle-related work, which has no community standard whatsoever for representing bools. a NUMBER with value 0 or 1 is just as valid as a VARCHAR with value "N" or "Y"
I'm pretty sure the NUMBER is a float, btw. Just in case you need something that's 0.9999999575% True
 
@MisterMiyagi I found stackoverflow.com/questions/758188 starting from those, which I think I prefer as the canonical
yeah, I like that one best, since it asks/titles the question in a way that isn't entirely dependent on looking to translate an idiom from other languages, and because it seems more directly aimed at the question beginners are most likely to have (I think?)
 
My ideal canonical would make a clear distinction between "The statement at line A must execute before the statement at line B" and "Line A must have a smaller line number than line B". Without clarification, a newbie might interpret "A must occur before B" as either one
 
although actually, stackoverflow.com/questions/3754240 seems to do a better job setting up the problem statement
it also has the advantage that there is an accepted answer... although really it's the second answer that does the best job of answering the technical detail stuff
 
4:44 PM
@KarlKnechtel I think all of them need a bit of cleaning up. Either the examples are convoluted or it refers to C style headers/declarations.
 
agreed, but I want to choose a base before I go hammering or requesting merges
 
There's a long trail of excrements on all of them...
 
in fact I'm not sure I want to be the one leading this
stackoverflow.com/questions/1590608 only, in my view, has the advantage of being most popular. I don't think it's the best choice of the three by any other metric
 
You could even contrive situations where there are more than two answers to "which function is first?", for example:
def Y():
    def A(): pass       #has the smallest line number among A, B, and C
    def B(): pass       #the first function called among A, B, and C
    B()
def C(): pass            #the first function to be bound to a name among A, B, and C
Y()
 
oh right, as for stackoverflow.com/questions/58306444 - that's where I found the one I proposed; I already hammered that because I agreed it straightforwardly had the same form
(also: is this chatroom really the intended/best process for choosing a specific-question canonical duplicate, where SME is required? it does kinda seem like going to meta.so isn't a great idea, but)
(Pythonistas are lucky that we have such an active and long-running chat room, and even then it's not that active)
 
5:08 PM
@KarlKnechtel It's probably the best place out of sheer practicality, what with combining SMEs and low latency. Though admittedly a lot of folks here are burned out from curation already.
Finding and cleaning up canonicals is a task that probably lies somewhere between what chat and meta provide.
 
5:42 PM
@KarlKnechtel meta.so is probably a no-go due to domain knowledge requirements
 
5:54 PM
plus here... you sometimes have a mod/two around that if agreed can shift around duplicates without using up close votes/running into restrictions...
 
Wouldn't this Meta StackOverflow room be interesting, too? chat.stackoverflow.com/rooms/197438/the-meta-room
 
 
1 hour later…
7:29 PM
It is written, practicality beats purity
 
7:41 PM
How would i run a bash command in python that is not a subprocess of python?
 
The subprocess module is the only way I'm familiar with.
 
that is a subprocess of python so the command i want to run won't work on a subprocess of python and only works on a main or subporcess of bash
 
Interesting. I didn't know that a process could even tell if it's a subprocess or not.
 
it can't but the command im running heavily relies on env vars wich are different if you run it from python
 
You can set those manually, if you happen to know what all of them are.
 
7:47 PM
99% sure subprocesses inherit env vars
 
then why does the command not work when i use them but work when I type it in manually
 
docs.python.org/3/library/os.html#os.putenv. "Such changes [made by putenv] to the environment affect subprocesses"
Usually when my subprocess command doesn't work, it's because I didn't set shell=True
 
@thatrandomperson that's a question only you can answer
 
well i think the problem is it being in the child process of python executable. not bash
the commands are nix-env commands if anyone can help me figure out how to run these via python
 
I don't see why that would matter, but go ahead and test that hypothesis. Run bash -c the_other_program and see if that makes a difference
 
7:52 PM
what other program
 
If I had a Linux system and if you had an MCVE, I would be happy to investigate, but I have little to contribute while I am trapped in Windows land
 
@thatrandomperson The one you're trying to run? nix-env?
 
@Kevin I am on windows but am using the online ide replit which is linux
 
This problem keeps unfolding in interesting ways :-)
One possible factor is, online IDEs may intentionally limit how much power you have over the server's environment. Maybe they don't want you running bash scripts to begin with.
 
@Aran-Fey It gives an error saying that the args i gave don't exist
@Kevin I've alredy said bash installing works just fine. it only breaks when i run in python, tho i agree that python may have different perms then bash
 
7:58 PM
Maybe the server wants to limit your power, but they didn't do a very thorough job :-P
"we'll block him from running bash inside python"
"what about him just running bash by itself?"
"Listen, it's four o clock on a Friday. Let's call it done and go to the pub"
 
they don't. They lirtey have a template called bash. that runs bash scripts
 
In that case I'm going back to "try shell=True"
Oh, and make sure the first argument to Popen/run/check_output/whatever is a list of strings, rather than a single string. Sometimes that makes arguments disappear.
 
no, i have a list. shell is also set to true
 
Hmm. I will retreat to my Pondering Cave.
 
the args are , shell=True, stdin=so.PIPE, stderr=so.STDOUT for popen
 
8:04 PM
It would be important for you to do a MCVE (stackoverflow.com/help/minimal-reproducible-example), so maybe someone can try to help you objectively.
 
Like this? o = so.Popen(' '.join(['bash','-c','nix-env', '-iA', Langs[target]]), shell=True, stdin=so.PIPE, stderr=so.STDOUT)
 
Wait 1 sec
`
 `
import subprocess as so
o = so.Popen(' '.join(['bash','-c','nix-env', '-iA', 'nixpkgs.python3Full']), shell=True, stdin=so.PIPE, stderr=so.STDOUT)
print(o.returncode)
`
?
 
How is this a MCVE if there are such parameters that will only work in your full program? Like the "nix-env" parameter, for example?
 
8:23 PM
Ah, idk how to setup that. On my ide it is already pre-setup
So I guess go onto replit.com and this will work
 
@thatrandomperson why are you joining those!?
and using Popen
if you're using subprocess... use the other methods like .check or the .run wrapper
 
@thatrandomperson Both 'bash' and shell=True will invoke a shell; there isn't much use to using both.
 
Running that in bash gives the same result as running it in python, which is nix-env: command not found
 
@Aran-Fey oh. Well remove the bash stuff in front and it works
Updated version:
import subprocess as so
o = so.run(['nix-env', '-iA', 'nixpkgs.python3Full'], shell=True)
print(o.returncode)
 
8:39 PM
Huh, apparently it matters whether you've created an actual repl or not
So what's the error you get? nix-env: /nix/store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/dd8swlwhpdhn6bv219562vyxhi8278hs-gcc-10.3.0-lib/lib/libstdc++.so.6)?
 
@Aran-Fey Yes!
@Aran-Fey what do you mean?
 
If you don't log in, you don't get a nix-env executable
Anyway, it seems that some environment variables differ between python and bash. PYTHON_LD_LIBRARY_PATH for example
 
@Aran-Fey well that’s what I said orginly
 
Well, you've said a lot of things and most of them weren't very clear...
 
@Aran-Fey oh, I got a different error after I compiled
Ok, nvm I just needed to compile things
 
9:05 PM
@Kevin weird deja vu of what you were talking about the other month or so: stackoverflow.com/questions/72807847/…
 
 
1 hour later…
10:21 PM
stackoverflow.com/questions/72808422 Look, it's the same question. Again. "How do I get information out of a function?"
 
Why do you keep posting them here though?
 
Just in case you hadn't seen them!
 
I think the plan is that at one point someone will be bothered enough to write a canonical :P
 
Lemme know if that works. I've got a backlog of things I'd love to bother people into fixing for me.
 
I volunteer Cody for the task. Writing prompt: "how do I the function?"
 
10:26 PM
pardon; when I previously talked about writing a canonical myself, it seemed to me as though there were resistance to the idea, or skepticism as to whether it could be properly focused as a SO question.
so this is mostly me justifying it to myself.
 
"How do I properly return a value from a function?"
 
that's the proper description of the content, I suppose, but I expect I'll try to include more beginner-friendly verbiage in the title
 
and there are more related facets, but I guess it is at least possible to take them apart
 
Maybe just clean this question up? Or this one? Or any of a dozen others?
@AndrasDeak--СлаваУкраїні I love any answer that says "Your understanding ... is wrong" in the very first sentence.
 
10:28 PM
this one has a dupe target chosen by none other than Aran-Fey stackoverflow.com/questions/3052793/…
 
"What is the purpose of the return statement? How is it different from printing?" That sounds like exactly the title of the post that Karl is imagining.
 
at this point someone will probably point out that these are not exactly dupes of that
@CodyGray hammered by none other than Karl
 
well, there's the problem of choosing one, and the annoyance that none of them is highly voted and the top answers lack authoritative tone and the questions are written idiosyncratically
@CodyGray no, this is an entirely separate issue.
 
I see two canonicals here and here.
 
yes, this is about accessing locals
printing would move the locals through the standard stream into the calling scope, so it's obviously different
 
10:31 PM
Oh wait, what? Ugh.
 
one issue is "why does print not let me use the value from outside" and the other is "why can't I just use the variables from outside, as is"
 
They are trying to print a local by passing the name of it as a string?
No wonder I did not grok that correctly the first dozen times I looked at it.
 
@CodyGray no, just hoping that a variable living inside a function is also accessible from outside, by the same name. After the function's returned.
s/hoping/assuming/
 
nonono. None of this is anything to do with printing. The new canonical I want is about using the local from outside in calculation - and not being told by others "it's a scope issue, here is how global works"
because "using the local from outside" is severely XY
 
Well, I'm very confused.
 
10:32 PM
Same
 
@CodyGray you're getting into the right mindset, keep going
 
Since my second guess was wrong, I'll go back to saying that these all look very much like duplicates.
Exact ones, even.
It even has a print in there.
 
They are duplicates, but the target is "please please please read a tutorial aimed at beginners"
 
(But no paper comes out! What's broken? How can I fix??! Plz halp!)
 
I think the inherent XYness of these questions is exactly why we don't have a nice canonical
 
10:33 PM
@AndrasDeak--СлаваУкраїні Yes, that's why I'm on Stack Overflow. I'm here to find an answer to my question.
 
let me step back to the beginning of the current discussion, where I pointed excitedly at stackoverflow.com/questions/72808422.
 
This is not a question about print. It is definitely not a question about confusing print vs return, because OP is not trying to use print inside the function.
 
perhaps we should convince OP to use print, then hammer it
 
10:36 PM
I fail to see the distinction
 
@CodyGray it is different though
 
you fail to see the distinction between inside the function, and outside the function?
 
I fail to see the distinction between the questions
I wonder if you're looking at the title, whereas I'm looking at the MCVE?
 
I'm trying to look at the kind of misconception that OP has
 
@KarlKnechtel well that's another issue again
 
10:38 PM
existing canonical addresses: "I tried to use print to get information out of a function, but this displays text and causes the expression outside the function to evaluate to None. What gives?" and variations on that theme.
Needed canonical would address: "I want to reach into the function and see the information it has, but I can't make it work. How is this intended to work?"
 
answer: use a debugger and set a breakpoint inside the function
 
I think you need two canonicals, one that specifically addresses print vs return, and one that just explains the various ways for two functions to communicate
 
yes, that is exactly what I have been saying.
 
Then we just have to agree on what Oguz's question is asking.
 
we do have the print vs return canonical.
 
10:41 PM
And someone will likely have to write the other one. I nominate Karl :P
 
I think Oguz' question, as asked, is not clear. However, I interpret that it is much more likely motivated by the second one
 
Seems you also have the how do I access a local from outside of a function canonical?
 
omg. You are my saviour.
do you have any idea how bad the site search is.
Please tell me exactly what you typed in to find this.
 
Why do you use site search?
 
@KarlKnechtel None whatsoever. I only use Google's site search.
 
10:42 PM
site search is utterly useless
 
The only time I would use site search is if I'm using one of the operators, like deleted:1, and the useful ones (like that one) are pretty much mod-only.
 
aside from site:stackoverflow.com, what did you supply to google? I wasn't successful that way either, nor with asking people about the problem in this chat off and on for literally weeks.
 
@KarlKnechtel Literally: acess local variable in fucntion python (including the typos, because I was that lazy)
 
@KarlKnechtel top and accepted answer suggests slapping on attributes to the function object
 
@AndrasDeak--СлаваУкраїні Yeah, that seemed... horrible, but I didn't judge because I don't know what y'all consider horrible.
 
10:43 PM
the kind of Python canonical you'd expect from Cody
 
@AndrasDeak--СлаваУкраїні ... why can't I have nice things.
 
@CodyGray it's pretty icky
 
You can haz all these
One of them taught me about locals().
 
it's even tricky icky because when many people see "global" they will say "no thanks", but they see this crap and think "oh, how cute"
 
the problem with stack overflow is that this gets +128 on a +65 question, while drowning in junk
 
10:44 PM
@CodyGray Intentionally sprinkling typos into your google search is probably a tactic I should try someday...
 
@Aran-Fey I don't think the typos helped in any way, other than saving me the couple of milliseconds it took to get my brain engaged.
 
I tried using ddg because I normally do. stackoverflow.com/questions/32822473/… seems better, score notwithstanding?
 
@CodyGray Canonical for that: stackoverflow.com/questions/40796264/…
Score never matters
 
@KarlKnechtel much better, yeah
don't care about votes
 
coming up with the phrasing was key, it seems.
 
10:46 PM
Or capitalizing random things
> calling multiple variables in python one function to another
yeah, how could we not have come up with this eloquence?
What were we doing all this time?
 
it does kinda feel like what comes up will be kinda random out of all the dreck
 
It's almost as if this site needs a delete button
Wait, it already has that
 
re stackoverflow.com/questions/52209825/…, the question is awfully posed. I will probably try to improve it and then dupe-hammer it once I am confident of which kind of question it is
I'll hammer stackoverflow.com/questions/19326004, too; it definitely shouldn't be canonical, and the popular answer seems to have been motivated by taking OP's attempt to solve the problem too seriously.
(also, "This time it doesn't give even an error." in that question doesn't describe reality)
@CodyGray it doesn't happen remotely enough, though
(oguz did self-delete, though. x.x)
 
11:37 PM
https://stackoverflow.com/questions/9186395
I wish Ben's answer here, mutatis mutandis, existed within a better-suited question.
 

« first day (4274 days earlier)      last day (657 days later) »