Replies: 3 comments 10 replies
-
|
As far as I understand, there's no ready solution for this, so here're my thoughts on how that could be done. The simplest solution could be exposing the Then everything needed can be extracted from that element using its However, this approach would fail e.g. if the worker is created via Another approach could be exposing particular tag attributes (or The latter is probably better. It could be a where all Maybe |
Beta Was this translation helpful? Give feedback.
-
Oh, I've just noticed
Well, I tried, but then decided that it would be too complicated anyway, never mind.
Sorry, that was my bad – I've just checked the
Whoa! I didn't know about it, it seems never mentioned in the docs. And also, it returns Also, would it be available without CORS, with Oh, by the way,
Oh, I don't care about that (yet?). For now, I'm looking at a situation where I have 4
Well, (almost) anything is possible. The questions I'm thinking are: Is it easy? Particularly for a novice? Is this answer easy to find? And to implement? Would a novice be comfortable implementing it? Would they feel the process as comfortable? Accessible? Intuitive? Would they feel PyScript as wowcool or as complicated and cumbersome in the end? Would they ask a ton of tech support questions? :) And also – is it pythonic? Is it comfortable and intuitive for a Python person who doesn't know a lot of JS? Because if a person knows JS well, what would they need PyScript for? For example, you're talking about "sync pollution" – I couldn't understand what that is. I've found
Well, you definitely don't NEED that. That would just make PyScript more comfortable, intuitive and easy to use from Python side. You know, a LOT of stuff in PyScript is already AMAZING, from Python view. I've written some stuff on JS in the past, and I have my reasons to hate it. So being able to have a wonderful GUI that HTML&Browser are from the comfort of Python – is SO much better! So get me right, I'm not saying PyScript API is poor or not capable. It just has its imperfections, "incompletenesses" in connecting Python logic with HTML GUI, and when I see those, I report them. But they're FEW in number, really. Most of the stuff if just working ™ and that's amazing, I'm having so much fun coding in PyScript! It's great!
Well, if it's a logical and understandable thing, and there is a reliable, but long way to achieve, the question I'd ask is as follows: what is easier, to create a short and precise way to achieve it, or having to document a long way around, or answering the support questions for anybody who couldn't find that long way on their own? Your choice. :) For example, you have |
Beta Was this translation helpful? Give feedback.
-
|
Closing since discussion seems to be complete and no further profit is expected. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Of course, that is possible via
pyscript.web.page.find('script[type="py"]').But this way the module has to guess which
<script>tag is theirs, particularly if there're multiple workers.I wonder if there's more explicit way to do that.
Mostly, I'm interested in
nameattribute that I'd like to use as a prefix for logging messages, for easier identification of messages from different processes in the console.But other
<script>attributes could be very useful too:targetcould be used by Python code, for example, to log its messages to the same container.idcould be used to mark some objects created by that module instance.styleandclassvalues can be copied to someElements the module creates.srccould be used to find out the source file name (useful for logging errors).etc...
Beta Was this translation helpful? Give feedback.
All reactions