On 09/07/2019 15:13, Ibarra, Jesse wrote:
Caveat: I'm no expert on embedding and indeed have only done
it once using the examples in the docs. However, based on
my general Python experience...
> I then embedded the example using C/Python API:
> https://docs.python.org/3.6/extending/embedding.html
Sorry for the duplicate threads but the forwarded message did not send the
original email. I apologize for any inconvenience.
The file are below.
I am running CentOS7:
[jibarra@redsky ~]$ uname -a
Linux redsky.lanl.gov 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC
2019 x86_64 x86_64
nd perhaps doing a little debugging.
-Original Message-
From: Tutor On Behalf Of
Asad
Sent: Thursday, December 27, 2018 10:10 AM
To: tutor@python.org
Subject: [Tutor] Re Module
Hi All ,
I trying find a solution for my script , I have two files :
file1 - I need a search a error s
On Thu, Dec 27, 2018 at 08:40:12PM +0530, Asad wrote:
> Hi All ,
>
> I trying find a solution for my script , I have two files :
>
> file1 - I need a search a error say x if the error matches
>
> Look for the same error x in other file 2
>
> Here is the code :
> I have 10 different pa
On 27/12/2018 15:10, Asad wrote:
> file1 - I need a search a error say x if the error matches
>
> Look for the same error x in other file 2
>
> Here is the code :
> I have 10 different patterns therefore I used list comprehension and
> compiling the pattern so I loop over and find the exact patt
Hi All ,
I trying find a solution for my script , I have two files :
file1 - I need a search a error say x if the error matches
Look for the same error x in other file 2
Here is the code :
I have 10 different patterns therefore I used list comprehension and
compiling the pattern so I
Thanks for the suggestion and corrections.
I don't put the else staement onf if log_file but now I realize my mistake
I have 3 comand to do:
step_1_out =["STAR --genomeDir /home/sbsuser/databases/Starhg19/GenomeDir/ --
runMode alignReads --readFilesIn %s %s --runThreadN 12 --readFilesCommand
z
On Wed, Sep 10, 2014 at 11:20:38AM +0200, jarod...@libero.it wrote:
> If I follow the exmple I have this type of error:
> File "./RNA_prova.py", line 73, in run
> for line in p1.stdout():
> TypeError: 'NoneType' object is not callable
Somehow you have p1.stdout set to None. You can confirm thi
On 09/10/2014 11:20 AM, jarod...@libero.it wrote:
If I follow the exmple I have this type of error:
File "./RNA_prova.py", line 73, in run
for line in p1.stdout():
TypeError: 'NoneType' object is not callable
You have at least two errors in your script below:
This time you're not piping
If I follow the exmple I have this type of error:
File "./RNA_prova.py", line 73, in run
for line in p1.stdout():
TypeError: 'NoneType' object is not callable
This is the class I use:
def run(cmd,pi):
import subprocess
import time
import logging
Hey thanks Danny Yoo, Chris “Kwpolska” Warrick, D.V.N Sarma
.
I will take all your inputs.
Thanks a lot.
On Fri, Aug 15, 2014 at 3:32 AM, Danny Yoo wrote:
> On Thu, Aug 14, 2014 at 8:39 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ
> wrote:
> > I tested it on IDLE. It works.
>
>
> Hi Sarma,
>
>
> Followi
Hi Sunil,
Don't use regular expressions for this task. Use something that knows
about HTML structure. As others have noted, the Beautiful Soup or
lxml libraries are probably a much better choice here.
There are good reasons to avoid regexp for the task you're trying to
do. For example, your re
On Thu, Aug 14, 2014 at 8:39 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ
wrote:
> I tested it on IDLE. It works.
Hi Sarma,
Following up on this one. I'm pretty sure that:
print re.search("https://docs.python.org/2/howto/regex.html#greedy-versus-non-greedy
for why.
___
-
On Thu, Aug 14, 2014 4:07 PM CEST Chris “Kwpolska” Warrick wrote:
>On 14 Aug 2014 15:58 "Sunil Tech" wrote:
>>
>> Hi,
>>
>> I have string like
>> stmt = 'Patient name: Upadhyay Shyamstyle="font-family: times new roman,times;"> Date of
>birth: 08/08/1988 Issue(s)
I tested it on IDLE. It works.
regards,
Sarma.
On Thu, Aug 14, 2014 at 7:37 PM, Chris “Kwpolska” Warrick <
kwpol...@gmail.com> wrote:
>
> On 14 Aug 2014 15:58 "Sunil Tech" wrote:
> >
> > Hi,
> >
> > I have string like
> > stmt = 'Patient name: Upadhyay Shyam style="font-family: times new roman
On 14 Aug 2014 15:58 "Sunil Tech" wrote:
>
> Hi,
>
> I have string like
> stmt = 'Patient name: Upadhyay Shyam Date of
birth: 08/08/1988 Issue(s) to be
analyzed: tesNurse Clinical summary: test1 Date of
injury: 12/14/2013Diagnoses: 723.4 - 300.02 - 298.3
- 780.50 - 724
Hi,
I have string like
stmt = 'Patient name: Upadhyay Shyam Date of
birth: 08/08/1988 Issue(s) to be
analyzed: tesNurse Clinical summary: test1 Date of
injury: 12/14/2013Diagnoses: 723.4 - 300.02 - 298.3
- 780.50 - 724.4 Brachial neuritis or radiculitis nos - Generaliz
On Wed, Sep 11, 2013 at 11:15:26AM +0100, Oscar Benjamin wrote:
> There is also the .format method. This was initially intended to
> replace % formatting but it was ultimately decided that removing %
> formatting was not necessary. Consequently there are now two ways of
> doing advanced string for
I'm resending this to the list. Please reply to the tutor list rather
than directly to me. Also please don't top-post. My answer is below.
On 11 September 2013 10:47, Thabile Rampa wrote:
>
> On Tue, Sep 10, 2013 at 11:57 AM, Oscar Benjamin
> wrote:
>>
>> On 10 September 2013 08:58, Thabile Ram
On 10/9/2013 03:58, Thabile Rampa wrote:
>
> On Aug 27, 2013, at 3:40 AM, isaac Eric
> wrote
>
> > print "For a circle of radius %s the area is
> %s" % (radius,area)
>
> > Question: What is the purpose of %s ?I will
> admit that this is homework for me. However, this is more for m
On 10/09/13 08:58, Thabile Rampa wrote:
print "For a circle of radius %s the area is %s" % (radius,area)
Question: What is the purpose of %s ?
Oscar has answered your basic question but to add to his comments thee
are other reasons for using the %s rather than str() or simply printing
the
On 10 September 2013 08:58, Thabile Rampa wrote:
> On Aug 27, 2013, at 3:40 AM, isaac Eric wrote
>
>
>
>> print "For a circle of radius %s the area is %s" % (radius,area)
>
>> Question: What is the purpose of %s ?
>
> I will admit that this is homework for me. However, this is more for my log
>
On Aug 27, 2013, at 3:40 AM, isaac Eric wrote
> print "For a circle of radius %s the area is %s" % (radius,area)
> Question: What is the purpose of %s ?
I will admit that this is homework for me. However, this is more for my log
book and not for marks.
According to my understanding, the purpose
On 04/08/13 08:45, Alex Kleider wrote:
sorry, my bad. I forgot to delete that backslash, I meant
re.findall(r"\be\b", "d e f"). Same with the other example.
..but the interesting thing is that the presence or absence of the
spurious back slashes seems not to change the results.
It wouldn't
Hi,
not quite. The moral is to learn about greedy and non-greedy matching ;)!
-nik
Alex Kleider schrieb:
>On 2013-08-03 13:38, Dominik George wrote:
>> Hi,
>>
>> b is defined as all non-word characters, so it is the complement oft
>> w. w is [A-Za-z0-9_-], so b includes $ and thus cuts off
Hi,
\b is defined as all non-word characters, so it is the complement oft \w. \w is
[A-Za-z0-9_-], so \b includes \$ and thus cuts off your group.
-nik
Alex Kleider schrieb:
>#!/usr/bin/env python
>
>"""
>I've been puzzling over the re module and have a couple of questions
>regarding the be
On 7/19/2012 4:10 PM Emile van Sebille said...
I found ~200k files in /var/log all but 227 look like:
Sorry -- my bad.
Emile
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/list
I found ~200k files in /var/log all but 227 look like:
list_boxes.day.1.gz.1.gz.1.gz.3.gz.1.gz.1.gz.2.gz.1.gz.1.gz.2.gz.1.gz
list_boxes.day.1.gz.1.gz.1.gz.3.gz.1.gz.1.gz.2.gz.1.gz.1.gz.2.gz.1.gz.1.gz
list_boxes.day.1.gz.1.gz.1.gz.3.gz.1.gz.1.gz.2.gz.1.gz.1.gz.2.gz.1.gz.1.gz.1.gz
list_boxes.day.1.
: Mon, 9 Jan 2012 14:47:46
To:
Subject: [Tutor] re module help
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
___
Tutor
Hi Gurus,
I have created regular expression with os modules, I have created file
sdptool to match the regular expression pattern, will print the result.
I want without creating file how to get required output, I tried but i
didn't get output correctly, over stream.
#! /usr/bin/python
import os,re
Can you try to split it into fonctions
Because it is hard to read it.
Envoyé depuis mon HTC
- Reply message -
De : "Susana Iraiis Delgado Rodriguez"
Pour :
Objet : [Tutor] Python loop isn't working
Date : ven., août 5, 2011 18:14
Hello list!
I have a python script which works with othe
On 2011-04-06 11:03, JOHN KELLY wrote:
I need help.
In that case, start with http://wiki.python.org/moin/BeginnersGuide
--
"Lots of people have brilliant ideas every day, but they often
disappear in the cacophony of life that we muddle through."
- Evan Jenkins, http://arstechnica.com/aut
On 06-Apr-11 02:03, JOHN KELLY wrote:
I need help.
Can you be a little more specific? :)
--
Steve Willoughby / st...@alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29 54F7 0F53
_
By the way with your helper function algorithm Steven and Peter comments
you made me think of this change:
karim@Requiem4Dream:~$ echo 'prima " "' | sed -e
's/""/\\"\\"/g;s/\([^\]\)"/\1\\"/g'
prima \" \"
karim@Requiem4Dream:~$ echo 'prima ""' | sed -e
's/""/\\"\\"/g;s/\([^\]\)"/\1\\"/g'
pr
On 02/04/2011 11:26 AM, Peter Otten wrote:
Karim wrote:
That is not the thing I want. I want to escape any " which are not
already escaped.
The sed regex '/\([^\\]\)\?"/\1\\"/g' is exactly what I need (I have
made regex on unix since 15 years).
Can the backslash be escaped, too? If so I don't
On 02/04/2011 02:36 AM, Steven D'Aprano wrote:
Karim wrote:
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (appears as stars) but I don't know
how to fix it yet.
A man when to a doctor and said, "
Karim wrote:
> That is not the thing I want. I want to escape any " which are not
> already escaped.
> The sed regex '/\([^\\]\)\?"/\1\\"/g' is exactly what I need (I have
> made regex on unix since 15 years).
Can the backslash be escaped, too? If so I don't think your regex does what
you think
Karim wrote:
> Recall:
>
> >>> re.subn(r'([^\\])?"', r'\1\\"', expression)
>
> Traceback (most recent call last):
> File "", line 1, in
> File "/home/karim/build/python/install/lib/python2.7/re.py", line
> 162, in subn
>return _compile(pattern, flags).subn(repl, string, count)
Karim wrote:
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (appears as stars) but I don't know how
to fix it yet.
A man when to a doctor and said, "Doctor, every time I do this, it
hurts. What sh
"Karim" wrote
Because expression = *' "" '* is in fact fact expression = ' "" '.
The bold appear as stars I don't know why.
Because in the days when email was always sent in plain
ASCII text the way to show "bold" was to put asterisks around
it. Underlining used _underscores_ like so...
On 02/03/2011 07:47 PM, Karim wrote:
On 02/03/2011 02:15 PM, Peter Otten wrote:
Karim wrote:
I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
consecutives double quotes:
* *In Python interpreter:*
$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
[GCC 4.4.
On 02/03/2011 11:20 PM, Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Karim wrote:
On 02/03/2011 02:15 PM, Peter Otten wrote:
Karim wrote:
(snip>
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (ap
On 01/-10/-28163 02:59 PM, Karim wrote:
On 02/03/2011 02:15 PM, Peter Otten wrote:
Karim wrote:
(snip>
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (appears as stars) but I don't know how
to fix
On 02/03/2011 02:15 PM, Peter Otten wrote:
Karim wrote:
I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
consecutives double quotes:
* *In Python interpreter:*
$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
[GCC 4.4.3] on linux2
Type "help", "copyright",
Karim wrote:
> I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
> consecutives double quotes:
>
> * *In Python interpreter:*
>
> $ python
> Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for m
I forget something. There is no issue with python and double quotes.
But I need to give it to TCL script but as TCL is shit string is only
delimited by double quotes.
Thus I need to escape it to not have syntax error whith nested double
quotes.
Regards
The poor tradesman
On 02/03/2011 12:45
Hello Steven,
I am perhaps a poor tradesman but I have to blame my thunderbird tool :-P .
Because expression = *' "" '* is in fact fact expression = ' "" '.
The bold appear as stars I don't know why. I need to have escapes for
passing it to another language (TCL interpreter).
So I will rewrit
Karim wrote:
Hello,
I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
consecutives double quotes:
You don't have to escape quotes. Just use the other sort of quote:
>>> print '""'
""
* *In Python interpreter:*
$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:5
Hello,
Any news on this topic?O:-)
Regards
Karim
On 02/02/2011 08:21 PM, Karim wrote:
Hello,
I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
consecutives double quotes:
* *In Python interpreter:*
$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
[GCC
Hello,
I am trying to subsitute a '""' pattern in '\"\"' namely escape 2
consecutives double quotes:
* *In Python interpreter:*
$ python
Python 2.7.1rc1 (r271rc1:86455, Nov 16 2010, 21:53:40)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
On 04/15/10 16:03, Karjer Jdfjdf wrote:
> When I try to parse the outputfile it creates different errors such as:
>* ExpatError: not well-formed (invalid token):
That error message is telling you that you're not parsing an XML file,
merely an XML-like file.
> Basically it ususally has somethi
>> I'm having problems with creating XML-documents,
>> because I don't seem to write it to a document correctly.
>Is that because you don't understand XML or because the
>output is not what you expect? How is the data being generated?
>Are you parsing an existing XML source or creating the XML
Samir-16 wrote:
> >
> > Hi Everyone,
> >
> > I am trying to read a comma-delimitted list ("aaa","bbb","ccc") from a
> > text
> > file and assign those values to a list, x, such that:
> >
> > x = ["aaa", "bbb", "ccc"]
> >
> > The code that I have come up with looks like this:
> >
> x = []
>
Hello everyone,
I to had the same problem and it pestered me to the nth degree. I had that
many problems I went to the python site and copied an example and used that
to test why it wasn't working -see below example and traceback report. I
wasted a lot of time trying to figure my issue out. Then
Thanks Kent! Once more you go straight to the point!
Kent Johnson writes:
> On Wed, Jun 24, 2009 at 2:24 PM, Tiago Saboga wrote:
>> In [33]: re.search("(a[^.]*?b\.\s?){2}", text).group(0)
>> Out[33]: 'a45453b. a325643b. '
>
> group(0) is the entire match so this returns what you expect. But what
Ok -- realized my "solution" incorrectly strips white space from
multiword strings:
> Out[92]: ['a2345b.', 'a45453b.a325643b.a435643b.']
>
So here are some more gymnastics to get the correct result:
In [105]: newlist
Out[105]: ['a2345b.', '|', 'a45453b.', 'a325643b.', 'a435643b.', '|']
In [109]
As usual, Kent Johnson has swooped in an untangled the mess with a
clear explanation.
By the time a regex gets this complicated, I typically start thinking
of ways to simplify or avoid them altogether.
Below is the code I came up with. It goes through some gymnastics and
can surely stand improvem
On Wed, Jun 24, 2009 at 2:24 PM, Tiago Saboga wrote:
> Hi!
>
> I am trying to split some lists out of a single text file, and I am
> having a hard time. I have reduced the problem to the following one:
>
> text = "a2345b. f325. a45453b. a325643b. a435643b. g234324b."
>
> Of this line of text, I wan
Serdar Tumgoren writes:
> Hey Tiago,
>
>> text = "a2345b. f325. a45453b. a325643b. a435643b. g234324b."
>>
>> Of this line of text, I want to take out strings where all words start
>> with a, end with "b.". But I don't want a list of words. I want that:
>>
>> ["a2345b.", "a45453b. a325643b. a4356
apologies -- I just reread your post and appears you also want to
capture the dot after each "b" ( "b." )
In that case, you need to update the pattern to match for the dot. But
because the dot is itself a metacharacter, you have to escape it with
a backslash:
In [23]: re.findall(r'a\w+b\.',text)
Hey Tiago,
> text = "a2345b. f325. a45453b. a325643b. a435643b. g234324b."
>
> Of this line of text, I want to take out strings where all words start
> with a, end with "b.". But I don't want a list of words. I want that:
>
> ["a2345b.", "a45453b. a325643b. a435643b."]
>
Are you saying you want a
Hi!
I am trying to split some lists out of a single text file, and I am
having a hard time. I have reduced the problem to the following one:
text = "a2345b. f325. a45453b. a325643b. a435643b. g234324b."
Of this line of text, I want to take out strings where all words start
with a, end with "b.".
Hello
>> for line in so:
>> if len(line)<70:de.write(line+'\n')
>> if len(line)>70:
>> da=textwrap.fill(line,width=60)
>> de.write(da+'\n')
>What happens if the line is exactly 70 characters long?
>I think you want an else instead of the second i
On Fri, Feb 27, 2009 at 5:09 AM, prasad rao wrote:
> Hello
> Finally I managed to writ a function to format a file.
> Thank to everybody for their tips.
>
> def mmm(a):
> import os,textwrap
> so=open(a)
> d=os.path.dirname(a)+os.sep+'temp.txt'
> de=open(d,'w')
> import te
"prasad rao" wrote
for line in so:
if len(line)<70:de.write(line+'\n')
if len(line)>70:
da=textwrap.fill(line,width=60)
de.write(da+'\n')
What happens if the line is exactly 70 characters long?
I think you want an else instead of the second
HelloFinally I managed to writ a function to format a file.
Thank to everybody for their tips.
def mmm(a):
import os,textwrap
so=open(a)
d=os.path.dirname(a)+os.sep+'temp.txt'
de=open(d,'w')
import textwrap
for line in so:
if len(line)<70:de.write(line+'\n'
On Fri, 27 Feb 2009 09:59:40 +0530, prasad rao wrote:
> def myform(s):
> import os
> so=open(s)
> d=os.path.dirname(s)+os.sep+'temp.txt'
> de=open(d,'w')
> for line in so:
> while len(line)>60:
> item=line[60:]
> try:
> a
2009/2/27 prasad rao :
> Hello
> I don't know why, but this I think going into infinite loop.
> I cant see anything wrong in it.
> Please show me where the problem is.
[...]
> while len(line)>60:
> tem=line[60:]
> try:
> ??? a,b=tem.split(' ',1)
> ?
HelloI don't know why, but this I think going into infinite loop.
I cant see anything wrong in it.
Please show me where the problem is.
def myform(s):
import os
so=open(s)
d=os.path.dirname(s)+os.sep+'temp.txt'
de=open(d,'w')
for line in so:
while len(line)>60:
?
On Wed, Feb 25, 2009 at 7:46 AM, prasad rao wrote:
> hi
licenseRe = re.compile(r'\(([A-Z]+)\)\s*(No.\d+)?')
for license in licenses:
> m = licenseRe.search(license)
> print m.group(1, 3)
>
> Traceback (most recent call last):
> File "", line 3, in
> print m.group(1, 3)
hi
>>> licenseRe = re.compile(r'\(([A-Z]+)\)\s*(No.\d+)?')
>>> for license in licenses:
m = licenseRe.search(license)
print m.group(1, 3)
Traceback (most recent call last):
File "", line 3, in
print m.group(1, 3)
IndexError: no such group
Something wrong with this code.
_
"prasad rao" wrote
HelloI changed the code as follows.But still the callback function
is not
working.
The he() is working well but clicking on the frame has no result.
class app:
def __init__(self,root):
frame=Frame(root)
frame.bind("", callback)
Should this not be self.callback?
def
HelloI changed the code as follows.But still the callback function is not
working.
The he() is working well but clicking on the frame has no result.
class app:
def __init__(self,root):
frame=Frame(root)
frame.bind("", callback)
frame.pack()
self.button=Button(root,text='quit',fg='red',command=f
hi I modified my function ' vertical' by adding a few characters to
eliminate
the division problem.
def vertical(columns):
if columns>7:
columns=7
import string
v=string.printable
v=v.replace('\n','')
v=v.replace('\t','')
if len(v)%columns !=0:
"prasad rao" wrote
2==True
False
It is an unexpected result to me.
I thought any value other than 0 is True.
Any value of non zero is treated as True in a boolean context.
But aq test of equality with a boolean value is not a boolean context.
For equiality you have to compare like with lik
On Tue, Feb 3, 2009 at 2:46 PM, prasad rao wrote:
> hi
>>Right now you skip by x+((len(v))/columns)
>>which will be different for each row.
> How is it possible. len(v)=98.A constant.
> Is it not.
> Does len(v) changes with each iteration?
No, but x does.
--
André Engels, andreeng...@gmail.com
hi>Right now you skip by x+((len(v))/columns)
>which will be different for each row.
How is it possible. len(v)=98.A constant.
Is it not.
Does len(v) changes with each iteration?
Prasad
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailm
On Tue, Feb 3, 2009 at 8:24 AM, prasad rao wrote:
>> I wrote a function named vertical to print string .printable characters
>> and
> .>> ASCII values in a table.
>>> 1)It is swallowing some characters.
>>> 2)It output some characters 2 or 3 times.
>>> 3)It prints one column more than what I aske
helloyes.you are right.
>>> 2==True
False
It is an unexpected result to me.
I thought any value other than 0 is True.
And the solution provided by you(bool(a/1))
is useful to me.
Thank you
Prasad
___
Tutor maillist - Tutor@python.org
http://mail.pytho
> I wrote a function named vertical to print string .printable characters
and
.>> ASCII values in a table.
>> 1)It is swallowing some characters.
>> 2)It output some characters 2 or 3 times.
>> 3)It prints one column more than what I asked for.
>> def vertical(columns):
>> import string
>
Le Sat, 31 Jan 2009 15:00:02 -0500,
Kent Johnson a écrit :
> On Sat, Jan 31, 2009 at 2:47 PM, spir wrote:
>
> >> > o.__class__ (or rather o.__class__.__name__) will work.
> >> Understood. Thank you.
> >> tj
> >
> > type(a) has been changed (since 2.2?) to return the same value as
> > a.__class
On Sat, Jan 31, 2009 at 2:47 PM, spir wrote:
>> > o.__class__ (or rather o.__class__.__name__) will work.
>> Understood. Thank you.
>> tj
>
> type(a) has been changed (since 2.2?) to return the same value as a.__class__
I think you mean type(o) (type of the instance) rather than type(a)
(type of
Le Sat, 31 Jan 2009 09:54:24 -0900,
Tim Johnson a écrit :
> On Saturday 31 January 2009, Andre Engels wrote:
> <...>
> > > o=a
> <>
> > Actually, it is false. To make it true, you have to do o=a() rather than
> > o=a
> You're correct. That was my typo.
> > > Is there a function that takes
On Saturday 31 January 2009, Andre Engels wrote:
<...>
> > o=a
<>
> Actually, it is false. To make it true, you have to do o=a() rather than
> o=a
You're correct. That was my typo.
> > Is there a function that takes one
> >
> > argument and returns the class?
> >
> > Example:
> >
> > class =
On Sat, Jan 31, 2009 at 5:57 PM, Tim Johnson wrote:
> Using python 2.5.1
>
> If I create a class a
>
> class a:
>
> pass
>
> initialize o as:
>
> o=a
>
> and call
>
> isinstance(o,a)
>
> the return value is True.
Actually, it is false. To make it true, you have to do o=a() rather than o=a
> Is t
On Wed, Jan 7, 2009 at 10:57 AM, prasad rao wrote:
> Hello
> I am trying to get a value as integer and a string.
class Value:
> def __init__(self,inte='',stri=''):
> self.inte=inte
> self.stri=stri
> def setvalue(self,inte='',stri=''):
> self.stri=str(
Hello
I am trying to get a value as integer and a string.
>>> class Value:
def __init__(self,inte='',stri=''):
self.inte=inte
self.stri=stri
def setvalue(self,inte='',stri=''):
self.stri=str(self.inte)
self.inte=int(self.stri)
>>> v=Value(45)
>>>
Omer wrote:
Bob, I tried your way.
>>> import re
>>> urlMask = r"http://[\w\Q./\?=\R]+()?"
>>> text=u"Not working
examplehttp://this.is.a/url?header=nullAnd another
linehttp://and.another.url";
>>> re.findall(urlMask,text)
[u'', u'']
Oops I failed to notice you were using findall. Kent expl
On Mon, Jan 5, 2009 at 11:16 AM, Omer wrote:
> Bob, I tried your way.
>
import re
urlMask = r"http://[\w\Q./\?=\R]+()?"
text=u"Not working examplehttp://this.is.a/url?header=nullAnd
another linehttp://and.another.url";
re.findall(urlMask,text)
> [u'', u'']
>
> spir, I did
Bob, I tried your way.
>>> import re
>>> urlMask = r"http://[\w\Q./\?=\R]+()?"
>>> text=u"Not working examplehttp://this.is.a/url?header=nullAnd
another linehttp://and.another.url";
>>> re.findall(urlMask,text)
[u'', u'']
spir, I did understand it. What I'm not understanding is why isn't this
wor
On Sun, 04 Jan 2009 14:09:53 -0500
bob gailer wrote:
> Omer wrote:
> > I'm sorry, burrowed into the reference until my eyes bled.
> >
> > What I want is to have a regular expression with an optional ending of
> > ""
> >
> > (For those interested,
> > urlMask = r"http://[\w\Q./\?=\R]+";
> > is th
Omer wrote:
I'm sorry, burrowed into the reference until my eyes bled.
What I want is to have a regular expression with an optional ending of
""
(For those interested,
urlMask = r"http://[\w\Q./\?=\R]+";
is ther version w/o the optional ending.)
I can't seem to make a string optional- only
I'm sorry, burrowed into the reference until my eyes bled.
What I want is to have a regular expression with an optional ending of
""
(For those interested,
urlMask = r"http://[\w\Q./\?=\R]+";
is ther version w/o the optional ending.)
I can't seem to make a string optional- only a single charact
Hey Spir!
Maybe you should read the book "Design Patterns" from Erich Gamma and
the rest of "the gang of four". (A.T.Hofkamp, mentioning its
terminology, got me thinking.) You ask complicated questions that
normal newbies don't ask, so you should maybe read an advanced book.
The book's idea is
Thank you for this relevant & precise review, Albert. I will answer
specific topic, then give a overall introduction of the problem(s)
adressed by this project, that may clarify a bit some topics.
A.T.Hofkamp a écrit :
> However, by moving the 'type' information to a seperate object, your
spir wrote:
After reading your mail, I cannot help wondering that something
crucial seems to be missing in your class structure. (I get the
impression that you are trying to squeeze object information and object
meta information together in one class definition.)
Yes. This is a consequence of
[forwarded, only A.T.Hofkamp got this answer]
A.T.Hofkamp a écrit :
spir wrote:
Q: Is there a way to write /type/ (class) functions, meaning methods
not bound to an instance, in python?
As Bob Gailer already said, staticmethod seems to do what you want.
Thank you for you answers about static
Steve Willoughby wrote:
Johan Nilsson wrote:
In [74]: p.findall('asdsa"123abc\123"jggfds')
Out[74]: ['"123abcS"']
By the way, you're confusing the use of \ in strings in general with the
use of \ in regular expressions and the appearance of \ as a character
in data strings encountered by you
Johan Nilsson wrote:
'text "http:\123\interesting_adress\etc\etc\" more text'
Does this really use backslashes in the text? The standard for URLs (if
that's what it is) is to use forward slashes.
For your RE, though, you can always use [...] to specify a range
including whatever you like.
Hi all python experts
I am trying to work with BeautifulSoup and re and running into one problem.
What I want to do is open a webpage and get some information. This is
working fine
I then want to follow some of links on this page and proces them. I
manage to get links that I am interested
1 - 100 of 565 matches
Mail list logo