Regular expression issue

2010-08-08 Thread genxtech
I am trying to learn regular expressions in python3 and have an issue with one of the examples I'm working with. The code is: #! /usr/bin/env python3 import re search_string = "[^aeiou]y$" print() in_string = 'vacancy' if re.search(search_string, in_string) != None: print(" ay, ey, iy,

Re: Regular expression issue

2010-08-09 Thread genxtech
On Aug 8, 7:34 pm, Tim Chase wrote: > On 08/08/10 17:20, genxtech wrote: > > > if re.search(search_string, in_string) != None: > > While the other responses have addressed some of the big issues, > it's also good to use > >    if thing_to_test is None: > >

Re: Regular expression issue

2010-08-09 Thread genxtech
I have it now. Had to beat my head over it a couple times. Thanks everybody. -- http://mail.python.org/mailman/listinfo/python-list

Assert statements in python 3.1

2010-08-19 Thread genxtech
This is more of a curiosity question then anything else... I was just wondering why in version 3 of python assertions weren't converted to use parenthesis, since print was. I am just asking because it seems the following line of code would seem more readable as a function: assert 2 + 2 == 5, "

Re: Overload print

2010-08-27 Thread genxtech
On Aug 25, 5:18 pm, Ross Williamson wrote: > Hi All > > Is there anyway in a class to overload the print function? > > >> class foo_class(): > >>      pass > >> cc = foo_class() > >> print cc > > Gives: > > <__main__.foo_class instance at > > > Can I do something like: > > >> class foo_class()

Question about Reading Files

2010-09-04 Thread genxtech
Hello. I am still really new to python and I have a project where I am trying to use the data files from another program and write a new program with new user interface and all. My first step was to open one of the files in 'rb' mode and print the contents, but I am unfamiliar with the format. H

Re: Question about Reading Files

2010-09-04 Thread genxtech
I forgot to mention that the output was the first 100 bytes of the output -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about Reading Files

2010-09-04 Thread genxtech
On Sep 4, 7:23 pm, Mats Rauhala wrote: > On 2010-09-04, genxtech wrote: > > > Hello.  I am still really new to python and I have a project where I > > am trying to use the data files from another program and write a new > > program with new user interface and all.  M

Re: Question about Reading Files

2010-09-05 Thread genxtech
On Sep 5, 4:16 am, Peter Otten <__pete...@web.de> wrote: > genxtech wrote: > > Hello.  I am still really new to python and I have a project where I > > am trying to use the data files from another program and write a new > > program with new user interface and all.