Markx
Posts: 21
Joined: Thu Nov 08, 2012 12:19 pm

Help!

Fri Apr 05, 2013 10:20 pm

Hey guys, I'm traveling at the moment so I downloaded Python onto my laptop so I could keep learning while I pretend to work. I'm having a problem. When I try to make a directory I get a syntax error. I am typing mkdir myprogs. Is this because I have a 32 bit version of Python on a 64bit machine? Someone please help. I will be on the road for a few weeks and learning to code has become my passion.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Help!

Fri Apr 05, 2013 10:29 pm

Are you typing that at the Python prompt or at a command prompt? (You should be typing it at a command prompt.)
Director of Communications, Raspberry Pi

Markx
Posts: 21
Joined: Thu Nov 08, 2012 12:19 pm

Re: Help!

Fri Apr 05, 2013 10:47 pm

Hi Liz, I'm typing python at the command prompt then I'm typing mkdir. Am I doing this arse about face? Sorry I'm a bit thick!

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Help!

Fri Apr 05, 2013 10:54 pm

Do it the other way around!
Director of Communications, Raspberry Pi

Markx
Posts: 21
Joined: Thu Nov 08, 2012 12:19 pm

Re: Help!

Fri Apr 05, 2013 11:00 pm

Will do. But how do I execute scripts from it? First time I've used python on a laptop or on any os except raspian. I'm a little confused so bear with my stupidity.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Help!

Fri Apr 05, 2013 11:04 pm

Generally you'd do that from the command line, by typing:

Code: Select all

python nameofscript
I'm off to bed, but I'm sure someone else can help you! (You might find a book on Python helpful - there are some free e-books at http://readwrite.com/2011/03/25/python- ... ingly-popu.)
Director of Communications, Raspberry Pi

Markx
Posts: 21
Joined: Thu Nov 08, 2012 12:19 pm

Re: Help!

Fri Apr 05, 2013 11:09 pm

Goodnight and thank you. I've been using zed shaws learn python the hard way, the magpi, and think python. They are all very useful. It's just python and windows that I am a little confused about. I love my Pi. Thanks again.

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany
Contact: Website

Re: Help!

Sat Apr 06, 2013 12:48 am

Hi,

what operating system is on the laptop?

Best regards

Alex

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Help!

Sat Apr 06, 2013 7:34 am

Windows still supports most commands listed under "DOS" :
http://www.yolinux.com/TUTORIALS/unix_f ... users.html

Can you start the python interpreter on the command-line
at all ? I always worked with IDLE and did not
come across that mode on Windows.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Markx
Posts: 21
Joined: Thu Nov 08, 2012 12:19 pm

Re: Help!

Wed Apr 10, 2013 10:20 am

Thanks to one and all for the speedy replies and offers of help. (And for not mentioning my stupidity.)
The great Zed A Shaw of learn python the hard way fame has released a brief but very usefull guide to the command line for Linux, apple, and windows machines. It is called clilearncodethehardway. It is simple to understand and well written.

Return to “General discussion”