Search found 1056 matches

by pfalcon
Sat Oct 20, 2018 10:24 pm
Forum: General Discussion and Questions
Topic: re.sub regex won't match
Replies: 9
Views: 147

Re: re.sub regex won't match

devnull, I'm not sure what you're talking about. There're 2 my replies above, one clearly addressed to you, another to dhylands. Feel free to skip anything not addressed to you (or anything at all).
by pfalcon
Sat Oct 20, 2018 10:14 am
Forum: Programs, Libraries and Tools
Topic: Improvements to uctypes module/infrastructure
Replies: 5
Views: 267

Re: Improvements to uctypes module/infrastructure

Updated docs for the uctypes module are available at https://pycopy.readthedocs.io/en/latest ... types.html . (So far, these capture the state of the module before the changes described in this thread.)
by pfalcon
Sat Oct 20, 2018 9:28 am
Forum: General Discussion and Questions
Topic: re.sub regex won't match
Replies: 9
Views: 147

Re: re.sub regex won't match

The bug is in the re module As mentioned above, there's no (builtin) "re" module in MicroPython, only "ure". And "ure" works per the specification (that being absolutely smallest and not duplicating functionality already provided by MicroPython, like quoting). However, there's a bug in some ports, ...
by pfalcon
Sat Oct 20, 2018 9:18 am
Forum: General Discussion and Questions
Topic: re.sub regex won't match
Replies: 9
Views: 147

Re: re.sub regex won't match

and also I don't use cpython. Well, you should. MicroPython Unix port and reference implementation of the Python language, CPython, should be at the fingertips of every MicroPython programmer, or they complicate their lives unnecessarily - literally, looking at the vast (Micro)Python landscape thru...
by pfalcon
Sat Oct 20, 2018 6:32 am
Forum: General Discussion and Questions
Topic: a question about const(..)
Replies: 4
Views: 78

Re: a question about const(..)

It seems you can't use const in the while loop. Of course not. The only use for const is *defining* symbolic constants, before const there should be "=", and before it - the name of constant. Also, should be imported properly: from micropython import const c = const(x+y) This isn't needed, the sum ...
by pfalcon
Fri Oct 19, 2018 9:32 pm
Forum: Programs, Libraries and Tools
Topic: Calling OS kernel syscalls from MicroPython
Replies: 0
Views: 446

Calling OS kernel syscalls from MicroPython

Made a quick example how to make a syscall into kernel of a Unix system: https://github.com/pfalcon/micropython-projs/blob/master/syscalls/syscall.py . More specifically, the example is for Linux, but the man for helper function, syscall() says it was available since the original BSD Unix, so might ...
by pfalcon
Fri Oct 19, 2018 6:17 am
Forum: Programs, Libraries and Tools
Topic: micropython-lib project: CPython backports
Replies: 2
Views: 117

Re: micropython-lib project: CPython backports

This is a very helpful contribution, thanks! I see it as being especially useful for unit testing where it can be much easier to run tests (at least first) on a PC. Right. But actually, it's possible for quite some to do unit testing using MicroPython itself (with Unix port if doing on a PC). The c...
by pfalcon
Wed Oct 17, 2018 5:12 pm
Forum: General Discussion and Questions
Topic: .isalpha() works for ascii only :-(
Replies: 1
Views: 65

Re: .isalpha() works for ascii only :-(

So this experimentally proves that .isalpha() seems to be restricted to ASCII. Sure. How bloated the micropython binary would be otherwise (and how little would be left for your apps)? is there an alternative in MicroPython() that works as .isalpha() in Python2? Who asks? Must be a complete Python ...
by pfalcon
Wed Oct 17, 2018 5:02 pm
Forum: General Discussion and Questions
Topic: re.sub regex won't match
Replies: 9
Views: 147

Re: re.sub regex won't match

MicroPython doesn't have issues with r-strings (unless someone provides a testcase). As often happens, this case has 2 layers of confusion. First of all, the regexp is not correct for the purpose stated (can be easily verified in CPython). Secondly ure (sic!) module doesn't implement any superfluous...
by pfalcon
Wed Oct 17, 2018 12:07 pm
Forum: General Discussion and Questions
Topic: Minimal MicroPython uwebsockets.client that works on esp8266
Replies: 3
Views: 80

Re: Minimal MicroPython uwebsockets.client that works on esp8266

Can I use it to implement a websocket client like I did wih uwebsockets module? Well, as was mentioned, WebREPL uses it. Both server side as runs on ESP8266, and client side (webrepl_cli.py), though in the latter, it was disabled and switched to an adhoc Python implementation to get the same script...