« first day (3500 days earlier)      last day (1461 days later) » 

6:28 AM
Any suggestion to make the title relevant to its content ?
0
Q: Python alarm signals, Exception handling outside of their working thread?

Abr001amIt is commonly known that signals in python only work inside the main thread, this is my little snippet on this subject: import signal from threading import Timer from time import sleep class timeout: def __init__(self, seconds=1, error_message='Timeout error'): self.seconds = seco...

 
 
2 hours later…
8:18 AM
100%|█████████████████████████████████████| 76/76 [00:28<00:00, 2.70it/s]
100%|███████████████████████████████████████| 1/1 [00:03<00:00, 3.89s/it]
what is it/s ??
for your reference this is some python pandas output
 
9:15 AM
if i had to guess, that's iterations per second.
also, this looks like tqdm's output, not pandas per se. tqdm is just a library that can give you information about time taken in some iterative operation among other things
 
9:58 AM
Yes, that. 76/28=2.71
 
could also mean "items per second"
 
tqdm is typically a wrapper in a for loop
So iterations seems straightforward
> Overhead is low -- about 60ns per iteration (80ns with tqdm_gui), and is unit tested against performance regression. By comparison, the well-established ProgressBar has an 800ns/iter overhead.
no smoking gun, but anyway tqdm's front page ^
 
it says "iter" instead of "it" there. Checkmate :P
 
10:37 AM
H
Hi
I am using requests in repl, and it gives error access denied | ... used cloudflare to restrict access
Can I get some guide?
 
@BlackThunder you know you can edit/delete messages...
@BlackThunder does the page load in a browser?
 
wdym?
browser?
 
What kind of request are we talking about?
 
import requests
requests module
just trying to read text in a page
 
OK. Do you know what a web browser is?
 
10:51 AM
ofc
 
OK. So take the URL you're trying to get and copy that into your web browser. Does it load?
 
yeah
doesn't work in repl.it
 
Does requests work locally, on your machine?
 
OK. This is very important information!
And "repl" is not "repl.it". If you're asking for help, try to be clear.
 
10:53 AM
I am using requests module in repl.it but it returns that error
 
Here's your question: "I'm trying to download a webpage with requests. I have code that works locally, but it gives me an error on repl.it. This is the error: <error message comes here with traceback"
 
Next step is probably to create an MCVE that works locally but not in repl.it. And with some general webpage if possible, assuming the problem happens all the time.
 
11:14 AM
Thinking about it, repl.it could be a nice platform to launch DDoS attacks or scrapers trying to do nefarious things. I wouldn't be surprised if they just shut things (libraries, access to particular URLs etc.) down indiscriminately. I get the feeling that the answer will just be "because it's not allowed"
@amish please see our room rules in regards to linking to questions from main. Specifically, that you should wait 48 hours to see if you get an answer before bringing it here
No worries. Hopefully you get it solved before then :)
 
 
1 hour later…
12:37 PM
i have a training folder with 5 images how can i store them into 5 different 2d arrays?
i know to do a single image but no idea on how to do multiple together
do i use a dictionary matrix?
 
12:51 PM
@KhwajaHussamQuasmi well, how do you want to store the five arrays?
List of arrays or dict of arrays are both reasonable. If all images are the same size you can even put them in a single 3d array.
just loop over the files, load each one the way you know how, then put the array in your container of choice (for the list or dict option)
to get a 3d array you can use np.stack on your list of 2d arrays
 
 
1 hour later…
user6276743
1:57 PM
Getting irregular logging behaviour. Sometimes it logs, sometimes it doesn't? Using IPython in Spyder.
 
user6276743
 
Aren't those different logging levels?
 
user6276743
I've set the logging level:
 
meaning the info might be silenced
 
user6276743
 
user6276743
2:00 PM
The main code hadn't changed, I just added a while loop somewhere and all of a sudden it isn't working.
 
user6276743
And... now it works... eh?
 
problem solved I guess :P
 
user6276743
I didn't change any code, it's weird
 
user6276743
 
Strange, anything below level 30 isn't logged even if the logger level is lower
>>> l.level
10
>>> l.log(30, 'foo')
foo
>>> l.log(29, 'foo')
>>>
 
user6276743
2:06 PM
The only thing I did was that I opened a new tab in Spyder, ran the code above in that tab, then ran my original code.
 
the handler and the logger can have individual settings
 
that's the next weird thing: l.handlers is empty
I should probably stop trying to make sense of this java-inspired monstrosity
 
I'm gonna go with logging singleton and Spyder commandeering it somewhere for its own internal logging
 
i guess there is a default handler that writes to stdout and is set to 30
@Aran-Fey hear hear
I'm still kind of waiting for the 3rd part logger that is to standard lib's logging what pytest is to unittest
 
hmm, I think what's happening is that the log call is "falling through" to the root logger, which has a level of WARNING
because the logger we're using doesn't have any handlers
maybe
 
2:10 PM
@WeavingBird1917 I guess that's spyder for you
 
user6276743
It's just a Spyder problem? If so that's good
 
nah, I can repro without spyder
 
user6276743
Otherwise I'll probably have to replace all the log functions with print functions x_x
 
there's that logging lib that wim always praises, the one with the laser-eyed beaver, but that might be about logging for machines, not humans
 
2:13 PM
that! thanks
 
99% sure you just need to add a handler to your logger
 
yeah, I think it's targeted more towards complex applications where you want to run some tooling that picks up your logs
 
user6276743
I managed to reproduce it by just reloading the console
 
user6276743
Set the root logger to INFO but still doesn't work, so not sure if it is falling thorugh
 
the handler also has a level, as Arne said
 
user6276743
2:29 PM
How do you check that?
 
don't know
 
user6276743
I used the obscure code here (stackoverflow.com/a/60988312/6276743) to check all the levels after setting the root logger to INFO, seems like all loggers are set to INFO
 
user6276743
Found a piece of code to print all loggers and handler info: github.com/mickeyperlstein/logging_debugger/blob/master/…
 
user6276743
Interesting, now nothings working again. Previous method of fixing it not working. :/
 
2:46 PM
Cbg
May I ask a doubt regarding regex grouping in findall?
>>> for k in d.keys():
d[k] = sub("\[\s*(\w+)\s*\]", d[r'\1'], d[k])


Traceback (most recent call last):
File "<pyshell#119>", line 2, in <module>
d[k] = re.sub("\[\s*(\w+)\s*\]", d[r'\1'], d[k])
KeyError: '\\1'
why do i get this error? d is a dictionary
i'm tryin to access (\w+) via r'\1'
its re.sub :( typo
 
user6276743
Looks like a key does not exist error
 
but the key shouldnt be \\1
the key should be what (\w+) has caught
 
user6276743
Oh I see what you're trying to do
 
@JoshuaVarghese what do you expect d[r'\1'] to do?
note that this is an input argument to re.sub. By the time re.sub is called this is already evaluated.
What is your situation that you're really trying to solve? You have an XY problem.
 
user6276743
sub(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl. repl can be either a string or a callable;
if a string, backslash escapes in it are processed. If it is
a callable, it's passed the Match object and must return
a replacement string to be used.

Don't think repl can take a dict?
 
2:57 PM
@WeavingBird1917 re.sub is a red herring
 
see, if you use re.sub('(...)(\w+)(...)',r'\2'), the 2nd group is they word replaced with
 
@JoshuaVarghese I suspect you're looking for lambda match: d[match.group(1)] instead of d[r'\1'].
 
you can use lambda in place of d{[] ???
 
WeavingBird1917 just posted the docs of re.sub, it's about time you read it
You can't use it "in place of d{[]" because you can't use "d{[]".
 
lol thats a typo too
btw can you use try expect in lambda function?
i want to avoid the key error
@AndrasDeak thanks for the lambda solution! it worked
 
3:06 PM
@JoshuaVarghese no
in that case use a proper function
And make sure you understand what's going on!
 
user6276743
What do you want it to do in the case of a key error?
 
3:35 PM
i want to avoid sub is key error happens
yea instead of try except i found a solution
but it returns error
>>> for k in d.keys():
d[k] = sub("\[\s*(\w+)\s*\]", lambda match: d[match.group(1)] if match.group(1) in d else match, d[k])


Traceback (most recent call last):
File "<pyshell#143>", line 2, in <module>
d[k] = sub("\[\s*(\w+)\s*\]", lambda match: d[match.group(1)] if match.group(1) in d else match, d[k])
File "C:\Users\Sindhu\AppData\Local\Programs\Python\Python37-32\lib\re.py", line 192, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: sequence item 4: expected str instance, re.Match found
i think i should use match.group() for else?
 
d[match.group(1)] if match.group(1) in d else match can be shortened to d.get(match.group(1), match)
 
I'm still waiting for "What is your situation that you're really trying to solve?"
 
@AndrasDeak sorry for late answer xd! here it is stackoverflow.com/a/61837853/13062813
 
so you're trying to solve someone's problem
note that OP's existing code was already better because it checked ahead of time whether the match was in the dict
I have the distinct feeling that this is way more work than it's necessary, but I can't be bothered to read OP's requirements
 
Op wanted to replace those [x] with d[x]
if x is in d
but in op's code, it seems re.search finds only the first match
lmao when you said "someone" did you mean the author?
 
user6276743
3:50 PM
What if a value it refers to a key whose value is to be changed by another key
 
you should ask OP that
 
@WeavingBird1917 ? i didn't understand what you said? :(
 
user6276743
Basically if a refers to b, b refers to c, c refers to d....
 
user6276743
and d refers back to a x_x
 
4:09 PM
 
4:26 PM
How is b_value refered to a_value?
 
^^ closed, thanks
 
:D
@WeavingBird1917 I need to admit i still don't understand how refers to the solution of mine ;-;
 
user6276743
@JoshuaVarghese I meant whether this situation is possible: {'a_key': '[c_key]+1', 'b_key': '0', 'c_key': '[b_key]+1'}
 
what is the point of calling @property?
and what is the point of @value.setter?
 
Did you research it?
 
4:36 PM
yes
i dont see the point
python lets you do things without these advanced features
i think my question really is, does everyone use these things?
 
Do you program in any other languages?
 
i did a bit of c++
 
@Permian "I need an attribute that's a number but I want to ensure that it's always divisible by 3`. How do you implement that?
 
for some reason c++ is less opaque
 
This is one of the things I understood so much better when I went outside of Python... programming to an interface
 
4:38 PM
Would you rather have a getValue() and a setValue() method?
 
i cant the point of either
 
Allow obj.x = 6 but not obj.x = 7
 
@Aran-Fey
 
It lets you execute code when that attribute is accessed or assigned to
letting you do things such as checking for invalid values
(which is what Andras has been saying for a while)
 
ok hang on ill have a think now
also does anyone use this sort of thing? from abc import ABCMeta
 
4:41 PM
I do, but... I can't blame anyone for not using it. Abstract classes don't have much of a purpose in python
 
@Aran-Fey ok thanks
ill ignore that for now
i think part of my problem is that i have never worked on commercial sized projects in java/c#
 
@Permian I thinki this is a pretty decent article. actually. I start to lose track in some parts of what they're trying to do, but I found it pretty useful
 
@roganjosh i think ive read that before but will take another read now
 
It definitely covers metaclasses, but it takes some time to chew through the content once you're mid-way through
 
> class definitions and functions are objects
1 demerit for sloppy language
 
4:46 PM
from enum import Enum
anyone use that?
 
@Permian stop.
Please continue this quiz in your local pub or elsewhere.
 
honestly its much easier with c++
 
So go write C++ \o/
 
the problem is python hides so much
 
Yeah, you should give up on python
I heard there are nice C++ room on chat.SO
they're probably really good at leetcode
 
4:49 PM
I've found the @property decorator very useful when refactoring
 
> Every class that you create in Python will implicitly derive from object. The exception to this rule are classes used to indicate errors by raising an exception.
This is quickly becoming worryingly bad
 
@Aran-Fey well it's realpython.com
 
@Aran-Fey this is now raising concerns for me :/
 
Dec 9 '19 at 12:41, by Andras Deak
Ugh https://realpython.com/python-lambda/ . I just took a glance after this was asked about on main:
Dec 9 '19 at 12:41, by Andras Deak
>>> (lambda x:
... (x % 2 and 'odd' or 'even'))(3)
'odd'
 
I actually found that article decent to try get a mental map of how I might structure projects in future
How bad is "bad" here? As in, borked-bad or just bad wording?
 
4:52 PM
when you're teaching newbies there's less of a difference than usual
 
@AndrasDeak youve forgotten what its like to be a noob
 
@Permian nope
 
you are probably a very clever man
 
@Permian You've forgotten (or never learned) that we're not here for your convenience
I teach at university. Not programming, but a noob is a noob. I'm very much aware what it's like to be new and how to go from clueless to knowledgeable, and how to help someone in this situation.
 
@Permian everyone is a noob when they are learning something new.
 
4:57 PM
@roganjosh I stopped reading shortly after that, but as far as I can tell it's a mixed bag. I found many small-scale flaws (bad wording leading to incorrect or misleading statements; using classes where they aren't necessary; getting sidetracked (i.e. why the heck were they even talking about exceptions there?)), but you can probably still learn useful big-picture stuff like program architecture
 
@RoadRunner their point is that I no longer remember that and thus too strict with them
 
the real problem is that newbies can't tell the good from the bad
 
user6276743
I wonder whether it is possible to be an expert at learning. Seems like learning is a skill in itself
 
@Aran-Fey makes sense, but I do wanna pin you down on "Every class that you create in Python will implicitly derive from object. The exception to this rule are classes used to indicate errors by raising an exception." since that seemed like a point of getting "worryingly bad"
What am I not seeing in that which is badly wrong?
 
@roganjosh exception classes don't raise the exceptions? Probably more, that's just what sounded weird to me.
 
5:01 PM
Well they inherit from Exception which, if my memory serves me, the article explains
 
@WeavingBird1917 being in academia for a long time helps with that. But there are quite a few "professionnal learner" types on SO who ask all the time, who claim they are learning all the time, but frankly it doesn't seem like that at all. So Dunning--Kruger probably works extra strong there.
 
They're making it sound like exceptions don't inherit from object, which is factually incorrect.
 
>>> isinstance(Exception, object)
True
suspicious
Why'd they say that?
 
ive never seen composition used before either @roganjosh (omg)
 
@WeavingBird1917 yea got it! But, that process since its in one line should work exactly like
"a,b,c = c,a,b"
right?
 
5:03 PM
@Permian mmm, I never said I'd not seen Composition. But ok
 
no its from your article
 
But IMO what makes it even worse that they went off on that exception tangent for no real reason. They just taught the reader that object is the base class for everything, and then they immediately "retract" that (sort of) by saying that's not true for exceptions (even though it is)
So not only is it incorrect (or at the very least, misleading), but they are also making a big deal out of it for unknown reasons. They should've just cut that part and continued on with something useful
 
user6276743
@JoshuaVarghese If you're iterating through the keys, then it won't work as expected. Try working through the example I gave in order; a references c, but c references b. But the program hasn't gotten to c yet, so a references an incomplete version of c. But it depends whether that is allowed in the first place in OP's question.
 
yea, i get it, so the process is incomplete due to circular reference?
 
@Aran-Fey so give me a bottom line of this. Is it actively unhelpful to share, in your opinion? That's a genuine question
 
5:08 PM
So for d = {'a_key': '[c_key]+1', 'b_key': '0', 'c_key': '[b_key]+1'}, it gives {'a_key': '[b_key]+1+1', 'b_key': '0', 'c_key': '0+1'} which is incomplete, right?
But if we run the code 2 times, the answer seems complete
{'a_key': '0+1+1', 'b_key': '0', 'c_key': '0+1'}
 
@roganjosh I wouldn't go that far. Again, I can't judge the whole thing because I didn't read everything, so I guess my bottom line is that it's... questionable. I don't think it's a good learning resource, but it's not necessarily harmful either
 
So we need to see whether the OP needs to run it until no references are left?
 
user6276743
Yes, you need to run the code n times, or construct a graph and update the values depth first.
 
I am importing this f-string from one file to another, the references will only be resolved in the file that it is imported to. Is that considered bad practice?
share_price_formula = f'=GOOGLEFINANCE({sp_ind}{row}, "price")'
 
"....= f' = ...." ?????
thats vaild python code?
 
5:14 PM
@Aran-Fey thing is, I don't know of another resource for that kind of thing... you better fire up your editor for your website :P
 
What kind of thing, exactly? Program architecture?
 
user6276743
Can perhaps just recursively do it too though :P idk why I thought of doing graphs. It's f-strings @JoshuaVarghese
 
@Aran-Fey For a problem like that, for sure
 
oh yea oops the "=" is inside the string :D
Btw are there more types like f'',b'',r''.......???
 
@rcwhiteley Unless I'm misunderstanding something, that's straight up not possible. f-strings are evaluated immediately. You can't import them into another module and evaluate them there
 
5:16 PM
I have no colleagues to turn to, to ask questions. And the article deliberately makes a mountain out of a mole hill to show how you can paint yourself into a corner
 
@Aran-Fey ok, thanks. Is there a standard way that i could do something equivalent to this? I have 'strings' file, to keep my programme neat, and I want to import them and use them when needed.
 
Well, it's not quite as powerful as an f-string, but you can use a regular string and then replace the placeholders whenever you want with the str.format method
 
Yea Aran is right, if i didn't mis understand him. Here is an example:
>>> b = '{} heyya '
>>> b
'{} heyya '
>>> b.format('wow')
'wow heyya '
 
ok, got it. My reference to the variable 'row' is still giving a warning, is ok to just ignore that as i will be importing the string to a file where it will be resolved?
this statement still gives the 'unresolved reference' warning:
share_price_formula = f'=GOOGLEFINANCE({}{}, "price")'.format(sp_ind,row)
 
5:26 PM
@rcwhiteley why are you mixing fstrings with format?
 
lol
use:
share_price_formula = '=GOOGLEFINANCE({}{}, "price")'.format(sp_ind,row)
 
And what is GOOGLEFINANCE?
 
@roganjosh oops, ignore the f-string. The string is actually irrelevant, the question is, is it ok to have an unresolved reference in my code, if i will be importing the variable to elsewhere in the programme?
 
No, because it's going to throw an error
 
@roganjosh Sorry, I'm still not quite sure what you'd want me to write about. Let's disregard the article you linked for a moment, because it's awfully long and I didn't read 95% of it. Which part of it are you interested in? The comparison of inheritance vs composition? Or maybe how both of those come together to create a whole program? Or something else?
 
5:30 PM
@roganjosh Is there a recommended way to have a variable within a string that will only be resolved when imported to another file? Otherwise I will potentially have circular imports.
 
I'm gonna go ahead and say you should use str.format. But I don't see how string interpolation leads to circular imports
 
@Aran-Fey you'd still have to skim the article and see how they deliberately tangle themselves up with inheritance. Learning the language itself doesn't help with making a package that is extensible. That article is one of very few that I've found that makes me think how to plan. And I don't think I'll be alone in not having someone to plan with
 
@Aran-Fey I mean I would have to import the file that declares the 'row' variable. But then also import the file that the string is declared in, back to the first one.
 
There's a dozen articles that explain how classes work etc. Reading just those and being set out of a journey on your own does not translate well to a good codebase
 
Ah, I think I know what you're talking about. At some point they created a secretary that was both an HourlyEmployee and a SalariedEmployee
 
5:37 PM
I should know this... I binned 100,000 lines of my own code :P
 
I'll skim it later, but I'm not optimistic that this is something I can, want, or should write about
 
Actually, 100,000 is too much. Probably 30,000 and the crap I pulled in on top
 
thanks, anyway!
 
@Aran-Fey fair enough. I'll just leave it by saying it's a niche where I can't find answers
 
@rcwhiteley So you'd be importing row.py and string.py into file_that_does_string_interpolation.py. There's no circle there
 
5:57 PM
i didnt get answer :(
 
6:23 PM
for "are there more types like f'',b'',r''.......???"
 
sort of: u
@JoshuaVarghese relevant docs
 
6:52 PM
what's up?
 
wim
ZM stock
 
7:06 PM
Hi guys
This is from Flask, so it doesn't actually fit here. But I didn't find a chatroom for flask
Let us say I have two functions from the same python file main.py which render the same template index.html
Now I want to use the local variable in one of the rendered spaces for the other rendered space (I don't know how clear that is :( ). How can I do that?
 
@AaronJohnSabu Please see our formatting guide for chat but you should post long code blocks off-site and link here as stated in the room rules
 
serializer.is_valid(): is false
above is my django code
why it fails to validate
 
side note: ItemOrederSerializer has a typo in its name
 
yes
fixed it
 
@AaronJohnSabu There is no active room that I know of dedicated to Flask. <a href="{{ version.wiki }}" target="_blank">{{ version.expansion }}</a> from the message I have moved looks problematic to me, so please do follow-up with correct formatting off-site
 
7:22 PM
@AndrasDeak all images are grayscale (pgm format) and of same size. i have 5 images in a folder i dont know how to load multiple images and store them in a 3d array or dictionary of 2d arrays
 
@AndrasDeak print(order_data) is list with all the details i want to save
any hint what wrong i am doing
 
@sunil sorry, I don't know any web dev, I just spotted the typo
 
ok
 
@KhwajaHussamQuasmi I already told you. Do you know how to put stuff in a list in a loop?
 
@AndrasDeak i dont know could you give me a little guidance. so far i know how to read one image and store it in 2d array
 
7:25 PM
@KhwajaHussamQuasmi well, I think you should first read a python tutorial before jumping to advanced things involving image manipulation and probably machine learning down the line.
If you don't have a foundation it's hard to build on top of it. I could tell you how to do this one thing but then you'll be stuck with the next.
 
@AndrasDeak i will bro. yes please tell i would be very grateful for the help
 
np.array([function_that_loads_your_array(file) for file in list_of_files])
 
@AndrasDeak thanks bro. but you're right im still confused :( . like what does this make a list of 2d arrays ?
 
My point exactly.
it creates a 3d array
 
@KhwajaHussamQuasmi you could test this yourself with print() and using small arrays
 
7:33 PM
@AndrasDeak whats the step before this line of code. i dont understand the word file here. is file my image?
 
And using something like np.shape. These are things you can get 95-100% solved just by trying things out yourself, no?
 
@roganjosh on it
@roganjosh im trying bro. Andras is right my foundation is weak
 
@KhwajaHussamQuasmi It's probably more-complex than I made out in my comment about print, but I'll be honest; that's still what I'd be doing, or converting to a df and dumping to a csv
 
@roganjosh "converting to df and dumping to a csv" is hardly an option
and hence my tutorial suggestion
 
Yeah, I'm gonna back out of this one :)
 
7:41 PM
@roganjosh That is alright since {{ version.expansion }} is actually an HTML link to a Wiki page everytime
@roganjosh here you go :)
 
Thanks
@AaronJohnSabu Where is your Flask code and what, exactly, do you mean by "local variable"? You could store it in a session, or pass to the template as a hidden variable, or just store it somewhere in a sensible database table...
 
@roganjosh One thing I'd love to do is store it in the session but I have no clue how to do that
What I am trying to do now is to send a variable from a different form in the same template to the present form
 
And does the form get submitted via AJAX?
 
I want to send {{ keyword }} along with {{ caseSns }} and {{ version }} when I pressing the Case Sensitive button
@roganjosh I haven't worked with AJAX, so no I guess
 
7:59 PM
Ok, so you want a dict with those 3 values when you click a button?
 
Nope. I want keyword to be returned to flask from HTML so that I can retain its value even when /case is executed. I can do this if it is a global variable. But that seems to be a very bad idea
I'm looking into cache as of now
 
"I want keyword to be returned to flask from HTML" To do what with?
I'm just trying to get a grip on what you're trying to implement and I'm not so clear, currently
 
Ah. So keyword is the search phrase. caseSns determines whether the user wants to do a case sensitive search or not
And consider version to be a particular database (linking it with sqlite3)
 
Then it has nothing to do with the code you posted? at best you might want to remember the option the user made, but it comes down to executing an SQL query
 
Hello, I need an example of MD5 Digest Authentication with sockets in Python. Is there any project you might know, that it could help me understand Digest? But I need it to use just sockets.. not urllib whatsoever. Thank you.
 
8:17 PM
@AaronJohnSabu See this from chat in terms of saving the preference on the case-sensitive button. Other than that, you'll need to share the back-end code to be relevant to this room (potentially the JS room can give you another approach)
If you want to save it in the session, then just access it as from flask import session and use it as a dict. It'll easily "overflow" (I don't know a better term) because it's tiny
So, in that case, use flask-session and back it up somehow, whether that is file storage or a table in your sqlite db etc...
 
8:40 PM
ok I have waited the requisite 48 hours continuing to try coming up with solutions ... Ive just posted a bounty on my question :P help me sopy stackoverflow.com/questions/61806372/…
 
FYI the bounty is not necessary to ask here
 
yeah I know :P I just really want to find an answer ... tbh its not that hard to verify visually and there are only a fairly finite number of classes of chart, so Ive basically verified it mostly, but im really curious as how to actually "test" it and I just dont know :P
 
@roganjosh This should probably help. Thanks a lot
 
@JoranBeasley sure, just wanted to make sure you're aware
it's a really open-ended problem
 
9:16 PM
cbg - does anyone connect two external monitors using a singleHDMI port, to get three distinct screens (laptop plus two externals) displaying three different applications?
 
10:07 PM
Greetings all
I am hungry
 
hello
 
10:20 PM
what up
 
 
1 hour later…
11:20 PM
in other news I figured out a major bug in my application I was very confused over was being caused by the website I use testing A/B versions of it randomly so it broke my application depending on which version was received
 
11:31 PM
Web scraping?
 
11:42 PM
yup, one part of the application is scraping and that function was basically like russian roulette these past few weeks
in that vein I have a question, is it better to do small stuff with regex than figuring out the relevant BeautifulSoup attributes and functions? It certainly is simpler to me but I'm not sure
For example bs4 now returns me a list of soup objects and I need to get text but after replacing br with \n, so if I do get_text() then the br tag gets removed too and I can't use str.replace because they are soup objects and not strings.

Doing the same with regex was much simpler because I could just replace as string and then substitute all the remaining tags like `re.sub("<.*?>", "", str(x).replace("<br/>", "\n"))`
 

« first day (3500 days earlier)      last day (1461 days later) »