Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No file/directory found #40

Closed
vijaykarthik123 opened this issue Feb 2, 2018 · 4 comments
Closed

No file/directory found #40

vijaykarthik123 opened this issue Feb 2, 2018 · 4 comments

Comments

@vijaykarthik123
Copy link

image

Is this a bug? Am I doing something wrong with my run command?

@evemorgen
Copy link

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.

@vijaykarthik123
Copy link
Author

vijaykarthik123 commented Feb 5, 2018

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.

@tdicola
Copy link
Contributor

tdicola commented Feb 7, 2018

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

@vijaykarthik123
Copy link
Author

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^.

@tdicola tdicola closed this as completed Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants