Jia-Yu Aw wrote:
> How to use __iter__
> Von:
> Jia-Yu Aw
> Antwortadresse:
> Jia-Yu Aw
> Datum:
> Dienstag, 9. August 2011 03:48:20
> An:
> tutor@python.org
> Gruppen:
> gmane.comp.python.tutor
> Hi all
>
> I've been learning Classes and have read the documentation on __iter__ but
st
Thanks again.
I add "print os.getcwd()" inside* app.py* and *app_test.py(the nosetests
script) *and find they are different.
In app.py, the working dir is the whole directory including all
subdirectories, but in app_test.py the working dir is the tests directory
only.
I guess it's due to the work
Hi all
I've been learning Classes and have read the documentation on __iter__ but
still don't understand how it works. I have two pieces of code: the first is
def __iter__, the second is using __iter__. Instead of being an iterator, I'm
just using this is a function, which I think is incorrect.
I am such a novice at this but I have gotten to a place where I am stuck. The
attachment is what I have done so far but it also has an error for indentation.
I will be working on that to. I have place comment as to what I want the
modules to do but that is as far as I can go. Can someone lead me
李龑 wrote:
Thanks Steven.
Sorry for trying to discuss nose or templates here :(
No need to be sorry, it isn't forbidden, but you may have more success
asking help elsewhere.
Do you actually have a template called "hello_form"? If not, then my *guess*
is that this is an *error* (even though
Thanks Steven.
Sorry for trying to discuss nose or templates here :(
Do you actually have a template called "hello_form"? If not, then my *guess*
> is that this is an *error* (even though it prints F) because you don't
> actually have a template called hello_form.
Yes, I have this template, and
Thank you and I will look into shutils, below is the code that did work:
import gzip
import os
MainFolder=r"E:/data"
for (path, dirs, files) in os.walk(MainFolder):
for dir in dirs:
print dir
path=path+'/'
for gzfiles in files:
if gzfiles[-3:]=='.gz':
pri
李龑 wrote:
Hi all,
I'm new in python and is learning about testing my little web.py app with
nosetests.
When the app is running in the web browser, it's ok. And the terminal
returns something like "127.0.0.1:51936 - - [08/Aug/2011 23:00:37] "HTTP/1.1
GET /hello" - 200 OK"
But when I'm trying to
>I would suggest using the string format() method to lay out the columns
>as you want them. You could use tab, but if your data values vary much,
>you'll get inconsistent results (i.e., if one row's value goes past the
>next tab stop). You'll want to create your own for loop to iterate over
>
Hi all,
I'm new in python and is learning about testing my little web.py app with
nosetests.
When the app is running in the web browser, it's ok. And the terminal
returns something like "127.0.0.1:51936 - - [08/Aug/2011 23:00:37] "HTTP/1.1
GET /hello" - 200 OK"
But when I'm trying to test the ap
On 08-Aug-11 02:20, Kayode Odeyemi wrote:
Either way, once you have the list of the keys you want to display,
print them out once as column headings
My concern is how do I print them out as columns, since writer.writerows
is currently lining them out as rows (\n)
Is there a function ava
Yup - sounds more like what the final version of my little project will
do.
At the moment, I'm more interested in taking each specific database's
version of it's DDL and converting it to an Oracle version of that DDL,
so initially it's not much more than a text converter which reads in
text de
>
> Either way, once you have the list of the keys you want to display, print
> them out once as column headings
My concern is how do I print them out as columns, since writer.writerows is
currently lining them out as rows (\n)
Is there a function available for me to do this or do I have to const
On 08-Aug-11 01:18, Kayode Odeyemi wrote:
Thanks so much. This is exactly what I'm looking for. In addition, since
fields is obviously a dict, I won't want to have to display it's keys
repeatedly. Is there a way to get the keys once, have it displayed and
used as columns, then it's values are dis
questions anon, 08.08.2011 01:57:
Thank you, I didn't realise that was all I needed.
Moving on to the next problem:
I would like to loop through a number of directories and decompress each
*.gz file and leave them in the same folder but the code I have written only
seems to focus on the last fold
Thanks so much. This is exactly what I'm looking for. In addition, since
fields is obviously a dict, I won't want to have to display it's keys
repeatedly. Is there a way to get the keys once, have it displayed and used
as columns, then it's values are displayed beneath it. Something like:
updated
16 matches
Mail list logo