Had the same problem trying to run a python script in the terminal at start up, here is what I did.
Raspberry pi 3 running OS: Raspbian, Version: 9 (stretch)
1) Go to
/home/pi/.config/autostart (If you cant find
/home/pi, Right Click in window and check "Show Hidden").
2) Right click>Create New...>Empty File. Name it, [whatever].desktop
3) Right Click on the new file and open in text editor.
4) Pasted the following and edit it to your liking.
Name=[name of this file, i.e. step 2]
Exec= lxterminal -e [Application, i.e. python3] [full path to the code you want to run]
5) save and reboot.
*There are other things you can put into your
.desktopfile but this works for me.