Re: [Tutor] urllib.urlretrieve ?

2013-04-08 Thread Alan Gauld
On 07/04/13 19:49, Matthew Ngaha wrote: yeah, sadly urlretrieve doesnt exist on my version of python. I just told you where to find it on Python 3. It's just been moved that's all. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___

[Tutor] Socket Programming

2013-04-08 Thread Mousumi Basu
I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try: s=s.bind(('172.18.2.11',2213)) pr

Re: [Tutor] Socket Programming

2013-04-08 Thread Timo
Op 08-04-13 09:06, Mousumi Basu schreef: I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_I

[Tutor] if statement problems(noob question)

2013-04-08 Thread Max Smith
Hi, everyone whom might read this, im Max and i am really new to coding, been going at it for about two weeks using codeacademy and the book "think python". when i decided to experiment a little with if statements i ran into the following problem: def plus(x,y): if x and y == int or float:

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Woody 544
Max, You've made the arguments a string (so never a number) in: print "The answer is: " + str(x+y) MJ On Apr 8, 2013 6:23 AM, "Max Smith" wrote: > Hi, everyone whom might read this, im Max and i am really new to coding, > been going at it for about two weeks using codeacademy and the book "thi

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Dave Angel
On 04/08/2013 06:21 AM, Max Smith wrote: Hi, everyone whom might read this, im Max and i am really new to coding, been going at it for about two weeks using codeacademy and the book "think python". when i decided to experiment a little with if statements i ran into the following problem: def plu

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Dave Angel
On 04/08/2013 06:37 AM, Woody 544 wrote: Max, You've made the arguments a string (so never a number) in: print "The answer is: " + str(x+y) MJ That has nothing to do with the issue. The str() function call is unnecessary, but harmless. If the two values x and y are ints or floats, they w

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Steven D'Aprano
On 08/04/13 20:45, Dave Angel wrote: will always fail, since the integer 2 is not equal to the type int. In Python 2.x, when you compare objects of different types, you generally get unequal. (Exception, if you define your own classes, you can define how they compare to others) In Python 3

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Steven D'Aprano
On 08/04/13 20:21, Max Smith wrote: Hi, everyone whom might read this, im Max and i am really new to coding, been going at it for about two weeks using codeacademy and the book "think python". when i decided to experiment a little with if statements i ran into the following problem: def plus(x,y

Re: [Tutor] Socket Programming

2013-04-08 Thread Steven D'Aprano
On 08/04/13 17:06, Mousumi Basu wrote: I want to perform binding between two computers having ip addresses 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer having IP address 172.18.2.95):- import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try:

Re: [Tutor] if statement problems(noob question)

2013-04-08 Thread Dave Angel
On 04/08/2013 07:55 AM, Steven D'Aprano wrote: On 08/04/13 20:45, Dave Angel wrote: will always fail, since the integer 2 is not equal to the type int. In Python 2.x, when you compare objects of different types, you generally get unequal. (Exception, if you define your own classes, you can def

[Tutor] How to extract a float from an instancemethod call

2013-04-08 Thread Sydney Shall
Hi, I am learning Python. I use MAC OSX 10.6.8 Python 2.7.3 I have been given a project to write a program involving random walks. I have drafted a program which has passed all the static tests, but on testing my program i get the following error message: Traceback (most recent call last):

Re: [Tutor] How to extract a float from an instancemethod call

2013-04-08 Thread Dave Angel
On 04/08/2013 08:40 AM, Sydney Shall wrote: Hi, I am learning Python. I use MAC OSX 10.6.8 Python 2.7.3 I have been given a project to write a program involving random walks. I have drafted a program which has passed all the static tests, but on testing my program i get the following error mes

Re: [Tutor] Socket Programming

2013-04-08 Thread Kushal Kumaran
Mousumi Basu writes: > I want to perform binding between two computers having ip addresses > 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer > having IP address 172.18.2.95):- > > > import socket > import sys > s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) > try: >

Re: [Tutor] How to extract a float from an instancemethod call

2013-04-08 Thread Flynn, Stephen (L & P - IT)
Aha - another EdX 6.00 Python course student. > Traceback (most recent call last): >File "/Users/Sydney/Documents/6.00x Files/Problem > Sets/ProblemSet7/ps7 copy.py", line 303, in > testRobotMovement(StandardRobot, RectangularRoom) >File "ps7_verify_movement.py", line 12, in testRobo

Re: [Tutor] Socket Programming

2013-04-08 Thread Alan Gauld
On 08/04/13 08:06, Mousumi Basu wrote: import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) try: s=s.bind(('172.18.2.11',2213)) print 'socket bind is complete' except socket.error,msg: print 'bind failed' sys.exit() Your first error is that when develo

Re: [Tutor] Socket Programming

2013-04-08 Thread Lolo Lolo
on socket programming. if as a client or server, the information being sent has a buffer size on 2048, will this retrieve all data below 2KB? or can it be exceeded with say 2100? or does 2100 fall under 3KB?___ Tutor maillist - Tutor@python.org To uns

[Tutor] Reading Program

2013-04-08 Thread Donald Dietrich
I am just new to python programing, but would like some help developing a program for “flow reading” What I would like the program to do is use any .txt file like micorsoft word .txt file and flow the words across the screen one at time until the file is come to the end. I would also like to c

Re: [Tutor] Reading Program

2013-04-08 Thread bob gailer
On 4/8/2013 2:58 PM, Donald Dietrich wrote: I am just new to python programing welcome. what other programming experience do you have? What version of python? and what OS? would like some help developing a program for "flow reading" What I would like the program to do is use any .txt file lik

[Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread brian arb
An Introduction to Interactive Programming in PythonJoe Warren, Scott Rixner, Stephen Wong and John Greiner This course is designed to be a fun introduction to the basics of programming in Python. Our main focus will be on building simple interactive games such as Pong, Blackjack and Asteroids. h

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread Steven D'Aprano
On 09/04/13 06:38, brian arb wrote: An Introduction to Interactive Programming in PythonJoe Warren, Scott Rixner, Stephen Wong and John Greiner This course is designed to be a fun introduction to the basics of programming in Python. Our main focus will be on building simple interactive games suc

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread Don Jennings
On Apr 8, 2013, at 7:58 PM, Steven D'Aprano wrote: > On 09/04/13 06:38, brian arb wrote: >> An Introduction to Interactive Programming in PythonJoe Warren, Scott >> Rixner, Stephen Wong and John Greiner >> >> This course is designed to be a fun introduction to the basics of >> programming in Pyt

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread Dave Angel
On 04/08/2013 07:58 PM, Steven D'Aprano wrote: On 09/04/13 06:38, brian arb wrote: An Introduction to Interactive Programming in PythonJoe Warren, Scott Rixner, Stephen Wong and John Greiner This course is designed to be a fun introduction to the basics of programming in Python. Our main focus

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread Len Conrad
wrong teaching language! :) Computer scientists develop video game that teaches how to program in Java http://phys.org/news/2013-04-scientists-video-game-java.html ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] Phyton script for fasta file (seek help)

2013-04-08 Thread kartik sundarajan
My guess is you are using Python version >2.6 where "set" is a built-in. You can fix this by doing the following. 1) Remove "from sets import Set" 2) And replace "alphabet = list(Set(stList))" with "alphabet = list(set(stList))" This should work straight away. P.S Its "Python" not phyton Cheers