Re: [Tutor] sftp get single file

2011-06-21 Thread Johan Geldenhuys
Hi all, This topic is old, but I have a similar issue and I know everybody will say I should use piramiko, but it is not that simple. The device I have to run my python scripts on is a simple, small, scaled down version of Suse linux and I can't install other packages like piramiko. All the file

[Tutor] Class methods

2011-06-21 Thread David Merrick
# Critter Caretaker # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger self.boredom = boredom # __ denotes private method def __pass_time(self):

Re: [Tutor] Socket Programming issue

2011-06-21 Thread Mark Tolonen
"aditya" wrote in message news:BANLkTikS+gzm=89thczpbwksd+wufec...@mail.gmail.com... This is a small client-server program in which i am using a Vbscript program to check for connectivity of 2 machines and write the output to a text file whether it connectes or not , for example the conten

Re: [Tutor] Tutor Digest, Vol 88, Issue 86

2011-06-21 Thread Alan Gauld
"David Merrick" wrote I have created a Critter object and a Farm object which is two critters. I want to use Critters methods in the Farm object as it just 2 critters in a list crit1 = Critter("Sweetie") crit2 = Critter("Dave") farmlet = [crit1,crit2] This creates two critters but it doe

Re: [Tutor] Tutor Digest, Vol 88, Issue 86

2011-06-21 Thread David Merrick
I have created a Critter object and a Farm object which is two critters. I want to use Critters methods in the Farm object as it just 2 critters in a list crit1 = Critter("Sweetie") crit2 = Critter("Dave") farmlet = [crit1,crit2] # Critter Caretaker > # A virtual pet to care for > class Critter(

Re: [Tutor] Tutor Digest, Vol 88, Issue 83

2011-06-21 Thread Walter Prins
Hi again Arun, On 21 June 2011 19:59, Walter Prins wrote: > It apparently installed successfully. (You would only be able to follow > this command if a) you're using Ubuntu, b) you have "pip" installed in your > Python environment. If you don't know what "pip" is or why it's useful then > eith

Re: [Tutor] Tutor Digest, Vol 88, Issue 83

2011-06-21 Thread Walter Prins
Hi Arun, On 21 June 2011 08:56, arun kumar wrote: > yes i did a Google search but did find anything useful. The xhtml2pdf is > buggy in i'm unable to install it. Also mailed the community of xhtml2pdf > but didn't receive any reply from them. > OK, firstly I'm no expect on xhtml2pdf, but not

Re: [Tutor] Tutor Digest, Vol 88, Issue 83

2011-06-21 Thread Alan Gauld
PLEASE PAY ATTENTION TO THE INSTRUCTIONS: When replying, please edit your Subject line so it is more specific than "Re: Contents of Tutor digest..." AND please edit the contents so we don't need to scroll through the whole digest to find your comments! Thanks for the suggestion but my deskt

Re: [Tutor] Using class methods

2011-06-21 Thread Alan Gauld
"Christopher King" wrote class Farm_class(object): ... or if you want to use a method of the Critter class within the farm do class Farm_class(object): But please do NOT add '_class' to the end of your class names! The fact that it has a capital letter at the front combined with context

Re: [Tutor] html files to pdf document

2011-06-21 Thread Walter Prins
On 20 June 2011 23:29, Michiel Overtoom wrote: > > On Jun 21, 2011, at 00:19, Walter Prins wrote: > > > For reference, for me the top hit is http://www.xhtml2pdf.com/ which > does indeed look like it might do the job (and is a pure python solution.) > > I get five SERP pages with tons of Stackove

Re: [Tutor] html files to pdf document

2011-06-21 Thread Walter Prins
On 20 June 2011 23:29, Michiel Overtoom wrote: > > On Jun 21, 2011, at 00:19, Walter Prins wrote: > > > For reference, for me the top hit is http://www.xhtml2pdf.com/ which > does indeed look like it might do the job (and is a pure python solution.) > > I get five SERP pages with tons of Stackove

Re: [Tutor] Using Class methods

2011-06-21 Thread Alan Gauld
"David Merrick" wrote I need help using Class methods in another class. I have a class called Critter and I want to create two critters in a farm Class Farm and use Class Critter's methods Ok, You seem to be a bit confused by OOP, and your code is using all sorts of features you probably

Re: [Tutor] Using class methods

2011-06-21 Thread Christopher King
Well it depends what you mean. If you have a critter object and want to invoke its method inside the farm, do somethinh like this. class Farm_class(object): def feed(self, critter): critter.eat(self.food) or if you want to use a method of the Critter class within the farm do class Farm_clas

Re: [Tutor] Using Class methods

2011-06-21 Thread col speed
and? On 21 June 2011 14:38, David Merrick wrote: > I need help using Class methods in another class. I have a class called > Critter and I want to create two critters in a farm Class Farm and use > Class Critter's methods > > -- > Dave Merrick > > merrick...@gmail.com > > Ph 03 3423 121 > Cel

Re: [Tutor] Using class methods

2011-06-21 Thread Andre Engels
On Tue, Jun 21, 2011 at 10:12 AM, David Merrick wrote: > I need help using Class methods in another class. I have a class called > Critter and I want to create two critters in a farmĀ  Class Farm and use > Class Critter's methods Could you please specify where your current code does not suffice -

[Tutor] Using Class methods

2011-06-21 Thread David Merrick
I need help using Class methods in another class. I have a class called Critter and I want to create two critters in a farm Class Farm and use Class Critter's methods -- Dave Merrick merrick...@gmail.com Ph 03 3423 121 Cell 027 3089 169 critter_farm2.py Description: Binary data ___

[Tutor] Using class methods

2011-06-21 Thread David Merrick
I need help using Class methods in another class. I have a class called Critter and I want to create two critters in a farm Class Farm and use Class Critter's methods # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0):

Re: [Tutor] Tutor Digest, Vol 88, Issue 83

2011-06-21 Thread arun kumar
gt; it > sometimes prints all the lines of the file on the server and sometimes it > doesnt , i dont know whether the issue is with the client or the server , > Please Help.. > > > CLIENT.PY > > import socket > import os > import sys > os.system("C:\Python26\pin

Re: [Tutor] Socket Programming issue

2011-06-21 Thread aditya
On Tue, Jun 21, 2011 at 12:45 PM, Alan Gauld wrote: > > "aditya" wrote > > > is that although the Vbscript writes the output to the file correctly but >> when the client sends the contents of the file to the server via socket , >> it >> sometimes prints all the lines of the file on the server an

Re: [Tutor] Socket Programming issue

2011-06-21 Thread Alan Gauld
"aditya" wrote is that although the Vbscript writes the output to the file correctly but when the client sends the contents of the file to the server via socket , it sometimes prints all the lines of the file on the server and sometimes it doesnt , i dont know whether the issue is with the c