Scott Melnyk wrote:
Hello!
I recently suffered a loss of programming files (and I had been
putting off my backups...)
[snip]
#regular expression to pull out gene, transcript and exon ids
info=re.compile('^(ENSG\d+\.\d).+(ENST\d+\.\d).+(ENSE\d+\.\d)+')
#above is match gene, transcript, then one or m
kumar s wrote:
I have Question:
How can I substitute an object as a pattern in making
a pattern.
x = 30
pattern = re.compile(x)
Kumar,
You can use string interpolation to insert x into a string, which can
then be compiled into a pattern:
x = 30
pat = re.compile('%s'%x)
I really doubt regular
Bernard Lebel wrote:
Okay here comes the next question.
In that class, I have 3 functions. Actually, one of them calls the two
others.
However when I call these functions (wich are placed before the caller
in the file), I get an error saying that the global name x (the function
name) is not def
David Holland wrote:
I have written my first cgi script :-
The .html code is :-
Friends CGI Demo (Static Screen)
Friends list for:New User
Enter your name>
How many friends do you have ?
0
10
25
50
100
The python code is :-
#!/usr/bin/env python
import cgi
reshtml = '''Content-Type: text/html\
David Holland wrote:
Rich,
That worked although I had to set the address to :-
http://127.0.0.1:8000/friends1.html
Thanks.
Good catch, sorry about that. I noticed you had spaces in the "how many"
field in your form. Did your cgi still work? If not, I guess you figured
that out by now too.
Intere
Michael Powe wrote:
Hello,
I'm having erratic results with a regex. I'm hoping someone can
pinpoint the problem.
This function removes HTML formatting codes from a text email that is
poorly exported -- it is supposed to be a text version of an HTML
mailing, but it's basically just a text version o
Brian van den Broek wrote:
[snip text]
class A:
def __init__(self):
self.something = None
self.something_else = None
self.still_another_thing = None
def update(self, data):
for key in metadata_dict:
if data.startswith(key):
exec('''self.%s = ""
Brian van den Broek wrote:
[text and code snipped]
FWIW, I ran your code using python 2.3.4 on linux with the following
modifications, and it worked fine (no failing tests out of 9):
1- added 'from sets import Set as set' since set() isn't built in in 2.3
2- changed True back to False in the foll
Orri Ganel wrote:
Hello all,
As part of a project i'm doing (mostly for the fun of it), I have a
class which creates a sort of wrapper around any object to make it
suitable for use in a custom container. However, if the class
receives an already wrapped object, I want it to just return the
object
Marcus Goldfish wrote:
I'm trying to understand custom iterators in Python, and created the
following toy class for sequence comparison, which seems to work:
class Foo(object):
"""A toy class to experiment with __eq__ and __iter__"""
def __init__(self, listA, listB):
self.head, self.tai
Kent Johnson wrote:
Rich Krauter wrote:
2) Or, if you really want your __eq__ method to use the iterator
returned by __iter__(),
def __eq__(self, other):
for i, j in map(None,self, other):
if i != j:
return False
return True
That's not right either, it will co
Brian van den Broek wrote:
Hi all,
I am wondering about the Pythonic way to handle the problem of
ostriches, emus, and penguins. (I cannot recall from where I got the
example.)
Here's what I mean:
class Bird(object):
def fly(self):
# flying logic here
def lay(self):
# egg
Tim Johnson wrote:
> The following test script is kind of got me baffled:
> #!/usr/local/bin/python
> class Eval:
> def __getitem__(self,key):
> return eval(key)
> ##def test():
> ## i = 100
> ## b = ["My", "name", "is", "Tim"]
> ## test = "this is number %(str(i))s for a test %(' '.
Israel Carr wrote:
> I'm using ftplib to connect to a server, and I want to grab every file
> from a specific folder. The filenames change frequently. What is the
> best way to use retrbinary with wildcards(or some better option) to
> transfer all files?
>
> Thanks,
> Israel
>
> ___
14 matches
Mail list logo