hey i was just wondering if any one could tell me if they know if you can make
multi player games through lan with python heres the code i want to lan.
just hash out the sound files
#NiCk TrEloaR PrOgRaMiNg Co.
#scissors paper rock
#10/6/07
from Tkinter import*
import pygame
from random im
Alan Gauld wrote:
> Over-use of direct access tends, in my experience, to lead to
> the temptation to move code that should be in the class (or a
> subclass) into client code. And it is avoidance of that temptation
> that is my main reason for providing a values() or state() type
> method, rather
"Kent Johnson" <[EMAIL PROTECTED]> wrote
> Alan doesn't like direct attribute access *or* getters and setters,
> IIUC. He wants all access to the attributes of a class instance to
> be
> through higher-level methods.
I'd moderate that slightly.
I really, really, don't like getters/setters. So, i
Answering my own question here, but for the sake of it... adding:
os.chdir(newpath)
makes it all work... so we have:
def run_cmd(cmd):
"""RUN A BASH CMD"""
import subprocess as sub
p = sub.Popen(['/bin/bash', '-c', cmd],
stdout=sub.PIPE, stderr=sub.STDOUT)
output =
Hello,
I'm converting a perl script which calls shell scripts which call fortran
routines into a python cgi that calls fortran directly (well, not yet using
f2py), but using subprocess.popen. Here's my code:
def run_cmd(cmd):
"""RUN A BASH CMD"""
import subprocess as sub
p = sub.Popen(
thanks
Tiger12506 wrote:
> >>> list = []
> total = 0
> if total > 0:
>> ... x = {'id': 'name', 'link': 'XX'}
>> ... list.append(x)
>> ... else:
>> ... y = {'id': 'name', 'link': 'YY'}
>> ... list.append(y)
>> ...
>>
>
> Yeah.
>
> list = []
> x = {'id':'name'}
> if total
>>> list = []
> >>> total = 0
> >>> if total > 0:
> ... x = {'id': 'name', 'link': 'XX'}
> ... list.append(x)
> ... else:
> ... y = {'id': 'name', 'link': 'YY'}
> ... list.append(y)
> ...
>
Yeah.
list = []
x = {'id':'name'}
if total > 0:
x['link'] = 'XX'
else:
x['link'] = 'Y
Hello,
Is there a better way to do this:
>>> list = []
>>> total = 0
>>> if total > 0:
... x = {'id': 'name', 'link': 'XX'}
... list.append(x)
... else:
... y = {'id': 'name', 'link': 'YY'}
... list.append(y)
...
I would like to change the key 'link' value depending on the valu
Dave Kuhlman wrote:
> Here is something relevant to this argument, although I'm not sure
> that I agree with it:
>
> "Getters and setters are evil. Evil, evil, I say! Python objects
> are not Java beans. Do not write getters and setters. This is
> what the 'property' built-in is for.
On Sat, Feb 09, 2008 at 08:42:04PM -0500, Kent Johnson wrote:
> Alan Gauld wrote:
>
> >> def values(self):
> >> return (self.name, self.wealth, self.strenth)
> >>
> >> Or get rid of values() entirely and just refer to the attributes
> >
> > Nope, I don't like that as much since it encourage
Varsha Purohit wrote:
> Hello All,
> I am using PIL function to change brightness of an image. But i
> am getting an error when i am trying to save that image. Here is the code..
>
> import Image
> import ImageChops, ImageEnhance
> import math, operator
>
> file1 = Image.open("r10001t0.
washakie wrote:
> Yes, I'm using 2.4, and will not likely be able to upgrade... so, the final,
> as you suggested Kent:
>
>
> dates_dt=([datetime.datetime(int(dates_list[i][0][:4]),int(dates_list[i][0][4:6]),
>
> int(dates_list[i][0][6:8]),int(dates_list[i][0][8:
Yes, I'm using 2.4, and will not likely be able to upgrade... so, the final,
as you suggested Kent:
dates_dt=([datetime.datetime(int(dates_list[i][0][:4]),int(dates_list[i][0][4:6]),
int(dates_list[i][0][6:8]),int(dates_list[i][0][8:10]),
13 matches
Mail list logo