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,
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:
>
>
I have it now. Had to beat my head over it a couple times. Thanks
everybody.
--
http://mail.python.org/mailman/listinfo/python-list
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, "
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()
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
I forgot to mention that the output was the first 100 bytes of the
output
--
http://mail.python.org/mailman/listinfo/python-list
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
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.