« first day (3513 days earlier)      last day (1418 days later) » 

wim
1:32 AM
 
 
2 hours later…
3:32 AM
btw, anybody here made a zeronet site? Are you able to then point a domain towards it and host both standard and decentralized?
 
 
2 hours later…
5:34 AM
Good morning
 
6:29 AM
what is the purpose of using super() in the return statement of a method ?
 
@roblox can you provide an example?
 
def data(self, index, role=qtc.Qt.DisplayRole):
        if role == qtc.Qt.BackgroundRole:
            data = index.data()
            value = float(data)
            return qtg.QColor("green") if 12 <= value <= 20 else qtg.QColor("red") # aus config dateil laden
        return super().data(index, role)
@bereal its a pyqt method maybe little bit confusing
 
@roblox the overloaded method does some manipulations on its arguments and then delegates the rest to the parent's (original) implementation.
And then returns the result.
It could be two lines, so that `return` has nothing to do with it:

result = super().data(index, role)
return result
 
6:46 AM
@bereal ah okay thanks for clarificaion
 
7:03 AM
Hello
 
@roblox the same as using super anywhere else in a method
 
wim
@bereal Not really, in this case. It's actually used as a fallback to default behavior for when role != qtc.Qt.BackgroundRole.
 
@wim ah right, thanks. Didn't notice the upper return.
 
wim
i.e. the author has just added in some special-case for role == qtc.Qt.BackgroundRole for some reason.
 
@roblox correction above ^
 
7:37 AM
got it
 
 
1 hour later…
user12267139
9:07 AM
some one using pycharm ?
 
9:35 AM
Learning dictionary comprehension. Can anyone tell me what's wrong in the following code?
char_list = sorted(['d','a','b','a','c','d','a','b','b','a'])
occurence = {char: (dict().get(char, 0) + 1) for char in char_list }
 
@d4rk4ng31 well, obviously dict().get(char, 0) will always return 0
 
@Aran-Fey That's why the +1
 
...so then why not just write 1?
if you want to count occurrences, use collections.Counter
 
@Aran-Fey Uh, no, I'm trying to implement this:
occurence = dict()
for char in char_list:
    occurence[char] = occurence.get(char, 0) + 1
 
yeah, you can't do that with a comprehension
it doesn't let you access the dict that it creates
 
9:42 AM
Oh!
 
@d4rk4ng31 As @Aran-Fey mentioned, just use collections.Counter as in collections.Counter(char_list).
 
Also, how does python determine in which order are the elements stored in a dictionary?
 
in 3.7+ it's insertion order, in older versions it's undefined
 
10:04 AM
@Aran-Fey That's what. Why was it undefined? Any particular reason? Or was that a design flaw which was fixed in 3.7?
 
stackoverflow.com/questions/62071484/… just another "I do not know anything about anything but here's a SQL injection for you"
 
@d4rk4ng31 It just wasn't considered relevant. The idea behind dictionaries is that they map keys to values; it doesn't really have anything to do with order
 
Oh, the thing is I actually want to sort the dictionary as per values. How do I do that then?
 
Use an OrderedDict
Google/SO has a hit for exactly that question
 
10:25 AM
Is there any sort of import modules in python? rather than just import stuffs/from math import * or perhaps, _add_?
I've read the import documentation on python 3.8, I didn't got something, but they have mentioned that this is not the only way to import modules.
 
@AjayMishra I don't understand the question, but you may be interested in importlib
 
I'm checking that, rn. Thanks, though.
 
10:54 AM
@lordpotato please don't ask for help here with fresh questions on the main site, as per our rules.
 
@AjayMishra there is __import__, but you likely do not want to use it.
 
11:39 AM
cbg
If I click on a link, how can I get the text?
Not looking for the code...just a push in the general direction. What library, for example, can I use?
 
"click on a link": hmm? "get the text": of what?
Context?
 
For example, <a href='somelink.com'>hello world!</a>
 
getting warmer :P
 
So you want the link text? How does clicking factor into this?
 
It's possible to do this doing jQuery: stackoverflow.com/a/50467463/2124148. I am searching for a Python-similar library. Pyquery, according to another answer, doesn't work
 
11:48 AM
So you want to detect when the user clicks on a link... in what program? A web browser? A word document? A tkinter gui?
 
A web browser.
 
then selenium is probably your best bet
 
Got it!
 
12:15 PM
I received a question asking what are the benefits of using Python over Power BI (Microsoft) for data analysis. I am stumped.
I suppose one reason is that not everyone has a Windows OS
Windows shares the majority of OS usage at ~83%, just like most of the general population owns a commuter car. But it is those that decide to join the Grand Prix that use the fast cars, specialized for a specific purpose. I would have to look at the performance of Python vs. Power BI to conclude my argument.
 
12:38 PM
That 83% number seems fishy - is that a general number for any computer, no matter the purpose? Our data analysis infrastructure is 100% Linux. You would have a hard time deploying windows-only products.
 
Yes, that's the world.
 
Either way, the questions seems like "what is the benefit of owning a car factory over a car?" to me.
 
That's a great way to put it.
 
I've generally found elastic w/ kibana and canvas is sufficient for what most people would look at Power BI for...
 
Kibana looks amazing
 
12:47 PM
plus for a fair few bits - having it backed by elastic is almost never a bad thing...
 
Yep...
 
1:04 PM
In the 2 and a bit year war with IT, I have finally been defeated. No authorisation for access to my own database or its export off-site, despite it just being a load of integers. An entire project down the toilet because of two people's egos. Oh well, I'm gonna get my short dial to redirect to their phones so I don't have to deal with all the unhappy shop floor staff that actually used the tool that I can't fix. Absolutely gutted :'(
 
You're leaving, right? That's disrespectful
 
@roganjosh ugh. Don't you have a boss whom you can complain to? Or a common boss?
 
Well, I'm a contractor so I never really was part of the company, but this thing was my baby. I've subverted a lot of company politics to even get it built, with 2 people vehemently against it despite the 50+ users that used it daily. Alas, I cannot get around this one
 
Nice guys finish last. In other words, you should have asked for what it was really worth. That way they would have literally paid for it.
 
1:09 PM
Can you query the data gradually to rebuild it elsewhere? :P
 
@roganjosh There's probably no point suggesting to rally the masses against the powers that be, is there?
 
The masses will rally themselves, rogan. Be patient!
 
That will now happen because I keep getting pestered by the shop floor that rely on this tool. It won't matter too much, though, because there's such a disconnect between management and the factory workers that they just won't care. They won their argument
I may go to the MD but I haven't "touched base" (ugh) about the project for a while now with the whole lockdown so I'm not sure what my pulling power will be there
 
Rogan, you need to direct them to the two egotistical (expletive). Short dial, remember?
 
@roganjosh I'd be tempted to let it go and let the chaos ensue if the staff are really dependent on that system and then maybe if you're reached out to regarding it again - play a bit of hardball
 
1:17 PM
@roganjosh That seems like a toxic environment. Any chance for riding off into the sunset and let them stew in their self-served.... stew?
 
Yeah, rogan...you need to charge 3x as much
 
@MisterMiyagi Thing is, I kinda actually care about the people working on the machines, which the people who won this argument don't. So I can easily walk away, but the fall-out from doing that just results in them having to go back to like 10 spreadsheets and bits of paper with multi-coloured highlighters to try keep track, and they take the flak when things go wrong
 
You need to emotionally detach yourself from the situation, as hard as that is. I know because I'm not in your shoes. But you need to take a leap of faith here.
"People don't value the things they get for free"
 
@roganjosh I know the feeling. Hoping that you can draw some positive vibes from the people that do appreciate your work is helping them. hugs josh
 
Thanks mate :) I'll let the sting wear off and formulate my response once I'm a bit calmer :)
 
1:30 PM
/me throws Josh some of his favourite biscuits.......
 
2:06 PM
@roganjosh until they run afoul of some regulation and have to pay out the ...nose for the fix (though they'll still blame the workers mind you)
sorry to hear that though, always a pain when politics like that happens
@AnttiHaapala I just saw this comment of yours and it made me happy :) (and hopefully the answer-er, who is the co-founder of a startup by their profile....terrific!, will read it too)
 
Blaming the workers when all the systems are borked is what annoys me, in addition to it being the project that made me learn Flask and running databases. I've just reverted to my teenage self and blasted myself with some Slipknot and I'm feeling a bit calmer
 
It's sad that we live in a world where the "and understand" part of "please read and understand X" isn't redundant
6
 
@roganjosh yeah, that is exactly why I moved to teaching (politics like this were common in the government agencies I used to work for)
Also Slipknot is awesome (Slayer helps too ;)
 
@LinkBerest Ah, it's Rammstein next. I still remember all the words to several of their songs. And by "know the words" I mean I can make noises similar to what they're singing; it's my own version of "Ken Lee"
 
@JossieCalderon on what? If I'm using analytic software I'm looking at servers and Linux has 2x (or more) coverage with Servers (interesting fact: most popular OS worldwide is Android). I've used both btw. and still use Python with Power BI
 
2:21 PM
@LinkBerest Again...the world.
 
again - for what purpose? Desktop is ~87% but Android kills it as top OS. Server its not even close to Linux (either way my answer would be: "cause we can use Python on Windows just fine - I am right now - and it even integrates with Power BI when the tools MS has are not sufficient or we need specific customization")
 
Any purpose...it's irrelevant to the discussion.
 
I'm gonna go with "consumer PCs" or some similar distinction
 
if its consumer PC why would you need analytic tools to be installed on them? Just seems weird when everything I see is server based (meaning web or cloud)
 
2:26 PM
But a good answer is that you can use Python with Power BI
@LinkBerest Because you can, and that's the point
 
fyi - a fun statistic with Windows PCs is to calculate how many are still using XP (its +20% the last time I checked - 3 months ago)
 
The confusion here is that you said "Windows shares the majority of OS usage at ~83%" without qualifying it, and that figure almost certainly can't stand alone without some kind of qualifying statement. I don't think it will be helpful in justifying anything
 
Windows shares the majority of OS usage at ~83% amongst all computer users.
 
What is the context of trying to justify this choice?
 
@JossieCalderon Since you've been asking about the purpose of data analysis, the scope of the numbers cited seems very important. No point counting systems not useful for this purpose.
 
2:35 PM
for the record, PowerBI is not bad and because it is pretty easy to integrate with Python/Pandas and R so I like it for certain companies which use OneDrive or Sharepoint a lot - esp. education which tend to do this due to grants and is why I recommend it to those places. It stinks at connecting directly to databases outside MS & Oracle & almost no NoSQL DBs but with Python its again an annoyance over critical failure. Not my favorite way of making dashboards, not terrible.
oh, and its OCR is great for regular pdfs but if you have those "user took a picture of the tables they filled out by hand and saved it as a pdf"....you're in for fun
 
Which is why I think we need to understand the context here. We can't promote Python as a tool to hammer nails etc. so being objective is hard with no info
 
@LinkBerest Fortunately most of these are on non-critical applications, like bank ATMs and industrial and utility controls.
 
heh, around me its all doctor's offices (most of whom upgraded to Windows 7 at the end of 2019......)
^ I wish that was a joke
 
Just in time for that to become obsolete
 
We still have some Linux systems that ship with Python 2.6, so I feel somewhat reluctant to snicker at such people.
It's a reality that many people have better things to do than move as fast as software does.
 
2:51 PM
oh, I don't snicker because I have to audit their security (data vulnerabilities) from time to time and its just :O
 
3:02 PM
Is anyone else getting a lot more fake (phishing) headhunter emails which reference SO jobs?
 
Nope, not a single email referencing SO Jobs that I can remember
 
okay, thanks (it makes them easy enough to filter at least)
 
user13004974
Hello guys ,
i need small help
i'm androidian guy and
i need to get translated strings automatically
from past i used : https://asrt.gluege.boerde.de/
but now its blacklisted
thay have a pythin script ; https://github.com/Ra-Na/GTranslate-strings-xml
GitHub
Ra-Na/GTranslate-strings-xml
Creats a strings.xml file by Google auto-translating an input strings.xml file - Ra-Na/GTranslate-strings-xml

i need to run this script into my PC how?
from https://hub.gke.mybinder.org/user/jupyterlab-jupyterlab-demo-we9ef3p0/lab
 
So many newlines. WTF?
 
user13004974
Jossie So sorry for inconvenience :/
 
3:16 PM
@PranavBhatt Please see the room rules, particularly "Avoid rapid, short "stream of consciousness" messages". It does make things harder to read. That said, I've gone through the links and I'm not clear on what you're trying to do
You passed strings through that translator via an API or something?
 
user13004974
rojanjosh Thanks, got rules
 
user13004974
when i need to translate one language to another automatically then i used 1st link.. there i can atatch my string.xml file and select Input language & Output language and file gonna downlaod automatically
 
It doesn't look very automatic to me. It looks like you have to upload a file in the first link
"We are blacklistet at Google translate". Mmm
 
There is an API for Google Translate (part of the cloud apis) but I doubt that would bypass the blacklist. @PranavBhatt is this a Python question?
and to stop this line: if the question is "how do I translate text with Python?" this is the subject of my current journal article so will not be answerable in chat or SO
 
3:35 PM
stackoverflow.com/q/62087750/4799172 needs debug details (they already fixed the issue)
 
Hi everyone, I was trying to solve this problem using this particular method but was not able to solve even though I am getting the correct answer in my IDE
My attempt:
zeros_count = nums.count(0)
nums = [num for num in nums if num != 0]
for _ in range(zeros_count):
    nums.append(0)
 
nums isn't even defined at the point you do zeros_count = nums.count(0)
 
No it is defined . Let me pull the actual code as it is running in leetcode
class Solution:
    def moveZeroes(self, nums: List[int]) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        zeros_count = nums.count(0)
        nums = [num for num in nums if num != 0]
        for _ in range(zeros_count):
            nums.append(0)
nums is the argument
 
looks correct to me
 
does leetcode have a timer limit (combined with a "large" number)? I don't see why this code would hit that limit but it can sometimes be weird with online repls
 
3:47 PM
Yes @LinkBerest but this was not a TLE
 
ah, you didn't modify nums. You created a new list
 
I thought when I am substituting the existing list with some operation I was doing an in-place operation?
 
use nums[:] = instead of nums = to modify the original list.
 
Works thanks!@MisterMiyagi
 
nums[:] = modifies the list object, whereas nums = takes the "nums" name tag off the input list and puts it on your new list
 
3:52 PM
I don't know what "TLE" is (well, I assume its not Teacher-Learning-Experience or Two-Line Element Set) and I started typing that before fully looking at the code (so works but doesn't pass tends to be that) - see others on modifying nums
 
Note that instead of counting zeroes, you can store the initial len(nums), then create original_len - len(nums) zeroes. .count is an O(n) operation, len is O(1).
 
wim
PEP 463 -- Exception-catching expressions was an interesting proposal with a mildly spicy rejection
 
^ I liked that one.
Would have been more useful for me than the walrus.
 
Now I remember from the official documentation, didn't think it was important until now :P , thanks! @Aran-Fey@MisterMiyagi
TLE is Time Limit Exceeded when speaking in competitive programming terms @LinkBerest
 
Feels somewhat strange that it is rejected on the notion that EAFP would not be "generally recommended" in Python – Python feels exceptionally EAFP'y compared to other languages.
 
3:58 PM
@MisterMiyagi Got it thanks again !
 
Why do people keep wanting to add more and more syntactical constructs to python? Especially ones that require parentheses?
 
Every language eventually degrades to LISP.
 
as long as they don't become Fortran
 
Ugh. Now you make me wish I had not written my above comment in jest.
 
Anyone else find this song strangely captivating? I didn't like it at first, but then somehow I still ended up listening to it on repeat for 3 hours...
 
4:07 PM
my first programming teacher was an old fortran guy - was really fun to listen to him talk about how great getting DO & ENDDO and if statements was (over labels)
 
@Aran-Fey it reminds me a bit of this song that I linked a few months back in being a fusion of different styles
 
@LinkBerest Such stories make me jealous. My first programming teacher was some PhD student who started sweating nervously on certain trigger words. These being "include", "header", "compile" and "pointer". It was a C course.
 
those still trigger me and I haven't coded in C for years
 
wim
@MisterMiyagi I agree with the rejection, but not the reason for the rejection :D
minor annoyance about the proliferation of all the conveniences such as dict.get , next(..., default) etc is that the default still has to be evaluated even if it doesn't get used (problem if the default is a function call or expensive to compute)
 
@wim What would have been your reason? I would understand a notion such as Aran-Fey's that the added syntax is just not worth it for an uncommon case.
 
wim
4:16 PM
@MisterMiyagi my reason: adding the syntax sugar is worth it, when try/except blocks also work fine.
the conditional expression was a similar syntax sugar which got accepted, and it is so abused and overused by those suffering from one-lineritis, or trying to dodge coverage reporting.
 
@wim ummm... only if you're not aware of that - otherwise it's not evil
 
wim
one-liners with e.g. v = d[k] except KeyError: 'default' flow as possibility would get even more gnarly and abused
 
@roganjosh That really is very similar! I'm not sure yet whether I like it; I'll know in 3 hours ;p
 
@Aran-Fey hahaha. I need a waiver for you to sign before I trap you in any more YouTube loops :P
 
@MisterMiyagi yeah, I got really lucky - Dr. Force had retired from academia and started teaching at the highschool for grandkids/benefits (old school but massive level of knowledge)
The class itself was C++ but he helped me learn Java & Cobol on the side for my job
 
wim
4:23 PM
@MisterMiyagi not sure what Guido was smoking when questioning that EAFP isn't generally preferred in Python. It absolutely is!
 
@roganjosh it only becomes a problem if it's late at night, so you're fine (:
 
wim
LBYL has been the cause of many security bugs in unix
 
@wim Why? Everyone checks the return code, right? :p
 
@wim So basically "being the exception variant of a if b else c isn't enough since we shouldn't have that either"?
 
on a positive note: My son loves math now - because I taught him fractions using brownies, pizza, & giant cookies ;)
 
wim
4:26 PM
@MisterMiyagi yeah. the rationale for conditional expression was already pretty weak (trying to stop people writing the buggy and/or trick)
i.e. the trick they learned from other languages cond and x or y which is actually not correct in Python, (cond and [x] or [y])[0] being the "correct" trick
 
I can see where you are coming from. I feel all the various "expression variants" are useful, but definitely abused a lot.
 
heck - guess it's "cool" to use 'em or something
personally, and I've ranted about this before I'm sure, f-strings are so over used as well
 
wim
@JonClements TOCTOU. By adjusting the style of your code slightly you eliminate that whole class of security bugs. What's not to like?
 
@wim you know I was being ironic?
 
Personally, I like the various expression variants to avoid mistakes when using functional patterns - e.g. comprehensions instead of mutating loops when filtering and such.
Teaching them to beginners usually reminds me that having a solution isn't worth much when people cannot recognise the problem in the first place.
 
wim
4:34 PM
@JonClements I'm unable to discern between your irony and your sarcasm
 
@wim seems I pulled both off very well then :p
 
4:48 PM
Jon reminds me of when The Doctor pulled out a yo-yo and when asked what he was doing said: "Testing the gravity"
 
Well, I think most dog treats are delivered via gravity-operated system in some way. They step on a pedal or something and treats fall. Testing gravity is totally cromulent in that case
I'm not sure how I hashed my pre-edit post so badly. I might as well have just gone with "dogs eat gravity" and moved on from there
 
wim
Dabeaz releases entire "Practical Python Programming" course as creative commons! twitter.com/dabeaz/status/1266339737624813569
 
but now everyone will be able to program python practically :(
 
let's hope so!
casts some votes onto SO pew! pew! pew!
 
5:29 PM
Treffer, versenkt
 
hmm?
 
Small german inside joke in response to the pew pew pew. It's what you say in a game of Battleship when the opponent hits and sinks one of your ships
 
wim
resets LANG=en_US.UTF-8 on Aran-Fey
 
is the Google Translate worth a laugh?
Du hast mein Schlachtschiff versenkt
 
that's actually perfect german
 
5:33 PM
Gah. Stupid algorithms getting things right
 
@Aran-Fey ah, my bad :P
 
@wim Changes will take effect after rebooting :P
 
Das reBoot
 
Ouch ^^
 
wim
hope your das reboot doesn't take 149 minutes
 
5:36 PM
Have you tried turning it off and on again to find out?
The only thing being reBoot'ed here are our HPC clusters, and they take a lot longer than 149 minutes. :/
 
you have to wait a month for them to be drained anyway... ;)
 
wim
that's cray cray
 
This "human" hardware is not very good. It can't hibernate, and even the sleep function doesn't work very well
 
probably more like blue gene q
 
wim
they still haven't patched the memory leaks since 1982
 
5:50 PM
Now I'm scared to google what happened in 1982
 
If you don't, then we have to. Go for it.
 
I don't remember 1982 being that bad (granted I was very young at the time so maybe a "rose-colored glasses" kinda thing)
 
actually I don't even know how to google that
 
Or was that the time that there was no work for engineers? (I remember my dad having trouble around that time but didn't know if that was a local thing)
 
m8_
Hey all, got a quick question on altair. With a plot like this (altair-viz.github.io/gallery/gantt_chart.html) if the start and stop are the same for a given task, nothing is displayed in the chart. Is there a way to force the bars to show for those cases?
 
6:02 PM
What is the x axis in this case?
 
m8_
@roganjosh, for my implementation the x-axis is an age (of a person). Since Gantt charts are time based I would imagine the x-axis is simulating date/time in the example link
 
But you said the start and stop date are the same, so wouldn't that be, at best, an infinitesimally small line?
 
m8_
@roganjosh, yes. It could be any shape (dot, line, whatever), but I just need to represent it somehow. In my case, the y-axis ticks are Events and some events start and stop at the same point
 
@Aran-Fey wikipedia probably mentions important things at the article for 1982
 
Well, turns out a lot of stuff happened in 1982 :D
 
6:11 PM
it was probably just a birthday joke
 
@m8_ I take it that the library doesn't like floats?
 
m8_
@roganjosh, no. My x-axis of ages are actually floats
 
in which case, you'd just add 0.1 days to your Gantt, or something similar?
 
m8_
@roganjosh, tried that but it still didn't show. I also made the chart wider but that didn't show anything either
@roganjosh, when I do add .01 to the stop, it will show on the x-axis but still no bar in the actual chart
 
6:24 PM
@m8_ but there is no bar to show
 
m8_
@roganjosh, well if the start and stop are both 60.0 and I then add .01 to the stop, it should show the distance between 60.0 and 60.01, no?
 
I can kinda visualise what you're after but it's just going to be a blank row and that's nonsensical in a Gantt chart. If that's not what you're after, we're on different pages
It just doesn't make sense to add a task that has no time demand
 
m8_
It might be easier to think about this in days, with the x-axis as Sunday thru Saturday. If an event started Monday morning and stopped Monday night, I want to see something to represent that as well as if an event started Monday and stopped Friday.
 
Then the Gantt chart should be oriented in terms of days, no?
 
m8_
6:32 PM
I'm just giving an example to illustrate the point. The x axis is time based. Maybe I'll have to find a different chart type or merge two kinds together
 
Something is amiss here. The granularity is important or the Gantt chart is even less useful than the thing I threw away years ago. It doesn't seem right to be planning on a weekly/monthly schedule when individual tasks can be completed in a day
I'm gonna back out because I don't follow the premise of the planning, sorry
 
m8_
No worries, thanks for trying
 
@m8_ Can you please provide an MCVE? The example you have linked has no problem with an entry such as {"task": "C", "start": 60, "end": 60.01}.
 
7:20 PM
/me looks around and realizes all the proposals are finished a few hours early and feels nice......then panics because what if they needed one last draft
 
7:32 PM
wowsers, can see I missed a few bits... sighs
 
I have kibbles & bits if that would help you feel better ;)
 
7:49 PM
:)
 
recbg
 
Coming in late to the conversation, but "Gantt charts" caught my eye. At least in MS Project, the way you display something with zero length on the Gantt Chart is to make it a milestone, not a task. I don't know if altair can do the same, though.
 
user9321739
8:47 PM
How can i compress an image with PIL without saving to to my HDD, e.g. keep it in RAM. i had a look at this answer. stackoverflow.com/questions/10607468/… but .save function saves it on HDD.
 
Can you try saving it to a BytesIO object or similar in-memory container?
 
user9321739
9:00 PM
img = ImageGrab.grab()

temp = StringIO()
img.save(temp, optimize=True, quality=50)

produces "ValueError: unknown file extension: " error
 
user9321739
raise ValueError("unknown file extension: {}".format(ext))
ValueError: unknown file extension:
 
oh, you have to pass a string
too bad
 
user9321739
so it's not possible then i guess to save the image to memory
 
user9321739
using PIL, will need to try find another way to reduce the size of the image
 
can't you use a tempfile?
 
9:09 PM
@Ironstone1_ I think if you assign a path to .name you can do it. But I'm not sure how nicely BytesIO will play ball when the fp.close() is reached.
It's really janky, so I'd not do it myself
 
wim
sounds promising. close should be no problem. use a BytesIO not a StringIO
isPath looks sufficiently dumb github.com/python-pillow/Pillow/blob/…
 
Yeah it's does. I think I should note that I'm looking at Pillow's source, cause I couldn't find PIL's :(
 
@Ironstone1_ Here's code that shows how to do that with Pillow stackoverflow.com/a/40588202/4014959
You may also find my answer here of interest: stackoverflow.com/a/52411829/4014959
 
user9321739
9:31 PM
im creating a screen recorder, when your capturing 30 FPS, saving it to the HDD is not an option due to it being to slow. thank you, im having a look at io.BytesIO() now :)
 
I missed that you weren't trying a BytesIO the first time I suggested that :|
 
that's one crazy directory tree you have there, but I'll chalk it up to github.io things
 
 
1 hour later…
11:05 PM
Is there some UI that tells me what xpath I have to use for specific content? Half of the time I get blanks...
blanks == no matching elements
 
in firefox (at least in dev edition) you can right click -> "inspect this element"
I don't do web stuff so I can't find right now if there's an easier way from there, but if you right click again on the element you can copy... -> XPath
 
In the average document there's, like, an infinite number of xpaths to most elements
 

« first day (3513 days earlier)      last day (1418 days later) »