PDA

View Full Version : beginner programing question


someguy9200
26-11-2006, 10:53 PM
I'm trying to learn how to program with python using an online tutorial and it says I have to "set the path" to use script files but doesn't explain how. Can anyone please tell me how to do this. Thanks.

Slayer_of_the_Immortals
26-11-2006, 11:08 PM
Hum....Maybe this will help:

http://mail.python.org/pipermail/tutor/2005-January/034581.html

?

someguy9200
26-11-2006, 11:15 PM
ok i stil don't get it

someguy9200
27-11-2006, 12:20 AM
anyone have any ideas?

jaketo
27-11-2006, 01:04 AM
Hi someguy9200,

I appreciate you're keen to find the answer to your question but please don't double post, use the 'Edit' button if necessary and edit your previous post.

With reference to your query, which OS are you running?

someguy9200
27-11-2006, 01:41 AM
I have no idea what that means.

Slayer_of_the_Immortals
27-11-2006, 04:15 AM
What Opperating System do you have? Windows? XP? Vista? 98? Linix? OS 10? Etc.

Kalki
27-11-2006, 02:39 PM
My guess is that you should set the path environmental variable to include the python binaries?

someguy9200
27-11-2006, 09:02 PM
i have xp and i don't know what that means either... I'm starting to feel dumb

Slayer_of_the_Immortals
27-11-2006, 09:24 PM
Maybe yer just heading into it to fast?

someguy9200
27-11-2006, 09:35 PM
no i'm just stuck on this one part about setting the path and the tutorial doesn't say how

jaketo
27-11-2006, 10:33 PM
Ok, if I'm interpreting this correctly, you're running Windows XP and the tutorial you're using says you need to 'set the path' to use some script files.

As Kalki says, 'path' in Windows XP is an 'environment variable' (i.e. a setting that you can change which will be affective system-wide). You can access these system variables as follows -

On your computer desktop, click with the right-mouse click (RMC) onto the 'My Computer' icon and then left-mouse click (LMC) on 'Properties', then clcik on the 'Advanced' tab, then click on the 'Environment Variables' button, this will cunningly open the Environment Varibales dialogue box.

There are two kinds of environment variables, 'User Variables' and 'System Variables'. User variables will only affect the currently logged on user (i.e. you!), System Variables will effective for every user. You can set the same variable type set as both User and System variables with different values and the affect will be cumulative. The reason I mention this will be obvious in a moment.

The purpose of the Path variable is very simple. In brief, some applications need to be told where to find certain files that they need. By default these applcations will look in their working folder, then the root of any drives, and then every folder on the Path. So I'd guess that your Python application needs you add a folder onto the Path so Python knows where to find some files it needs.

The Usual Warning - as with most things on a PC, fiddling around with these variables could potentially have undesireable affects, so proceed with caution!

If you look under the System Variables, you'll see one for Path. It'll read something like '%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;'. This is fairly important so I'd advise against changing that, but at least it'll give you an idea of what one looks like. Instead, I'd suggest adding a Path variable as a User variable. This way, should you get it wrong, it won't affect the System variables.

Under the 'User variables for <user>' section, click on 'New'. The 'Variable name' will be 'Path' (without the apostrophes) and the 'Variable value' will be whatever the Python tutorial is asking for you to add into the path, something like 'c:\python\bin' (without the apostrophes) maybe. If you add more than one folder to the Path, separate each folder with a ';' (again, without the apostrophes!)

Hope that helps :)

Jake

EDIT - LMAO, I've just noticed this was my 1,337th post. Oh, the irony :D

someguy9200
27-11-2006, 10:44 PM
Thank you very very much for the help.

someguy9200
28-11-2006, 01:48 AM
I have another question. Do you know how to set a directory and how to make the directory your current one?

jaketo
28-11-2006, 02:12 AM
(I'd like to refer you to my previous comment about not double posting!)

Could you be a little more specific? From which program or app? The answer is probably 'yes I do', but first I need to know the question ;)

someguy9200
28-11-2006, 02:19 AM
python and what exactly does "double post mean"

Slayer_of_the_Immortals
28-11-2006, 02:32 AM
Posting two times in a row, without anyonelse posting first. It's much easier, and neater just to edit yer post instead of posting again.

Kalki
28-11-2006, 09:28 AM
Not to be mean or anything, I'm not sure you're ready to start coding python.
I think it might be good to start with common computer knowledge like operating systems, memory, harddrives, other IDE/EIDE/SATA/SCSI devices etc...

You'll end up needing to know alot about those things when you start to code, especially how a computer's memory works.

Don't get me wrong, I think it's great that you want to learn but you're starting in the wrong end, coding is what you start with when you have a good foundation.

Take jaketo as an example, he has excellent skills when it comes to operating systems, hardware and the platforms. He might not necessarily be a good coder but he's a hell of a techie. I might not know as much as he does about "his" things but I know enough to enable to me focus on "my" stuff, the databases and application development.

So I'd suggest learning the "jaketo" stuff first.


And Jake, that's so cool, that your 1337th post was so 1337 ;)

someguy9200
28-11-2006, 12:56 PM
Ok, so where do I learn all the "Jaketo stuff"?

Kalki
29-11-2006, 09:20 AM
Best thing is to first read books and then apply it to your own test environment.
If you can, get a windows 200x server book (or other operating system, doesn't really matter). After that get a crappy old PC and install the OS. Then read about things like:

DNS - And after you've read, install a DNS server on the PC
DHCP
Domain Controller
File server
Web server
etc etc

jaketo
29-11-2006, 10:21 AM
Couldn't agree more.

Read, fiddle, break, repair, play, experiment, break, repair, reinstall, repeat.

Start with a single PC environment first, so maybe buy on a book on Windows XP and basic PC hardware. The 'Idiot's Guide' range are very good. I'm not sure which timezone you're in but look here (http://www.amazon.co.uk/Windows-Dummies-2nd-Andy-Rathbone/dp/0764573268/sr=8-1/qid=1164794229/ref=pd_ka_1/203-5411680-8072761?ie=UTF8&s=books) on Amazon UK. Then read trhese books and play with your computer. Expect to break it sometimes, but I can guarantee that having to fix something that's broken is the best way to learn it :)

The n perhaps when you're happy with that start looking at server technologies such as DNS, DHCP etc. and start getting a feel for how things fit together in networks.

This should give you a very good grounding in how PCs/OSes work and how they fit together. Once you have that grounding, you should find learning to programme much easier because you'll be able to see how software interacts with the hardware and the OS on a PC.

Also remember that 'IT' is a huge arena, inculding many, many disciplines, so specialisation into one field might be a good idea.

The last thing I would recommend is to develop a very obsessive streak. All the best hardcore techies I know are obsessive nutters. I've been fiddling with computers since I was about 8 or 9 years old and I still get a huge rush out of it today :D

Take jaketo as an example, he has excellent skills when it comes to operating systems, hardware and the platforms. He might not necessarily be a good coder but he's a hell of a techie.

Woo-hoo, thank you! Kalki's pretty good in his field too! And this reinforces my point about specialisation! :)

Hatheildra
31-08-2007, 10:45 AM
Not to be mean or anything, I'm not sure you're ready to start coding python.
I think it might be good to start with common computer knowledge like operating systems, memory, harddrives, other IDE/EIDE/SATA/SCSI devices etc...

You'll end up needing to know alot about those things when you start to code, especially how a computer's memory works.

Don't get me wrong, I think it's great that you want to learn but you're starting in the wrong end, coding is what you start with when you have a good foundation.

Take jaketo as an example, he has excellent skills when it comes to operating systems, hardware and the platforms. He might not necessarily be a good coder but he's a hell of a techie. I might not know as much as he does about "his" things but I know enough to enable to me focus on "my" stuff, the databases and application development.



I know I should not pick a fight with you being annihilation and all but wow... The degree of pompousness and just plain rudeness is just so overwhelming I had to say something. This guy wants to learn programming and you tell him: " noo just go fiddle around on your pc" . The guy could be learning high level programming concepts and advanced algebra but noo he need to know every single useless registry key first. Also the cocky remark towards jaketo is just smelling till end of 2007. It is amazing. Almost as if you have an interest in keeping this 15 year old guy dumb.
kuddos

jaketo
31-08-2007, 06:09 PM
Hi Hatheildra

I see where you're you're coming from but as a new member to PR you're probably not familiar with some of the personalities and characteristics of some of the more established members.

Kalki for example may come across sometimes as a pompuous, sarcastic ass-fiddler but in reality is a thoroughly top bloke and means well, and will usually go out of his way to to help anyone in PR, or outside it for that matter.

Sometimes however, especially with technical matters from within his field, he can be a little sarcastic, espeically when the asker of the original question is stubbornly refusing to respond appropriately to all requests to help him, and also appears to assume that everyone here is a master of Python, has limitless free time to answer questions on it and are to a degree, telepathic.

We also have a very wry tone in Tech Disc, which sometimes can be construed as overly bombastic pomposity.

In this case I happen to agree with Kalki's comment and sadly also share his propensity for sarcasm given enough provocation :D