Re: [Tutor] sometimes I feel like my head is going to explode

2014-07-10 Thread Sacha Rook
At some point in time you will get to a place where you know enough, never
everything. That's what makes it fun

-Original Message-
From: Tutor [mailto:tutor-bounces+sacharook=gmail@python.org] On Behalf
Of Deb Wyatt
Sent: 10 July 2014 23:36
To: tutor@python.org
Subject: [Tutor] sometimes I feel like my head is going to explode

The more I learn, the more I realize that there is so much more to learn,
and the more difficult some of the stuff to learn seems to be.  I'm not sure
that I would have set out on this journey to learn Python if I had known how
massive the task was going to be. I AM enjoying it, but my gosh, when am I
ever going to feel like I have a handle on this stuff?

That is all.  

Deb in WA, USA


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your
desktop!
Check it out at http://www.inbox.com/marineaquarium


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

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


Re: [Tutor] Which computer operating system is best for Python

2014-02-05 Thread Sacha Rook
Hi as much as I like chrome books

My opinion so I would rather give him a laptop either with Linux or windows
with free virtualisation software on to run either so and program on both
especially if he will be offline.

Alternative if you have wifi/network constant connection then just a
browser and spin up a free tier aws host and program on that.

It's good to get a grasp early of things like git github an IDE and a
appstack on a PaaS to run the apps developed, like aws elastic beanstalk or
heroku.

The reason I say this is that it's great to learn python but it's great to
learn about using it in the real world...

Again my opinion hope it's useful to you.

S

On Wednesday, 5 February 2014, Colin Chinsammy 
wrote:

>  I am considering purchasing the Acer c720 chromebook for my 13yo to
> begin learning Python for Kids. Obviously I am on a budget.
>
> Is this a good choice for a complete beginner? Any particular challenges
> that she might encounter using a chromebook OS?
>
> Any advice would be greatly appreciated. As I have researched my way into
> confusion.
>
>
>
> Thanks
>
>
>
> *Colin Chinsammy*
> Transportation Coord
> Transportation
> Office: 703-923-3150
> 7400 Spring Village Drive
> Springfield, VA 22150
> www.EricksonLiving.com 
>
>  
>
>  
>
>  
>
>  
>
>  
>
>
>
>
>
> The information in this email is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmissions, dissemination or other use of or
> taking of any action in reliance upon this information by persons or
> entities other than the intended recipient is prohibited. If you receive
> this email in error, please contact the sender and delete the material from
> any computer.
>
<><><><><>___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Sacha Rook
Hi
Do you need to;

return totalCost in the function trip_cost

so when you call trip_cost(city, days) it gives you something back?

Hope it helps

S


On 29 April 2013 16:15, Joseph Parkton  wrote:

> I am working on a codeacademy problem and I am stuck. The instructions are
> as follows:
>
> INSTRUCTIONS
>
> Below your existing code, write a function called trip_cost that takes
> two inputs, city and days. cityshould be the city that you are going to
> visit and days should be the number of days that you are staying.
>
> Have your function return the *sum* of the rental_car_cost, hotel_cost,
> and plane_ride_cost functions with their respective inputs.
>
>
> my code so far looks like this:
>
> def hotel_cost(nights):
>
> nights = nights * 140
>
> return nights
>
>
>
> def plane_ride_cost(city):
>
> if city == 'Charlotte':
>
> return 183
>
> if city == 'Tampa':
>
> return 220
>
> if city == 'Pittsburgh':
>
> return 222
>
> if city == 'Los Angeles':
>
> return 475
>
>
> def rental_car_cost(days):
>
> dailyCost = 40
>
> dailyCost = dailyCost * days
>
> if days >= 3:
>
> dailyCost = dailyCost - 20
>
> if days >= 7:
>
> dailyCost = dailyCost - 30
>
> return dailyCost
>
>
>
> def trip_cost(city, days):
>
> totalCost = plane_trip_cost(city) + hotel_cost(nights) +
> rental_car_cost(days)
>
> #And here is where I am stuck...
>
>
> It is probably a simple answer but I don't know how to accomplish it. Any
> help is appreciated.
>
>
> ___
> 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] CSV TO LDIF

2007-11-15 Thread sacha rook
Hi
 
I have a csv of users that I want to update their records in edirectory.
 
I am quite happy to use the ldap import utility to pull an ldif file into 
edirectory to update information.
 
I am using the csv module to parse the csv, anyone got any suggestions for 
creating the ldif file from this?
 
Any help or pointers greatly appreciated.
 
Regards
 
S
_
Celeb spotting – Play CelebMashup and win cool prizes
https://www.celebmashup.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] data from excel spreadsheet to csv and manipulate

2007-10-03 Thread sacha rook
Hi
 
can anyone help with the best way to tackle this?
 
I have a spreadsheet ms excel, that has a name column that I want to extract to 
csv and manipulate as follows.
 
The name column has data in this format
 
Name
 
Surname Firstname
 
after extracting and manipulating I want it to be as follows in three comma 
separated fields;
 
 
Firstname, Surname, Firstname Surname
 
So 
 
Smith John
 
becomes
 
John, Smith, John Smith
 
I hope I have explained myself.
 
I want to use python to do all this if sensible, so what is the best approach?
 
Many thanks
 
S 
_
Feel like a local wherever you go.
http://www.backofmyhand.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] python and wmi interface

2007-09-19 Thread sacha rook
Hi all
 
can anyone point me in the direction of any python docs or tutorials of 
interacting with the windows WMI interface ?
 
I am not trying to do anything specific as yet just try to build up a bit of 
knowledge see what the possibilities are!
 
Thanks in advance for you help :0-)
 
S
_
100’s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] remove blank list items

2007-09-14 Thread sacha rook
Hi
 
i was expanding my program to write urls parsed from a html page and write them 
to a file so i chose www.icq.com to extract the urls from.
 
when i wrote these out to a file and then read the file back I noticed a list 
of urls then some blank lines then some more urls then some blank lines, does 
this mean that one of the functions called has for some reason added some 
whitespace into some of the list items so that i wrote them out to disk?
 
I also noticed that there are duplicate hosts/urls that have been written to 
the file.
 
So my two questions are;
1. how and where do I tackle removing the whitespace from being written out to 
disk?
 
2. how do i tackle checking for duplicate entries in a list before writing them 
out to disk?
 
My code is below 
from BeautifulSoup import BeautifulSoupimport urllib2import urlparse
file = urllib2.urlopen("http://www.icq.com";)
soup = BeautifulSoup(''.join(file))alist = soup.findAll('a')
output = open("fqdns.txt","w")
for a in alist:href = a['href']output.write(urlparse.urlparse(href)[1] 
+ "\n")
output.close()
input = open("fqdns.txt","r")
for j in input:print j,
input.close()
the chopped output is here 
 
chat.icq.comchat.icq.comchat.icq.comchat.icq.comchat.icq.com
 
 
labs.icq.comdownload.icq.comgreetings.icq.comgreetings.icq.comgreetings.icq.comgames.icq.comgames.icq.com
_
Celeb spotting – Play CelebMashup and win cool prizes
https://www.celebmashup.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] list iteration question for writing to a file on disk

2007-09-14 Thread sacha rook
Hi
 
can someone help with this please?
 
i got to this point with help from the list.
 
from BeautifulSoup import BeautifulSoupdoc = ['Page 
title',   'This is 
paragraph one.',   'This is 
paragraph two.',   'http://www.google.co.uk";>',   
'http://www.bbc.co.uk";>',   'http://www.amazon.co.uk";>',   'http://www.redhat.co.uk";>',   '']soup = 
BeautifulSoup(''.join(doc))alist = soup.findAll('a')
import urlparsefor a in alist:href = a['href']print 
urlparse.urlparse(href)[1]
 
so BeautifulSoup used to find  tags; use urlparse to extract to fully 
qualified domain name use print to print a nice list of hosts 1 per line. here
www.google.co.ukwww.bbc.co.ukwww.amazon.co.ukwww.redhat.co.uk
 
nice, so i think write them out to a file; change program to this to write to 
disk and read them back to see what's been done.
 
from BeautifulSoup import BeautifulSoupdoc = ['Page 
title',   'This is 
paragraph one.',   'This is 
paragraph two.',   'http://www.google.co.uk";>',   
'http://www.bbc.co.uk";>',   'http://www.amazon.co.uk";>',   'http://www.redhat.co.uk";>',   '']soup = 
BeautifulSoup(''.join(doc))alist = soup.findAll('a')
 
import urlparseoutput = open("fqdns.txt","w")
for a in alist:href = a['href']output.write(urlparse.urlparse(href)[1])
output.close()
 
 
this writes out www.google.co.ukwww.bbc.co.ukwww.amazon.co.ukwww.redhat.co.uk
 
so I look in Alan's tutor pdf for issue and read page 120 where it suggests 
doing this; outp.write(line + '\n') # \n is a newline
 
so i change my line from this
output.write(urlparse.urlparse(href)[1])
to this
output.write(urlparse.urlparse(href)[1] + "\n")
 
I look at the output file and I get this
 
www.google.co.ukwww.bbc.co.ukwww.amazon.co.ukwww.redhat.co.uk
 
hooray I think, so then I open the file in the program to read each line to do 
something with it.
i pop this after the last output.close()
 
input = open("fqdns.txt","r")for j in input:print j
input.close()
 
but his prints out 
 
www.google.co.uk
 
www.bbc.co.uk
 
www.amazon.co.uk
 
www.redhat.co.uk
 
 
Why do i get each record with an extra new line ? Am I writing out the records 
incorrectly or am I handling them incorrectly when I open the file and print do 
I have to take out newlines as I process?
 
any help would be great
 
s
 
_
Feel like a local wherever you go.
http://www.backofmyhand.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] is this a vista issue

2007-09-13 Thread sacha rook
Hi 
 
when I run this code on a winxp box I get a nice list of url's
when I run this code on a win VISTA box I get this
 
 
print urlparse.urlparse(href)[1]TypeError: 'module' object is not callable
 
can a. someone tell me why & b. how do i get rid of this condition before I 
throw vista away :)
 
Many thanks in advance
 
S
 
 
[CODE]
 
from BeautifulSoup import BeautifulSoupdoc = ['Page 
title',   'This is 
paragraph one.',   'This is 
paragraph two.',   'http://www.google.co.uk";>',   
'http://www.bbc.co.uk";>',   'http://www.amazon.co.uk";>',   'http://www.redhat.co.uk";>',   '']soup = 
BeautifulSoup(''.join(doc))blist = soup.findAll('a')print blist
import urlparsefor a in blist:href = a['href']print 
urlparse.urlparse(href)[1]
 
 
[/CODE]
_
Get free emoticon packs and customisation from Windows Live. 
http://www.pimpmylive.co.uk___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] extract hosts from html write to file

2007-09-11 Thread sacha rook
Hi I wonder if anyone can help with the following
 
I am trying to read a html page extract only fully qualified hostnames from the 
page and output these hostnames to a file on disk to be used later as input to 
another program.
 
I have this so far
 
import urllib2f=open("c:/tmp/newfile.txt", "w")for line in 
urllib2.urlopen("http://www.somedomain.uk";):if "href" in line and "http://"; 
in line:print line
f.write(line)f.close()fu=open("c:/tmp/newfile.txt", "r")for line in 
fu.readlines():print line   
 
so i have opened a file to write to, got a page of html, printed and written 
those to file that contain href & http:// references.
closed file opened file read all the lines from file and printed out
 
Can someone point me in right direction please on the flow of this program, the 
best way to just extract the hostnames and print these to file on disk?
 
As you can see I am newish to this
 
Thanks in advance for any help given!
 
s
_
Feel like a local wherever you go.
http://www.backofmyhand.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor