|
Could this also be made to run on Android with NDK? You could have a neat cross-platform kit if you got that figured out, but just getting it working on iOS would be plenty cool all on its own.
|
# ¿ Nov 25, 2015 15:11 |
|
|
# ¿ May 9, 2024 11:36 |
|
duck monster posted:I believe it already runs on Android. Ah, so it does. Not sure why that didn't come up when I googled earlier. E: google auto-corrects pyotherside to otherside haha thanks goog Munkeymon fucked around with this message at 18:53 on Nov 25, 2015 |
# ¿ Nov 25, 2015 17:52 |
|
Thermopyle posted:I think Suspicious Dish first told me this, and I now agree with him: javascript is very similar to python. And becoming more and more so with all the new features they're adding.
|
# ¿ Nov 25, 2015 18:54 |
|
Use Selenium's Python bindings and http://stackoverflow.com/questions/3422262/take-a-screenshot-with-selenium-webdriver Part of their API lets you pick a frame to interact with http://stackoverflow.com/questions/13567128/selenium-frames Or you can just record your own actions and replay them automagically if hand-coding the workflow is too much http://www.seleniumhq.org/projects/ide/
|
# ¿ Dec 9, 2015 15:27 |
|
TryPython code:
|
# ¿ Jan 20, 2016 21:27 |
|
Tigren posted:And where am I supposed to be seeing the output that I want to capture? Oh sorry I got it in my head that you just wanted to suppress it. Python code:
|
# ¿ Jan 20, 2016 22:45 |
|
Tigren posted:
You'd still have to do something about the exception: Python code:
|
# ¿ Jan 21, 2016 17:18 |
|
Tigren posted:Thanks for being patient with me. stderr/stdout redirection seems like kind of a funky beast. Caching shouldn't be an issue because we're supplying our own buffer before the output is generated. Could be I made an invalid assumption and it might be sending the output on stdout. Could be that there's an init in the module that grabs copies of the std* streams before we're replacing them. This should mitigate both: Python code:
|
# ¿ Jan 21, 2016 19:40 |
|
When you're searching for an ID like cur_pm25, you should just use find because there shouldn't be more than one on the page but you also seem to be confusing classes and IDs. aqivalue is a class, so there can be more than one, but you can do Python code:
Python code:
E: forgot class was a keyword Munkeymon fucked around with this message at 17:11 on Jan 28, 2016 |
# ¿ Jan 28, 2016 17:09 |
|
hooah posted:Say I have a string test='hello\tworld'. Why does test.find(string.whitespace) return -1? I know tab is in string.whitespace. I'm guessing tab isn't the only thing in string.whitespace? .find searches for a string(needle) in a string(haystack), not any arbitrary sub-part of the needle in the haystack. E: are you trying to figure out if there's any whitespace or find the first whitespace character? Munkeymon fucked around with this message at 17:25 on Mar 1, 2016 |
# ¿ Mar 1, 2016 17:20 |
|
Well the regular expression /\s/ will match all white space characters, hint hint Also it's really lovely of them to mix tab and space delimiters JFC
|
# ¿ Mar 1, 2016 17:51 |
|
They're not loving with the delimiter, you're just trying to treat the first column as two columns when it's actually a bucket. The CSV module with delimiter set to tabs should handle that just fine.
|
# ¿ Mar 1, 2016 19:51 |
|
Hammerite posted:* like not having a notion akin to Python's "class methods", where you have an essentially static method but it cares which class you used to call it Extension methods don't do what you want?
|
# ¿ Apr 8, 2016 18:21 |
|
Hammerite posted:I don't know what you mean - I don't understand how extension methods would be relevant to this, but if you can point me to something I don't know about them that would be great. Might be me misunderstanding why classmethods are useful, but in C# if I want to make a utility method that I can just call as if it were a member of a type when it's not, I'd write an extension method. Granted, this doesn't give the extension method access to private members or anything similarly magical, but it looks like a similar use case to me.
|
# ¿ Apr 11, 2016 15:05 |
|
Hammerite posted:No, that's not what I mean. I mean I wanted to have something like Python's "classmethod" where it acts like a static method (you don't need an instance to call it), but it does still care which class it's called through. A dumb, babby's- first-OOP type example would be You kind-of can, though: https://dotnetfiddle.net/TRTDYx E: well, you can't override the implementation's methods with an extension - you'd have to inherit and explicitly override to do that. To associate a static method with a type is totally doable, though. Munkeymon fucked around with this message at 16:58 on Apr 11, 2016 |
# ¿ Apr 11, 2016 16:02 |
|
taqueso posted:I was trying to think of where this might not be true, and in Rust, it seems like the unary operators (including -) have higher precedence than binary operators. Same in JS. It's almost like they come from the same organization heh
|
# ¿ Apr 26, 2016 19:58 |
|
Loving Africa Chaps posted:looks like it was the missing comma after twitterid The comma changes the type from a string to a tuple, in case that wasn't clear.
|
# ¿ May 5, 2016 20:12 |
|
Loving Africa Chaps posted:It wasn't and might explain my cool new errors. Got some more reading to do i guess The method probably looks something like Python code:
Anyway, both string and tuple are enumerable, so that for loop will happily consume either, member by member, so it will try to bind every character in a naked string (or code point in Python 3, I guess). The reason you need the (thing,) construct to pass a tuple instead of a string is that that's the special case syntax to create a one-element tuple. An empty tuple would just be empty matching parens. I would be a little surprised if a list didn't work just as well and the syntax there is a little more intuitive: [thing].
|
# ¿ May 9, 2016 15:27 |
|
QuarkJets posted:Personally I feel like this kind of move is tacky It's kinda rickety and weird, but for better or for worse the web browser is kinda becoming the lingua franca of UI toolkits. OK yeah fine probably for worse
|
# ¿ Dec 5, 2016 23:02 |
|
It's becoming more Pythonic, but in a janky JS-y kind of way, and I say that as a front-end dev, so I'm doing mostly JS for my day job and have been for a while now. For example, they added generator functions at the language level (yay) but they don't have a .map, .reduce, etc specified on them like regular arrays so you can't just write code that works for both without monkeypatching or going through a library
|
# ¿ Dec 7, 2016 15:16 |
|
Suspicious Dish posted:map in Python implicitly converts to an array. If you want that in JavaScript you have to explicitly convert to an array. [...myGeneratorFunc(foo)].map(...) I like the way Py3k and LINQ work better
|
# ¿ Dec 7, 2016 20:18 |
|
Asymmetrikon posted:You can technically kind of replicate f-strings with format by doing: I wish there was room in the spec to add implicit naming to dictionary literals like JS is doing, you could just do something like Python code:
Huh, I thought 3 deprecated the modulo formatting, but I guess not? I mean, I would have, but whatever.
|
# ¿ Dec 19, 2016 17:13 |
|
They can't do what I did there because {thing} already means "make a set consisting of 'thing'". IDK how you get around that without doing something kind of gross and unintuitive.
|
# ¿ Dec 19, 2016 20:22 |
|
Thermopyle posted:I'd really like to see some more in-depth discussion of this. I bet it's more work to take a big codebase like YouTube to 3+ than to write a compiler that'll drop-in replace 2. The fib test they cite just used threads, which would underperform an approach that spun off processes (last I checked, on Windows, for something that uses lots of memory). I'm not familiar enough with how Go handles that sort of thing to know if it's a good comparison, but I'm guessing it's weak and meant to say "Look, ma: no GIL!" They should have included comparisons to the other alternatives they explored to make a good case, but at the end of the day we're not the audience they need to justify this to.
|
# ¿ Jan 4, 2017 20:40 |
|
Dex posted:from some stuff i looked at last year, go's concurrency for cpu intensive threads was around 50x cpython's. however, go has some seriously nasty leaks that are completely beyond your ability to control, so you will almost certainly end up with memory issues that are near impossible to isolate, so if you have even the slightest reason to care about memory consumption, it seems like a terrible choice Oh that's interesting and now you've got me wishing for a Grumpy vs IronPython cage match since neither gets C extensions. My money's on IPY because I know I've seen CPU-heavy code run better there than CPython and it has a really good GC behind it
|
# ¿ Jan 4, 2017 21:07 |
|
QuarkJets posted:Wasn't Go also created at Google? Yeah Suspicious Dish posted:CPython is really, really bad and even with the new "asyncio" stuff even something like node.js can run circles around it. I said this in a different thread, I think, but Mozilla says you can get a pretty good performance boost by compiling Python to Web Assembly or asmjs (or whatever it's called this year) and running the result on SpiderMonkey. It's probably not a terribly fair comparison, though, because JS interpreters don't have to care about threading or C interop. Still kinda neat, though.
|
# ¿ Jan 5, 2017 15:05 |
|
Thermopyle posted:Where does one even get CSV-formatted data nowadays? Excel exports? "See attached report" Outside of that, in my experience, it's still a common data exchange format because it's so widely supported and 'easy', meaning the pain comes in dribs and drabs forever instead of being in the up-front setup effort.
|
# ¿ Jan 23, 2017 23:00 |
|
Thermopyle posted:The best way to do this is look at that javascript and see what it doing to get the date/time and then do that with python. So, maybe it's doing an AJAX request to some url, and you can do this with requests in python. This often fails because you've got to have specific cookies or something else the page sets up in its environment and it's a bitch to reverse engineer. You can also have Phantom/Slimer save the rendered DOM as HTML to disk pretty easily if there's no complicated login process to get to it.
|
# ¿ Jan 26, 2017 18:51 |
|
Dominoes posted:Thoughts? Sounds like you want a rules engine.
|
# ¿ Feb 10, 2017 14:43 |
|
Dominoes posted:Thanks, homes. From what I gather so far, sounds like I need to roll my own, STS!!! Django. There aren't some already kicking around out there?
|
# ¿ Feb 13, 2017 18:38 |
|
https://pymotw.com/3/ deserves a mention. I know the standard modules are a functionality mausoleum but there's still good stuff in there i you know where to look.
|
# ¿ Feb 28, 2017 16:43 |
|
|
# ¿ May 9, 2024 11:36 |
|
Dominoes posted:Thread's up. https://pymotw.com/3/ http://ironpython.net/ still technically exists!
|
# ¿ Mar 6, 2017 18:53 |