Re: [Tutor] example of spawn

2007-06-05 Thread Martin Walsh
Jason Coggins wrote: > In the example listed below, reproduced from the web page you recommended, > what does `cp`, `cp` and `/dev/null` do? I am assuming `index.html` is the > name of the program that will be launched. > > example:-- > os.spawnlp(os.

Re: [Tutor] Engarde program was: i++

2007-06-05 Thread Danny Yoo
> There where some values I did not want saved to the character file. A couple > where values that are for all characters, so I put them into their own class. > > ### > class Master_stats: > def __init__(self, year, month): > self.year = year > self

Re: [Tutor] example of spawn

2007-06-05 Thread Jason Coggins
In the example listed below, reproduced from the web page you recommended, what does `cp`, `cp` and `/dev/null` do? I am assuming `index.html` is the name of the program that will be launched. example:-- os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html',

Re: [Tutor] example of spawn

2007-06-05 Thread Alan Gauld
"Jason Coggins" <[EMAIL PROTECTED]> wrote > Would someone please provide me a short, simple > example of the spawn statement. > I am having trouble figuring the syntax out. There are two examples in the os module documentation. http://docs.python.org/lib/os-process.html What part do you not

Re: [Tutor] Engarde program was: i++

2007-06-05 Thread scott
Danny Yoo wrote: I will work at your suggestions and will get back to you if I have any problems. Good! Keep the folks on Python-Tutor up to date with your progress. Here is the code changes I made based on your suggestions: I put all the values together into a class ###

Re: [Tutor] python & google gear

2007-06-05 Thread Bob Gailer
Picio wrote: > Salve, qualcuno sa dirmi se esiste una API in python per google gear? > code.google.com/apis/gears > A similar question was asked on py-gwt. Here is the thread. I suggest you subscribe to py-gwt and follow the thread. http://pyworks.org/mailman/listinfo/py-gwt On Thu, 31 May 20

[Tutor] example of spawn

2007-06-05 Thread Jason Coggins
Would someone please provide me a short, simple example of the spawn statement. I am having trouble figuring the syntax out. Jason___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] i++

2007-06-05 Thread Danny Yoo
>> All these values "belong" together. Rather than pass them separately, >> glue them together as a "structure". In Python, can we use a class to >> glue things together... > > Okay, that makes good sense :) This should be a good exercise for OOP > Programming :) Just to clarify: structures

Re: [Tutor] i++

2007-06-05 Thread scott
Danny Yoo wrote: > > >> I have attached what I got so far if you feel like taking a look, but >> it is probably nasty by your standards :) > > Good, this is exactly what I want. Yes, there are a few things here > that you will want to learn how to fix. Let me point out one or two, > and I'm

Re: [Tutor] i++

2007-06-05 Thread Danny Yoo
> I have attached what I got so far if you feel like taking a look, but it > is probably nasty by your standards :) Good, this is exactly what I want. Yes, there are a few things here that you will want to learn how to fix. Let me point out one or two, and I'm sure others here on the list c

Re: [Tutor] i++

2007-06-05 Thread scott
Danny Yoo wrote: is there any way in Python to simply add or subtract one from a variable like i++ or i--? I don't mind doing a i = i + 1, but would prefer something more simple and faster. Out of curiosity, why are you incrementing variables? Actually, it is mostly just my curiosity :)

Re: [Tutor] i++

2007-06-05 Thread Danny Yoo
> is there any way in Python to simply add or subtract one from a > variable like i++ or i--? I don't mind doing a i = i + 1, but would > prefer something more simple and faster. Out of curiosity, why are you incrementing variables? I know this might sound silly, but I'm just curious.

Re: [Tutor] i++

2007-06-05 Thread Paulo Nuin
Hi You can use i += 1 or i -=1 HTH Paulo scott wrote: > Hi, > > is there any way in Python to simply add or subtract one from a > variable like i++ or i--? I don't mind doing a i = i + 1, but would > prefer something more simple and faster. > > ___

Re: [Tutor] i++

2007-06-05 Thread Kent Johnson
scott wrote: > Hi, > > is there any way in Python to simply add or subtract one from a > variable like i++ or i--? I don't mind doing a i = i + 1, but would > prefer something more simple and faster. i += 1 There are no ++ or -- operators in Python. Kent __

[Tutor] i++

2007-06-05 Thread scott
Hi, is there any way in Python to simply add or subtract one from a variable like i++ or i--? I don't mind doing a i = i + 1, but would prefer something more simple and faster. -- Your friend, Scott Sent to you from a Linux computer using Kubuntu Version 7.04 (Feisty Fawn) __

Re: [Tutor] Is this a good idea?

2007-06-05 Thread Kent Johnson
Carlos wrote: > Hello, > > I'm trying to generate two classes, one of them is a given object and > the other is a 'factory' of those objects. I'm doing this because I'm > working with huge amounts of objects and would like to have a loop > generating them. The problem is that I fear that my und

[Tutor] Is this a good idea?

2007-06-05 Thread Carlos
Hello, I'm trying to generate two classes, one of them is a given object and the other is a 'factory' of those objects. I'm doing this because I'm working with huge amounts of objects and would like to have a loop generating them. The problem is that I fear that my understanding of OOP is just

[Tutor] python & google gear

2007-06-05 Thread Picio
Salve, qualcuno sa dirmi se esiste una API in python per google gear? code.google.com/apis/gears Daniele -- http://picio.gotdns.com ...Il mio blog su NSLU2 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] urlencode

2007-06-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: >> From: Lee Jones >> Subject: [Tutor] urlencode >> Hello, >> I am trying to urlencode a string. In python the only thing I can see > is the urllib.urlencode(). But this takes a dictionary, and returns >> "key=value", which is not what I want. I only want to url-encode a

Re: [Tutor] numbers and ranges

2007-06-05 Thread Kent Johnson
Kent Johnson wrote: Here is a solution that uses a generator to create the ranges: > > def ranges(data): > i = iter(data) > first = last = i.next() > try: > while 1: > next = i.next() > if next > last+1: > yield (first, last) >

Re: [Tutor] software modeling tools used with Python

2007-06-05 Thread Alexander Kapshuk
Thanks, Alan. The whole situation is clear as day now. Alexander Kapshuk ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] urlencode

2007-06-05 Thread Senthil_OR
>From: Lee Jones >Subject: [Tutor] urlencode >Hello, >I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns >"key=value", which is not what I want. I only want to url-encode a string. Does any one know how to d

[Tutor] urlencode

2007-06-05 Thread Lee Jones
Hello, I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns "key=value", which is not what I want. I only want to url-encode a string. Does any one know how to do this in python Thanks Lee _