Failed to start -.-

3 posts / 0 new
Last post
xStatic
Failed to start -.-

Hello,

a fucking indentation error screwed up my testing-.-

I cant believe it!!

I was testing my code all the time in the simulator and wouldnt have
send it before havent tested it thouroughly!!

Well I cant proof that it wasnt my mistake(already had similar indentation issues when transferring code from my windows machine to my pi via WinSCP), but this happend to me before -.-
#
Just too bad I wasnt able to test a newly added, very important new function =(

best regards,

xStatic

Arron Churchill
Arron Churchill's picture
I understand you frustration :(

I understand you frustration, I have had this exact problem with Python a few times myself :(

Personally I find the way Python uses indentation to be helpful writing short bits of code, but clunky and error-prone for larger bits of code like this. It does not help that different editors do different things with tab characters.

As for copying code or other files between a Raspberry Pi and a Windows machine, I usually create a network share in Windows and mount that share on the Pi. It is not hard to do, but you will need to run the command to mount the share each time the Pi has been restarted.

First you will need to create a directory to mount the Windows share to. I usually create mine in the /mnt directory like this:

sudo mkdir /mnt/windows
sudo chown pi /mnt/windows

You only need to do this the first time, the next time the directory will already exist.

You can then run a rather long command to mount the Windows share onto this directory:

sudo mount.cifs //192.168.0.100/SHARENAME /mnt/windows -o rw,noperm,username=USERNAME

but replace:

  • 192.168.0.100 with the IP address of the Windows machine
  • SHARENAME with the name of the Windows share
  • /mnt/windows with the directory you created
  • USERNAME with your Windows username

When you run the mount.cifs command it will ask for your Windows password to access the share. After that you can then copy to and from the /mnt/windows directory like any other one on the Pi :)

I will be looking at all of the entries which did not work sometime later tomorrow. I will confirm with you if the indentation is indeed the cause of problem.

Geoff Riley
Geoff Riley's picture
Useful utility

If you're working command line on the Pi, then a very useful utility to install is 'mc' (Midnight Commander): it's a text based file management system very similar to an old DOS application called 'XTree' for the days of yore.

install it with

sudo apt install mc

and just run it with mc

It's extremely useful for when you've got an external drive mounted because it has two panes for you to copy between.

One of the first things I tend to install on a headless machine.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, cpp, perl, python.
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Comment Images
Files must be less than 10 MB.
Allowed file types: png gif jpg jpeg.
Comment Attachments
Files must be less than 10 MB.
Allowed file types: txt pdf nfo doc docx rtf jpg png gif bmp zip tar gz csv xls.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.