Re: [Tutor] str format conversion help

2010-07-15 Thread eMyListsDDg
thanks,
   

def conv_tst(bytes)

 return ('-'.join([binascii.hexlify(v) for v in bytes]))



i ended up experimenting with the suggestions and the above returns what i'm 
looking for, i.e., the formatted mac addr to store in a sqlite db. 

i'm sure there are other ways, though the above is working now.



mucho gracias all




> use de fucntion encode. For example:

> '\x7e\x00\x20'.encode('hex') will return that = '7e0020'  


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


Re: [Tutor] str format conversion help

2010-07-15 Thread ALAN GAULD


> print "[%s]" % ('-'.join([hex(v) for v in  theValue]) )

Oops, that leaves 0x at the front of each byte.

You could strip that off with

print "[%s]" % ('-'.join([hex(v)[2:] for v in  theValue]) )

Sorry,

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


Re: [Tutor] Request for help learning the right way to deal with listsin lists

2010-07-15 Thread Payal
On Tue, Jul 13, 2010 at 08:35:45AM +0100, Alan Gauld wrote:
> If the data gets more complex you could put the data into a class:
>
> class Book:
>  def __init__(self, title, pages=[]):
>  self.title = title
>  self.pages = pages
>
> Books = [ Book('War & Peace", [3,56,88]),
>   Book("Huck Finn", [2,5,19]) ]

Can someone please explain the above 2 lines?

> for book in Books:
> print book.title, book.pages

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


[Tutor] Parsing through decorators program

2010-07-15 Thread Mary Morris
So my new internship asked me to write a program that would parse through
all of our source code on an svn server, find all the decorators and print
them. I found all of the decorators by finding the '@' symbol.  What I still
have to do is write something that will make the computer print all of the
names of the decorators that it finds.  So far, this is what I have written:

# Written by Mary Morris
# July 2010
#





import os
import warnings
import traceback





##
#
#
def get_py_files(path):
ret = []
 if path[-1] != '/':
path += '/'
 files = os.listdir(path)
for file in files:
if file == '.svn':
continue
 if os.path.isdir(path + file + '/'):
temp = get_py_files(path + file + '/')
for ele in temp:
ret.append(ele)
 else:
ext = file.split('.')[-1]
if ext != 'py':
continue
 temp = path + file
temp = temp.replace('/', '\\')
 ret.append(temp)
 return ret










if __name__ == '__main__':
imports = {}
 files = get_py_files(os.getcwd())
 our_modules = [file.split('\\')[-1][:-3] for file in files]
 for file in files:
# for file in files[:1]:
f = open(file)
lines = f.readlines()
f.close()
 for line in lines:
line = line[:-1]
 #
# Conveniently, "import bleh" and "from bleh import bleh2" both have the
second string (when split) of "bleh"
#
if line.startswith('import') or line.startswith('from'):
line = line.replace('\t', ' ')
temp = [s for s in line.split(' ') if len(s) != 0]
 # This is because FirstAssist uses "import os, sys" (and similar) all over
the place...
if temp[1].find('@') != -1:
for ele in temp[1:]:
ele = ele.replace('@', '')
if not ele in imports.keys():
# imports[ele] = [file.split('\\')[-1]]
imports[ele] = [file]
else:
# imports[ele] += [file.split('\\')[-1]]
imports[ele] += [file]
else:
if not temp[1] in imports.keys():
# imports[temp[1]] = [file.split('\\')[-1]]
imports[temp[1]] = [file]
else:
# imports[temp[1]] += [file.split('\\')[-1]]
imports[temp[1]] += [file]
  external_imports = [im for im in imports.keys() if not im in our_modules]
 dependencies = []



Could you give me suggestions on how to make my program print the names of
the decorators?
Thanks,
Mary
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Path?

2010-07-15 Thread Jim Byrnes

Adam Bark wrote:

On 14 July 2010 17:41, Jim Byrnes  wrote:


Adam Bark wrote:


On 14 July 2010 02:53, Jim Byrnes   wrote:

  Adam Bark wrote:





  If I use the terminal to start the program it has no problem using the


  file.  There are multiple files in multiple directories so I was

looking
for
a way to just double click them and have them run.  If it turns out
that
I
must make changes to or for each of the files it will be easier to
just
keep
using the terminal.  I've only been using Ubuntu for a few months so
I
was
surprised that the program could not see a file that is in the same
directory.

Regards,  Jim




The problem is ubuntu doesn't run the script from the directory it's
in
so
it's looking for wxPython.jpg somewhere else.


  OK, I mistakenly thought that double-clicking on file in Nautilus
would


take care of the path info.

In my reply above I also mentioned that I tried by dropping it on a
Launcher on the top panel and that the command the launcher uses is
usr/bin/python2.6.  Is there a way that the command can be changed so
that
it will look in the same directory the python script is in for any file
it
needs?

Thanks,  Jim




Not sure if you got my previous email but you could try writing the bash
script I posted (with the $1 line to get the path) and setting that as
your
launcher, I think it should work.

Let me know if you didn't get it or it doesn't work.

HTH,
Adam.


  I got it, got sidetracked and then forgot to look at it again.  Thanks

for
reminding me.  Your idea works, but with one little downside.  The
directories I am working with are chapters in a book.  So as I move from
chapter to chapter I will need to change the bash script, but this seems
to
be less typing than using the terminal.


Thanks,  Jim



Ok cool, glad it works. It might be possible to get the path so you don't
have to set it each time, try this:

#!/bin/bash
IFS="/"
path=($1)
cd $(path[0:#path[*]])
python $1


# Warning, I'm not exactly a competent bash programmer so this may not
work
:-p

Let me know if you need a hand to fix it,

HTH,
Adam.



I tried the new bash code but when I dropped a file on the launcher it just
flashed an gave no output.  So I tried running the bash script
(name=runpython) in a terminal and got this error:

/home/jfb/runpython: line 4: path[0:#path[*]]: command not found
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.




I know even less about bash than you do, so I don't where to start to debug
this.


Thanks,  Jim

Ok then, this time it's tested and not just improvised, here we go:


#!/bin/bash

script=$1 # Full path for calling the script later
orig_IFS=$IFS # This is to reset IFS so that "script" is correct (otherwise
has spaces instead of /)
IFS="/"
path=( $1 )
IFS=$orig_IFS
last_ind=${#pa...@]} # Works out the length of path
let "last_ind -= 1" # Sets last_ind to index of script name
len_path=${pa...@]:0:last_ind} # Gets the path without the script name
let "len_path=${#len_path[0]} + 1" # This gives the length of the script
string upto just before the last /
cd ${scri...@]:0:len_path} # cds to the path
python script


As pretty much my first non-trivial bash script it's probably horrible but
it seems to work.

HTH,
Adam.



There must be something different in our setups because it did not work 
for me.  If I run it from a terminal I get:


j...@jfb-ubuntu64:~$ /home/jfb/runpython_test bitmap_button.py
/home/jfb/runpython_test: line 12: cd: b: No such file or directory
python: can't open file 'script': [Errno 2] No such file or directory
j...@jfb-ubuntu64:~$

Thanks  Jim

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


Re: [Tutor] Path?

2010-07-15 Thread Adam Bark
On 15 July 2010 17:21, Jim Byrnes  wrote:

> Adam Bark wrote:
>
>> On 14 July 2010 17:41, Jim Byrnes  wrote:
>>
>>  Adam Bark wrote:
>>>
>>>  On 14 July 2010 02:53, Jim Byrnes   wrote:

  Adam Bark wrote:

>
> 
>
>
>  If I use the terminal to start the program it has no problem using the
>
>   file.  There are multiple files in multiple directories so I was
>>
>>>  looking
> for
> a way to just double click them and have them run.  If it turns out
> that
> I
> must make changes to or for each of the files it will be easier to
> just
> keep
> using the terminal.  I've only been using Ubuntu for a few months
> so
> I
> was
> surprised that the program could not see a file that is in the same
> directory.
>
> Regards,  Jim
>
>
>
>  The problem is ubuntu doesn't run the script from the directory
 it's
 in
 so
 it's looking for wxPython.jpg somewhere else.


  OK, I mistakenly thought that double-clicking on file in Nautilus
 would

  take care of the path info.
>>>
>>> In my reply above I also mentioned that I tried by dropping it on a
>>> Launcher on the top panel and that the command the launcher uses is
>>> usr/bin/python2.6.  Is there a way that the command can be changed so
>>> that
>>> it will look in the same directory the python script is in for any
>>> file
>>> it
>>> needs?
>>>
>>> Thanks,  Jim
>>>
>>>
>>>
>> Not sure if you got my previous email but you could try writing the
>> bash
>> script I posted (with the $1 line to get the path) and setting that as
>> your
>> launcher, I think it should work.
>>
>> Let me know if you didn't get it or it doesn't work.
>>
>> HTH,
>> Adam.
>>
>>
>>  I got it, got sidetracked and then forgot to look at it again.
>>  Thanks
>>
> for
> reminding me.  Your idea works, but with one little downside.  The
> directories I am working with are chapters in a book.  So as I move
> from
> chapter to chapter I will need to change the bash script, but this
> seems
> to
> be less typing than using the terminal.
>
>
> Thanks,  Jim
>
>
>  Ok cool, glad it works. It might be possible to get the path so you
 don't
 have to set it each time, try this:

 #!/bin/bash
 IFS="/"
 path=($1)
 cd $(path[0:#path[*]])
 python $1


 # Warning, I'm not exactly a competent bash programmer so this may not
 work
 :-p

 Let me know if you need a hand to fix it,

 HTH,
 Adam.


  I tried the new bash code but when I dropped a file on the launcher it
>>> just
>>> flashed an gave no output.  So I tried running the bash script
>>> (name=runpython) in a terminal and got this error:
>>>
>>> /home/jfb/runpython: line 4: path[0:#path[*]]: command not found
>>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
>>> [GCC 4.4.3] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>

>>
>>> I know even less about bash than you do, so I don't where to start to
>>> debug
>>> this.
>>>
>>>
>>> Thanks,  Jim
>>>
>>> Ok then, this time it's tested and not just improvised, here we go:
>>>
>>
>> #!/bin/bash
>>
>> script=$1 # Full path for calling the script later
>> orig_IFS=$IFS # This is to reset IFS so that "script" is correct
>> (otherwise
>> has spaces instead of /)
>> IFS="/"
>> path=( $1 )
>> IFS=$orig_IFS
>> last_ind=${#pa...@]} # Works out the length of path
>> let "last_ind -= 1" # Sets last_ind to index of script name
>> len_path=${pa...@]:0:last_ind} # Gets the path without the script name
>> let "len_path=${#len_path[0]} + 1" # This gives the length of the script
>> string upto just before the last /
>> cd ${scri...@]:0:len_path} # cds to the path
>> python script
>>
>>
>> As pretty much my first non-trivial bash script it's probably horrible but
>> it seems to work.
>>
>> HTH,
>> Adam.
>>
>>
> There must be something different in our setups because it did not work for
> me.  If I run it from a terminal I get:
>
> j...@jfb-ubuntu64:~$ /home/jfb/runpython_test bitmap_button.py
> /home/jfb/runpython_test: line 12: cd: b: No such file or directory
> python: can't open file 'script': [Errno 2] No such file or directory
> j...@jfb-ubuntu64:~$
>
> Thanks  Jim
>
>
Oh cock, I missed a $ sign it should be "python $script". Seems to complain
about the path as well though, not sure about that one, I'll get back to you
later.

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


[Tutor] How to deal failed function and 0xDEADBEEF type errors...

2010-07-15 Thread Sean Carolan
Spoiler alert:  This was encountered while working on MIT OCW 6.000
problem set 4.

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/ps4.py


My function returns a list as it should:

##
def nestEggFixed(salary, save, growthRate, years):
yearlyreturn=[]
nut = 0
for i in range(0, years):
# print "At the end of year",(i),"nut size is:",(nut)
nut = nut * (1 + 0.01 * growthRate) + (salary * save * 0.01)
yearlyreturn.append(nut)
return yearlyreturn
##

print nestEggFixed(1, 10, 15, 5)
[1000.0, 2150.0, 3472.5, 4993.375, 6742.38124999]

So far so good right?  Not so fast, the test function provided by the
instructors is failing:

Here's the test function:

##
def testNestEggFixed():
salary = 1
save   = 10
growthRate = 15
years  = 5
savingsRecord = nestEggFixed(salary, save, growthRate, years)
print savingsRecord
##

Run it by itself and there's no output:

testNestEggFixed

Try to print it and it throws this error:

print testNestEggFixed


What am I missing here?  I even tried running all the code in the test
function in my script and it works fine.  It only fails when it's put
into a function.  I think I must be doing something wrong.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to deal failed function and 0xDEADBEEF type errors...

2010-07-15 Thread Emile van Sebille

On 7/15/2010 11:07 AM Sean Carolan said...


Try to print it and it throws this error:

print testNestEggFixed




That's not an error -- that's what testNestEggFixed -- a function 
located at 0x0214D5F0.  If you intended to _execute_ the function, add 
parens and the appropriate parameters to your print statement.


HTH,

Emile

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


[Tutor] append, list and variables

2010-07-15 Thread Mary Morris
Hi,
I'm working on a program that parses through all of our source code at my
office and i need to get my code to print a list of the decorators.  I used
a find(@) to locate all the decorators, but I need to assign them to a
variable somehow to get it to print a list. How do I do this? How do I
assign a variable to all the indexed strings after the @ symbol?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] append, list and variables

2010-07-15 Thread Emile van Sebille

On 7/15/2010 11:32 AM Mary Morris said...

Hi,
I'm working on a program that parses through all of our source code at my
office and i need to get my code to print a list of the decorators.  I used
a find(@) to locate all the decorators, but I need to assign them to a
variable somehow to get it to print a list. How do I do this? How do I
assign a variable to all the indexed strings after the @ symbol?



So, decorator lines start with an '@'.  Source files end in '.py'.

Pseudo code could be:

initialize result container

with each sourcefilename in globbed list:
  for eachline in opened(sourcefilename):
if line.startswith('@'):
  append [sourcefilename, line] to result

# print it

for eachline in result:
  print eachline


Hope this gets you going,

Emile




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


Re: [Tutor] Request for help learning the right way to deal with listsin lists

2010-07-15 Thread Christopher King
I will spilt it up and add comments.

Books =\ #Assign to Books
[Book('War & Peace", [3, 56, 88]), #The first is a Book named 'War & Peace'
Book("Huck Finn", [2, 5, 19])] #You use the book class twice in a row, one
for each book


On Thu, Jul 15, 2010 at 8:09 AM, Payal wrote:

> On Tue, Jul 13, 2010 at 08:35:45AM +0100, Alan Gauld wrote:
> > If the data gets more complex you could put the data into a class:
> >
> > class Book:
> >  def __init__(self, title, pages=[]):
> >  self.title = title
> >  self.pages = pages
> >
> > Books = [ Book('War & Peace", [3,56,88]),
> >   Book("Huck Finn", [2,5,19]) ]
>
> Can someone please explain the above 2 lines?
>
> > for book in Books:
> > print book.title, book.pages
>
> With warm regards,
> -Payal
> --
> ___
> 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


[Tutor] Python Book recomandation!

2010-07-15 Thread Daniel
Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the
Python website, but I have a question regarding it. With what book I should
start learning Python? Or should I take them in the order they are presented
there on the website?I have no previous programming experience, thanks.



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


Re: [Tutor] Python Book recomandation!

2010-07-15 Thread Eric Hamiter
Hi Daniel,

As a fellow complete beginner, I have actually started a web site that
details just this. I'm learning as I go and have tried to put together
a curriculum of sorts that will helpfully guide other newbies as well,
and reinforce what I'm learning for myself.

http://letslearnpython.com/

Pardon my own plug, but you are exactly the audience member I am
targeting. Everything I recommend with the exception of a paperback
book is free to access. I'm adding more "lessons" as I go, and
hopefully as I progress, I can make more specific recommendations.

You are off to a great start by asking this list; I've found the
people here are very friendly and extremely knowledgeable.

Thanks,

Eric


On Thu, Jul 15, 2010 at 4:07 PM, Daniel  wrote:
> Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the
> Python website, but I have a question regarding it. With what book I should
> start learning Python? Or should I take them in the order they are presented
> there on the website?I have no previous programming experience, thanks.
>
>
>
> Have a great day!
>
> ___
> Tutor maillist  -  tu...@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] Python Book recomandation!

2010-07-15 Thread Robert
'Building Skills in Python" by Steven Lott, This free book is simply awesome
http://homepage.mac.com/s_lott/books/python.html

I went thru the "short" books first : "Dive Into Python" and "Byte of
Python" - they are good for a bit of foundation then come to this one,
and this one rreinforces concepts and explain things in a much more
organized and clear-cut way.


On Thu, Jul 15, 2010 at 5:07 PM, Daniel  wrote:
> Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the
> Python website, but I have a question regarding it. With what book I should
> start learning Python? Or should I take them in the order they are presented
> there on the website?I have no previous programming experience, thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python Book recomandation!

2010-07-15 Thread Shashwat Anand
On Fri, Jul 16, 2010 at 2:37 AM, Daniel  wrote:

> Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the
> Python website, but I have a question regarding it. With what book I should
> start learning Python? Or should I take them in the order they are presented
> there on the website?I have no previous programming experience, thanks.
>

FWIW I feel going through official python tutorial and then making a project
helps better than anything else to learn python.

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


Re: [Tutor] Python Book recomandation!

2010-07-15 Thread David Hutto
On Thu, Jul 15, 2010 at 5:22 PM, Eric Hamiter  wrote:
> Hi Daniel,
>
> As a fellow complete beginner, I have actually started a web site that
> details just this. I'm learning as I go and have tried to put together
> a curriculum of sorts that will helpfully guide other newbies as well,
> and reinforce what I'm learning for myself.
>
> http://letslearnpython.com/
>
> Pardon my own plug, but you are exactly the audience member I am
> targeting. Everything I recommend with the exception of a paperback
> book is free to access. I'm adding more "lessons" as I go, and
> hopefully as I progress, I can make more specific recommendations.
>
> You are off to a great start by asking this list; I've found the
> people here are very friendly and extremely knowledgeable.
>
> Thanks,
>
> Eric
>
>
> On Thu, Jul 15, 2010 at 4:07 PM, Daniel  wrote:
>> Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the
>> Python website, but I have a question regarding it. With what book I should
>> start learning Python? Or should I take them in the order they are presented
>> there on the website?I have no previous programming experience, thanks.
>>
>>
>>
>> Have a great day!
>>
>> ___
>> Tutor maillist  -  tu...@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>
> ___
> Tutor maillist  -  tu...@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

I've done several, including Byte Of  Python, as well as Dive into
python, and this is the best so far:

inventwithpython.com/IYOCGwP_book1.pdf

Although each individually might not make you an immediate expert.
Each helps you gain knowledge by repeating some of what you know, and
then offering a different program in which these fundamentals operate.

 So the more you practice the fundamentals within the books,(and don't
forget the online tutorials available), the more user friendly Python
becomes.

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


Re: [Tutor] str format conversion help

2010-07-15 Thread eMyListsDDg

yep, i noticed. ;^)

no prob, through your help, it is working the way i needed.

thanks



>> print "[%s]" % ('-'.join([hex(v) for v in  theValue]) )

> Oops, that leaves 0x at the front of each byte.

> You could strip that off with

> print "[%s]" % ('-'.join([hex(v)[2:] for v in  theValue]) )

> Sorry,

> Alan G.



-- 
Best regards,
 eMyListsDDgmailto:emylists...@gmail.com

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


Re: [Tutor] Python Book recomandation!

2010-07-15 Thread Joseph Gulizia
I've found "Snake Wrangling for Kids" http://code.google.com/p/swfk/  by
Jason Biggs an easy, fun and understandable free e-book.  I also have
started reading "Head First Programming" from O'Reilly which teaches
programming using Python.  I have others also but those two have been the
easiest to read.  YouTube also has many tutorials...some quite good.

Joe

On Thu, Jul 15, 2010 at 5:04 PM, David Hutto  wrote:

> On Thu, Jul 15, 2010 at 5:22 PM, Eric Hamiter  wrote:
> > Hi Daniel,
> >
> > As a fellow complete beginner, I have actually started a web site that
> > details just this. I'm learning as I go and have tried to put together
> > a curriculum of sorts that will helpfully guide other newbies as well,
> > and reinforce what I'm learning for myself.
> >
> > http://letslearnpython.com/
> >
> > Pardon my own plug, but you are exactly the audience member I am
> > targeting. Everything I recommend with the exception of a paperback
> > book is free to access. I'm adding more "lessons" as I go, and
> > hopefully as I progress, I can make more specific recommendations.
> >
> > You are off to a great start by asking this list; I've found the
> > people here are very friendly and extremely knowledgeable.
> >
> > Thanks,
> >
> > Eric
> >
> >
> > On Thu, Jul 15, 2010 at 4:07 PM, Daniel 
> wrote:
> >> Hello, I recently browsed the BeginnersGuide/NonProgrammers section of
> the
> >> Python website, but I have a question regarding it. With what book I
> should
> >> start learning Python? Or should I take them in the order they are
> presented
> >> there on the website?I have no previous programming experience, thanks.
> >>
> >>
> >>
> >> Have a great day!
> >>
> >> ___
> >> 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
> >
>
> I've done several, including Byte Of  Python, as well as Dive into
> python, and this is the best so far:
>
> inventwithpython.com/IYOCGwP_book1.pdf
>
> Although each individually might not make you an immediate expert.
> Each helps you gain knowledge by repeating some of what you know, and
> then offering a different program in which these fundamentals operate.
>
>  So the more you practice the fundamentals within the books,(and don't
> forget the online tutorials available), the more user friendly Python
> becomes.
>
> .
> ___
> 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] Python Book recomandation!

2010-07-15 Thread Guilherme P. de Freitas
On Thu, Jul 15, 2010 at 5:22 PM, Eric Hamiter  wrote:
> As a fellow complete beginner, I have actually started a web site that
> details just this. I'm learning as I go and have tried to put together
> a curriculum of sorts that will helpfully guide other newbies as well,
> and reinforce what I'm learning for myself.
>
> http://letslearnpython.com/

The first lesson on the link above suggests the tutorial "Learn Python the Hard
Way". One comment about it: it seems to teach Python 2.x series, as can be seen
from the print statements. I would advise most beginners to learn Python 3.

-- 
Guilherme P. de Freitas
http://www.gpfreitas.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Toronto PyCamp 2010

2010-07-15 Thread Chris Calloway
The University of Toronto Department of Physics brings PyCamp to Toronto 
on Monday, August 30 through Friday, September 3, 2010.


Register today at http://trizpug.org/boot-camp/torpy10/

For beginners, this ultra-low-cost Python Boot Camp makes you productive 
so you can get your work done quickly. PyCamp emphasizes the features 
which make Python a simpler and more efficient language. Following along 
with example Python PushUps™ speeds your learning process in a modern 
high-tech classroom. Become a self-sufficient Python developer in just 
five days at PyCamp! Conducted on the campus of the University of 
Toronto, PyCamp comes with your own single OS/single developer copy of 
Wing Professional Python IDE.


--
Sincerely,

Chris Calloway
office: 332 Chapman Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python Book recomandation!

2010-07-15 Thread Alan Gauld


"Daniel"  wrote

Python website, but I have a question regarding it. With what book I 
should
start learning Python? Or should I take them in the order they are 
presented
there on the website?I have no previous programming experience, 
thanks.


Don't try to read them all!

They all present much the same information just in different styles.
Some major on getting you writing code quickly, some present a more 
theoretical
basis first. Some use a common theme or project others use lots of 
different a
shorter projects. There is no right or best approach, pick the one 
that sems to

work best for you.

Much will depend on what you want to do with your new skills and what 
your
previous experience is. If you can already program in another language 
the
official tutor is probably the best starting place, but if you don't 
already

programme much of it will be meaningless.

The one that is best for you can only be decided by you!

HTH,

--
Alan Gauld
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] How to deal failed function and 0xDEADBEEF type errors...

2010-07-15 Thread Alan Gauld


"Sean Carolan"  wrote


Run it by itself and there's no output:

testNestEggFixed

Try to print it and it throws this error:

print testNestEggFixed


What am I missing here?


parentheses?

I assume you are from a Visual VBasic background?
Unlike VB Python requires you to have the parentheses
after the function name, even if there is nothing inside them.
Otherwise you are referring to a function *object* - which
is what the print statement told you...

HTH,


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


I even tried running all the code in the test
function in my script and it works fine.  It only fails when it's 
put

into a function.  I think I must be doing something wrong.
___
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