Hi all,
After six years of tutor posts my interest and energy have waned and
I'm ready to move on to something new. I'm planning to stop reading
and contributing to the list. I have handed over list moderation
duties to Alan Gauld and Wesley Chun.
Thanks to everyone who contributes questions and
with the Mercurial
project or SunlightLabs.org.
Kent
On 3 March 2010 14:17, Kent Johnson ken...@tds.net wrote:
After six years of tutor posts my interest and energy have waned and
I'm ready to move on to something new.
___
Tutor maillist - tu
On Thu, Feb 25, 2010 at 8:59 PM, Kirk Bailey kbai...@howlermonkey.net wrote:
for WEBMAIIL portal to a pop3/smtp email service in my server; centrally
hosted or in the laptop is fine, what can people recommend? Without going to
IMAP, i want to leave the mail on the server.
I still have no idea
On Tue, Feb 23, 2010 at 10:58 PM, Shurui Liu (Aaron Liu)
shuru...@gmail.com wrote:
This time is not my assignment, I promise.
In python, when we want to list numbers, we use the command range, like,
if we want to list integer from 0 to 9, we can write: range(10); if we want
to list integer
This looks promising and probably of interest to some on this list.
Kent
-- Forwarded message --
From: Noam Yorav-Raphael noamr...@gmail.com
To: python-announce-l...@python.org
Date: Sun, 21 Feb 2010 11:39:02 +0200
Subject: DreamPie - The Python shell you've always dreamed about!
On Mon, Feb 22, 2010 at 11:50 PM, Vincent Davis
vinc...@vincentdavis.net wrote:
I must be missing something simple. I have a list of lists data = [[' 0', '
0', '234.0', '24.0', ' 25'], [' 1', ' 0', '22428.0', '2378.1', '
25'],.. and what to make a record array from it but it gets
On Tue, Feb 23, 2010 at 1:55 PM, Giorgio
And, please let me ask a question: Kent told that nested_namespace(s) are
default in python 2.6. And i found a line confirming this in py2.6 library.
But, what about python 2.5 that as you know is the default on linux?
Yes, since 2.2 nested namespaces
On Mon, Feb 22, 2010 at 1:06 AM, Lao Mao laomao1...@googlemail.com wrote:
Hi,
I have an html file, with xml style comments in:
!--
Some comments here
Blah
...
--
I'd like to extract only the comments. My sense of smell suggests that
there's probably a library (maybe an xml library)
On Mon, Feb 22, 2010 at 9:13 AM, Giorgio anothernetfel...@gmail.com wrote:
And, i have some difficulties understanding the other strange example in
that howto. Just scroll down to: However, the point is that the value
of x is picked up from the environment at the time when the function is
On Sun, Feb 21, 2010 at 8:44 AM, jim serson fubarni...@hotmail.com wrote:
Can anyone tell me if I can have my program check to see if something is
true the add to count
For example something like
if c_1 and c_2 and c_3 true:
count + 1
This will almost work as written. Try
if
On Sat, Feb 20, 2010 at 12:50 PM, Alan Harris-Reid
aharrisr...@googlemail.com wrote:
Hi,
I am having trouble understanding how superclass calls work. Here's some
code...
class ParentClass():
def __init__(self):
do something here
You should inherit object to use super():
class
On Sat, Feb 20, 2010 at 5:34 PM, Lao Mao laomao1...@googlemail.com wrote:
Hello,
I need to be able to replace the last bit of a bunch of URLs.
The urls look like this:
www.somesite.com/some/path/to/something.html
They may be of varying lengths, but they'll always end with
On Fri, Feb 19, 2010 at 1:56 PM, Carnell, James E
jecarn...@saintfrancis.com wrote:
I am trying to teach a computer program - to program. It builds grammars and
procedural memories on dictionary networks. How do I get the program to be
able to input to the interpreter/command line and read the
On Fri, Feb 19, 2010 at 7:42 AM, Norman Rieß nor...@smash-net.org wrote:
Hello,
i am trying to read a large bz2 file with this code:
source_file = bz2.BZ2File(file, r)
for line in source_file:
print line.strip()
But after 4311 lines, it stoppes without a errormessage. The bz2 file is
On Fri, Feb 19, 2010 at 7:07 PM, Steven D'Aprano st...@pearwood.info wrote:
On Sat, 20 Feb 2010 06:33:04 am Kent Johnson wrote:
It sounds like you are looking for eval()
(Standard warning - use eval() only on trusted data)
This is the tutor list, aimed at beginners to Python, many of whom
On Thu, Feb 18, 2010 at 4:59 AM, C.T. Matsumoto c.t.matsum...@gmail.com wrote:
Hello Tutors,
Can someone point me to any resources that can teach me about algorithms in
python?
I'm interested in learning how to analyze and make an algorithm.
I have been reading The Algorithm Design Manual
On Thu, Feb 18, 2010 at 9:43 AM, C.T. Matsumoto c.t.matsum...@gmail.com wrote:
Here is the example.
To keep this simple and practical, as a suggestion, consider the problem of
sorting a list (a pack of cards, or a list of names or whatever you want)
into order.
Yes, there are many
On Wed, Feb 17, 2010 at 11:31 AM, Karjer Jdfjdf karper12...@yahoo.comwrote:
I'm relatively new at Python and I'm trying to write a function that fills
a dictionary acording the following rules and (example) data:
Rules:
* No duplicate values in field1
* No duplicates values in field2 and
On Wed, Feb 17, 2010 at 3:12 PM, David Perlman dperl...@wisc.edu wrote:
Yeah, I got this part. The thing that's hanging me up is that there doesn't
seem to be any way to get a tzinfo instance that contains the current local
time zone information. You can do time.timezone to get the seconds
, it is
implicit in the existing definitions that the system *knows* the current
offset, even if it doesn't know the whole set of rules...
On Feb 17, 2010, at 2:26 PM, Kent Johnson wrote:
On Wed, Feb 17, 2010 at 3:12 PM, David Perlman dperl...@wisc.edu wrote:
Yeah, I got this part. The thing that's
On Wed, Feb 17, 2010 at 4:37 PM, David Perlman dperl...@wisc.edu wrote:
OK, here's a function that does precisely what I want:
def tzDelta():
by whatever means necessary, return the current offset of the local time
from utc.
s=time.time()
t,u=time.localtime(s),time.gmtime(s)
Hi all,
I'm going to PyCon this year for the first time (yeah!) and I would
love to meet other regular contributors to the tutor list. Is anyone
else going to be there? Any interest in a Meet the tutors Open Space
or dinner?
Kent
___
Tutor maillist -
On Tue, Feb 16, 2010 at 10:09 AM, Vern Ceder
vce...@canterburyschool.org wrote:
Kent Johnson wrote:
Hi all,
I'm going to PyCon this year for the first time (yeah!) and I would
love to meet other regular contributors to the tutor list. Is anyone
else going to be there? Any interest in a Meet
On Tue, Feb 16, 2010 at 10:17 AM, Wayne Watson
sierra_mtnv...@sbcglobal.net wrote:
Hi all,
I'm going to PyCon this year for the first time (yeah!) and I would
love to meet other regular contributors to the tutor list. Is anyone
else going to be there? Any interest in a Meet the tutors Open
On Tue, Feb 16, 2010 at 11:54 AM, Shurui Liu (Aaron Liu)
shuru...@gmail.com wrote:
Modify the guess_my_number.py program to limit the number of guesses to ten (10).
Tell the user up front that they have ten guesses.
After each guess, tell the user that they have ___ guesses remaining.
On Mon, Feb 15, 2010 at 6:07 AM, patrice laporte zepango...@gmail.com wrote:
My own experience is that there is too much coder that forget the app they
work on is aim to be used by real human, not by C/C++/Python/put what ever
you want here/ guru : if your app popups to the user a message that
On Mon, Feb 15, 2010 at 7:28 AM, Amit Sethi amit.pureene...@gmail.com wrote:
Well ya I was kind of hoping to know about more tools and recommendations on
how to edit broken html .
This page lists several alternatives: html5, lxml, elementtree:
On Sun, Feb 14, 2010 at 6:10 AM, Amit Sethi amit.pureene...@gmail.com wrote:
Hi I need to edit html programmatically . Sadly the html might be broken at
places . I was using BeautifulSoup but there were lots of problems and it is
also not maintained can some one guide me to any tutorials on
On Fri, Feb 12, 2010 at 11:49 PM, Eduardo Vieira
eduardo.su...@gmail.com wrote:
Hello! I was reading the latest version of Mark Pilgrim's Dive into
Python and am confused with these example about the pluralization
rules. See http://diveintopython3.org/examples/plural3.py and
On Fri, Feb 12, 2010 at 10:55 PM, Wayne Watson
sierra_mtnv...@sbcglobal.net wrote:
There seems to be something of a general consensus in ordering import
statements. Something like standard library imports first. When using tools
like matlablib or tkinter (maybe), must one keep an order among
On Sat, Feb 13, 2010 at 7:21 AM, Chris Patillo pythonnewb...@gmail.com wrote:
I need to read in a .json file and write out a file with some of the
information from this file. I can't figure out how to read the .json file
in. I know there is a module for this, but I don't understand how it
On Sat, Feb 13, 2010 at 10:56 AM, patrice laporte zepango...@gmail.com wrote:
Being in an exeption of my own, I want to print the name of the caller, and
I'm looking for a way to have it.
I've found a lot of recipe all of them using what seems to be, according to
me, a not so good trick :
On Sat, Feb 13, 2010 at 4:08 PM, 刘书睿 shuru...@gmail.com wrote:
Here are my assignment about Python, I don't know if anything is wrong. Is
there anybody can help me?
1. assignment 9a and 9b hyperlink:
http://cset.sp.utoledo.edu/cset1100py/cset1100_assign.html#simplepy
2. I don't know how to
2010/2/13 Shurui Liu (Aaron Liu) shuru...@gmail.com:
Yeah, i know. I don't want somebody tell me all the answers of these
assignment directly. I just want to know is there any error in the commands
listed online? My teacher told us there is some, but I cannot find out. He
said we can run them
On Sat, Feb 13, 2010 at 3:00 PM, Chris Patillo pythonnewb...@gmail.com wrote:
Thanks for your response. i did some research on json.load() and I don't
understand how you extract the data from it. How do I get just the name and
number from the file?
The value returned from json.load() is a
On Sat, Feb 13, 2010 at 8:08 PM, the kids the7hans...@msn.com wrote:
Hi, my name is John Paul.
I was trying to define a class but I can't make it asign particular objects
particular variables at their creation. Please help.
It would help to see some details of what you are trying to do. It
2010/2/11 Григор grigor.ko...@gmail.com:
I found this.
http://karrigell.sourceforge.net/en/pythoninsidehtml.htm
Many options here:
http://wiki.python.org/moin/Templating
Kent
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
On Thu, Feb 11, 2010 at 4:44 AM, Stefan Behnel stefan...@behnel.de wrote:
2) given that you have lists as items in the 'data' list, it's enough to
call sort() once, as the comparison of lists is defined as the comparison
of each item to the corresponding item of the other list. If you want to
On Thu, Feb 11, 2010 at 4:56 AM, Lao Mao laomao1...@googlemail.com wrote:
Hi,
I have 3 servers which generate about 2G of webserver logfiles in a day.
These are available on my machine over NFS.
I would like to draw up some stats which shows, for a given keyword, how
many times it appears
On Thu, Feb 11, 2010 at 8:37 AM, Stefan Behnel stefan...@behnel.de wrote:
Kent Johnson, 11.02.2010 14:16:
On Thu, Feb 11, 2010 at 4:44 AM, Stefan Behnel wrote:
2) given that you have lists as items in the 'data' list, it's enough to
call sort() once, as the comparison of lists is defined
On Thu, Feb 11, 2010 at 1:59 PM, Matthew Matson gtx...@hotmail.com wrote:
Hi Tutors,
I am looking for the proper approach regarding the analysis of a dictionary
of combinations I have.
What I need to do is read from a supplied text file that has a unique ID and
that unique ID's associated
On Thu, Feb 11, 2010 at 3:13 PM, Grigor Kolev grigor.ko...@gmail.com wrote:
Hi.
I try send a mail with smtplib
Server work with postfix.
I try it
import smtplib
s=smtplib.SMTP(localhost)
tolist=['grigor.ko...@gmail.com']
msg = '''\
On Tue, Feb 9, 2010 at 10:00 PM, David ld...@gmx.net wrote:
Hi guys,
I just wrote this message, but after restarting ipython all worked fine.
How is it to be explained that I first had a namespace error which, after a
restart (and not merely a new run Sande_celsius-main.py), went away? I
On Wed, Feb 10, 2010 at 6:47 AM, nikunj badjatya
nikunjbadja...@gmail.com wrote:
I commented out the raise Exception statement in Row.py library
module.
Here's the (line no. 150 ) of Row.py which i have edited:
def insert_cell(self, col_index, cell_obj):
if col_index in
On Wed, Feb 10, 2010 at 6:26 AM, Owain Clarke simb...@cooptel.net wrote:
Please excuse the obviousness of my question (if it is), but I have searched
the documentation for how to generate a list e.g. [(1,2), (3,4)] from a
string [(1,2), (3,4)]. I wonder if someone could point me in the right
On Wed, Feb 10, 2010 at 8:32 AM, Owain Clarke simb...@cooptel.net wrote:
My son was doing a statistics project in which he had to sort some data by
either one of two sets of numbers, representing armspan and height of a
group of children - a boring and painstaking job. I came across this piece
On Wed, Feb 10, 2010 at 2:30 PM, Grigor Kolev grigor.ko...@gmail.com wrote:
Hi.
I want to make a list of E-mail, photos and some additional data.
But I want this list to be displayed in one site.
How can I send data from a list of site page. Which module should I use
I don't understand send
On Wed, Feb 10, 2010 at 2:54 PM, Grigor Kolev grigor.ko...@gmail.com wrote:
В 14:39 -0500 на 10.02.2010 (ср), Kent Johnson написа:
On Wed, Feb 10, 2010 at 2:30 PM, Grigor Kolev grigor.ko...@gmail.com wrote:
Hi.
I want to make a list of E-mail, photos and some additional data.
But I want
On Wed, Feb 10, 2010 at 4:27 PM, invincible patriot
invincible_patr...@hotmail.com wrote:
hi
i want to compare a string with a dictionary
or u can say that i want to take user input A STRING, and want to compare
each character of that string with the KEYS in the dictionary, and then i
wana
On Wed, Feb 10, 2010 at 6:43 PM, jim serson fubarni...@hotmail.com wrote:
I am getting an error when I try and run split and count I seem to get it to
work with one or the other but not together. python wants a character buffer
but I am not sure how to use it.
I would also like to use
On Tue, Feb 9, 2010 at 11:09 AM, Ken G. beach...@insightbb.com wrote:
Kent Johnson wrote:
On Tue, Feb 9, 2010 at 10:28 AM, Ken G. beach...@insightbb.com wrote:
I printed out some random numbers to a datafile and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n
On Sat, Feb 6, 2010 at 11:35 AM, David ld...@gmx.net wrote:
Hello again,
in Knowlton's 2008 book Python: Create, Modify, Reuse the author makes
frequent use of the term -1 in his code, but doesn't tell to what aim. For
want of search terms Google is not helpful. Could someone please enlighten
On Thu, Feb 4, 2010 at 5:39 PM, ssiverling ssiverl...@gmail.com wrote:
I uploaded a file. I know it's not very impressive.
Where did you upload it?
For short programs you can just include them in your email.
Also, please don't top-post, and please subscribe to the list.
Kent
Kent
On Thu, Feb 4, 2010 at 5:43 AM, Owain Clarke simb...@cooptel.net wrote:
My question is, that if I proceed like this I will end up with a single list
of potentially several hundred strings of the form frword:engword. In
terms of performance, is this a reasonable way to do it, or will the
On Thu, Feb 4, 2010 at 12:11 PM, Serdar Tumgoren zstumgo...@gmail.com wrote:
I just noticed, however, that in the comments section of the
ActiveState recipe that someone is getting incorrect results for
certain numbers (11 and 12, specifically).
But when I use the code on my own machine it
On Thu, Feb 4, 2010 at 1:09 PM, Kent Johnson ken...@tds.net wrote:
On Thu, Feb 4, 2010 at 12:11 PM, Serdar Tumgoren zstumgo...@gmail.com wrote:
Here's the link to the recipe:
http://code.activestate.com/recipes/576888/
Perhaps the code on activestate is not a correct copy of what you
On Thu, Feb 4, 2010 at 12:47 PM, Alan Harris-Reid
aharrisr...@googlemail.com wrote:
Hi,
I have a SQLite cursor which I want to traverse more than once, eg...
for row in MyCursor:
method1(row)
then later...
for row in MyCursor:
method2(row)
Method2 is never run, I guess because the
On Thu, Feb 4, 2010 at 1:21 PM, Serdar Tumgoren zstumgo...@gmail.com wrote:
Perhaps the code on activestate is not a correct copy of what you are
running? The conditional at line 23 extends all the way to line 35 -
the end of the function - so if value % 100/10 == 1 no more code is
executed
On Thu, Feb 4, 2010 at 1:19 PM, ssiverling ssiverl...@gmail.com wrote:
So I have been working on this example for a little while. I looked for the
answer before posting. I tried to use two raw inputs, then use
sys.stdout.write, to add them together. However I think I might need to use
a
On Wed, Feb 3, 2010 at 8:19 AM, NISA BALAKRISHNAN
snisa.balakrish...@gmail.com wrote:
hi
I am very new to python.
I have a string for example : 123B new Project
i want to separate 123B as a single string and new project as another
string .
how can i do that.
i tried using partition
On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine nor...@khine.net wrote:
here are the changes:
import re
file=open('producers_google_map_code.txt', 'r')
data = repr( file.read().decode('utf-8') )
Why do you use repr() here?
get_record = re.compile(ropenInfoWindowHtml\(.*?\\ticon: myIcon\\n)
On Tue, Feb 2, 2010 at 8:04 AM, Zheng Jiekai zjkh...@gmail.com wrote:
I'm beginning my python learning. My python version is 3.1
I‘v never learnt OOP before.
So I'm confused by the HTMLParser
Here's the code:
from html.parser import HTMLParser
class parser(HTMLParser):
def
On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine nor...@khine.net wrote:
On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson ken...@tds.net wrote:
On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine nor...@khine.net wrote:
here are the changes:
import re
file=open('producers_google_map_code.txt', 'r')
data
On Tue, Feb 2, 2010 at 1:39 PM, Norman Khine nor...@khine.net wrote:
On Tue, Feb 2, 2010 at 4:19 PM, Kent Johnson ken...@tds.net wrote:
On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine nor...@khine.net wrote:
On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson ken...@tds.net wrote:
On Tue, Feb 2, 2010
On Tue, Feb 2, 2010 at 4:56 PM, Norman Khine nor...@khine.net wrote:
On Tue, Feb 2, 2010 at 10:11 PM, Kent Johnson ken...@tds.net wrote:
Try this version:
data = file.read()
get_records = re.compile(ropenInfoWindowHtml\(.*?\ticon:
myIcon\n, re.DOTALL).findall
get_titles = re.compile
On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine nor...@khine.net wrote:
thanks, what about the whitespace problem?
\s* will match any amount of whitespace includin newlines.
Kent
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
On Sat, Jan 30, 2010 at 4:56 AM, spir denis.s...@free.fr wrote:
I'm surprised of this, for this should create as many indexes (in the
underlying array actually holding the values) as there are integer keys. With
possibly huge holes in the array. Actually, there will certainly be a
On Fri, Jan 29, 2010 at 8:03 AM, spir denis.s...@free.fr wrote:
I recently discovered that Lua uses the data's address (read: id) as input to
the hash func. This allows Lua tables (a kind of more versatile associative
array) to use _anything_ as key, since the id is guaranteed not to change,
On Fri, Jan 29, 2010 at 1:20 PM, Rich Lovely roadier...@googlemail.com wrote:
I've played with this a little. The following class was quite handy for this:
class BrokenHash(object):
def __init__(self, hashval):
self.hashval = hashval
def __hash__(self):
return
On Wed, Jan 27, 2010 at 6:57 PM, Alan Gauld alan.ga...@btinternet.com wrote:
read() functions usually have an optional buffersize parameter
set to a reasonable size. If you try to read more than that it
will be truncated. This is explained in the read() documentation
for files.
?? files have
On Thu, Jan 28, 2010 at 1:22 AM, Muhammad Ali ali@gmail.com wrote:
Hi,
I am multipliying two lists so that each of list As elements get multiplied
to the corresponding list Bs. Then I am summing the product.
For example, A= [1, 2, 3] and B=[2, 2, 2] so that I get [2, 4, 6] after
On Sun, Jan 24, 2010 at 12:08 PM, Alan Gauld alan.ga...@btinternet.com wrote:
Hugo Arts hugo.yo...@gmail.com wrote
print this is {0}.format(formatted)
this is formatted
Caveat:
this style only works in Python 3.0 upwards (or maybe in 2.6/2.7?)
It's in 2.6
On Thu, Jan 21, 2010 at 1:57 AM, sudhir prasad sudheer@gmail.com wrote:
hi,
is there any other way to keep track of line number in a file other than
fileinput.filelineno()
With enumerate():
for line_number, line in enumerate(open('myfile.txt')):
# etc
Kent
On Thu, Jan 21, 2010 at 4:03 AM, Paul Melvin
p...@assured-networks.co.uk wrote:
The code is at http://python.codepad.org/S1ul2bh7 and the bit I would like
some advice on is how to get the sorted data and where to put it.
Generally the code seems a bit disorganized, consider breaking it into
On Thu, Jan 21, 2010 at 4:06 AM, markus kossner m.koss...@tu-bs.de wrote:
Dear Pythonics,
I have a rather algorithmic problem that obviously made a knot in my brain:
Assume we have to build up all the arrays that are possible if we have a
nested array
containing an array of integers that are
On Thu, Jan 21, 2010 at 8:07 AM, Kent Johnson ken...@tds.net wrote:
On Thu, Jan 21, 2010 at 4:06 AM, markus kossner m.koss...@tu-bs.de wrote:
Dear Pythonics,
I have a rather algorithmic problem that obviously made a knot in my brain:
Assume we have to build up all the arrays that are possible
On Mon, Jan 18, 2010 at 4:17 PM, Alan Gauld alan.ga...@btinternet.com wrote:
I use plain old RCS for version control because its just me working on the
code.
Wow. You should take a look at Mercurial. It is so easy to set up a
Mercurial repository for a local project - just
hg init # create a
On Tue, Jan 19, 2010 at 9:12 AM, Andreas Kostyrka andr...@kostyrka.org wrote:
The cool part about git that I've not yet replicated with hg is git add -p
which allows you to seperate out
different changes in the same file.
Sounds like the record and crecord extensions come close, anyway:
.
Kent Johnson wrote:
On Sun, Jan 17, 2010 at 3:45 PM, Kirk Z Bailey kbai...@howlermonkey.net
wrote:
I am writing a script that will send an email message. This will run in a
windows XP box. The box does not have a smtp server, so the script must
crete not merely a smtp client to talk to a MTA
On Sun, Jan 17, 2010 at 3:45 PM, Kirk Z Bailey kbai...@howlermonkey.net wrote:
I am writing a script that will send an email message. This will run in a
windows XP box. The box does not have a smtp server, so the script must
crete not merely a smtp client to talk to a MTA, it must BE one for
On Fri, Jan 15, 2010 at 4:24 AM, Paul Melvin
p...@assured-networks.co.uk wrote:
Hi,
Thanks very much to all your suggestions, I am looking into the suggestions
of Hugo and Alan.
The file is not very big, only 700KB (~2 lines), which I think should be
fine to be loaded into memory?
I
On Fri, Jan 15, 2010 at 3:43 PM, Guilherme P. de Freitas
guilhe...@gpfreitas.com wrote:
Ok, I checked the answers you all gave me, and the suggestions seem to be 2:
a. Compute the list of members on the fly, with a list comprehension
that looks up stuff on self.__dict___;
b. Stay with my
On Wed, Jan 13, 2010 at 9:24 PM, Guilherme P. de Freitas
guilhe...@gpfreitas.com wrote:
Hi everybody,
Here is my problem. I have two classes, 'Body' and 'Member', and some
attributes of 'Body' can be of type 'Member', but some may not. The
precise attributes that 'Body' has depend from
On Wed, Jan 13, 2010 at 11:15 PM, Guilherme P. de Freitas
guilhe...@gpfreitas.com wrote:
Ok, I got something that seems to work for me. Any comments are welcome.
class Member(object):
def __init__(self):
pass
class Body(object):
def __init__(self):
self.members = []
On Wed, Jan 13, 2010 at 2:21 PM, Stefan Behnel stefan...@behnel.de wrote:
Hugo Arts, 13.01.2010 15:25:
Here is my solution for the general case:
from itertools import groupby
def alphanum_key(string):
t = []
for isdigit, group in groupby(string, str.isdigit):
group =
On Tue, Jan 12, 2010 at 9:39 AM, Make Twilight ph4...@gmail.com wrote:
I can understand how to use parameters of cmp and reverse,except the
key parameter...
Would anyone give me an example of using sort method with key parameter?
http://personalpages.tds.net/~kent37/kk/7.html
Kent
On Sun, Jan 10, 2010 at 10:44 PM, Tom Roche tom_ro...@pobox.com wrote:
How to create a single unittest test suite class that runs all methods
from multiple TestCase classes? Why I ask:
I'm trying to relearn TDD and learn Python by coding a simple app.
Currently the app has 2 simple
On Mon, Jan 11, 2010 at 2:33 AM, sudhir prasad sudheer@gmail.com wrote:
hi,
what is the equivalent function to strtok() in c++,
what i need to do is to divide a line into different strings and store them
in different lists,and write them in to another file
To split on a single character
On Mon, Jan 11, 2010 at 12:33 AM, VacStudent v...@petradiamonds.com wrote:
I would like to get a python book, how and where to get one?
Amazon.com? Or lots of free resources online.
Kent
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
On Mon, Jan 11, 2010 at 8:53 AM, Tom Roche tom_ro...@pobox.com wrote:
Kent Johnson Mon, 11 Jan 2010 06:42:39 -0500
However I don't recommend this style of organizing tests. I prefer
using nose for test discovery, it saves the work of creating all the
aggregating suites.
I've heard of Nose
On Mon, Jan 11, 2010 at 2:02 PM, Carnell, James E
jecarn...@saintfrancis.com wrote:
I want to subtract the Red Value in an array cell from a neighboring
Red Value cell.
pictArray[39][4] #pixel at 39 4
array([150, 140, 120], dtype=unint8)
pictArray[39][5]
On Sat, Jan 9, 2010 at 8:03 AM, spir denis.s...@free.fr wrote:
Do you realize the inner func will be redefined before each call? Meaning in
your case n calls x n outer loops x n inner loops.
def f() ...
is actually a kind of masked assignment
f = function()...
That's true, but it is
On Sat, Jan 9, 2010 at 3:50 AM, spir denis.s...@free.fr wrote:
Lie Ryan dixit:
only use from module import * if the
module was designed for such use
In most cases, this translates to: the imported module defines __names__,
which holds the list of names (of the objects) to be exported.
On Thu, Jan 7, 2010 at 1:26 PM, Lowell Tackett lowelltack...@yahoo.com wrote:
I found the Python documentation (on line} and came
across--'csv.Dialect.skipinitialspace' which I believe is the answer to my
dilemma. However, my effort to implement that detail, based on interpreting
the
On Thu, Jan 7, 2010 at 5:08 PM, kumar s ps_pyt...@yahoo.com wrote:
I want to take coordiates x and y from each row in file a, and check if they
are in range of zx and zy. If they are in range then I want to be able to
write both matched rows in a tab delim single row.
my code:
f1 =
On Fri, Jan 8, 2010 at 2:24 AM, galaxywatc...@gmail.com wrote:
So how do I
uncompress zip and gzipped files in Python,
zipfile and gzip
and how do I force split to only
evaluate the first two columns?
Use the optional second argument to split():
line.split(',', 2)
Better yet, can I tell
On Fri, Jan 8, 2010 at 9:54 AM, Lowell Tackett lowelltack...@yahoo.com wrote:
Now, perhaps you can you shed some light on this problem--I'm trying to do
some simple arithmetic with two of the retrieved values, and get this error:
coord = csv.reader(open('true_coord', 'rb'), skipinitialspace
On Fri, Jan 8, 2010 at 10:56 AM, Lowell Tackett lowelltack...@yahoo.com wrote:
Please keep in mind, as I'd mentioned earlier, all of this is fairly new
concepts to me; from running an interpretive Python screen, to delving into
the zen of computing, [even] to pasting stuff from there to
On Fri, Jan 8, 2010 at 2:39 PM, Rob Cherry pythontu...@lxrb.com wrote:
Extending on this advice somewhat - is it *ever* correct to import foobar.
There are countless examples of
import os,sys
etc,etc. Strictly speaking should we always be using from to only
get what we know we need?
No,
2010/1/5 朱淳 zhuchu...@gmail.com:
Hi all,
I put files in a list, just like this module:
#! /usr/bin/python
# -*- coding=utf-8 -*-
fileList = []
def openFiles():
for i in range(0,2):
fname = file%s%i
f = open(fname,a)
fileList.append(f)
def
1 - 100 of 4490 matches
Mail list logo