> 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.
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 d
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 com
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 f
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 or
> 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 an
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
On Tue, Mar 1, 2011 at 7:59 PM, Sean Carolan 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 be out on p
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 wi
On Tue, Mar 1, 2011 at 1:59 PM, Sean Carolan 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 be out
> 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 n
On Tue, Mar 1, 2011 at 7:10 PM, Sean Carolan wrote:
> On Tue, Mar 1, 2011 at 11:55 AM, Sean Carolan 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 s
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.
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:
http://mail.python.org/mailman/listinfo/
On Tue, Mar 1, 2011 at 11:55 AM, Sean Carolan 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 lines in files, an
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 gott
"ANKUR AGGARWAL" 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 Dietel book has a chapter o
"Hugo Arts" 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 __init__?
Because
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
__
On Tue, Mar 1, 2011 at 5:35 PM, Alan Gauld wrote:
>
> "David" 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 no
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 chan
"David" 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 valid reference or N
"David" 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
Thats pretty much how I
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
from? I can't resolve it. Or do I have to cre
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 i
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 :
> 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
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 :
> Hi Python Tutors,
>
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 interfac
Thank you all for answers. Again.
2011/2/28 Alan Gauld
>
> "Christopher Brookes" 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.
>
> Basically the "best"(?) sol
29 matches
Mail list logo