Search found 22 matches

by cagiva
Tue Nov 28, 2017 5:29 pm
Forum: General Discussion and Questions
Topic: How to get the file size
Replies: 3
Views: 412

Re: How to get the file size

That's exactly what I was looking for. Thank you, both.
by cagiva
Tue Nov 28, 2017 8:03 am
Forum: General Discussion and Questions
Topic: How to get the file size
Replies: 3
Views: 412

How to get the file size

Does MicroPython have a method to obtain the size of a file like os.path.getsize(filename)?
by cagiva
Sat Nov 18, 2017 6:16 pm
Forum: ESP8266 boards
Topic: Fragment identifier
Replies: 3
Views: 411

Re: Fragment identifier

@SpotlightKid, I'm not using any framework. I just wrote my own WSGI using the MicroPython API. I request the image by polling it from the browser via JavaScript.

@deshipu, thank you for the clarification. That makes sense now.
by cagiva
Sat Nov 18, 2017 8:21 am
Forum: ESP8266 boards
Topic: Fragment identifier
Replies: 3
Views: 411

Fragment identifier

Does MicroPython support URLs with fragment identifiers? https://en.wikipedia.org/wiki/Fragment_identifier I'm writing a small web server that polls a JPEG image that constantly changes (e.g.. like a live webcam feed). It's currently working by adding an unique cache-busting query parameter to the U...
by cagiva
Sat Nov 04, 2017 4:17 am
Forum: General Discussion and Questions
Topic: Benchmark comparison of MicroPython boards
Replies: 7
Views: 4533

Re: Benchmark comparison of MicroPython boards

Sorry for reviving this old thread, but I was wondering where does the OpenMV M7 board rank within this list?

https://openmv.io/
by cagiva
Tue Oct 31, 2017 6:13 am
Forum: ESP8266 boards
Topic: ure - regular expressions api
Replies: 4
Views: 542

Re: ure - regular expressions api

Hi Peter, I'm well aware that MicroPython does not support the entire python standard library. However, it will be great if the core team can consider extending the basic grouping syntax to add named-groups. It's a very helpful feature for parsing dynamic URIs/URLs containing named gapturing groups....
by cagiva
Mon Oct 30, 2017 7:41 am
Forum: ESP8266 boards
Topic: ure - regular expressions api
Replies: 4
Views: 542

Re: ure - regular expressions api

I was able to make it work without sub() and groupdict(). However, I cannot figure out why this generates ValueError: Error in regex, but it run perfectly fine with standard Python re api.

Code: Select all

import ure
ure.compile('^{}$'.format('/cam/(?P<epoch>.+)'))
by cagiva
Sun Oct 29, 2017 1:29 am
Forum: ESP8266 boards
Topic: ure - regular expressions api
Replies: 4
Views: 542

ure - regular expressions api

Why doesn't ure have the ure.sub() or match.groupdict() functions? Is there a workaround for that in the MicroPython?
by cagiva
Sat Oct 28, 2017 3:35 am
Forum: ESP8266 boards
Topic: Converting UTC in utime.localtime giving wrong date
Replies: 5
Views: 1529

Re: Converting UTC in utime.localtime giving wrong date

@The Royal We and @dhylands, thank you both for posting this information. It helped me a lot. I have just one question. "The Royal We" is getting GMT date/time, how did you convert it to PST? Just subtract 7 epoch hours?
by cagiva
Mon Oct 23, 2017 10:33 pm
Forum: General Discussion and Questions
Topic: File mode 'w+'
Replies: 1
Views: 309

File mode 'w+'

Does MicroPython support the 'w+' file mode? w+ : Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing. with open('log.tx', 'w+') as f: v = int(f.read()) v = v+1 f.write(str(v))