« first day (3576 days earlier)      last day (1372 days later) » 

12:53 AM
I just got a comment from an OP for a dupe I suggested (and 2 others voted for) saying it wasn't correct because his problem is Tensorflow is not in his PATH and that question is about pip not being in the PATH
OP's are never happy unless its spoon-fed
(I don't mean its broken English or a bad translation - which I see every day and just requires editing - I mean it looks like someone just typed their exact stream of conscious and expect us to be able to parse it)
 
1:11 AM
needs clarity, and everything else
 
 
4 hours later…
5:01 AM
@LinkBerest Tensorflow not in PYTHONPATH vs pip not in PATH... in fairness it is slightly different issue, just canonically the same... also I love all the users addicted to APIs who don't know what their path is or where to inspect it or set it...
 
5:39 AM
...I meant 'IDEs' obviously...
 
 
2 hours later…
7:12 AM
Guys, I have a list but its enclosed in quotes like so A = '['item1','item2']' , when I tried to explicitly convert it into list using list(A), it converts every single thing inside into elements of a list instead of removing the quotes
I just want to remove the quotes from the list
 
use ast.literal_eval
 
what is that? never seen it
 
@Anarach google
 
yeah doing
 
Find the hit that starts with docs.python.org
@MisterMiyagi json.loads?
 
7:14 AM
jesus..
and I was thinking, I knew python
 
@Anarach where's the string from?
 
@AndrasDeak Nah. Single quotes.
 
literally first time encountering it
its from an event hub
 
@MisterMiyagi both outside and in...
 
@AndrasDeak oh my...
 
7:15 AM
I am learning event hub and python at the same time because of shortage of good python devs
 
Case of unreliable narrator
@Anarach what does that mean in terms of python code?
 
@AndrasDeak I tried this first but didnt work
 
@Anarach OK...
 
@Anarach Is the code actually "['item1','item2']" or '["item1","item2"]'?
 
@AndrasDeak umm azure event hub ,
 
7:17 AM
"Is there a difference?"
 
'["item1","item2"]'
 
Today's forecast is: 99% chance of JSON
 
Note that as far as Python is concerned, this is not a list enclosed in quotes. It's just a string. That it happens to look like a list to you and you intend it to mean this is nothing that Python can guess.
@Anarach json.loads should be able to handle that.
 
@Anarach it doesn't matter if it's from azure or your grandmother. How did it enter your python codebase?
 
@Aran-Fey ha ha ha my bad should have mentioned that
 
7:19 AM
Anyway, I've got things to do
 
Nothing to think!
So bad!
 
@AndrasDeak Yup that worked, I was using Json.loads instead of json.dumps
Arigato everyone
also , how is SQL alchemy faster than native SQL?
it has to do more work right? but at the end it writes SQL on its own anyway
 
@Anarach Can you clarify? The situation should be exactly the other way around. json.loads should work, not json.dumps (that one will work, but provide something else).
 
@MisterMiyagi oops my bad, I was using json.dumps instead of json.loads
 
@Anarach another problem solved by diligent cargo culting. Tune in next week when we encounter a different, yet very similar problem :)
 
8:09 AM
Good morning guys, i need some help! I am importing a variable from one file to another (this variable contains the serial output of a device). When i am printing the result of the "output" variable on the file that i imported it, nothing happens, while it's printing normally on the other file
 
@Rozakos do you expect the value to update later, by any chance? And are you using from module import name?
 
Can you clarify what you mean by "nothing happens"? Does it output a newline or nothing at all?
 
if not, an MCVE would help explain your issue
 
fck, i formatted incorrectly
ok i update the "output" variable here, and then
 
Please see our code formatting guide sopython.com/wiki/…
 
8:16 AM
def hwid_test(self):
    global output
    output = ""
    try:
        hwid_command = b"!!shell sudo wf_test g_sig 61 \r"
        self.ser.write(hwid_command)
        output = self.ser.read(1000).decode('UTF-8', 'ignore')
        print(output)
        # write(output)
        hwid_regex = re.findall(r'\d\w\d', output)
        print(hwid_regex)
        if "sig[61] = 0x7" in output:
            return "PASS"
        else:
            return "FAIL"
    except Exception as e:
        print("type error: " + str(e))
 
Instead of from module import output try keeping it as import module; module.output
 
i imported the whole thing using " from module import * "
i will try your suggestion!
 
y.y
hey guys, im at work currently and im facing a problem with my crawler, are here some experts who can help me a bit?
 
@AndrasDeak doesn't seem to work
@MisterMiyagi i just run it step by step, the variable on the file i imported it is empty
so it outputs nothing at all
 
Again, can we have an MCVE?
 
8:32 AM
@y.y if this is about your new question on main please wait 2 days before asking here, see sopython.com/chatroom
And don't post updates in answers, edit the question instead
 
@Rozakos take note that the output of both print() and print("") should not be empty, but a newline.
 
y.y
@AndrasDeak ok alright, thanks for information
 
8:53 AM
uh
output = "" #buffer

def hwid_test():
    global output
    output = ""

    try:
        output = "blabla"
        print(output)
        if "sig[61] = 0x7" in output:
            return "PASS"
        else:
            return "FAIL"
    except Exception as e:
        print("type error: " + str(e))
ok here is the MCVE
from _1_test import *

print(output + "Test2")
 
... you never call the hwid_test function?
 
oh wait
 
TIL the Windoze file chooser dialog limits the contents of the file name text box to 259 characters. Even though that stupid limit can be disabled. Thank you, Microsoft.
 
you are right i forgot to call it in the example, BUT i am calling it to the actual program
in*
 
Then the solution Andras proposed ages ago should solve your problem, though
 
8:58 AM
from _1_test import *

x = hwid_test()
print(output + "Test2")
 
That import creates a copy of the output variable, so it doesn't even matter if you call the function or not
 
 
1 hour later…
10:11 AM
Hello
Anyone here who study deep learning/machine learning?
image classification/ segmentation or so on.
 
@Aran-Fey could you please give a try to the code i will send?
File 1
output = "" #buffer

def hwid_test():
    global output
    output = ""

    try:
        output = "blabla"
        # print(output)
        if "sig[61] = 0x7" in output:
            return "PASS", output
        else:
            return "FAIL", output
    except Exception as e:
        print("type error: " + str(e))
File 2
from _1_test import *

x = hwid_test()
print(x)
print(output + "Test2")
the variable isn't updating :<
 
Yeah.
1 hour ago, by Aran-Fey
That import creates a copy of the output variable, so it doesn't even matter if you call the function or not
2 hours ago, by Andras Deak
Instead of from module import output try keeping it as import module; module.output
 
10:30 AM
@Rozakos see this Q&A for some explanation/background: stackoverflow.com/questions/60838018/…
 
i am gonna grab something to eat and check it out @MisterMiyagi, thank you!
 
11:00 AM
@smci Sorry to disappoint but I don't have one. I was just ambling between different articles and finding the different statements. I can't really get beyond my general interpretation, which was why I was hoping there might be a curated precis somewhere
 
11:29 AM
@Anarach it isn't and that's not what it was designed for anyway
It's a wrapper around various different libraries e.g. it won't work with Postgres without psycopg2 and there are loads of other dialects. I'm not sure where you saw such a claim but it doesn't make much sense to me
 
@roganjosh well if you read the surrounding discussion you shouldn't be too trusting with information they provide
 
Yeah, I read that too. I just wasn't so comfortable with that claim sitting unchallenged
 
> Radio Yerevan was asked: "Is it correct that Grigori Grigorievich Grigoriev won a luxury car at the All-Union Championship in Moscow?"

Radio Yerevan answered: "In principle, yes. But first of all it was not Grigori Grigorievich Grigoriev, but Vassili Vassilievich Vassiliev; second, it was not at the All-Union Championship in Moscow, but at a Collective Farm Sports Festival in Smolensk; third, it was not a car, but a bicycle; and fourth he didn't win it, but rather it was stolen from him."
 
Probably the same thief that robbed poor Theseus of his ship. He never stops sharing posts looking for it on facebook
 
11:58 AM
@MisterMiyagi I just checked it, it's working now, thank you very much!
 
12:27 PM
@smci In my Data Engineering course I have students install MongoDB - teaching them what the PATH is - that's a whole lesson in & of itself (which I have to give twice: one for Apple people & one for Win - none of the Linux people have ever needed that lesson :)
@roganjosh That's okay, until I saw your reply to that statement: I was ready to reply with a "What?! Huh?!"
 
It's practically just littering :P
 
1:21 PM
Well, this is fun. Something suddenly started working in Spyder and now pretty much every line throws a linting error... for the code that I wrote using it. Mostly "W293 - blank line contains whitespace". Well - who put that there on every empty line? <evil glare at Spyder>. Its own auto-indent feature raises issues with its own linter. Fantastic.
 
Lol. You trust an evil spider with your code, what ya expect? ;)
 
It's kinda convenient to keep the code I'm refactoring open in Spyder and do the work in VSCode but the gigantic explosion of alerts is getting somewhat distracting and hurtful :'(
 
Which part of "evil spider" did you not understand?
I'm still not a fan of VSCode either (love Studio)
 
I've kinda sorta got used to VSCode now... except for that one file where it explodes my jinja code despite having plugins; I've got notepad++ for that baddie. I don't know what suddenly started working in Spyder to throw its own code under the bus but it's somewhat unhelpful
 
Gvim for life!
(actually I use latex more than other editors at this point)
Which is better than the executive reports.... writing a little code in word? Shiver
7 mins ago, by LinkBerest
Which part of "evil spider" did you not understand?
;)
 
1:37 PM
Indeed. Darn, my evil refactoring plan is foiled!
 
I mean I swear Spyder starts eating itself at least twice a year
It's updates used to give me fits when I had to use it with my team (cause guess who had to fix everyone's development environment)
......wait.....I still have to do that.....'xcuse me, I have something I need to delegate
 
:)
 
2:39 PM
Ooh, Python 3.9 is introducing string methods removeprefix and removesuffix, which should be useful to everyone trying and failing to use strip for the same purpose
A moment of silence for our comrades that thought "foobar".lstrip("fo") would return "obar"
I expect this will not have any impact on neophytes continuing to use strip incorrectly, but at least now we can point them to the right approach more easily while we hammer their questions
 
3:31 PM
can a noob ask questions here?
 
Yeah
 
4:37 PM
@roganjosh "Something suddenly started working in Spyder": finally some good news!
 
no no no. This working thingy-bob brings only bad news. I need to make a PR to re-break it
 
@Kevin neat!
 
 
2 hours later…
6:33 PM
Anyone has any experience with Algolia?
 
7:10 PM
^^closed , thank you :)
 
 
2 hours later…
8:48 PM
Ugh, just saw f"{(cwd := os.getcwd())}/**/{old_name}" in a question that did not even use the cwd name. Wondering who started that cargo cult...
 
9:09 PM
Huh, I didn't realize walruses worked inside f-strings
 
I see why they would, being expressions and all that. Not sure whether using a string to embed an assignment is a good idea, though.
I'm usually feeling guilty when using strings inside f-strings already.
 
9:59 PM
typo (wrong assumption by OP) stackoverflow.com/questions/63199602/…
oh my, can't look at any more crap-guessing-races today. g'night folks.
 
night
@MisterMiyagi at least that OP self-duped and is truly grateful. Rare sight.
 

« first day (3576 days earlier)      last day (1372 days later) »