Re: [Tutor] starting to learn

2012-07-16 Thread Jugurtha Hadjar

On 07/12/2012 12:46 AM, blindmaildrop wrote:

Hello!

I am just starting to learn python, having signed up for a class on it in
University.  The last time I programmed anything was in the long long long
ago of BASIC and (well since I spent time doing other things) I missed the
development boat.

So starting from scratch, how-to?

thanks



Hello,

There are different types of people, each with their own learning style.

Personally, I found it hard to read books, because most of them write 40 
pages before getting to the point. Then another 40 pages before getting 
to the other point. If you programmed anything before, then you probably 
need to type code and get familiar with the syntax on a superficial 
level first (like copying examples given in the Index when programming 
BASIC).


There is a book, available for free which might help you do that: 
Directly to the point. Typing code and a lot of it. It's by Zed Shaw, 
and it's called "Learn Python The Hard Way". (If you're anything like 
me, you probably will like the title and like the book).



http://learnpythonthehardway.org


This book aims to "get you going", beating inertia. Then you can really 
start to "learn" Python. Read more code, read other books, etc..



--
~Jugurtha Hadjar,


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to get two user inputs in same prompt seperated by a special character?

2012-07-16 Thread Alan Gauld

On 14/07/12 04:46, Santosh Kumar wrote:


height_in_feet = input("How much feet are you long: ")
remaining_inches = input("How much inches remained? ")

Here I want something like:
Enter you height in format like 5' 10"


Mario has given a partial answer for this specific case although he 
missed stripping of the inches symbol " at the end.


However in the general case what you want to do is quite hard (and
the reason most UIs ask for separate values) You need to parse the 
character string input identifying any markers (like ' and ") and 
extract the values. There are several ways to do this:


1) use split() based on the markers, works well for simple cases,
less so for symbols like lbs, ft, etc

2) read the characters in one by one and process them using a state 
machine. Works well for simple cases with multiple char markers (or 
multiple variations of the same (like ' or ft or feet) and for formal 
specification of input format (typically where the input is normally a 
file and exceptionally a human).


3) use regular expressions to extract recognised patterns, works better 
for unstructured input.


3) use a formal parser to extract the values, most powerful but usually 
most work too.


But it is generally easier (for the programmer) and safer (better
data quality) to ask for each value explicitly.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] converting EBCIDIC to ASCII

2012-07-16 Thread Flynn, Stephen (L & P - IT)
I am trying to convert an EBCIDIC file to ASCII, when the records are
fixed length I can convert it fine, I have some files that are coming in
as variable length records, is there a way to convert the file in
Python? I tried using no length but then it just reads in to a fixed
buffer size and I can't seem to break the records properly

Hi Craig,

You might find it easier to pass the records through iconv if
you're on a Linux/Unix box and convert to ISO8859 from IBM037 (or
whatever codepage your ENCDIC files are in). There are versions of this
gnu software for Windows too, if that's your platform - it's trivial to
use. Shout if you need a hand.

Saying that, you'll almost certainly find that the 4 byte RDW
has been stripped from the file when it was sent to you, so you're not
being given any information to determine the length of each variable
length record.

Quick way to check - open the EBCDIC file up in an hex editor (I
use HxD (from http://mh-nexus.de/en/hxd/as it will happily run in EBCDIC
mode). If you can't see 4 bytes at the start of each record, then you're
in trouble as you have no way of determining the record length, without
the copybook for the file on the mainframe.

S.


This email and any attachment to it are confidential.  Unless you are the 
intended recipient, you may not use, copy or disclose either the message or any 
information contained in the message. If you are not the intended recipient, 
you should delete this email and notify the sender immediately.

Any views or opinions expressed in this email are those of the sender only, 
unless otherwise stated.  All copyright in any Capita material in this email is 
reserved.

All emails, incoming and outgoing, may be recorded by Capita and monitored for 
legitimate business purposes. 

Capita exclude all liability for any loss or damage arising or resulting from 
the receipt, use or transmission of this email to the fullest extent permitted 
by law.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] converting EBCIDIC to ASCII

2012-07-16 Thread Flynn, Stephen (L & P - IT)
> -Original Message-
> From: tutor-bounces+steve.flynn=capita.co...@python.org [mailto:tutor-
> bounces+steve.flynn=capita.co...@python.org] On Behalf Of Steven
D'Aprano
> Sent: Saturday, July 14, 2012 2:42 AM
> To: tutor@python.org
> Subject: Re: [Tutor] converting EBCIDIC to ASCII
> 
> Prinn, Craig wrote:
> > I am trying to convert an EBCIDIC file to ASCII, when the records
are
> fixed
> > length I can convert it fine, I have some files that are coming in
as
> > variable length records, is there a way to convert the file in
Python? I
> > tried using no length but then it just reads in to a fixed buffer
size
> and
> > I can't seem to break the records properly
> 
> 
> I'm afraid that I have no idea what you mean here. What are you
actually
> doing? What does "tried using no length" mean?

The conversion to ASCII from EBCDIC is only going to get Craig so far -
depending on how the sender transferred the files to him, there's a very
good chance that the 4 byte RDW (Record Descriptor Word) has been
stripped off the start of each record.

This 4 byte RDW should indicate that the next N bytes belong to this
record. Without it, you have no way of determining how long the current
record should be and thus where the next RDW should be. This makes
finding the start and end of records tricky to say the least.

I've written to Craig off list with some info as it's not particularly
relevant to Python, other than letting python do the work of iconv.

S.



This email and any attachment to it are confidential.  Unless you are the 
intended recipient, you may not use, copy or disclose either the message or any 
information contained in the message. If you are not the intended recipient, 
you should delete this email and notify the sender immediately.

Any views or opinions expressed in this email are those of the sender only, 
unless otherwise stated.  All copyright in any Capita material in this email is 
reserved.

All emails, incoming and outgoing, may be recorded by Capita and monitored for 
legitimate business purposes. 

Capita exclude all liability for any loss or damage arising or resulting from 
the receipt, use or transmission of this email to the fullest extent permitted 
by law.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] passing global variable as argument.

2012-07-16 Thread Bala subramanian
Friends,
I want to define a function that can populate an array by taking its name
(which is defined globally). I defined two empty arrays as follows and a
function that can populate the array.

REF_F1=np.array([])
REF_F2=np.array([])

# populating the given array
def ref(ln,REF_F1):
global REF_F1
REF_F1=np.zeros((ln,3),dtype='float32')
for i in range(ln):
for j in range(3):
   REF_F1x[i,j]=resid[Index[i]].cent()[j]

ref(ln, REF_F2)

In this case, when i pass REF_F2 as argument, the fn. always populates
array REF_F1. I also tried something like the following
*def ref(ln,x=REF_F1)* and then calling as *ref(ln,x=REF_F2)*. The result
is the same. Could someone please give me hint on how pass global variables
as arguments.

Thanks,
Bala








-- 
C. Balasubramanian
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Dave Angel
On 07/16/2012 07:00 AM, Bala subramanian wrote:
> Friends,
> I want to define a function that can populate an array by taking its name
> (which is defined globally). I defined two empty arrays as follows and a
> function that can populate the array.
>
> REF_F1=np.array([])
> REF_F2=np.array([])
>
> # populating the given array
> def ref(ln,REF_F1):
> global REF_F1
> REF_F1=np.zeros((ln,3),dtype='float32')
> for i in range(ln):
> for j in range(3):
>REF_F1x[i,j]=resid[Index[i]].cent()[j]
>
> ref(ln, REF_F2)
>
> In this case, when i pass REF_F2 as argument, the fn. always populates
> array REF_F1. I also tried something like the following
> *def ref(ln,x=REF_F1)* and then calling as *ref(ln,x=REF_F2)*. The result
> is the same. Could someone please give me hint on how pass global variables
> as arguments.
>
> Thanks,
> Bala
>
>
>

When you use a non-standard library, you really ought to mention what it
is.  I'm assuming np refers to numpy, which i'm not familiar with.  So I
won't address any particular quirks of that library.

When you use the global statement in a function, you are saying you want
a particular global value, so the argument detail is irrelevant.  Seems
to me it should have been a compile error.

Nix the global statement if you really want to pass it as an argument. 
And for readability, call the formal parameter something else, and do
not capitalize it.  it's not read-only; you're intending to change it.

Since I don't know numpy, I'll have to use a built-in type for example. 
I choose list.

(untested)
myglobal1 = [3,4]
myglobal2 = [5,6,7]

def  myfunc(ln, target):
while target: target.pop()
for i in xrange ln:
 target.append(3*i)
for j in xrange(ln):
 target[j] += 5

myfunc(10, myglobal1)
myfunc(5, myglobal2)

A key point is I do not bind my local variable target to a new object. 
If I do, I'll have no effect on the global object.  So I cannot use the
following line:
 target = []

I also notice you use 'ref' several places.  Perhaps you're under the
mistaken belief that Python does references.

-- 

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Wayne Werner

On Mon, 16 Jul 2012, Bala subramanian wrote:


Friends,
I want to define a function that can populate an array by taking its name
(which is defined globally).


Are you sure this is what you really want to do? I've noticed that many times
that I want to do something, but only because I don't understand how to do it a
better way.


I defined two empty arrays as follows and a
function that can populate the array.

REF_F1=np.array([])
REF_F2=np.array([])

# populating the given array
def ref(ln,REF_F1):
   global REF_F1


My command of the global syntax is a little weak, but I'm going to say what is
probably happening with this line is that you are telling python you now want
to refer to the REF_F1 that lives in the global namespace, not the one that was
passed in to your function.


   REF_F1=np.zeros((ln,3),dtype='float32')


This line here tells me that what I mentioned first is correct. You don't care
*what* the array is before hand, because you're actually zeroing the array.
Read the conclusion below.


   for i in range(ln):
   for j in range(3):
  REF_F1x[i,j]=resid[Index[i]].cent()[j]


I'm not sure what `resid` or `Index` are. Also, REF_F1x wasn't defined anywhere
so you're probably getting a name error here. When sending code, especially
misbehaving code, the best thing to do is provide a SMALL, but complete
program that can be run on its own, as long as one has the dependencies.



ref(ln, REF_F2)

In this case, when i pass REF_F2 as argument, the fn. always populates
array REF_F1. I also tried something like the following
*def ref(ln,x=REF_F1)* and then calling as *ref(ln,x=REF_F2)*. The result
is the same. Could someone please give me hint on how pass global variables
as arguments.


First off, the whole point of global variables are so that you don't have to
pass them as arguments. This is fine, and there are occasions where you
legitimately want to have a global variable - but this isn't one of them. When
you use globals improperly, they cause maintenance nightmares by making it
really hard to figure out what's going on in your code. At least Python
requires you to explicitly state that you care about some global value with the
global keyword.

But in this case it looks like you don't actually care about the original array
- you're completely replacing the values based on whatever the value of `ln`
  is. So instead you could do something like

def initialize_array(ln):
new_array = np.zeros((ln,3),dtype='float32')
for i in range(ln):
for j in range(3):
   new_array[i,j]=resid[Index[i]].cent()[j]
return new_array

And then you would call it like this:

REF_F2 = ref(ln)

HTH,
Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] newbie Questions

2012-07-16 Thread Matthew Ngaha
Hi all. I'm new to Python and Programming in general. I've started out with
Python for beginners, and so far so good. My friend who i might add, is not
a programmer but has had experience in the world of programming (i dont
know how much but he claims a lot), has told me to forget about Python and
focus on PHP. He knows i studied a HTML and CSS course and told me for the
direction i'm going in, Python is not needed and won't give me all the
options or variety PHP can. Thats he's opinion, i'd rather make my own mind
up, but its lead me to these questions out of curiousity:

a) at this early stage i dont exactly know what web options are:(  but is
Python limited when it comes to matters relating to Web options/developing?
b) Are there better options, or can Python get the job done as good as any?
c) after completing and understanding a beginner's book, would i be at
intermediate level, or still below?
d) Would i need a more advanced tutorial, what do you advise after
finishing a beginners course?

e) And finally, are there other essential things i must learn after Python?
i heard Django is important?
f) is Django the equivelent to PHP's MySql?

You dont have to answer all questions. Just answering one would help me
greatly in my future decisions, as i want to commit fully to the right
programming language.

since this isnt a forum, how can i thank everyone for helping?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Walter Prins
Hi Matthew,

On 16 July 2012 13:09, Matthew Ngaha  wrote:
> Hi all. I'm new to Python and Programming in general. I've started out with
> Python for beginners, and so far so good. My friend who i might add, is not
> a programmer but has had experience in the world of programming (i dont know
> how much but he claims a lot), has told me to forget about Python and focus
> on PHP. He knows i studied a HTML and CSS course and told me for the
> direction i'm going in, Python is not needed and won't give me all the
> options or variety PHP can. Thats he's opinion, i'd rather make my own mind
> up, but its lead me to these questions out of curiousity:

Well firstly you should note you're asking this on a Python mailing
list so you're likely to see some Python bias here. :) That being
said:

> a) at this early stage i dont exactly know what web options are:(  but is
> Python limited when it comes to matters relating to Web options/developing?

It's true that Python is more general than PHP.  So, while PHP
generally is almost exclusively focused on web development, Python is
a far mor generally useful programming language that happens to be
able to used in a web context if so desired.  So it depends on what
you mean by "limited" really.  There are probably more PHP websites
out there than Python based ones.  Does that make Python "more
limited"?  Perhaps not.  You need to probably be more specific.

> b) Are there better options, or can Python get the job done as good as any?

It depends on what the job is.  In general however I'd cautiously say
yes. Python can "get the job done as good as any" in most cases.

> c) after completing and understanding a beginner's book, would i be at
> intermediate level, or still below?

Impossible to say without knowing what book you worked through and testing you.

> d) Would i need a more advanced tutorial, what do you advise after finishing
> a beginners course?

Depends on what you're trying to accomplish.

>  e) And finally, are there other essential things i must learn after Python?

Probably yes.  But this is true of most programming languages...  If
you're going to do web development you will need to learn all there is
to know about how browsers and web servers funtion, how they exchange
requests and responses and everything else related to this (e.g.
cookies etc).  Even if a web framework or language takes care of a lot
of these details for you, you'll still need to get to a point where
you actually understand how everything works together IMHO.

> i heard Django is important?

Django is a web framework for/written in Python.  If you want to do
websites with Python it's a good option, although there are others
such as Turbogears, Web2Py.  See for example: http://is.gd/fo1FZ6

> f) is Django the equivelent to PHP's MySql?

Well, first to note that MySQL doesn't belong to PHP.  MySQL is a
seperate project and is used in many contexts quite apart from PHP.
It can be easily used from Python as well.

Django similarly as metioned is a web framework that can use several
database back-ends, including (but not limited to) MySQL.  For example
it can also use Postgresql, SQLite & Oracle.

>  You dont have to answer all questions. Just answering one would help me
> greatly in my future decisions, as i want to commit fully to the right
> programming language.

"Right" very much depend on your requirements.  That said, I'd prefer
Python over PHP any day.  But then, I would say that. :)

>  since this isnt a forum, how can i thank everyone for helping?

Just say "thank you" when you feel you want to by emailing the list as
you've just done.  :-)

Hope that helps a bit.

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Walter Prins
Hi again Matthew,

I forgot to include the following link which I originally thought to
include, which is one guy's set of (IMHO very cogent) criticisms
against PHP as programming language:  http://is.gd/z1POXC  Hopefully
it gives you something else to think about regarding the PHP vs Python
question apart from just whether doing websites in it is "easy".

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Monte Milanuk
Probably the single biggest 'problem' with Python for web development, in
my opinion, is that while a lot of web hosts have all sorts of PHP
templates or frameworks installed and ready for easy deployment... Python
options seem to be a bit sparser.  Individual hosts may vary, but thats the
overall sense of things that I've gotten

Please note I'm not saying that there are fewer Python options overall, or
that its in any way inferior... just a matter of market penetration.  PHP
has been one of the big dogs in open-source web development for a while,
merits or warts aside.  Python might be arguably 'better' in various ways,
but momentum in the market place is hard to ignore.

I'm guessing your friend 'sees' more PHP out there than Python too, hence
his recommendations.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Wayne Werner


On Mon, 16 Jul 2012, Walter Prins wrote:


Hi again Matthew,

I forgot to include the following link which I originally thought to
include, which is one guy's set of (IMHO very cogent) criticisms
against PHP as programming language:  http://is.gd/z1POXC  Hopefully
it gives you something else to think about regarding the PHP vs Python
question apart from just whether doing websites in it is "easy".



I read that article recently and recommend it as well. I used to
think that PHP was just fine... but since reading that article (and 
several related ones), I've since revised my opinion.


I would now tell someone to learn any language besides php.

-Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Joel Goldstick
On Mon, Jul 16, 2012 at 9:54 AM, Wayne Werner  wrote:
>
> On Mon, 16 Jul 2012, Walter Prins wrote:
>
>> Hi again Matthew,
>>
>> I forgot to include the following link which I originally thought to
>> include, which is one guy's set of (IMHO very cogent) criticisms
>> against PHP as programming language:  http://is.gd/z1POXC  Hopefully
>> it gives you something else to think about regarding the PHP vs Python
>> question apart from just whether doing websites in it is "easy".
>>
>
> I read that article recently and recommend it as well. I used to
> think that PHP was just fine... but since reading that article (and several
> related ones), I've since revised my opinion.
>
> I would now tell someone to learn any language besides php.
>
My take on this depends upon the background (and goal) of the new
learner.  In this list, and among people who care about professional
software development I'm sure python would win the question.  But for
someone with a passing curiosity about 'what is programming?', and
'can I make my own website?', he might be better served to learn a
little php coding (along with html and maybe css).  I say this
because, although python is really straightforward to learn as a first
language, or as a language to learn in order to understand computer
science concepts, I think it has a higher barrier to entry than
cobbling together some php and html in a text editor and copying it
into a directory that lets apache serve up php to a web browser.  This
might spur the learner to dig deeper. And that is where python will
prove a better fit.
-- 
Joel Goldstick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Steven D'Aprano

Matthew Ngaha wrote:

Hi all. I'm new to Python and Programming in general. I've started out with
Python for beginners, and so far so good. My friend who i might add, is not
a programmer but has had experience in the world of programming (i dont
know how much but he claims a lot), has told me to forget about Python and
focus on PHP. He knows i studied a HTML and CSS course and told me for the
direction i'm going in, Python is not needed and won't give me all the
options or variety PHP can. Thats he's opinion, i'd rather make my own mind
up, but its lead me to these questions out of curiousity:


What do you want to do? Do you want to program in a clean, fun language?

Or do you want to find it easy to get a low-paying coding job?

(Admittedly, low-paying is relative -- slinging PHP code may be at the bottom 
of the programming totem pole, but it's better than slinging hamburgers at 
McDonalds.)


There are more PHP jobs available than Python jobs. But there are also more 
PHP developers than Python developers, because every doofus with a copy of 
Idiots Guide To Idiot Programming thinks they can code in PHP :)


Seriously, you will be competing with a million other PHP coders, and ten 
million more in India willing to work for $10 an hour. *And* using a horrible 
language.




a) at this early stage i dont exactly know what web options are:(  but is
Python limited when it comes to matters relating to Web options/developing?


Absolutely not. Python has many powerful web development systems:

Django, Zope, Plone, MoinMoin, Trac, Pylons, TurboGears, and my favourite (for 
what little it's worth), CherryPy.


More here: http://wiki.python.org/moin/WebProgramming/

The one limitation is that while nearly all hosting providers supply PHP by 
default, only a few supply Python.




b) Are there better options, or can Python get the job done as good as any?


The opposite: some systems can get the job done almost as well as Python.



c) after completing and understanding a beginner's book, would i be at
intermediate level, or still below?


"If I tie two pieces of short string together, will it be as long as a long 
piece of string?"


:)




d) Would i need a more advanced tutorial, what do you advise after
finishing a beginners course?


Tutorials are great, but nothing beats programming. Program program program.

Even if your programs are never finished, just keep coding.



e) And finally, are there other essential things i must learn after Python?
i heard Django is important?


Django is one out of many web frameworks. If you don't like Django, there are 
alternatives.




f) is Django the equivelent to PHP's MySql?


No, and no.

Django is something like an application-builder for the web, using Python.

MySQL is a database which you can use from any programming language, including 
PHP and Python. There are many other databases, ranging from SQLite to 
Oracle's monster database systems. Python can talk to (nearly) them all.




You dont have to answer all questions. Just answering one would help me
greatly in my future decisions, as i want to commit fully to the right
programming language.


You will be a better programmer if you expose yourself to multiple different 
languages and programming paradigms. It's like being a cook: the world-class 
chefs learn many different styles of cooking, and are equally at home cooking 
Italian, Chinese or Cajun, and can invent new fusion recipes that combine the 
best of different cultures. Average chefs can grill a pretty good steak, and 
absolutely nothing else.




since this isnt a forum, how can i thank everyone for helping?


Dibs on your first born child!!!

But seriously, just remember that this is a community staffed by volunteers. 
Some day, you can give back to the community by helping others just as you 
were helped.




--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Extracting columns from many files to different files

2012-07-16 Thread susana moreno colomer

Hi!
I have a folder, with the following text files with columns:
 
bb_ 1
bb_2
ww_1
ww_2
ff_1
ff_2
 
What I want to do is:

Extract columns 5,6, 8 from files bb_
Extract columns 3,4 from files ww_
Get 5 files, corresponding to different columns:
Files (excel files): 'ro' with colums number 5,  'bf' with colums number 6,  
'sm' with column 8,  'se' with columns number 3 and  'dse' with columns number 4
 
I was following the example from: 
http://mail.python.org/pipermail/tutor/2009-February/067391.html 
 
import os
import fnmatch
import csv
 
path = '//(my path)/'
files=os.listdir(path)
csv_out=csv.writer(open('out1.csv', 'wb'),delimiter=' ')
 
ro=[]; bf=[]; sm=[]; se=[]; dse=[]

listofcolumns=[]
 
def column(tofile):

for infile in files:
filename= os.path.join(path,infile)
f=open(filename, 'r')
  
for line in f.readlines():
b=line.split('\t')

if fnmatch.fnmatch(filename, 'bb_*'):
A=[]; B=[]; C=[]; 
for b in line:
A.append(b[5].strip())
B.append(b[6].strip())
C.append(b[8].strip())
ro.append(A)
bf.append(B)
sm.append(C)
elif fnmatch.fnmatch(filename, 'ww_*'):
D=[]; E=[]
for b in line:
D.append(b[3])
E.append(b[4])

se.append(D)
dse.append(E)
f.close() 
#list of pairs of (value list, name)
listofcolumns=[(ro, 'ro'),(bf, 'bf'),(sm, 'sm'),(se, 'se'),(dse,'dse')]  
  
 for values, name in listofcolumns: 
   
output=open(name + '.csv', 'w')
   for value in values:
 csv_out.writerows(rows)
 csv_out.writerows('\n')
  
 column(listofcolumns)
 
It does't give me any error but gives me the documents in blank
Another question, Is there anyway to write the code properly ? I am sorry about 
the spaces, I can send a text file 
Many thanks! :D
  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Steven D'Aprano

Bala subramanian wrote:

Friends,
I want to define a function that can populate an array by taking its name
(which is defined globally). I defined two empty arrays as follows and a
function that can populate the array.


In general it is tricky to resize and populate numpy arrays in place. It is 
usually better to just create a fresh array and reassign it. Something like 
this should probably work:


def ref(length):
arr = np.zeros((length, 3), dtype='float32')
for i in range(length):
for j in range(3):
arr[i, j] = resid[Index[i]].cent()[j]
return arr


ref_f1 = ref(3)
ref_f2 = ref(5)


should work for you. (I can't test it because you don't say what resid and 
Index are.)




To explain why your earlier code does not work the way you expect, read on:



REF_F1=np.array([])
REF_F2=np.array([])

# populating the given array
def ref(ln,REF_F1):


So far this is good -- your function takes an argument called "REF_F1", which 
can be any array you like. It's just a local name.


The function sees REF_F1 is a local variable.



global REF_F1


But this is no good, because now you declare the name REF_F1 to be global 
instead of local. So now the function sees REF_F1 as a global variable, and 
everything that you do to it, occurs to the global called REF_F1.


By the way, this bug is no longer permitted in the latest version of Python. 
Using Python 3.2:


py> x = 23
py> def func(x):
... global x
... print("x =", x)
...
  File "", line 1
SyntaxError: name 'x' is parameter and global


In general, if you feel the need to use "global", 90% of the time you are 
doing something wrong and will have problems. You should avoid using global 
unless absolutely necessary.




--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Alexandre Zani
On Mon, Jul 16, 2012 at 5:09 AM, Matthew Ngaha  wrote:
> Hi all. I'm new to Python and Programming in general. I've started out with
> Python for beginners, and so far so good. My friend who i might add, is not
> a programmer but has had experience in the world of programming (i dont know
> how much but he claims a lot), has told me to forget about Python and focus
> on PHP. He knows i studied a HTML and CSS course and told me for the
> direction i'm going in, Python is not needed and won't give me all the
> options or variety PHP can. Thats he's opinion, i'd rather make my own mind
> up, but its lead me to these questions out of curiousity:
>
> a) at this early stage i dont exactly know what web options are:(  but is
> Python limited when it comes to matters relating to Web options/developing?

PHP will get you from 0 to website by the first page of your first
tutorial. That's very attractive if you're interested in web
programming. Most likely, if you use Python, you'll learn how to use
the language more generally, before learning how to apply the language
to a website. However, in my experience (I learned PHP a long time ago
and Python a few years ago) Python gives you the most reward. I've
used Python for website building, but also lots of other useful
applications.

> b) Are there better options, or can Python get the job done as good as any?

It depends upon the job. If you plan on work as a programmer/software
engineer, you will need to learn many languages. Yes, hammers can be
used to put in screws and you could probably figure out how to use a
screwdriver to put in a nail, but really, you're going to be
successful if you have both a hammer and a screwdriver in your
toolbox. Java, C, Python, C++, each have their own uses. However, (and
this may be a biased assessment) PHP is more like a hammer with its
head removed and a screwdriver duct-taped on it. Sure, you can use it,
but it's not going to be a pleasant experience.

The languages which I would say are closest to Python in terms of
where they are put to use are Perl and Ruby. My advice is this: give
them each a shot (the first couple pages of a tutorial shouldn't take
more than a few hours) and see which makes you feel the most
comfortable.

> c) after completing and understanding a beginner's book, would i be at
> intermediate level, or still below?
> d) Would i need a more advanced tutorial, what do you advise after finishing
> a beginners course?

Code, code, code. Programming is a practice. You'll learn the most by
doing and researching solutions for specific problems you are
encountering. Then, read blog posts, watch PyCon videos, look at the
mailing list etc... Just expose yourself to the language and community
and learn through osmosis.

>
> e) And finally, are there other essential things i must learn after Python?
> i heard Django is important?

Django is just one way to do Python web development. It's hugely
useful for some things and terribly useless for others. There are
plenty of other ways to do web development.

> f) is Django the equivelent to PHP's MySql?

As plenty of people have said, Django is a way to make websites while
MySQL is a database system. You can actually use MySQL with Django.

>
> You dont have to answer all questions. Just answering one would help me
> greatly in my future decisions, as i want to commit fully to the right
> programming language.
>
> since this isnt a forum, how can i thank everyone for helping?
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Bala subramanian
Thank you wayne and steven. You suggestion to create a fresh array within
the function and assigning it to variable worked fine and the result was
exactly what i was looking for. In future i remember not to use global
variables as fn. parameters.

thanks once again for detailed explanation,
bala

On Mon, Jul 16, 2012 at 5:06 PM, Steven D'Aprano wrote:

> Bala subramanian wrote:
>
>> Friends,
>> I want to define a function that can populate an array by taking its name
>> (which is defined globally). I defined two empty arrays as follows and a
>> function that can populate the array.
>>
>
> In general it is tricky to resize and populate numpy arrays in place. It
> is usually better to just create a fresh array and reassign it. Something
> like this should probably work:
>
> def ref(length):
> arr = np.zeros((length, 3), dtype='float32')
> for i in range(length):
> for j in range(3):
> arr[i, j] = resid[Index[i]].cent()[j]
> return arr
>
>
> ref_f1 = ref(3)
> ref_f2 = ref(5)
>
>
> should work for you. (I can't test it because you don't say what resid and
> Index are.)
>
>
>
> To explain why your earlier code does not work the way you expect, read on:
>
>
>
>  REF_F1=np.array([])
>> REF_F2=np.array([])
>>
>> # populating the given array
>> def ref(ln,REF_F1):
>>
>
> So far this is good -- your function takes an argument called "REF_F1",
> which can be any array you like. It's just a local name.
>
> The function sees REF_F1 is a local variable.
>
>
>  global REF_F1
>>
>
> But this is no good, because now you declare the name REF_F1 to be global
> instead of local. So now the function sees REF_F1 as a global variable, and
> everything that you do to it, occurs to the global called REF_F1.
>
> By the way, this bug is no longer permitted in the latest version of
> Python. Using Python 3.2:
>
> py> x = 23
> py> def func(x):
> ... global x
> ... print("x =", x)
> ...
>   File "", line 1
> SyntaxError: name 'x' is parameter and global
>
>
> In general, if you feel the need to use "global", 90% of the time you are
> doing something wrong and will have problems. You should avoid using global
> unless absolutely necessary.
>
>
>
> --
> Steven
> __**_
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor
>



-- 
C. Balasubramanian
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread taserian
On Mon, Jul 16, 2012 at 10:58 AM, susana moreno colomer <
susana...@hotmail.com> wrote:

>  Hi!
> I have a folder, with the following text files with columns:
>
> bb_ 1
> bb_2
> ww_1
> ww_2
> ff_1
> ff_2
>
> What I want to do is:
>
>- Extract columns 5,6, 8 from files bb_
>- Extract columns 3,4 from files ww_
>- Get 5 files, corresponding to different columns:
>- Files (excel files): 'ro' with colums number 5,  'bf' with colums
>number 6,  'sm' with column 8,  'se' with columns number 3 and  'dse' with
>columns number 4
>
> How are these columns separated? Blank spaces, tabs, commas?

I'm mostly worried about:

for b in line:
A.append(b[5].strip())
B.append(b[6].strip())
C.append(b[8].strip())

For the A List, this will take the 5th character from the line, not the 5th
column. You may need to split the line based on the separators.

AR
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread Joel Goldstick
On Mon, Jul 16, 2012 at 12:11 PM, taserian  wrote:
> On Mon, Jul 16, 2012 at 10:58 AM, susana moreno colomer
>  wrote:
>>
>> Hi!
>> I have a folder, with the following text files with columns:
>>
>> bb_ 1
>> bb_2
>> ww_1
>> ww_2
>> ff_1
>> ff_2
>>
>> What I want to do is:
>>
>> Extract columns 5,6, 8 from files bb_
>> Extract columns 3,4 from files ww_
>> Get 5 files, corresponding to different columns:
>> Files (excel files): 'ro' with colums number 5,  'bf' with colums number
>> 6,  'sm' with column 8,  'se' with columns number 3 and  'dse' with columns
>> number 4
>
> How are these columns separated? Blank spaces, tabs, commas?
>
> I'm mostly worried about:
>
>
> for b in line:
> A.append(b[5].strip())
> B.append(b[6].strip())
> C.append(b[8].strip())
>
> For the A List, this will take the 5th character from the line, not the 5th
> column. You may need to split the line based on the separators.
>
> AR
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
To make your code show correctly you must set your email program to
write text and not html.  You should also set your text editor to turn
tabs into 4 spaces.  Tabs work in python, but you can't mix tabs and
spaces, so it is less of a problem if you only use spaces for
indenting


-- 
Joel Goldstick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread susana moreno colomer

They are separated by tabs

> Date: Mon, 16 Jul 2012 12:16:22 -0400
> Subject: Re: [Tutor] Extracting columns from many files to different files
> From: joel.goldst...@gmail.com
> To: taser...@gmail.com
> CC: susana...@hotmail.com; tutor@python.org
> 
> On Mon, Jul 16, 2012 at 12:11 PM, taserian  wrote:
> > On Mon, Jul 16, 2012 at 10:58 AM, susana moreno colomer
> >  wrote:
> >>
> >> Hi!
> >> I have a folder, with the following text files with columns:
> >>
> >> bb_ 1
> >> bb_2
> >> ww_1
> >> ww_2
> >> ff_1
> >> ff_2
> >>
> >> What I want to do is:
> >>
> >> Extract columns 5,6, 8 from files bb_
> >> Extract columns 3,4 from files ww_
> >> Get 5 files, corresponding to different columns:
> >> Files (excel files): 'ro' with colums number 5,  'bf' with colums number
> >> 6,  'sm' with column 8,  'se' with columns number 3 and  'dse' with columns
> >> number 4
> >
> > How are these columns separated? Blank spaces, tabs, commas?
> >
> > I'm mostly worried about:
> >
> >
> > for b in line:
> > A.append(b[5].strip())
> > B.append(b[6].strip())
> > C.append(b[8].strip())
> >
> > For the A List, this will take the 5th character from the line, not the 5th
> > column. You may need to split the line based on the separators.
> >
> > AR
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
> To make your code show correctly you must set your email program to
> write text and not html.  You should also set your text editor to turn
> tabs into 4 spaces.  Tabs work in python, but you can't mix tabs and
> spaces, so it is less of a problem if you only use spaces for
> indenting
> 
> 
> -- 
> Joel Goldstick
  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread Joel Goldstick
On Mon, Jul 16, 2012 at 12:24 PM, susana moreno colomer
 wrote:
> They are separated by tabs
>
>> Date: Mon, 16 Jul 2012 12:16:22 -0400
>> Subject: Re: [Tutor] Extracting columns from many files to different files
>> From: joel.goldst...@gmail.com
>> To: taser...@gmail.com
>> CC: susana...@hotmail.com; tutor@python.org
>
>>
>> On Mon, Jul 16, 2012 at 12:11 PM, taserian  wrote:
>> > On Mon, Jul 16, 2012 at 10:58 AM, susana moreno colomer
>> >  wrote:
>> >>
>> >> Hi!
>> >> I have a folder, with the following text files with columns:
>> >>
>> >> bb_ 1
>> >> bb_2
>> >> ww_1
>> >> ww_2
>> >> ff_1
>> >> ff_2
>> >>
>> >> What I want to do is:
>> >>
>> >> Extract columns 5,6, 8 from files bb_
>> >> Extract columns 3,4 from files ww_
>> >> Get 5 files, corresponding to different columns:
>> >> Files (excel files): 'ro' with colums number 5, 'bf' with colums number
>> >> 6, 'sm' with column 8, 'se' with columns number 3 and 'dse' with
>> >> columns
>> >> number 4
>> >
>> > How are these columns separated? Blank spaces, tabs, commas?
>> >
>> > I'm mostly worried about:
>> >
>> >
>> > for b in line:
>> > A.append(b[5].strip())
>> > B.append(b[6].strip())
>> > C.append(b[8].strip())
>> >
>> > For the A List, this will take the 5th character from the line, not the
>> > 5th
>> > column. You may need to split the line based on the separators.
>> >
>> > AR
>> >
>> > ___
>> > Tutor maillist - Tutor@python.org
>> > To unsubscribe or change subscription options:
>> > http://mail.python.org/mailman/listinfo/tutor
>> >
>> To make your code show correctly you must set your email program to
>> write text and not html. You should also set your text editor to turn
>> tabs into 4 spaces. Tabs work in python, but you can't mix tabs and
>> spaces, so it is less of a problem if you only use spaces for
>> indenting
>>
>>
>> --
>> Joel Goldstick
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
Its great that you are using spaces in your code editor, but the
reason your code isn't formatted in your emails is that you have rich
text editing or html editing on.  If you are using gmail, you can tell
this because it gives a word processor style ribbon of buttons at the
top of your edit window.


-- 
Joel Goldstick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Matthew Ngaha
Thanks guys, i didnt think i would get so many kind and helpful responses.
I am so grateful:x. I have read each and every reply and i am now very
confident in the direction i need to take. Everything is a lot clearer now.
Even though i'm new to programming, i am very intrigued by it and want to
dedicate a good portion of my time to it, and by reading the replies, i
know ive made the right choice in choosing Python over PHP:) To answer a
question on what was more important, a job that pays low, or to learn good
clean coding.. My answer is I want to devote my time in it for a love of
programming and to gain a deeper understanding on it. the money part is not
as important:)The book i am currently reading is "Python Programming for
the absolute beginner". I will save this mail in a special place on my hard
drive:) i really appreciate it guys:)


On Mon, Jul 16, 2012 at 4:16 PM, Alexandre Zani wrote:

> On Mon, Jul 16, 2012 at 5:09 AM, Matthew Ngaha 
> wrote:
> > Hi all. I'm new to Python and Programming in general. I've started out
> with
> > Python for beginners, and so far so good. My friend who i might add, is
> not
> > a programmer but has had experience in the world of programming (i dont
> know
> > how much but he claims a lot), has told me to forget about Python and
> focus
> > on PHP. He knows i studied a HTML and CSS course and told me for the
> > direction i'm going in, Python is not needed and won't give me all the
> > options or variety PHP can. Thats he's opinion, i'd rather make my own
> mind
> > up, but its lead me to these questions out of curiousity:
> >
> > a) at this early stage i dont exactly know what web options are:(  but is
> > Python limited when it comes to matters relating to Web
> options/developing?
>
> PHP will get you from 0 to website by the first page of your first
> tutorial. That's very attractive if you're interested in web
> programming. Most likely, if you use Python, you'll learn how to use
> the language more generally, before learning how to apply the language
> to a website. However, in my experience (I learned PHP a long time ago
> and Python a few years ago) Python gives you the most reward. I've
> used Python for website building, but also lots of other useful
> applications.
>
> > b) Are there better options, or can Python get the job done as good as
> any?
>
> It depends upon the job. If you plan on work as a programmer/software
> engineer, you will need to learn many languages. Yes, hammers can be
> used to put in screws and you could probably figure out how to use a
> screwdriver to put in a nail, but really, you're going to be
> successful if you have both a hammer and a screwdriver in your
> toolbox. Java, C, Python, C++, each have their own uses. However, (and
> this may be a biased assessment) PHP is more like a hammer with its
> head removed and a screwdriver duct-taped on it. Sure, you can use it,
> but it's not going to be a pleasant experience.
>
> The languages which I would say are closest to Python in terms of
> where they are put to use are Perl and Ruby. My advice is this: give
> them each a shot (the first couple pages of a tutorial shouldn't take
> more than a few hours) and see which makes you feel the most
> comfortable.
>
> > c) after completing and understanding a beginner's book, would i be at
> > intermediate level, or still below?
> > d) Would i need a more advanced tutorial, what do you advise after
> finishing
> > a beginners course?
>
> Code, code, code. Programming is a practice. You'll learn the most by
> doing and researching solutions for specific problems you are
> encountering. Then, read blog posts, watch PyCon videos, look at the
> mailing list etc... Just expose yourself to the language and community
> and learn through osmosis.
>
> >
> > e) And finally, are there other essential things i must learn after
> Python?
> > i heard Django is important?
>
> Django is just one way to do Python web development. It's hugely
> useful for some things and terribly useless for others. There are
> plenty of other ways to do web development.
>
> > f) is Django the equivelent to PHP's MySql?
>
> As plenty of people have said, Django is a way to make websites while
> MySQL is a database system. You can actually use MySQL with Django.
>
> >
> > You dont have to answer all questions. Just answering one would help me
> > greatly in my future decisions, as i want to commit fully to the right
> > programming language.
> >
> > since this isnt a forum, how can i thank everyone for helping?
> >
> >
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread Dave Angel
On 07/16/2012 12:58 PM, Joel Goldstick wrote:
> On Mon, Jul 16, 2012 at 12:24 PM, susana moreno colomer
>  wrote:
>> They are separated by tabs
You're top-posting again.  The history of all these other messages is
thoroughly obfuscated if you don't follow the convention of adding your
remarks AFTER the part you're quoting.

>> 
>> for b in line:
>> A.append(b[5].strip())
>> B.append(b[6].strip())
>> C.append(b[8].strip())
>>
>> For the A List, this will take the 5th character from the line, not the
>> 5th
>> column. You may need to split the line based on the separators.
>>
>> AR
>>
>> To make your code show correctly you must set your email program to
>> write text and not html. You should also set your text editor to turn
>> tabs into 4 spaces. Tabs work in python, but you can't mix tabs and
>> spaces, so it is less of a problem if you only use spaces for
>> indenting
>>
>>
>> --
>> Joel Goldstick
>>
> Its great that you are using spaces in your code editor, but the
> reason your code isn't formatted in your emails is that you have rich
> text editing or html editing on.  If you are using gmail, you can tell
> this because it gives a word processor style ribbon of buttons at the
> top of your edit window.
>
>

You'll notice that you've successfully confused Joel, by not putting
your remarks AFTER his query.

Since you have tabs in your source file (and some people do prefer tabs
for some obscure reason), the easiest way to get rid of them is the
Linux utility 'expand'.

-- 

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Extracting columns from many files to different files

2012-07-16 Thread Walter Prins
Hi

On 16 July 2012 15:58, susana moreno colomer  wrote:
> Hi!
> I have a folder, with the following text files with columns:

If I may ask, how does this question relate to your previous similar
question(s)?  What do you want to do with these 5 files once you have
them?  (Differently put, does this question imply you've succeeded
with your previous question(s) and now you're onto the next step or a
different problem, or does this question imply you've given up with
the previous line of endeavour and are now just trying a new tack to
the same problem?)

Anyway, it seems to me you're trying to cobble something together for
your purposes from sources on the web without (possibly) really
understanding what the code is doing.  It may be easier and better in
the long run to just write your own solution to your own specific
problem requirements.

Regarding the code/formatting, as others have suggested, you should
ideally try to paste plaintext formatted with nothing more than
spaces, but you may also consider pasting your code using pastebin:
http://pastebin.com/

Cheers,

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Jordan
I would just like to add that I am a web developer and I left PHP for
Python. I left PHP because it was not as powerful server side (Cron Jobs
and Such) and I wanted to possibly create desktop applications, more
recently Android Apps via SL4A and IPhone Apps via pyjamas. PHP is a
limited language although there have been attempts at making it work for
desktop apps,it just was not designed as a generally use language like
Python. But the choice is yours and the path for Python in web
development may be a little more trickier than PHP; but when you want to
do more than web development you will realize Python is the way to go.
Also just one more note Python code is so much easier to read than PHP,
and the language as a whole is much more consistent, thanks PEP 8.

On 07/16/2012 03:54 PM, Wayne Werner wrote:
>
> On Mon, 16 Jul 2012, Walter Prins wrote:
>
>> Hi again Matthew,
>>
>> I forgot to include the following link which I originally thought to
>> include, which is one guy's set of (IMHO very cogent) criticisms
>> against PHP as programming language:  http://is.gd/z1POXC  Hopefully
>> it gives you something else to think about regarding the PHP vs Python
>> question apart from just whether doing websites in it is "easy".
>>
>
> I read that article recently and recommend it as well. I used to
> think that PHP was just fine... but since reading that article (and
> several related ones), I've since revised my opinion.
>
> I would now tell someone to learn any language besides php.
>
> -Wayne
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie Questions

2012-07-16 Thread Vignesh Sathiamoorthy
Check out http://www.udacity.com/

Enroll in few courses - to begin with, check
http://www.udacity.com/view#Course/cs101/CourseRev/apr2012/Unit/671001/Nugget/675002





On Mon, Jul 16, 2012 at 5:09 AM, Matthew Ngaha  wrote:

> Hi all. I'm new to Python and Programming in general. I've started out
> with Python for beginners, and so far so good. My friend who i might add,
> is not a programmer but has had experience in the world of programming (i
> dont know how much but he claims a lot), has told me to forget about Python
> and focus on PHP. He knows i studied a HTML and CSS course and told me for
> the direction i'm going in, Python is not needed and won't give me all the
> options or variety PHP can. Thats he's opinion, i'd rather make my own mind
> up, but its lead me to these questions out of curiousity:
>
> a) at this early stage i dont exactly know what web options are:(  but is
> Python limited when it comes to matters relating to Web options/developing?
> b) Are there better options, or can Python get the job done as good as any?
> c) after completing and understanding a beginner's book, would i be at
> intermediate level, or still below?
> d) Would i need a more advanced tutorial, what do you advise after
> finishing a beginners course?
>
> e) And finally, are there other essential things i must learn after
> Python? i heard Django is important?
> f) is Django the equivelent to PHP's MySql?
>
> You dont have to answer all questions. Just answering one would help me
> greatly in my future decisions, as i want to commit fully to the right
> programming language.
>
> since this isnt a forum, how can i thank everyone for helping?
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] starting to learn

2012-07-16 Thread Vignesh Sathiamoorthy
Have you explored (
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/
)

check out their assignments, sample programs, lecture notes ..

Also start reading/executing examples/codes from
http://docs.python.org/tutorial/index.html



On Wed, Jul 11, 2012 at 4:46 PM, blindmaildrop wrote:

> Hello!
>
> I am just starting to learn python, having signed up for a class on it in
> University.  The last time I programmed anything was in the long long long
> ago of BASIC and (well since I spent time doing other things) I missed the
> development boat.
>
> So starting from scratch, how-to?
>
> thanks
>
> --c.
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor