Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Newbie Here

Reply
Thread Tools

Newbie Here

 
 
Mark Sargent
Guest
Posts: n/a
 
      05-31-2005
Hi All,

I'm taking the plunge into Python. I'm currently following this tutorial,
http://docs.python.org/tut/
I am not a programmer in general, although I've learnt a bit of bash
scripting and some php/asp. I want to get into python to use it for
Linux/Unix related stuff. A question I have, is, those of you who use it
for the same things, what do you primarily use it for. Could you show me
some examples.? I find the hardest thing with programming, is not
remember the syntax/logic etc, but, when to use it. Perhaps that is also
a personal thing, but, I'd love to see some basic examples out there.
Cheers.

Mark Sargent.
 
Reply With Quote
 
 
 
 
Peter Maas
Guest
Posts: n/a
 
      05-31-2005
Mark Sargent schrieb:
> I want to get into python to use it for
> Linux/Unix related stuff. A question I have, is, those of you who use it
> for the same things, what do you primarily use it for. Could you show me
> some examples.?


- little daily stuff e.g. transforming data
- sysadmin tasks (backup scripts)
- web applications (replacing asp/php)

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
 
Reply With Quote
 
 
 
 
raviteja.bhupatiraju@gmail.com
Guest
Posts: n/a
 
      05-31-2005
Not sure what you mean Unix related stuff. Anything can be.

I use Python as a general purpose language. Python is good for most
things I do.
Recently I used it for Web Applications (CherryPy), Search Engines
(Lupy, PyLucene), Middleware (Ice), Swing GUIs (Jython), data
transformations etc.

 
Reply With Quote
 
Rob Cowie
Guest
Posts: n/a
 
      05-31-2005
As a relalative newbie myself I think I can say Python is used for
anything any major programming language is used for. One of its many
strengths is scalability - it can be used to great effect as a
scripting language AND as an object oriented language for creating
large, GUI apps.

Yours is not an easy question to answer - there are as many uses for
python as there are 'computing tasks'.

Go to http://www.awaretek.com/tutorials.html for a load of tutorials
and examples

 
Reply With Quote
 
Peter Maas
Guest
Posts: n/a
 
      05-31-2005
Rob Cowie schrieb:
> As a relative newbie myself I think I can say Python is used for
> anything any major programming language is used for.


My list was meant as an enumeration of tasks for which _I_ _currently_
use Python. You are of course right that Python covers a much wider
range, although "anything any major programming language is used for"
is probably too wide. I would e.g. exclude device drivers, router
firmware etc.

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
 
Reply With Quote
 
Magnus Lycka
Guest
Posts: n/a
 
      05-31-2005
Mark Sargent wrote:
> A question I have, is, those of you who use it
> for the same things, what do you primarily use it for.


Erh, I'm sure different people use it for very different things.
In contrast to e.g. PHP or bash, Python is a very generic language
usable for most preogramming tasks. My answer would be "almost
everything when I need to do programming or calculate something".
I mainly complement Python with some SQL for work with databases
and C/C++ for performance, some integration, or when I have to,
due to "external forces". Actually, it's almost always the third
reason. It's very rare that I skip Python for performance reasons.

Note that Python is a very good "team player". It's often not a
matter of using Python OR [insert some other language] but rather
Python AND [insert some other language]. Of course, some languages,
such as Perl and Ruby are reasonably similar to Python, and using
them together will probably add little. I guess the Python/SQL/C/C++
combo is fairly common.

People use Python for various small scripts, for major business
applications, many different web systems, for image processing
(for everything from weather maps to Star Wars animations), as
embedded macro language in large applications, as a programmable
calculator, for data integration and conversion etc etc.

For a "business case" perspective on Python, look at www.pythonology.com
For coding examples, look at the Python Cookbok. See
http://aspn.activestate.com/ASPN/Python/Cookbook/

Other relevant sources for information for a newbie are...
http://mail.python.org/mailman/listinfo/tutor
http://www.freenetpages.co.uk/hp/alan.gauld/
http://www.uselesspython.com/
 
Reply With Quote
 
newcoder
Guest
Posts: n/a
 
      05-31-2005
The impression for me for python is that it can be scalable and you can
really build a full fledge application from it. In the past I used to
evangelized on certain language and think that the world is full of
philips screws that I can use my philips screwdriver to screw at. I was
totally wrong. But generally I think if you are looking at web
scripting, PHP is simple to learn and fast to execute; if you want to
automate and parse data on the fly, Perl is no doubt; and if you want
to build application and not in particular in execution speed, Python
is the way to go. I considered myself as a newbie too as I always
trying to learn a thing or two, here and there.

The way I learn to program usually I would get one of those open source
application written in whatever language I wish to learn and I would
study it from ground zero. I would try to understand the programmer
style and also try to understand his logic and why he want to do this
or that. You may think its crazy but I kinda like to pretend I am a
detective trying to solve a case. When you have the right attitude and
fun, you will pick up fast. This way you will basically learn
everything. Books are good but just don't get sucked into everything. I
discovered that in real programming life, 80% of what you apply comes
from the 20% of the knowledge you've learn. Just my n cents worth.

Pardon my political incorrect grammar if any, as I am not a native
english speaker.


Mark Sargent wrote:
> Hi All,
>
> I'm taking the plunge into Python. I'm currently following this tutorial,
> http://docs.python.org/tut/
> I am not a programmer in general, although I've learnt a bit of bash
> scripting and some php/asp. I want to get into python to use it for
> Linux/Unix related stuff. A question I have, is, those of you who use it
> for the same things, what do you primarily use it for. Could you show me
> some examples.? I find the hardest thing with programming, is not
> remember the syntax/logic etc, but, when to use it. Perhaps that is also
> a personal thing, but, I'd love to see some basic examples out there.
> Cheers.
>
> Mark Sargent.


 
Reply With Quote
 
Kent Johnson
Guest
Posts: n/a
 
      06-01-2005
Mark Sargent wrote:
> Hi All,
>
> I'm taking the plunge into Python. I'm currently following this tutorial,
> http://docs.python.org/tut/
> I am not a programmer in general, although I've learnt a bit of bash
> scripting and some php/asp. I want to get into python to use it for
> Linux/Unix related stuff. A question I have, is, those of you who use it
> for the same things, what do you primarily use it for. Could you show me
> some examples.? I find the hardest thing with programming, is not
> remember the syntax/logic etc, but, when to use it. Perhaps that is also
> a personal thing, but, I'd love to see some basic examples out there.


As others have said, Python is very useful for a wide range of tasks. But you asked for simple
examples. One thing I use Python for is simple file manipulations. I recently had to look through
2,400 folders to see if they contained two specific files in a nested subfolder. This is easy to do
in Python; below is my script.

Kent


''' Look in the warehouse for courses that are missing
\output\html\saveres.htm and/or \output\html\readres.htm

path module from http://www.jorendorff.com/articles/python/path/
'''

import path, sys

def checkCourses(basePath, out):
''' Iterate through the course / output / html folders rooted at basePath
looking for missing files.
'''
for coursePath in basePath.dirs():
htmlPath = coursePath / 'output' / 'html'
if not htmlPath.exists():
continue

for fileName in [ 'saveres.htm', 'readres.htm' ]:
aPath = htmlPath / fileName
if not aPath.exists():
print >>out, aPath
print >>out

basePath = path.path(r'\\Amrnasfs1\QA\BS_and_SIMS\Content')

out = open('MissingFiles.txt', 'w')
checkCourses(basePath, out)
 
Reply With Quote
 
Dave Cook
Guest
Posts: n/a
 
      06-02-2005
On 2005-05-31, Mark Sargent <(E-Mail Removed)> wrote:

> for the same things, what do you primarily use it for. Could you show me


Web apps using nevow/twisted for work, and pygtk apps for fun.

You might browse around sourceforge a bit:

http://sourceforge.net/softwaremap/t...p?form_cat=178

Dave Cook
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 7 02-10-2007 02:55 PM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 12-04-2006 12:00 AM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 10-06-2006 11:00 PM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 08-09-2006 11:00 PM
Try over here likely more to the point here George Hester Javascript 0 09-30-2004 03:14 AM



Advertisments