« first day (3117 days earlier)      last day (1846 days later) » 
00:00 - 21:0021:00 - 00:00

12:00 AM
How does one remember what type a function returns when programming in Python? As a C++ programmer, I don't need to remember such things as functions must have the return type defined.
 
12:50 AM
hi
you can type() it
anyone still use 2.7 ?
 
wim
1:32 AM
@Aran-Fey feature, not a bug. It allows properties to "hide" themselves by (conditionally) raising AttributeError.
 
 
3 hours later…
4:11 AM
cbg
 
 
1 hour later…
5:39 AM
@cs95 question for ya, came up yesterday. Why do we prefer not having object (such as list) datatype for columns in pandas? And do the downsides apply to a pandas column of numpy arrays? Context
 
@ParitoshSingh it's mostly about performance. lists are objects, so the data type will be object, which is a bad thing. You're better off using python than pandas/numpy
 
Guys, i have a question about a class
 
scalar types such as numeric usually have vectorised operations. For objects you fall back to a loop which you might as well implement yourself
 
Should i make the class in a way where i have to mention the class twice:
A(1) + B(2) + 3
Or in a way that i only say the class once but then call the sequence with another function
 
haha, i KNEW i had read that somewhere before
i open that link, and see an upvote :P
 
5:46 AM
(A(1) + 2 + 3).seq()
 
🙌
 
I hope for some quick answer
I am trying to create a python module
 
@U9-Forward um, there's context lacking here...
what is A, B, and what are they doing, etc etc
 
@cs95 Sorry i meant:
A(1) + A(2) + 3
 
Alright, and what is the end goal? (Why do you call .seq() at the end of that expression?)
 
5:49 AM
@cs95 to get the sequence out of it
 
Sequence? You mean a list?
 
Yeah
Lemme do an example class
Eeek! probably won't, running out of time, i'm almost rbrbing
 
    class A:
        def __init__(self, val=None):
            self.data = [val] if val is not None else []

        def __add__(self, other):
            if not isinstance(other, A):
                self.data.append(other)
            else:
                self.data.extend(other.data)
            return self

        def seq(self):
            return self.data[:]
 
@cs95 Okay, i would go with that style
 
In [31]: (A(1) + 2 + 3).seq()
Out[31]: [1, 2, 3]

In [32]: (A(1) + A(2) + 3).seq()
Out[32]: [1, 2, 3]
why not do both
note that __add__ modifies the object it's called on rather than return a new one, you can change that pretty easily though
 
5:54 AM
@cs95 Thanks again!, i am always calmed down when i see you helping :-)
 
cheers bud
 
@cs95 Just a last thing, sorry, should i use @property here or not?
So should i make it a callable function or not
 
If you want to make data a property. But it's up to you to expose it to the end user.
 
@cs95 Okay, i will chose
Bye
rbrb
 
hows the shotgun arne :P
 
Yeah... I hope you maxed out your daily close votes to celebrate :p
 
That's the goal =D
@ParitoshSingh honestly, I didn't notice that my votes didn't count for the longest time. I just flagged away, and sometimes wondered why my name didn't appear in the voters list in case it was clsoed
 
6:35 AM
@Arne closed...
and you're the first named.... woo hoo... :p
 
thanks
i sometimes see cv-pls posts crossed out. is that a manual edit if the closing is fast enough or is it somehow scripted?
 
I imagine you probably see that in SOCVR? A lot of 'em use userscripts - so they can close a post and have the request automatically posted to SOCVR etc... think they also keep scanning the Q to see if it's closed or not yet or something or other...
@Arne have you dared enter the CV queue yet? :p
 
Yesterday for a bit, I cast my first actual vote in there. But I haven't had a coffee this morning yet, so I can't face that kind of ... creative freedom yet. I'm cleaning up the tags I care about first =)
also, machine-learning alone already has enough bad content to eat up all my votes I'm afraid.
 
6:58 AM
cbg
 
cbg
 
@Arne well, you can filter the CV queue by tags, and types of existing close flags on it, so you can find those ones that have already got CVs on 'em...
 
ohhh
hadn't seen that before
@JonClements that made my job about 8 times easier, thanks!
 
7:14 AM
@Arne no worries... beware audits! :p
(also means you've got the opportunity to get some more badges over time...)
 
I'll take all the badges I can get. But seeing bad posts disappear is its own reward
 
7:40 AM
@Arne great attitude :)
 
if only we could sort by close votes.....
@Arne in case you're getting really bored or fed up with the review queue there's a bot in the SOBotics chatroom that can gather possibly-closeable questions for you with various filters
 
^ that, look at Queen, it easily replaces the CV queue with a more useful interface
 
no badges though ;)
 
If only one could jump straight from a post to its current review tasks easily...
 
We used to have that :'(
 
7:56 AM
@AndrasDeak some of us still do :p
 
hehe
 
8:49 AM
@Aran-Fey thanks... got there eventually... :)
 
happy to help :)
anyone know that feeling when finally all of your unit tests pass, so you want to pat yourself on the back for all your hard work, but instead you add new unit tests that you then have to make work? It's kinda like "I wanna celebrate, but I'll hit myself instead"
 
Can't say I do... clearly not quite such a masochist as you :)
 
this is why i dont add tests and pray everything works. :P Smart, isn't it?!
 
Well, you know, I've been procrastinating on this project for months... so now I really ought to make some progress
@ParitoshSingh If that works, I'll convert to whatever religion you subscribe to :D
 
@Aran-Fey surely though - there's only Cabbage? :p
 
9:01 AM
Don't forget about the Flying Spaghetti Monster!
 
@Arne Congrats man for that, next thing is hammer, like me
:-)
 
@Aran-Fey Haha, its the religion of loveeeee! Your code doesn't work? Give it some more love :P
 
cbg
 
@U9-Forward given my current speed, i'll get it in a measly 9 years or so
 
9:04 AM
Haha, i am happy to have it tho
 
Well... can't rush these things, hey? :p
 
@JonClements lol :-)
@Arne Wow, you're on this site for long time already, unlike me
 
@U9-Forward your comment prompted me to look at my oldest questions
I wish I hadn't
 
Wow, i would love to have a answer that's the score of either your top question or top answers
@Arne You're one away from Inquisitive badge
 
@U9-Forward I'm starting to think you're obsessed with tracking badges :p
 
9:10 AM
@JonClements hahaha, lol, i am happy with anything i find
(fixed grammer)
 
You going to fix the spelling of grammar as well? :p
 
gamification of SO was probably done for precisely this reason. Some people derive pleasure in tracking progress ^^
 
@Paritosh indeed... it's normally your own though... not everyone else's :)
 
play the game, but silently
 
That's true. I suppose that's like the gamers who love to keep track of the leaderboards though
 
9:13 AM
I wish there was an opposite of the "Legendary" badge - "lose 200 reputation in a single day, 150 times". Because unlike the Legendary badge, I'd have a real chance of getting that one :D
 
you can only downvote 50 times in a day :(
 
bounties, my friend
 
ah, those :D
what is it you look for in a bounty-worthy answer?
(/question)
 
@Aran-Fey lol :-)
@Aran-Fey haha for second one as well
@Aran-Fey You also can create sockpuppet accounts and non-stop keep down-voting your Aran-Fey account
 
@U9-Forward Click on the dropdown to the left of a specific message you want to reply to, then click "reply to this message". Like this <----
 
9:16 AM
@cs95 blah blah blah
Oh, didn't know that
thanks for the info
 
so you don't have to be like
haha (first one)
haha (second one)
 
Oh, that's right
 
@cs95 I mostly give bounties to people who post good and detailed answers on relatively simple questions. Because most people answer easy questions with less than 3 sentences, y'know? "Here's the code, copy/paste this", or junk like that. But easy questions deserve good answers too, sometimes
 
@Aran-Fey yeah, that's right
 
@Aran-Fey I've seen a discussion on this here before. Some people believe there's such a thing as "too much information"
so excessively deep dive answers are not always appreciated. Actually, I've seen that with my necroposts as well, with how people vote on them
more importantly, how frequently they are voted on, relative to the traffic it gets
 
9:21 AM
And I also restrict my bounties to questions that aren't immensely popular... because awarding a bounty to an answer that has a million views and 2k upvotes makes people think "I wish I would've been active on SO back when these kinds of questions were posted... shame I'll never get an opportunity to post an answer like this", but what I want people to think is "huh, I guess putting effort into my answers can always pay off"
 
I can only speak for myself, but some of my favourite answers on SO have been deep dives into the seemingly simple questions.
 
can relate ✋
 
yeah, sometimes we veterans forget that most people don't care so much, they just want code to copy/paste
 
I like it when an answer gives a short version, and a deeper explanation as an option
(and then theres ofcourse the answer about xml parser :P )
 
an in-depth explanation is nice for people who're interested in mastering the language, but otherwise they probably don't care
 
9:23 AM
I think it is important to gauge what people are looking for when their google search lands them on that question.
 
@Aran-Fey you mean this: stackoverflow.com/questions/7334727/…, the owner went and added some invisible text to make it enough chars
As well as:
 
i mean, its a yes no question
 
i think you can stop linking at this point :P
 
32 secs ago, by U9-Forward
And that's it
 
9:27 AM
too lazy, didn't click
 
i followed about 4 or so
 
haha, just saying most of them saying "No. <some invisible text>"
 
To me, there is nothing inherently wrong with a short answer
if the question deserves a short answer, so be it
 
I meant answers like this. It's just "here's code, take it" with no explanation. At first glance it might appear that the code is so simple that no explanation is necessary, but under the hood what you're doing is summing up booleans, and there are definitely a lot of people who don't grok that. That's the kind of answer I don't like.
 
9:34 AM
You're a cool person Aran.
 
thanks (:
 
@Aran-Fey +1 for you
Lol, +2 out of nowhere
 
another one from nowhere :P
 
2 upvotes after I said I don't like it :I
I guess I have to improve it now
 
peer pressure :-p
At least improve the styling, else I can do it too. That's just too much of a one-liner.
 
9:43 AM
One from me, same vote score as yours
I just said "Try this:"... "Output:"
 
sometimes that's all that is needed though :)
 
@shad0w_wa1k3r Lol :-), yeah
@shad0w_wa1k3r As i mentioned above in my post
i am ready to rbrb
rbrb
 
10:36 AM
just overhauled an old pandas answer of mine and it feels so satisfying
 
11:00 AM
C:\Python37\lib\pathlib.py:1151: in stat
    ???
^ interesting traceback
very useful
 
it's as surprised as you are
 
11:38 AM
cbg all
    For a newbie with C and one who has skimmed through the Cython docs, I'm looking at the source code of a library and came across a declaration like:

cdef str test(APPLE* apple,..)

Just to confirm, APPLE* is a pointer and apple is of type APPLE*?
 
If a certain module stops working when deployed on a server, are there certain things to check first?
 
the traceback
 
Cabbage.
 
11:55 AM
apple is of type APPLE*. That's basically correct. APPLE is a type defined by some earlier typedef statement. Strictly, that line should be written as
cdef str test(APPLE *apple, ...)
So APPLE *apple declares apple to be a pointer to objects of type APPLE. Without seeing other code (specifically, the typedef that defines APPLE, and anything which that typedef depends on), we have no idea what kind of type APPLE is. It could even be a pointer, making apple a pointer to a pointer, although many C coders don't typedef pointers like that without making it obvious in the typedef'd name that it is some kind of pointer.
 
@PM2Ring, thanks. To be specific I'm reading the source for Spacy and found that sort of cdef. An interesting definition can be found here: github.com/explosion/spaCy/blob/…
So, basically the token object i hope is one of the many objects created which have type TokenC*. I see many declarations like these all over: cdef TokenC* tokens where tokens is a collection type here. The type TokenC* is declaring many things.
 
12:15 PM
cbg
G'day mate.
 
cbg Frank
 
:)
@amanb So what's your final question about C?
 
Its in my previous post, just trying to understand C-type declarations
in Cython
 
@amanb Ok. I don't know Cython, but I assume everything in a cdef line is standard C syntax. I really don't like that style of joining the asterisk to the typename, it can be misleading. Eg, APPLE* apple, yam; does not declare 2 pointers, it declares yam as a full APPLE object, not a pointer to such objects.
 
yeah, i don't see inline multiple declarations like that anyway, just one declaration at a time.
 
12:20 PM
We normally don't discuss other languages here, but since this is in reference to Cython, it's perfectly fine.
 
Sounds a little bit deep for me :) I haven't dig into CPython yet
 
I started just recently and it calls for a thorough refresher on C.
 
@PM2Ring Wow, it's good reasons
 
@amanb That makes sense. Like doing 1 import per line.
 
I guess developers have their own style of writing code for libraries.
 
12:23 PM
@FrankAK CPython is the usual, standard Python. Cython is a version of Python that permits you to mix Python and C.
 
This type of declaration may not be visible elsehwere, atleast not frequently. It sure is misleading.
 
One day I will make the naming situation even more complicated by writing CPPython, which is like Cython except for C++ instead of C
 
Any good reasons we will probably need to write the function in C?
 
And then CPPPython, which is like CPython but written in C++
@FrankAK Speed mostly
 
Soga
I haven't got the chance to try it, I will do it later :)
 
12:27 PM
@amanb They should! Library code needs to be as clear as possible. Because so much other code may depend on it, you want to do everything possible to make sure it behaves correctly. Also, lots of people are likely to read library code, compared to application code.
 
Yes, agreed. Should write a feedback for the library devs but maybe more experienced devs should do that. Nobody would listen to a newb, what if they have a valid rebuttal.:)
 
Anyone who have experience in serverless?
I don't really understand the different between micro-service and serverless.
Not sure if it is good question to ask here.
 
a microservice is a design concept, serverless is managed infrastructure
serverless is kinda like PaaS (Heroku, Cloud Foundry) but instead of an entire app, just a function
 
Soga
 
when people say 'serverless' they're often talking about AWS Lambda but other cloud providers like Azure and GCP have their own versions
 
12:36 PM
I see, Thank you bro :)
 
cabbage
 
1:21 PM
argh, firefox wiped my extension database... there go all the userscripts I wrote in the browser and never saved to disk :(
 
Ouch!
 
It might finally be time for me to upgrade from 3.6... My annoyance at having to write an equivalent for subprocess.run's check_output param is greater than my annoyance at running a Python install wizard
I've never used subprocess in a context where I actually cared about the result beyond "did the process exit with code 0?" but now I need to have, like, diagnostics and junk
Or else my coworkers will be like "wah, the log file just says INFO: something bad happened, bloo bloo bloo"
Those darn coddled millenials. In my day we didn't even have log files (because I didn't bother to make one)
 
2:04 PM
There, I've upgraded. Now I will cross my fingers that the client's machine also has 3.7.
It's not yet clear that they have Python installed at all. But actually that's a better-case scenario than having an old version installed. The red tape required to install new software is substantially less onerous than the red tape required to upgrade.
 
2:19 PM
The software i'm dealing is stick to 3.3.. not even bothering to upgrade -.-
but then i'm just new to python, as I don't exactly know what new versions have that 3.3 doesn't.
 
For the most part, me neither. Until I try to use a parameter, and it doesn't work, and I confusedly read the documentation until I see the "new in 3.7" footnote
 
Oh, and dataclasses. But who cares about those?
 
I'm mildly interested in using them.
 
2:35 PM
3.6 has f-strings. And dicts that preserve insertion order.
I suppose the sensible thing to do is to look at the What's New pages, like docs.python.org/3/whatsnew/3.4.html
 
I wanted to look up when f strings were introduced, but raw.githubusercontent.com/python/cpython/master/Misc/HISTORY stopped updating last year and AFAIK there's no other single document I can ctrl-F through
I guess I could google f strings site:https://docs.python.org/3/whatsnew but historically that hasn't been as successful an approach for me
 
3:27 PM
@Kevin f-strings python being up the what's new as my first result, closely followed by the PEP that has it listed for inclusion in 3.6, as well as a link to the docs further down, where it is listed as 'new in 3.6'...
 
3:45 PM
Mm hmm. It's usually less effective for older features, in which case the desired "added <Thing X> to the language" page gets swamped by results like "moved Thing X from module Y to module Z" or "fixed bug where Thing X wouldn't work in <obscure case Q>"
 
I still need to see the killer app for dataclasses
Like, I'm sure they're useful, just like stacks and queues, but I don't use those every day either
 
4:07 PM
morning cabbage
 
cbg @Code-Apprentice
 
Here's the Marcus King Band from South Carolina, doing a funky soul number titled Homesick. Marcus normally plays blues / blues rock / Southern rock, but I guess soul is part of the Southern sound.
 
4:45 PM
My laziness has paid off: Months ago, I never uninstalled my "hide SciFi and Movie questions on the Hot Network Question sidebar" userscript, even after Infinity War spoilers stopped popping up. And so I am now protected from Endgame spoilers* without me having to do anything.
 
at least now that mods can un-HNQ questions there's a chance for spoilers to be caught early and kicked out of there
 
(*I assume that the HNQ contains a spoiler, or will in the near future. Obviously I cannot confirm this.)
The Scifi and movie communities try to avoid spoilers by phrasing their questions as "why didn't Ant Man defeat this particular character by crawling into his body and expanding?" which technically does not tell you what happens, but still reduces the probability space of all possible plots
 
@Kevin you could confirm by disabling your blocker...
 
I have looked into four million possible futures and I don't do that in any of them
Mods, please disable the question title duplicate detector on the SciFi site so they can write posts like "why didn't this character do this thing to this other character by doing this thing?"
Anime fans may be familiar with this kind of sentence structure, since "I'll have to use... That move!" shows up in 90% of all action shonen
 
Random question: what is the Python equivalent to NA in R?
 
4:57 PM
@Kevin How come in those possible futures, you didn't read someone replying with a spoiler like "duh, everyone knows Dr Strange went back to 1998 and had Marvel decide to never make another movie."
 
@Code-Apprentice python? None. Pandas? Various.
 
or more accurate to my use case: what is the numpy equivalent to NA?
 
Sometimes I use float("nan") in contexts where I require a number-typed thing that isn't really a number
 
@Code-Apprentice with numpy, a masked array
 
There isn't a nan int or bool or anything though
 
4:58 PM
np.nan can work for doubles but nan is weird and often not what you want
 
hmm...
 
@toonarmycaptain I focused my third eye so I could only see a specific volume of spacetime in the future where spoilers are not likely to appear. In particular, the interior of a safe in my study where my future self will deposit a note saying "yes, I disabled my blocker" or "no, I did not disable my blocker".
 
>>> x = np.arange(3*4).reshape(3, 4)
... y = np.ma.array(x, mask=x**2 % 3)

>>> y
masked_array(
  data=[[0, --, --, 3],
        [--, --, 6, --],
        [--, 9, --, --]],
  mask=[[False,  True,  True, False],
        [ True,  True, False,  True],
        [ True, False,  True,  True]],
  fill_value=999999)
>>> y.sum()
18
most but not all of numpy supports masked arrays
 
A sufficiently determined troll could break into the safe and write "Zombie Stan Lee defeats Thanos" but this will only happen in one trillionth of all possible futures, so only looking at four million futures means I'm reasonably protected
 
@AndrasDeak I'll check that out to see if it works for my use case
why can't I just put None values in an int array? ;-(
 
5:05 PM
fast arrays, heterogeneous arrays: choose one.
 
Because the point of numpy arrays is homogeneity. That's the basis of both speed and memory.
 
@Kevin Well, the troll would be wrong, because Thanos is obviously St Theresa of Avila reincarnated ;)
 
oooo...rpy2 declared some constants that will probably be more along the lines of what I want: rpy.sourceforge.net/rpy2/doc-2.4/html/…
 
I suspect that Zombie Stan Lee would have trouble defeating any reincarnated saint since they are likely to have the ability to turn undead
 
What if there's no oxygen?
 
5:21 PM
saints get all manner of abilities so it wouldn't surprise me if "doesn't need to breathe" is among them
God is quite high up in the Marvel Cosmic Beings ranking so if He decides that one of his Earthly representatives should win a fight, there aren't many ways to avoid that outcome
I think "Stan Lee, incarnated in the very universe that he himself created" is a peg or two down the power chart
 
5:40 PM
@AndrasDeak I'm confused. How come that isn't mask=x % 3 ?
 
Hello all, I am looking for some help in stackoverflow.com/questions/55872476/…. Can someone suggest ideas on how to do it
 
@PM2Ring I just wanted to write something there.
 
@AndrasDeak Oh, ok.
 
I was going to write something like x < 5 but then I wanted to spice up the pattern, didn't even think about what the result would look like
 
@coolarm I guess there aren't any Jinja experts here right now, but some of the regulars do know about it.
 
5:55 PM
I don't know anything about Jinja but after a perusal of the documentation I see Environment.parse, which takes a jinja template and returns an abstract syntax tree. Perhaps you can iterate over that tree and detect loops that can be unrolled, and then unroll them, and then turn the abstract syntax tree back into a template.
Even if you know what you're doing (I personally do not), this is probably a fairly difficult procedure
 
Things were looking pretty bleak for the Physics.SE mod election. But we finally got a few nominations. And who knows, we might get more in the next 2 hours...
 
@Kevin This idea does look interesting.
 
user10984358
hey, quick question, I have been recently learning python and I believe I have some intermediate level of understanding on it other than Django, flask where should I look for learning more??
 
user10984358
well I consider object oriented concepts, iterators and a tab bit of functional programming concepts like map, filter to be intermediate, if that helps
 
Trying to remember what I did when I was in that stage. Mostly, I think:
- Watched Stack Overflow for questions that were slightly too hard for me to answer, then tried to find the answer.
- Browsed through Python's Library Reference and Language Reference, largely at random, looking at chapters that seemed interesting.
- Read Python entries on the Code Golf stack exchange, but kept in mind that many of the techniques used therein should never be employed in production-quality code
- Worked on tiny personal projects that interested me
 
6:09 PM
@Kevin Concur with the last suggestion. Its all about a project objective. You will learn on-the-fly
 
@TheNamesAlc It depends on what you want to do. If you want to write programs that have a GUI, you could learn a GUI library, eg Tkinter if you haven't done GUI stuff before, or maybe Qt or GTK if you want something more powerful (wirh a bigger learning curve). Or if you want to do number crunching, learn Numpy.
 
This was something of an osmotic process. Basically I positioned myself in environments with a greater concentration of Python expertise than what I myself possessed, and waited for the knowledge particles to cross the thick barrier of my skull.
The problem with osmosis is that you'll get gradually better at many things at the same time, but it will be a while before you're super good at any one thing.
Not the ideal state of affairs if you're goal-oriented and you want to measure your programming ability with a checklist of Things I've Totally Mastered
I'm as goal-oriented as a phytoplankton so I don't have much advice for that mindset
 
user10984358
6:36 PM
@PM2Ring hey actually I have done basic tkinter stuff, a normal window that can browse and display images with buttons that do stuff
 
user10984358
@Kevin well that was what I was looking for, even if it is a borderline project, I just want to do something that is conceptually perfect rather than use case ready
 
user10984358
I have had basic courses on python in my uni, I had taken up basics on opencv for python, basics of data science using pandas and Matplotlib, I dont really know where to go from this point
 
It may be helpful to think about what your long-term goal is. "I want to write the pattern recognition engine I've always dreamed of", "I want to get hired by a trendy startup and collect fat paychecks", "I want everyone to treat me like the wise guru on the mountaintop", ...
 
user10984358
hey, I want to do web scraping
 
My goal is approximately "I want to encounter and possibly solve lots of fun puzzles" and I get a good amount of those from SO and Code Golf and occasionally my subconscious
 
user10984358
6:51 PM
recently I just got some codes off of here and did some mods and added in a gmail api, all this to check if the tickets to a certain movie was open or not, i really liked what I was doing, so I want to be able to do more in this
 
user10984358
requests library, beautiful soup I guess
 
requests and BeautifulSoup are certainly very good libraries for web scraping.
 
user10984358
other than that I have no clue on where to go, I know docs are the place to start
 
user10984358
my goal is tbh get fat paychecks but this is something that makes me well "into" it
 
What else is good to learn for that field... Selenium is good for scraping sites that dynamically populate content with Javascript. Understanding the theoretical basis of Tree data structures is good because HTML is essentially a tree. You might try to learn enough regex to understand why 99% of the time it shouldn't be used to parse HTML, and how to identify the 1% of the time that it's useful.
 
user10984358
6:56 PM
so regex is not the go to way then??
 
user10984358
when I did what I did for my "scrapper" all I did was write a regex and based on the result I sent an email
 
Regex is a sharp and shiny saw that is excellent at cutting, and everyone tries to use it to pound nails
 
user10984358
what other ways are there??
 
You might use regex to find all instances of "your movie will begin at [some time goes here]". You don't want to use regex to find all <span> elements on the page.
 
user10984358
so what I have gathered from here and from my own is that, I stick with requests and BeautifulSoup and go with selenium ??
 
user10984358
7:00 PM
is that more than enough to get me a fair idea??
 
user10984358
using which I can do better scrappers?? what would you suggest I try first?? requests or ??
 
Use requests and BeautifulSoup unless you have a good reason not to. One possible good reason is "the data I'm trying to access isn't on the page until it gets fetched by asynchronous javascript". That's when you use a more specialized tool like Selenium.
 
user10984358
I just put the code in an invite while loop and ran it in a terminal
 
user10984358
infinite* it breaks when I an email is sent, I just want to make it more perfect
 
user10984358
like for all movies I want using a GUI
 
user10984358
7:04 PM
I have some idea now lol
 
user10984358
so Selenium it is, thanks @Kevin 😇
 
user10984358
I guess my vacay is not gonna be boring after all, also to anyone reading this in the future you are free to suggest me anything as well
 
user10984358
good day y'all!!
 
7:34 PM
cabbage
 
8:09 PM
cbg
 
cbg
Is it bad if you have to comment every other line of code so people who aren't programmers don't break it in the future?
 
@RobertFarmer Might be easier to make it read only?
rhubarb all
 
do people who're not programmers care about comments?
that seems like a bold assumption to make
 
doesn't altering source code make one a programmer anyway?
 
I made them because tools used in teams tend to get shared with other teams to make their lives easier and someone somewhere overwrites or tries to change and edit the code. Which is how I got my Internship.. They had VBA Macros running reports and another Department changed some stuff and it all went poof for awhile.
 
wim
8:21 PM
cool, shlex has a tokenizer for __main__. try it out with python -m shlex
 
Now they have my code which runs it in Python.. It isn't pretty I'll admit but it does the job in two minutes or less.
 
I was at PyTexas recently and there was a talk relating to code commenting. I was surprised to learn that some people take comments in code seriously and have strong opinions about when and to what extent one should comment code. I personally comment anything that I think might benefit from any shred of added information. I learned from the talk that some people will think a person is stupid if they comment everything in their code.
 
x = 5 # set x to 5
 
x = 5  # set x to 6
ftfy
 
Wait what.
 
wim
8:25 PM
these are the same kind of people that have commit messages like "myusername - updating thefile.py"
 
and/or comment code out in case it can be reused in the future
 
haha, the first hundred or so commits I made to my github simply said "update" but I add a little more detail lately
 
My Professor said he would Crucify our GPA if we did that,,
 
@Dodge The code itself should explain what the code is doing. Comments shouldn't do that, unless you're using an obscure feature of the language. Comments can be used to explain why the code is doing a particular thing.
With well-written code and good class, function, and variable names, even that shouldn't be necessary most of the time, unless you're implementing algorithms that aren't immediately obvious. But IMHO it's good practice to have "section heading" comments, to help readers navigate large source files.
 
I mean Ill put it up on Pastebin yall rip me a New one if you need to. Any input really to help make it more efficient or even just clean it up and make it work better would be good.
 
8:37 PM
@PM2Ring Been listening to The Marcus King Band all afternoon on my headphones, good stuff...
 
pastebin.com/NZDtREis. There you all go hit me with the C&Cs.
 
@Dodge Excellent. I'm really impressed by them. They just did a couple of gigs in Australia, but I only found out today. Oh well, maybe they'll be back in another year or two.
 
@PM2Ring With respect to the commenting, I know what you're saying is true but until idiomatic code flows freely from my fingertips, excessive commenting is probably my best hope for understanding things later on.
 
I'll admit for a project I've excessive commented so that i remember where I leave off but sometimes I need it to be able to just return to a Project X time down the line.
 
8:44 PM
@wim so many edits ;)
 
I've also heard about the big fuss with variable names which is something else I don't get. I just use a nice descriptive name, could be five words, who cares... It's used once and it's gone. Apparently some people legitimately struggle to name a variable.
 
Variable names imo should atleast grasp the concept of what your naming
 
@RobertFarmer I find that generally, the hardest part when going back to code I wrote before (and currently while reading that) is figuring out wth I was trying to say with my variable names.
 
I can agree with that. Sometimes I ask myself why i chose that name.
 
in that place, while I arguably have no idea what the domain is, there are a lot of two letter variables, that could use longer name, and possibly that would circumvent the need for any comment
 
8:49 PM
generally If i don't know what is going on with the variable I try to use names I wont repeat like "loop_counter" or "var_a"
 
@Dodge Understood. Too much commenting is always better than not enough. And when you're using some new language feature verbose commenting can be helpful to keep things straight, as long as you keep the comments in synch with the code. ;)
 
00:00 - 21:0021:00 - 00:00

« first day (3117 days earlier)      last day (1846 days later) »