Jump to content

[Python] getting started?


Recommended Posts

Why am I finding it impossible to get started with Python?

Do I save it as a .py file?

how do i "run" the file?

Do i just open it in a browser like php?

 

 

2 days (hours and hours) worth of web searching for tutorials always results in command line jargon that is useless for any project/ authentic beginners project.  I downloaded a komodo free trial...tried their tutorials...useless yet again???

 

I know Python is an iterpreted language so things will need to be run through an interpreter like php through apache but how does this all fit together? I will be using python for the web btw...

 

background:

I've written large scale projects (procedural and oop) from scratch in php and as3 for the past 3 years including membership sites, galleries, and custom CMS's.

 

When i knew nothing about scripting...i remember installing xampp, opening up dreamweaver and typing some php. saving it and simply opening it up in the browser and Viola!  I was writing php in under an hour.

 

How can it be that I can't figure out anything regarding python?  how do i run test files? I tried opening a .py file with a browser through apache...nothing.  This seems like a big joke to me at this point.

Link to comment
Share on other sites

thanks for the reminder:

 

I actually did read that entire page prior (2 times) and once more after you linked to it.  What I got out of it was that python needs to be interpretted, like php and that there are frameworks built to dish out html/web code easier.

 

but frameworks exist in php too; but ive never used them. Never liked frameworks. I always just wrote all my own code -different philosophy then most i guess but it has worked fine thus far.

 

I was actually advised to learn django from a buddy who heads a web firm...so that i might be able to pick up some work with their company...but django wouldn't install (a bitNami package / I have windows xp)...either way i figured i could learn some python but haven't even come close to getting started...madness

 

web stuff aside, I'm not sure how to run anything in python.  I tried writing a simple script written in notepad...saving it as a ".py" file and opening it...nothing...opening it through apache...nothing.  These "elites" you speak of sure make lousy teachers.  The php community is loaded with superb tutorials.

 

How come I can make a valid website that incorporates as3, js, php, MySQL, html, css, xml seemlessly and runs like a sportscar but can't even figure out how to get this python bull $#!T started... uhggg so mad right now.

Link to comment
Share on other sites

ok it looks like both of you are suggesting some kind of add-on for apache...

I'm sure they both work fine but as always, the coder instructions assume too much prior knowledge.  seriously... tar balls I try researching them only to find out they are derived from tape storage? Are they kidding me? why is it coders get caught in the earliest days of coding and insist on carrying all this antiquated stuff forward...almost as to confuse by means of a pseudo form of wisdom:" i know this from way back when so i am smarter than you" - I had some awful teachers growing up that subscribed to that theory. 

 

When looking into django they suggested visiting an irc channel if I needed help irc?  irc=wtf.  I think the last time i heard of irc was when my friend was talking to some russian on his amiga computer in the late 80s.  why not have a normal web bulletin board like everyone else.  No, once again "we know this, you don't so you are dumb"

 

Mod_python  not sure what to do (of course)

what does the following mean:

 

1.Build and install a distributed Apache module, say mod_foo.c, into its own DSO mod_foo.so:

$ ./configure --prefix=/path/to/install --enable-foo=shared

$ make install

Where the heck does this get typed into?  A typewriter?

 

modwsgi no dice (once again)

To setup the package ready for building run the "configure" script from within the source code directory.

./configure

 

how on earth do i "run" something?  Are we going back to the BASIC language i was introduced to in 7th grade are we going to make the ^ symbol shoot up to the top of the page like a rocket?  ahhhh...cool.

 

everything i have ever opened on a computer, could be clicked on and opened ( i guess an .exe) but these modwsgi files don't even have extensions so i can't even research them; and the instructions are always useless and assume to much prior knowledge anyhow.

 

hopefully my rant will at least get a chuckle out of someone; enough to explain something. Thanks for listening:)

Link to comment
Share on other sites

Are you serious? Seeing as you're used to just clicking .exe files, I assume Windows. This is how you do it:

 

If using Windows you can use the precompiled binaries available for download or compile from source code.

 

Go download that: https://code.google.com/p/modwsgi/wiki/DownloadTheSoftware#Windows_Binary_Downloads

 

Then:

The appropriate mod_wsgi.so file for the version of Python and Apache being used should be copied into the Apache modules directory. For Apache 2.2, this would typically be directory:

 

/Program Files/Apache Software Foundation/Apache22/modules

 

[...]

 

To configure Apache to make use of mod_wsgi, follow the instructions for loading mod_wsgi in the Quick Installation Guide.

 

In the simplest case, all that is required is to add a line of the form:

 

LoadModule wsgi_module modules/mod_wsgi.so

 

into the main Apache "httpd.conf" configuration file at the same point that other Apache modules are being loaded.

 

So basically:

[*]Download file.

[*]Add line to config file.

[*]Restart Apache.

 

How much more simpler do you want it to be?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.