Thank you all for answers. Again.
2011/2/28 Alan Gauld alan.ga...@btinternet.com
Christopher Brookes chris.klai...@gmail.com wrote
I don't understand
@classmethod
def DisplayAll(cls, herosAll):
What is cls ?
This is one of the advanced techniques I referred to a few days ago.
Hi Python Tutors,
I'm using a storm water modelling program, EPA SWMM, to model the
hydrology and hydraulics of a study area.
SWMM reports its results in a binary (.out) file that contains the
results for each element in the model at each time step in the model
run. According to the SWMM
I see that I have misread the manual and that I need to reproduce the
code in the C example in python. The SWMM DLL doesn't contain
ready-made functions to open files etc.
Apologies for posting before I was completely sure of the problem.
Hanlie
2011/3/1, Hanlie Pretorius
Can anyone perhaps suggest the easiest way of translating the C code
into Python, bearing in mind that I'm rather a beginner?
Thanks
Hanlie
2011/3/1, Hanlie Pretorius hanlie.pretor...@gmail.com:
I see that I have misread the manual and that I need to reproduce the
code in the C example in
Hanlie Pretorius, 01.03.2011 13:33:
Can anyone perhaps suggest the easiest way of translating the C code
into Python, bearing in mind that I'm rather a beginner?
A beginner of what? Python? Programming in general?
The C code you posted doesn't look too complex, so you could try to
translate
David bouncingc...@gmail.com wrote
clever enough to refuse to instantiate itself if a necessary
condition
is not met.
class MyClass_2(object):
def __new__(self, condition):
if condition:
return object.__new__(self)
else:
return None
David bouncingc...@gmail.com wrote
clever enough to refuse to instantiate itself if a necessary
condition
is not met.
Oops, sent too soon.
I meant to add that you should realize that the implication of your
design is that the user of the class now has to check each object
to see if it is a
Hey
Any good recommendation (ebook,links,videos,Live Example) to get started
with the pygame api. I am totally new to pygame.
Thanks in advance. Waiting for the suggestions :):)
Ankur Aggarwal
___
Tutor maillist - Tutor@python.org
To unsubscribe or
On Tue, Mar 1, 2011 at 5:35 PM, Alan Gauld alan.ga...@btinternet.com wrote:
David bouncingc...@gmail.com wrote
clever enough to refuse to instantiate itself if a necessary condition
is not met.
Oops, sent too soon.
I meant to add that you should realize that the implication of your
http://www.pyweek.org/
Cheers
On Tuesday 01 March 2011, ANKUR AGGARWAL wrote:
Hey
Any good recommendation (ebook,links,videos,Live Example) to get started
with the pygame api. I am totally new to pygame.
Thanks in advance. Waiting for the suggestions :):)
Ankur Aggarwal
Hugo Arts hugo.yo...@gmail.com wrote
Side question: Any reason why you'd raise the exception from __new__
rather than __init__? If you want to return None, then yeah I can
see
why you'd have to use __new__, but would there be any reason you
can't
or shouldn't simply raise an exception from
ANKUR AGGARWAL coolankur2...@gmail.com wrote
Any good recommendation (ebook,links,videos,Live Example) to get
started
with the pygame api. I am totally new to pygame.
Thanks in advance. Waiting for the suggestions :):)
Have you looked at the tutorial on the pygamje web site?
Also the
Maybe someone can help with this. I have a function that takes a
single file as an argument and outputs a tuple with each line of the
file as a string element. This is part of a script that is intended
to concatenate lines in files, and output them to a different file.
This is as far as I've
On Tue, Mar 1, 2011 at 11:55 AM, Sean Carolan scaro...@gmail.com wrote:
Maybe someone can help with this. I have a function that takes a
single file as an argument and outputs a tuple with each line of the
file as a string element. This is part of a script that is intended
to concatenate
I teach videogames programming to my students using Python and Pygame:
http://pythonwiki.wikispaces.com
Sorry, in spanish...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Sean,
: Maybe someone can help with this. I have a function that takes a
: single file as an argument and outputs a tuple with each line of
: the file as a string element. This is part of a script that is
: intended to concatenate lines in files, and output them to a
: different file.
On Tue, Mar 1, 2011 at 7:10 PM, Sean Carolan scaro...@gmail.com wrote:
On Tue, Mar 1, 2011 at 11:55 AM, Sean Carolan scaro...@gmail.com wrote:
Maybe someone can help with this. I have a function that takes a
single file as an argument and outputs a tuple with each line of the
file as a string
I saw in your follow-up that you went straight for vars(). I really
don't think that's what you wish to use. Get rid of vars(), he had
to go to jail. Don't go visit vars() again for at least two months,
then maybe he'll be out on probation.
Thanks Martin and Hugo. As you can tell I'm no
On Tue, Mar 1, 2011 at 1:59 PM, Sean Carolan scaro...@gmail.com wrote:
I saw in your follow-up that you went straight for vars(). I really
don't think that's what you wish to use. Get rid of vars(), he had
to go to jail. Don't go visit vars() again for at least two months,
then maybe
On 3/1/2011 10:59 AM Sean Carolan said...
Take an arbitrary number of text files. Assume that each text file has
the exact same number of lines. Concatenate each line of each file
with the corresponding lines of the other files and output the data.
So in other words, the first line of output
On Tue, Mar 1, 2011 at 7:59 PM, Sean Carolan scaro...@gmail.com wrote:
I saw in your follow-up that you went straight for vars(). I really
don't think that's what you wish to use. Get rid of vars(), he had
to go to jail. Don't go visit vars() again for at least two months,
then maybe he'll
Sorry if im annoying, but I think this is a better question than my previous
one of today.
I have some Images in an HTTP Server that I need to transfer to an SFTP server
using a Python script.
So far I can download them to my hard drive, and upload them to the sftp
server; quite easy. I would
My advice would be to go read up on the zip() function and the
str.join() function. Then, if you are using python 2.x, go find
itertools.izip. It does the same thing as zip but it's more memory
efficient. With those two you can do it in about two lines or so (and
maybe a few for set up and
On 3/1/2011 11:49 AM Sean Carolan said...
My advice would be to go read up on the zip() function and the
str.join() function. Then, if you are using python 2.x, go find
itertools.izip. It does the same thing as zip but it's more memory
efficient. With those two you can do it in about two lines
Am 01.03.2011 16:19, schrieb Emanuel Lauria:
Hi everyone,
I'm trying to map a couchdb document to a python object using
couchdb.mapping. I'm stuck in the very first part were it says I should
declare a Python class that inherits from the 'Document'.. Where does
this 'Document' superclass comes
This isn't a python solution, but if you have an ssh connection to
both servers, (I assume so) you can forward them directly. It would
look like this in an operating system shell like tcsh or bash:
me@baz scp -r m...@foo.com:/home/me/pictures m...@bar.com:/somewhere/
You could wrap the above
Emile van Sebille wrote:
On 3/1/2011 11:49 AM Sean Carolan said...
My advice would be to go read up on the zip() function and the
str.join() function. Then, if you are using python 2.x, go find
itertools.izip. It does the same thing as zip but it's more memory
efficient. With those two you can
Another way is:
zip(*map(open, myfiles))
Then your loop looks like:
for i in zip([ cleanedup(filename) for filename in myfiles ])
Thanks, Steven! I knew there was a way to do this with just a few
lines. I will read up some more on list expansion and the map
built-in.
28 matches
Mail list logo