Command Reference

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
schuschu
Posts: 3
Joined: Fri Feb 28, 2014 8:30 am

Command Reference

Post by schuschu » Fri Feb 28, 2014 9:28 pm

Is there some sort of reference of all currently implemented commands/functions? I was trying to execute a script from flash but can't seem to figure out how to do that (aside of main.py on startup).

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Command Reference

Post by dhylands » Sat Mar 01, 2014 4:40 pm

Not that I'm aware of.

Right now, the best thing to do is to look at the source. Look in stm/main.c and search for "add some functions" to get a list of custom functions available.

Other than that, I think that there are some examples in the exampless directory. I haven't tried them yet myself.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Command Reference

Post by pfalcon » Tue Mar 04, 2014 1:45 am

There's indeed none, because the project is still in active development phase - it's just more productive to maintain just source than two of source and docs, both in flux.

The easiest way to see if something is supported is to build a "unix" version and try it in the comfort of your "desktop" system, whatever that means nowadays. Second good reference is the testsuite: https://github.com/micropython/micropyt ... sts/basics . It has small scripts for each feature/function implemented (or that's the aim). The source is ultimate reference, as Dave says.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: Command Reference

Post by torwag » Tue Mar 04, 2014 10:19 am

This comes along the lines, whether micropython should use something like doxygen or Epydoc etc.
It will encourage devs to write meaningful commands, docstrings, etc. and can be a task for non-programmers to help with.
Even if this auto-generated doc is very limited, it is better then no doc.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Command Reference

Post by pfalcon » Wed Mar 05, 2014 2:00 am

Don't encourage devs - become one and submit patches ;-). Answering to specific suggestion, I don't see how doxygen and friends would help - they are for documenting *C* code. The approach I have in mind is that the documentation is at http://docs.python.org/3/ . We should just offer "differences" document, though level of detail of that is actually the main question. I wanted to start drafting some high-level doc like that for several weeks now, but still didn't get to it (having a chance to write a line, I prefer that line to be a code).

And besides that, there should be user-level docs and tutorials specific to PyBoard, and I'm sure that's next big task in Damien's queue, now that hopefully hardware production question is tackled. In the meantime, Kickstarter updates is the best reference for early adopter (that's at least how I now about stuff like boot.py/main.py , but as I work mostly on "unix" port, I'm not sure if more focused reference exists already).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: Command Reference

Post by torwag » Wed Mar 05, 2014 9:42 am

That is actually a very good idea.
We might can thing of a diff document structure which links to (or embed) the original doc and add a paragraph "Micropython:" to it. A semi-automatic system would allow to pull in new docs from python.org relatively easy just adding the micropython specific parts.

Tutorials and other stuff should start soon too. We are just in the middle to set-up the user wiki system.

BTW. Epydoc does for python what doxygen does for C.

And yes, if I find time I would love to splatter comments across code. We just would need to get an rule how those comments should look like.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Command Reference

Post by pfalcon » Sat Mar 22, 2014 10:19 pm

Here's first cut at differences doc mentioned above: http://forum.micropython.org/viewtopic.php?f=3&t=50
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply