def main():
infile = open("list.txt", "r")
for line in infile:
state = line[146:148]
omit_states = ['KS', 'KY', 'MA', 'ND', 'NE', 'NJ', 'PR',
'RI', 'SD', 'VI', 'VT', 'WI']
for n in omit_states:
if state != n:
print line
infile.close()
ma
On May 24, 2009, at 11:18 PM, Paras K. wrote:
Hello,
I came across your answer / assistance on the IP range.
I recommend looking at the ipaddr library:
http://svn.python.org/projects/python/trunk/Lib/ipaddr.py
There is some Sphinx documentation with the python 2.7 docs and some
on the ori
On Dec 26, 2008, at 8:57, "Emad Nawfal (عماد نوفل)" mail.com> wrote:
2008/12/26 Kent Johnson
On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل)
wrote:
> suppose I have an external program that prints "testing the
subprocess
> module"
> I know I can run it through the commands module
On Oct 4, 2008, at 4:03 AM, David wrote:
Dear list,
one of the exercises in Zelle's book is:
given
import string
s1 = "spam"
s2 = "ni!"
show a Python expression that could construct the following result
by performing string operations on s1 and s2:
"Spam Ni! Spam Ni! Spam Ni!".
I have t
On Sep 22, 2008, at 11:50 PM, Steve Willoughby wrote:
Dinesh B Vadhia wrote:
Thanks Steve. How do you sort on the second element of each list
to get:
a' = [[42, 'fish'],
[1, 'hello']
[2, 'world']
]
something like this would do the trick:
a_prime = sorted(a, key=(lambd
On Jul 11, 2008, at 7:54 PM, Christopher Spears wrote:
For another Core Python Programming question, I created a stack
class. I then put the class into a script to test it:
I understand that this is an exercise; but I think it might be
interesting for you to also look at collections.deque
On Jul 7, 2008, at 9:10 PM, James wrote:
Hi All,
I'm writing a web application in CherryPy. What a beautiful thing it
is to write Python code and get a simple yet powerful web output. :)
The web application needs to have some decent level of security and
authentication implemented.
The big is
On Feb 16, 2008, at 9:58 PM, bob gailer wrote:
> Marc Tompkins wrote:
>> John, Luke, Marc... can we get a Matthew to join this thread?
> You thinking of Matthew Dixon Coles?
>
> But then wouldn't Paul want to get into the Act?
For Pete's sake...
~ro
__
On Jan 10, 2008, at 12:41 AM, Allen Fowler wrote:
> Hello,
>
> How can a make a python script run in "deamon mode"? (on a linux box)
>
> That is, I want to run the program via "python myfile.py" and have
> it drop me back to the command line. The program should continue
> running until I kill
On Jan 8, 2008, at 7:49 PM, Bill Campbell wrote:
> On Tue, Jan 08, 2008, [EMAIL PROTECTED] wrote:
>>
>> my friend uses vim
Small editors for small minds;)
>>
>> and i use xemacs
>>
>> so our shared python code is a mix of tabs and spaces and it is
>> hard
>> for him to edit it in vim
>
On Dec 28, 2007, at 11:29 AM, doug shawhan wrote:
*sigh* Ignore folks. I had forgotten about .has_key().
.has_key() is deprecated in 2.6 and goes away in 3.0 IIRC
You should use
record in D
or
D.get(record)
On Dec 28, 2007 11:22 AM, doug shawhan <[EMAIL PROTECTED]> wrote:
I'm building
On Dec 24, 2007, at 1:19 PM, Shahjehan Hakim wrote:
Hi everyone..
I have to make Telnet session with Router/switch of Cisco. Anybody
has idea how it can be done? from what i researched, i got most of
the telnet session like client/servers. But what I have to do here
is just to create a Te
On Oct 29, 2007, at 7:54 PM, elis aeris wrote:
http://www.pythonware.com/products/pil/#pil116
has anyone been able to compile this on Mac os x?
http://two.pairlist.net/pipermail/reportlab-users/2007-October/
006262.html
___
Tutor maillist -
On Jul 1, 2007, at 6:38 PM, ALAN GAULD wrote:
> Suddenly it seems like I have an embarassment of advanced
> shells to choose from. At risk of starting a religious war, who
> favours which and why?
>
>
Alan,
I have been using ipython for the last few months. I am barely
touching teh surface o
On Jul 1, 2007, at 7:13 PM, elis aeris wrote:
might just end my quest for
optimized python source code.
ugh,
what does it mean ?
elias,
We have two MAJOR rules regarding optimization. These rules really
go beyond python, but this is a good place to learn them.
The two rules of optimi
On Jun 27, 2007, at 10:24 AM, Mike Hansen wrote:
>
>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of Gardner, Dean
>> Sent: Wednesday, June 27, 2007 3:59 AM
>> To: tutor@python.org
>> Subject: [Tutor] Regular Expression help
>>
>> Hi
>>
>> I have
On Jun 25, 2007, at 9:56 PM, Sara Johnson wrote:
I'm to use the bundle method to append some information to a list.
I have no idea how to do that! I have Python for Dummies and I
think I need Python for Complete Idiots because I am not seeing how
to do this!! I have basic C+ knowledge a
On Jun 22, 2007, at 7:26 AM, Kent Johnson wrote:
> Reed O'Brien wrote:
>> have a gander at:
>> http://codeidol.com/python/python3/Databases-and-Persistence/
>
> That URL points to a (presumably) stolen copy of the book
> Programming Python by Mark Lutz. If you like
On Jun 21, 2007, at 9:59 PM, [EMAIL PROTECTED] wrote:
I created a shelf called 'myshelf' and put two objects in it, a
string and a list. When I open the shelf I get:
d=shelve.open('/Users/development/Desktop/myshelf')
d.keys()
['dir1', 'dir2']
d
{'dir2': '/Users/development/Desktop/RSSRea
On Jun 21, 2007, at 9:06 AM, Lloyd Kvam wrote:
> On Wed, 2007-06-20 at 23:51 -0400, Reed O'Brien wrote:
>> On Jun 20, 2007, at 2:03 PM, Richard Querin wrote:
>>
>>> I'm interested in writing a quick script that would run a diff-type
>>> command that woul
On Jun 20, 2007, at 2:03 PM, Richard Querin wrote:
> I'm interested in writing a quick script that would run a diff-type
> command that would compare a local directory to a remote one to
> identify the changes in the files within that directory.
>
> I was initially thinking that I would maybe use
On Jun 17, 2007, at 3:44 AM, John Fouhy wrote:
> On 17/06/07, Iyer <[EMAIL PROTECTED]> wrote:
>>
>> say, if I have a list l = [1,2,3,5]
>>
>> and another tuple t = ('r', 'g', 'b')
>>
>> Suppose I iterate over list l, and t at the same time, if I use
>> the zip
>> function as in zip(l,t) , I wil
22 matches
Mail list logo