Comments (4)
It might seems a bit counterintuitive but, when you type run scratch.py
ampy looks for scratch.py
file in local machine current directory ("C:\Python27\Scripts" in this case), not board filesystem. However, it would be cool tho to actually run things from board filesystem. Correct me if I'm wrong.
from ampy.
I couldn't get it to work this way and hence I've resorted to exporting scratch.py
to main.py
and then using the variables there.
But to your point, if I replace my main.py with scratch.py
and run it using the command, ampy -p com4 run main.py
it works.
from ampy.
Yeah run works by copying the local file to the board and running it, not by running a file already on the board. If you're curious check the help output to see a good description of what it does (and other commands):
Run a script and print its output.
Run will send the specified file to the board and execute it immediately.
Any output from the board will be printed to the console (note that this is
not a 'shell' and you can't send input to the program).
Note that if your code has a main or infinite loop you should add the
--no-output option. This will run the script and immediately exit without
waiting for the script to finish and print output.
For example to run a test.py script and print any output after it finishes:
ampy --port /board/serial/port run test.py
Or to run test.py and not wait for it to finish:
ampy --port /board/serial/port run --no-output test.py
If you missed it too there's a good guide that describes the usage of the commands here: https://learn.adafruit.com/micropython-basics-load-files-and-run-code/run-code
from ampy.
Okay, thanks, mate! I have currently moved on from Windows CMD prompt to Ubuntu, which is a lot easier. I'll keep the above things in mind, though. GD^.
from ampy.
Related Issues (20)
- possibility to put files to a subdirectory
- not neccessarily working on esp32-cam-mb HOT 1
- Ampy cannot execute some commands due to various errors
- GET fails with CircuitPython
- On Ubuntu 22.04: ampy runs into an errror, ab ttyUSB0 is after then never available, till replugin the USB wire.
- put includes hidden folders like .git
- 未找到 'ampy' 命令
- timeout waiting for first EOF reception HOT 1
- Fix location of progress_bar
- How do printing and debug at minicom while ampy run? HOT 1
- I can run my main.py (blinky_1.py) test but the put command does not work
- new feature: add a STOP command HOT 1
- The reason why ampy is unreliable for a large number of boards, like ESP32CAM etc... HOT 2
- CAUTION - THIS PROJECT IS STALE (UNMAINTAINED). There is no point submitting PRs into it - nobody merges any of them... HOT 11
- Cannot upload file with specific starting character on Windows HOT 2
- `rmdir --missing-okay` not working on ESP32 w. MicroPython HOT 1
- infuriating behaviour of recursive put HOT 1
- ampy.pyboard.PyboardError: could not enter raw repl HOT 5
- ampy not working after raspberry pi 4 dist-upgrade
- Make a new release to PyPI please HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ampy.