« first day (3544 days earlier)      last day (1629 days later) » 
03:00 - 22:0022:00 - 00:00

03:21
How can I import database.py from index.py?

crawler/
   __init__.py
   index.py
   database.py
04:06
cbg
04:18
cbg
04:56
from . import database or from .database import whatever
import database will not work?
It might work depending on how much you screwed up your setup, but you shouldn't import it like that in any case
If all your stuff is neatly organized in a package (crawler in this case), you want to import everything from there
__init__.py is still empty?
*shrug* doesn't really matter
I just have a main folder and save all modules there, need to understand packages
05:24
@Aran-Fey cannot import name 'database'
I hate python's modeling rules! I:
It's fixed. Thanks.
05:53
Oftentimes our frustration arises from a lack of understanding of the concept, but we take that frustration out on the concept itself when we should instead channel that frustration into motivation that drives you to figure it out
06:10
Hey guys anybody know how to get a query to actually pass to jinja template? running a simple print in app.py shows I am receiving the expected data from sql, however it doesn't seem to be passing into the html template
dpaste.com/0BP4FA3 thats the relevant html and here is the relevant py dpaste.com/0JKN6H8
I believe the issue lies in where I am passing the information back to the template
I don't know flask, but you have a bunch of render_template calls without a return and that doesn't look right to me
@Aran-Fey and that would be it
cant believe i missed that :/
oh cool, @JonClements is moderator again, I missed that
06:26
@cs95 Yup, the pupper is back!
In somewhat related news, another moderator election is scheduled.
is the schedule out? I realise this one's delayed a good 2 months since the last, the nominations for 2019 began in April iirc
Nominations begin in 8 days
I suspect we'll start question collection tomorrow or very soon.
heh, 2 open positions. They have more shoes to fill than that.
pretty big shoes, at that
Yes... But we can't train more than 2 people at once.
How about this, fill in 4 positions for the election, then stagger their instatement into office. Of course you folks have a better idea of how to do things but at the moment it really seems like y'all could take all the help you can get
I can't imagine how understaffed the queue is right now
06:50
We do okay, actually. There's a lag time, but stuff doesn't fall through the cracks.
More help is good, but we'll be far more overwhelmed by too many new incoming mods.
It's possible we may call up a third-place runner-up a few months after the election, depending on how things go. There's precedent for that.
@CodyGray Neat, glad to hear (about y'all being able to manage OK). Are there any users in particular you're looking forward to seeing running this time?
@cs95 Yes, of course. :-)
Ah, well. Good luck to them if they run. I dunno, the title of "Stack Overflow moderator" has lost a lot of its shine for me, after last year. But they've started their redemption arc now, so to speak. Let's see how it goes...
I wouldn't quite call it a "redemption" arc... Things are a bit better, but still have a long way to go.
A lot of the people I want are struggling with whether or not they want the job, which I completely understand.
Being an unpaid employee for a boss that can lay you off at any time on their own prerogative would deter any reasonable human
Oh and don't forget, unpaid severance with a side dish of possible slander, now that's a recipe for disaster
07:00
@cs95 To be fair, that's always been the status of a SE moderator.
cbg..
until now, you could convince yourself that you'd be serving the greater good. I wouldn't be able to tell myself that now and reasonably believe that
@cs95 I still believe that.
Depends on what you consider the "greater good" then, right? Is it the knowledgebase you are fighting so desperately to protect, or the evil overlords (this is a joke, please) who want to do away with it
How do I insert a polygon data into postGIS?
poly = data_dict[polygon_data]
    cur.execute("INSERT into  public.test(timestamp,polygon) values (now(),poly);")
07:04
to me it's still the former.
This one does not work :-(
@cs95 The community. I was elected by the community, I'm here because I believe in the community and the site's original mission, and I answer to the community. I'm here to serve the community and to facilitate working towards the original goal of building a high-quality knowledge base. I'm not a representative of the company. No moderators are.
If I manually give each polygon co ordinates it works but when I pass it via a variable it failes
If any of the moderators are half as dedicated to their job as you are, I'd say the election was a success. Keep it up, the heroes our community needs but doesn't deserve
correction, the hero community deserves, not the company :-)
I wouldn't call myself especially dedicated. There are some far more dedicated than I.
07:57
Light theme gang, what do you think? aran-fey.github.io/programming-guides/readable-code.html
light+friendly looks good. is it on purpose that theme+codestyle can be chosen independent of each other?
btw, thanks for your input on the 622 topic, chat ate my reminder but the main site told me this morning =)
After investing ~15 hours into writing the theme switcher, I couldn't be bothered to invest even more time into making syntax themes dependent on site themes. Conclusion: Yes, totally intentional :D
I can't do gif editing, but imagine this with a text switching from "limitation" to "feature" in sync with the transformation as my answer
It's a blog. Does it really need to be extensively customizable?
Well, let me put it this way: I got more complaints about the syntax highlighting theme than positive feedback about the things I wrote
@Arne No worries, what you lack in image editing skills we make up for with imagination :P
08:12
@Aran-Fey That's a good sign: it means your content is up to snuff and people are complaining about trivialities.
You're right though, I wouldn't have bothered if it was only for the website. I'm also planning on using it for my documentation
08:32
Do you Pythonistas use Doxygen?
I think most of us are in an abusive relationship with sphinx
Ah, I see. I've heard of that, but never used it.
@Aran-Fey not sure if it is my browser or I missed something but clicking the "sun" button lets me toggle both dark and light mode, whereas the moon button only lets me select dark mode
but that is a cool site, I guess I can use your guide for Project Structure
huh, nice find
Windows 10 and Chrome if you want to replicate, if it is the issue with your css
08:56
aaaand it's fixed, thanks
In my mobile firefox it is was the other way around
Probably the same bug - the default theme depends on your prefers-color-theme setting
The standard [Aa] is a bit confusing for me, because it doesn't touch text colour
Gotta run, but let me know if the bug still exists
No, fixed for me
08:59
its fixed for me as well, that was fast
 
1 hour later…
10:28
is there a way to test an implicit request being sent by a function?
as in accessing the request contents like json and the url
10:44
@aaaaa please don't ask for help here with fresh questions on the main site as per our rules.
11:01
@AndrasDeak Noted, but unfortunately I don't know how to make it clear that those buttons only affect code (at least not without making them 3 times as large)
Yeah... I wonder if replacing [Aa] with [def] would help... but at least on desktop there's a tooltip
Unrelated, but I seriously need to stop writing bug reports. The number of times devs have responded with "that's not a bug" is staggering
Well...better to be safe than buggy :)
You can reword them to ask if they are bugs
@Aran-Fey Ugh. That's a sure sign of an insecure dev. I get tired of that response, too.
Even if it's intentional design, the fact that you thought it was a bug means that there's a UI/UX bug.
No need to ask - that question was answered when they removed the "bug" label and replaced it with "question". Even though there's not a single question mark anywhere. Anyway, mini-rant over.
11:09
@Aran-Fey btw you can use the system theme variable as default, so like if someone on phone opens your website, and they're using system wide dark mode then your website will be in dark mode
It already does that :)
oh weird, I was on my phone and got light mode but it's dark theme always
If you've selected a theme before, it remembers your selection. It only checks for light vs dark mode the very first time you visit. Maybe that's it?
@Aran-Fey that's probably it if cookies are shared b/w computer and phone in chrome
I'm not entirely sure how it's stored to be honest. I'm using localStorage, no clue if that internally uses cookies or what
11:47
How can i run something like:
if(isset(self.player_main_frame)): ?
I want to check if self.variable_name exists.
It'd be if hasattr(self, 'variable_name') but it's very rare you really want to be doing that...
I have seen three questions related to django/drf nested serializers, all of them are more or less same. I have answered one of them and it hasn't been accepted, since OP is offline and hence I can't flag them as duplicate. So would it be good to answer the rest? and one more thing it okay to ask these type of questions here or should I avoid it in future.
12:12
We don't mind questions about moderating SO, feel free to ask
To answer your first question: If the questions are similar enough to be closed as duplicate, try to do that. If you're having trouble reaching the required number of close votes, we can help you out. But if, for any reason, the questions aren't closed as duplicates, go ahead and post your answer on every one of them
Err... best not to post identical answers to multiple questions... they're likely to be deleted... if they're not quite dupes then tailor as best you can the answer to each question
@ChrisP .winfo_ismapped()
Unless it's created but not yet visible (then use .winfo_exists() )
And to answer your question which you pinged me about: As I stated before no Minimum Code Example then I cannot help
Thanks :)
12:29
how would I go about testing a function like:
def discord_genius_logger(song: str, artist: str, g_stripper: Optional[str]) -> None:
    """
    sends message to Discord server when stripper resolved using the backend.
    """
    url = f"https://discord.com/api/webhooks/{os.environ['DISCORD_URL_GENIUS']}?wait=true"
    title = f"Genius Stripper for {song} by {artist}."
    if g_stripper:
        desc = f"Found! {g_stripper}"
        color = 3066993  # green
        lyrics_url = f"https://genius.com/{g_stripper}-lyrics"
    else:
        desc = "Stripper not found. Sad!"
I was thinking if I could access the json, then I could test it is being formatted correctly. But I am not sure how to do that, or even if it is possible.
@Aran-Fey yeah, dupe answers are not welcome
If the questions aren't duplicates, then what's the problem?
@aadibajpai The details depend on the testing framework you use, but essentially you have to monkeypatch/mock requests.post
@Aran-Fey I am mocking requests.post but how do I access the attributes?
the test runner is pytest but the old tests were written in unittest so I am following that
Which attributes are you trying to access?
@aadibajpai I'd recommend factoring out creating and sending of the data. You should test only the former.
12:40
@Aran-Fey I'd like to test the json that the request sends
not sure what else there is worth testing
@MisterMiyagi so a separate function that creates it and I test just that?
I was thinking of capturing logs and testing that, but can't use pytest caplog fixture with unittest :(
@aadibajpai So replace requests.post with a function that accepts url and json parameters and validate the input in there
@Aran-Fey what do you mean? like when patching it?
@LinkBerest i just use a try stament.
Like this one:
https://stackoverflow.com/questions/15059212/checking-if-a-variable-exists-in-python-doesnt-work-with-self
@aadibajpai yes. When you have to jump through hoops to make a test, that is often a good sign that the function does too many things.
def test_discord_genius_logger(monkeypatch):
    def fake_post(url, json):
        assert json == {}
        return FakeResponse()

    monkeypatch.setattr(requests, 'post', fake_post)
Something like that
12:49
@MisterMiyagi oops I've been jumping through a lot of hoops
@Aran-Fey I see, let me try doing this with mock
13:06
@ChrisP I was talking about earlier, not linking as it's hard on mobile, note: that will check if the variable exists but not if the frame is visible
btw is testing generally easy or is it like tedious for everyone?
I never look forward to writing tests
it's tedious, but can be very rewarding. either through shiny "100% coverage" badges, or because your code has a lot less regression than it used to have.
13:22
yeah when writing code that 100% coverage badge does offer some peace of mind but when writing tests I keep getting ideas on changing stuff that I end up not getting around to.
I vastly prefer writing tests over debugging the smoldering, unmaintainable remains of a production system. That is a huge motivation boost for writing tests.
writing tests front load the cost of debugging later to early on, and they will pay dividends when you eventually need it
like now I'm thinking I should ditch unittest asap and move everything over to pytest, but that seems very time taking
I still write all my tests with vanilla unittest module to ensure compatibility/portability - my projects can still be tested with pytest (and for the most part with 100% coverage)
yeah but you can't use fixtures with unittest—I'd have loved to use caplog to test statements that get logged but well
13:30
I've built my own fixtures on top of unittest, and for one of my projects I have a context manager for dealing with capturing logging outputs
if I am going to use a library for testing, I would look into hypothesis
13:41
When i redraw a canvas table (43 rows, ~20 columns) the grid output it's quick.
But if i also run a method which is called periodically and changes another canvas (no tables inside), the grid output of table canvas method is piece by piece.
How can i speed up this?
I try to include the periodically method in threading, but no speed up.
0.0
Any idea why cant i find boot from device in Advanced StartUp Option? :/
it was there till yesterday :(
Is it in bios settings?
It should be
not in bios
the advanced startup thing
in grub loader?
13:51
This one?
https://www.lifewire.com/advanced-startup-options-2625805
yea
i cant see the "Use A Device" option
You've already booted into Windows at that point.
ooo
but last time when i had a X64 in my pendrive, i saw that option and had no prob :/
but this time i had x32 (my pc is x64) and the option vanished
like in that image, i cant see "Use the device"
it says u need to have UEFi, but if i could do it trice, why not now? :/ searched google a lot :'(
Hmm, I wasn't aware an option like that existed. Are you sure you copied the OS onto the pendrive correctly?
Did you check out "Troubleshoot" to see if the Advanced Options enable that?
I've been handing out downvotes on poor answers like candy
either I've been spending more time on the front page or it's worse than ever
@AndrasDeak except people like candy :)
@AndrasDeak It is, random low quality posts reach hnq status so quickly
@AndrasDeak Same here. There has been a lot of low-quality posts lately.
Most importantly, I feel like there has been an influx of outright harmful advice.
summer vacation with nowhere to go -> people pick up that one hobby they have been avoiding for so long
lets be nice and welcoming, mkay?
15:05
Collecting stamps, collecting downvotes... varietas delectat
@Arne yes Mr Mackey!
@MisterMiyagi how do i do that
oh that
yea its not there lmao
@Aran-Fey yea i did
Wow at all the fallout for changing " Strunk & White Standard English" to clear and understandable English...I kinda feel like commenting that if they're going to have "English" unqualified as "American English" they should change all the spellings to English spellings... colour, 'ise' for 'ize' etc.
I don't take offence easily at all, but I do get a little irked when people comment on my English...when I'm English, and they're not (and wrong, lol).
@toonarmycaptain Context? Who changed it where?
@AndrasDeak github.com/python/peps/pull/1470 - and there's a whole lot of back and forth involving political stuff on python-dev.
"typo" – user tries to install a package that is deliberately not installable. stackoverflow.com/questions/62640592/…
@toonarmycaptain ah
15:29
People now started suggesting raising a ticket with the maintainer to "fix" the installation...
I have no issue with the change, FWIW, it makes sense not to stick to the most formal of writing style guides in favour of clarity, which is the goal, but...who decides whether something is clear? And as far as I understand many people using English as a second language learn British English, so it makes some sense to use that, if they're trying to be clear to them.
I weighed in on that on python-dev, not because i thought it was a bad change but because i thought the commit message was unnecessary.
I'm using the following line as an element of my `urlpatterns` in Django 1.11 (yes, I know) with Django-rest. When I try to access the URL I see the error in https://pastebin.com/t8mmhTaS and I'm clueless (as some of you already know).

url(r'^licenses/(?P<pk>[a-zA-Z0-9]+)/events/archive/$', views.archive_license_events, name='events-archive')
Why is Django complaining that "decorator() got an unexpected keyword argument 'pk'"?
15:56
@holdenweb what's the function signature for views.archive_license_events ?
Good question. It's decorated with @api_view, and is currently

@api_view
def archive_license_events(request, **kwargs):


I have previously attempted

def archive_license_events(request, pk):

with similarly disappointing results.
Bingo! I have to CALL the decorator! Thank you all for your services as stuffed bears (and especially to you, Jon, happy to see you!)
Yay... happy to be your rubber duck... and yes, it's been a while, how's things?
Chugging along. Starting three days a week for my current post, going down from four, and casting about for writing opportunities and mentoring. And your good self?
Keeping relatively occupied thanks...
if it's not a spoiler - what've you got in mind writing wise these days?
cbg-evening
quick one to the rubber duck god: why a function is being called correctly on some part of my codes and on some other parts, I'm calling it and the function is not replying back?
16:14
@AndyK we need an MCVE
one sec... I need to charge my crystal ball :p
presumably some parts of your code have a bug
@JonClements +1000
@AndrasDeak issue is I have no idea where. I've put a print before and after the function called and the print appears on both occasion
Nothing for myself, but I saw an interesting data science blog where the software was a bit cheesy, and it turned out they were looking for writers so I put in an application. Also I realised that quite a bit of what I wrote in "Python Web Programming" would still be of value to a modern audience, so perhaps some blogs.
@AndyK I also have no idea where
16:16
and it says It is decidedly so... oh hang on... I think this is the wrong ball :p
@AndrasDeak at least, you are replying to me, the code does not. XD
@JonClements I need a punching ball, this is the kind of ball I need actually.
@AndyK why not set a breakpoint on that function and then trace it through?
@AndyK What constitutes "not replying back"? If you are seeing the prints, the function clearly returns. Is the logic dropping off the end, returning None?
@JonClements mmh that's an idea
@holdenweb actually no None. the function does not display any text
But you have a print before and after, so the function returns. So why do you say it's "not replying back?" What is it NOT doing that you want it to, please?
This psychic debugging can be quite wearing.
16:22
@holdenweb Holdenweb, the function should be displaying a string like 'You lose play again'. Here the function is not displaying that string. Yet, in other part of my code, when I'm calling the function, it is displaying correctly any string I want.
so the problem can be the follwoing:
1/ The function does not do display correctly
2/ if the function does not display correctly, why does it work in other part of my code?
so yeah... that hint about an MCVE and psychic debugging can be wearing... - they umm... hit home yet? :p
OK. So put prints inside the function to verify that the logic is doing what you expect. Clearly you have misunderstood some aspects of its operation, even thought you wrote it yourself (a daily occurrence for most programmers). So you ave to extract the information piece by piece: Am I setting that value to what I think I am? Does the input parameter have the value I expect? It's foolish to expect someone who hasn't read your code to understand what's going on.
@JonClements soz folks, I was more thinking out loud rather than really asking for your help. that code is not complicated but as i've inherited, I need to sort a few things before.
@holdenweb good points.
does google cloud run support windows based containers?
I certainly sympathise with the thinking out loud. A problem shared is a problem halved, they say.
16:27
@holdenweb ty for the heuristics btw.
A good debugging IDE speeds the process up by letting you easily set breakpoints and examine variable values, but the process is the same.
@harveyslash how does that relate to python?
I am trying to run a python server
on google cloud run
but its throwing an error which I am unable to understand
@AndrasDeak I did not dare to ask.
16:57
Hi, I wanted to perform a bulk_update_insert kind of thing in django. I asked on IRC #django and I got to know that it's not available in django.They told it's called upsert and refered me pypi.org/project/django-postgres-extra .I went to the docs but I 'm unable to connect
Can someone help me with my code?
I want to make the update_or_create classmethod to work like bulk_upsert
dpaste.com/339JWWC and sorry, I forgot to tell I 'm using postgres
Well, the user will upload the file(a text file which is unstructured csv), I pick out the values with python basic list reading and once done convert row to a model object and push to database. The first classmethod is for what you might know as populating the database and second to update it.
update in above line meant insert if key not present else update.
key is a composite key
I'm not sure if models.UniqueConstraint, is present in this package since unique_together is about to be deprecated.
17:47
I am currently trying to deploy a python app with compiled source code. I run 'python -m compileall .' and the files get generated in the cache directory...but how to I package this for deploying on another computer....? Trying to not use pyinstaller because it is a pain and causes too many runtime erros
I know one way. Download python embedded installer and use that
wim
wim
Hello all! I will not be contributing in room 6 until there is some kind of triage from the Python ROs in MetaPython. It's a serious complaint and I was not just blowing off steam.
Doing this if your python can run on that system then your work is done and you do not need any installation of python on that system
This was for @user2337757
I had and even might have an example.
Please respond if you are interested to know how.
3 GB to install Anaconda? OMG
miniconda is smaller
18:02
hmmmm it doenst have those packages which i dont know if i need so i ll take in the whole reptile into the system
I want to make a simulation of a water flow and the special module is anaconda depended Panda depended all that
thnx
how are you all installing your python apps on other machines?
I have been using miniconda and move the env over to the machine
I wanted to deploy with compiled source code for my app code only....anyone do this?
I said I had done this
you only require python embedded and get-pip.py
and a .bat script, or whatever that is called on linux
@user2337757 Erm, are you sure compiled bytecode is what you want? It's almost equivalent to shipping the source, just less portable.
Hi. When I try to insert a new row in my sqlite table I get this error:

Caught an error: unrecognized token: "!"

Does anyone have any idea what's the problem?

https://gist.github.com/hamedgasemi200/7e5d373b819f8f3f75df571aa05259e7
It was working correctly, but when I made a database class I got this error!
@user2337757 pull python3 from the system package manager, create a venv, install the package via pip, done.
18:20
@X4748-IR The first thing they (should) teach you about databases is that you never ever create SQL queries with format
@Aran-Fey What do you mean by format? You mean that's the problem?
Flag description: "A problem not listed above. Try to be as specific as possible." Writing two sentences: "too long by 36 characters". I'm done with flagging for a while... :/
@MisterMiyagi I am deploying on customer systems and would like to hide the source from them at least a bit...I know it can be decompiled but just trying to add some protection
@user2337757 Alright. Just be aware that you are buying this minor protection at a huge maintenance cost.
@X4748-IR The str.format method. And yes, it's most definitely the problem. Check out the documentation for your database module, they'll show you how to do it right
18:40
@MisterMiyagi are there any other things I can do other then just letting the customer have the source?
@user2337757 If a weak protection is fine, just zipping the source might be enough. Python can natively run code from a zip archive.
@MisterMiyagi comment flag? Or post flag? The latter usually allows enough characters.
@MisterMiyagi unzipping is a bit easier than decompiling ;)
@AndrasDeak Comment flag. There's a comment discussion that has culminated in a github ticket to complain an un-installable package is un-installable.
Yeah, those are limited
18:56
@AndrasDeak zip + rot13 encoding, then? it's all pretty weak protection.
Anything that my mother can't undo will work
19:24
Voting Philosophy: How to handle a question that is answered by the description of its own tags?
@MisterMiyagi I don't understand
Aaah...that's not a flag thing, that's a vote and close thing.
Basically an RTFM variant, right?
It's kind of RTFQ, in a way.
Then perhaps I don't understand after all...
If OP should know better or just google it, downvote. If it's so trivial that you can't believe that's what they're asking, close as unclear.
19:40
it is a bit scary that sometimes you want to do things where there is only documentation for that package. Its not like you are learning through tutorials for example in Matlab. You have to go through the documentation ... for that package
Do you think Py packages are less documented than Matlab?
I think they just mean a specific package they have to work with. Mainstream third-party packages tend to have excellent documentation
if you want say Pywr that is not being used from a lot of people so there are not so many resources to play around
(and by "excellent documentation" I also mean tutorials or at least a lot of examples)
19:44
@AndrasDeak probably smth like Pandas will have an excellent documentation
No matter how decent a library specification is, that's usually not an easy source for learning. You'd have to be very good at the language itself, and even then it can be really difficult.
@ExoticBirdsMerchant yes, as I said, mainstream
Tutorials is an unofficial part of the docs, they are useful but don't come in the mojority of times from the authors
Jun 25 at 22:12, by Andras Deak
@rodrigarco mainstream python packages tend to have excellent documentation. The more niche your package is, the more of a gamble it is whether its documentation is up to par.
so i shouldnt use the documentation ... ill check if there is anything for Pywr i want to do some simulation on aquifer data.
Find docs supplement is should say
19:46
@ExoticBirdsMerchant no, no, use it, it's your friend. But if there's an official (or unofficial but decent) tutorial, use that first. And when you're done or just have specific questions during the tutorial, look up the reference docs to see how things work in detail.
For instance, you'd learn the basics of python loops and containers from the tutorial, but if you run into for k in range(n): and wonder what range is, or want to know what range(n, m) does, you'd look up the library reference
Thank you for the the instructions. That is how i will proced. I am reading a very interesting paper called A water resource simulator in Python from the University of Manchester and they made a Py package in Elsevier @AndrasDeak
Python packages written by scientists...yeah, good luck ;)
Is it me or the gitter's last message is from 2018? gitter.im/pywr/pywr
if you get stuck your best bet might be asking on their github page, if that exists
Ahhhh cmon man heheh @AndrasDeak hehe. I did a Mooc but hmmm i need to do some real life stuff to gain a litte affinity with the language
@Abdur-RahmaanJanhangeer that mean the whole thing isnt active? Not in development
You are right the git is the place to find if they are still working on the thing
19:51
Yes somewhat active 6days ago but lots of issues and some PRs
It seems a great package in purpose
I guess for some games it might come in useful
Or to get a Sci-fi story running
@wim Yeah, I just popped back in and saw more peple asking essentially aimless questions as though this were some kind of Python soup kitchen. It doesn't encourage participation.
heheh i need to put some work in the is all Newland for me
The PyCommunity is quite nice, feel free to explore around!
Just got chat privilege. yay!
@CanuteS welcome
19:55
As for the Anaconda thing i suggest a full install if you are just begining else you might be wondering why this and that not working in miniconda
So i did i installed the whole thing cause i dont wanna bother me with packmgmt
@AndrasDeak Thank you!
Thanks I had a question about a question I was going to post: I was wondering why chartify package requires chrome for png. Would that be ok to ask?
I guess your background is scientific, if so, take your time to understand Anaconda (It's simple). I've seen people with 5y+ speaking at PyCon saying that Anaconda is a black box (XD). Turns out they never learnt Python in the first place but just hacked their way through. Like a passionless drive through university years
rb folks. it was great talk to you
Folks, what's the equivalent of .__version__ for a package that's just a SWIG wrapper, like spaCy? Can we programmatically get it from inside Python interpreter at all? Obviously we can use pip freeze/conda list outside on command-line.
20:00
It depends if the package author included version for you to use >>> import package >>> package.__version__ if not you wont get the version
i mean __ version __
@CanuteS borderline. "Why does package X do Y" often gets closed as "primarily opinion based", because only the developer could say. Often there's an objective answer that anyone could say, but that's not always obvious at the time of asking.
@Abdur-RahmaanJanhangeer No it doesn't depend. SWIG is a wrapper to a C/C++ package, they often don't have .__version__ like a native Python package does. I already said above that __version__ wasn't included on ths package, and I asked what the equivalent programmatic way to get it was (from inside Python interpreter).
@CanuteS Have you tried looking at their github page or equivalent to see if there's some information? Or see how chrome is used in the code?
subprocess is always a hack i guess
@AndrasDeak I'm very new to python just started coding last month. I wanted to ask on github but is there a good place to ask on github? The only place I can see where I can post something is "Issues" but I didn't feel that would be the right thing to do.
20:05
@CanuteS What does "chartify package requires chrome for png" mean? requires chrome to import PNG format? export PNG format? compress PNG format? all of these? Does it actually require Chrome browser and call it under-the-hood, or do you mean some Python package for calling Chrome? etc. Good to be specific. If SO users see a question that appears to just ask "Why use browser X?", then yes it would get closed as subjective.
@CanuteS if you've thoroughly looked at their documentation, and you can't see a better venue (like gitter, slack, support mailing lists etc.) it can make perfect sense to post an issue. They are called "issues" but you can usually post feature-requests and support questions as well as bugs. It depends a bit on the local culture, you can see what kind of issues (both open and closed) they have.
just remove the "is:open" filter that's there by default
@CanuteS and Andras: but the question phrasing is still unclear. Does that question mean a) "Why doesn't chartify implement native support...?" or b) "Why does chartify use Chrome (rather than Firefox/Safari/IE/Edge/Opera/Brave/etc.)?" a) might be an interesting question, b) isn't
Presumably there would be more to the actual question...the way I read it is "I find this dependency to be surprising, what is the reason for it?"
@smci Chartify needs you to install chrome and chromedriver if you want the output as png charts. That's what I meant. I'll just let it slip. They must have a good reason to do it that way but it kinda itches why they didn't go for something like imagemagick. I think I'll just learn matplotlib.
I don't know what that package is so I didn't feel like I was missing out on anything crucial. We're having a high-level discussion.
20:11
Chartify is a charting package built on top of bokeh to make charts quickly by Spotify and it requires a browser to output to png.
@CanuteS Ok then you're asking a) "Why doesn't chartify implement native support...?" Presumably because they didn't want to spend time/energy implementing it and maintaining it themselves, which seems pragmatic. Best to ask them directly on their mailing list. Is your context: "Will chartify always have a dependency on chrome+chromedriver for PNG support, or is there a plan to impklement it natively?"
@smci to be fair chrome is a really funky dependency for creating pngs
@AndrasDeak I hear you, I'm not that familiar with package support for PNG
@AndrasDeak yeah lol but they must have a good reason for it
my bet would be that they need javascript at one point, and you can only render that in a browser
so it's probably not directly related to exporting to PNG
20:14
@CanuteS Err, I conjectured above "Presumably because they didn't want to spend time/energy implementing it and maintaining it themselves, which seems pragmatic." But obviously there are licensing, privacy and malware considerations about programmatically invoking Chrome under-the-hood, as well as the very obvious operational ones (big memory footprint? can we strip down to minimal size? Chrome has command-line flags to disable major parts of the rendering pipeline, IIRC).
@AndrasDeak um, that would make a lot of sense
@CanuteS: you might also ask them why Firefox's APIs won't do the job, and if they'd ever switch to FF.
Is there a firefox library that you can import to python?
@AndrasDeak Couldn't find any...
I've only seen chromedriver mentioned in various posts but I don't do web stuff anyway
20:24
@CanuteS That was useful to know, if you ever found/wanted to review support of various Python plotting packages for PNG, WEBP and SVG, (e.g. 'native', 'via browser driver', 'none') that's really useful information. I was using matplotlib to generate SVG recently.
I really need to near the core ones np, pandas and mpl. I'm really new to python. Plan to use in for my analytical work. That reminds me I need to do my daily courses and practice exercises.
Thanks guys. I gtg now. Need to come out of the lockdown as a python pro. Now going back to practicing xD
@CanuteS First learn native python a bit, be comfortable with it. Then numpy. Then mpl and pandas which in a way build on top.
and have fun :)
Thanks.
Cya, stay safe!
you too
 
1 hour later…
21:39
@CanuteS: Good luck. I didn't know about chartify, I'm curious as you learn how it compares to matplotlib+bokeh, if it's a simpler interface for charts with interactivity, tooltips, zoomability, etc..
This was useful: Chartify: A Quick Review (12/2018) "make it easy for Python users to create standard chart types, including line, bar and area charts, and is built on top of Bokeh... implements the R paradigm of 'tidy data'... clean API to ingest tidy data and generate a variety of visually pleasing charts, while also exposing the underlying Bokeh figure for further customization"
so basically seaborn for bokeh
21:55
Hello all!
While calling a setInterval method i get this error: RuntimeError: main thread is not in main loop
But i have not any thread inside that method.
The error raised while trying to move a canvas element.
self.now_playing_canvas.move(self.now_playing_text, self.now_playing_x_step, 0)
  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 2591, in move
03:00 - 22:0022:00 - 00:00

« first day (3544 days earlier)      last day (1629 days later) »