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
Asad,
After reading replies to you by Alan and Steven I want to ask you if you can
first tell us in normal words what the exact outline of the program does. If
you only want help on one small part, tell us about that.
I was first fooled into thinking you wanted to show us how you solve the
major
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
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
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
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 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
You could use read directly on the popen call to negate having to write to a
file
output = os.popen(“sdptool -i hci0 search OPUSH“).read()
Bodsda
Sent from my BlackBerry® wireless device
-Original Message-
From: Ganesh Kumar
Sender: tutor-bounces+bodsda=googlemail@python.org
Date:
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
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
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
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
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)
> ?
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)
"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
"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
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
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 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(
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
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
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.
On Thu, Jun 19, 2008 at 2:44 AM, John [H2O] <[EMAIL PROTECTED]> wrote:
>
> I've defined:
>
> def get_contents(infile=file_object):
> """ return a list of lines from a file """
> contents=infile.read()
> contents = contents.strip().split('\n')
> return contents
> I think I understand the di
"Jim Morcombe" <[EMAIL PROTECTED]> wrote
> I have changed qwerty and saved it away.
> I have then run my program (F5) and the program acts as
> if it is using an old version of qwerty.
You need to "reload" the module to pick up the changes.
>>> help(reload)
Help on built-in function reload in m
On Wed, Oct 10, 2007, Ed Goulart wrote:
>
> Hello!
>
> Though I've tried very hard, I couldn't find in the WEB the needed
> help; so, if you can help me, please...!!!
import os
os.rename(old, new)
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.c
On Tue, 20 Feb 2007, Kent Johnson wrote:
> Marilyn Davis wrote:
> > Hello Tutors,
> >
> > I'm trying to get a grip on MULTILINE and I guess I don't have it.
> >
> > Here's some code:
> >
> > #!/usr/bin/env python
> > import re
> >
> > def sub_it(mo):
> > return 'xxx'
> >
> > def test(re_str, d
Marilyn Davis wrote:
> Hello Tutors,
>
> I'm trying to get a grip on MULTILINE and I guess I don't have it.
>
> Here's some code:
>
> #!/usr/bin/env python
> import re
>
> def sub_it(mo):
> return 'xxx'
>
> def test(re_str, data):
> return re.sub(re_str, sub_it, data, re.MULTILINE)
>
The
Glenn T Norton wrote:
> jhl wrote:
>
>> Hi-
>>
>> How is the 1st import of a module removed so that new edits on the
>> module can be re-imported?
>>
> Read about reload here:
> http://docs.python.org/lib/built-in-funcs.html
Make sure you understand the limitations of reload(). In particular,
n
Thanks again!That is just what I need.-JOn 10/29/06, Glenn T Norton <[EMAIL PROTECTED]
> wrote:jhl wrote:> Hi->> How is the 1st import of a module removed so that new edits on the
> module can be re-imported?>> DETAIL:>> I am working on a module/file and importing it into a python shell,> trying it
On Sunday 29 October 2006 18:25, jhl wrote:
> Hi-
>
> How is the 1st import of a module removed so that new edits on the module
> can be re-imported?
>
> DETAIL:
>
> I am working on a module/file and importing it into a python shell, trying
> it out and then tweaking/editing the module. Then to se
jhl wrote:
> Hi-
>
> How is the 1st import of a module removed so that new edits on the
> module can be re-imported?
>
> DETAIL:
>
> I am working on a module/file and importing it into a python shell,
> trying it out and then tweaking/editing the module. Then to see the
> effects of the edits,
Tiago Saboga wrote:
> I'm afraid I don't fully understand file objects. I thought I could use it
> just as a file: if I have one, and I want several copies, I just save it with
> several names. So, if Popen.stdout already is a file object, I thought the
> easier way would be to save it with anot
> For this simple example, this solution is fine, and I think the
> solution
> proposed by Alan (StringIO) is not going to add anything. Would it
> be faster?
Probably not, the StringIO solution is just closer to how you
described the problem, but also provides a fuller set of file-like
method
Em Segunda 09 Outubro 2006 10:41, Kent Johnson escreveu:
> Tiago Saboga wrote:
> > Hi!
> >
> > I have a problem with file-like objects for months now, and I hoped I
> > could cope with it, but I keep using what seems to me like a newbie
> > workaround...
> >
> > The question is: how can I read a fi
> because it reads the file with read() method, which can only be used
> once. If
> it's a real file, on disk, I agree it would not be a clever
> strategy, reading
> it once for each copy, and I would be happy keeping its content in a
> variable. But if the file is in memory, why can't I simply r
Tiago Saboga wrote:
> But I strip the code, and post a new one. The solution I found is in the
> seek() method of the file object. And the problem I had is that not all the
> file-like objects have a functional seek() method. It's not the case for the
> object referenced by the stdout attribute
Tiago Saboga wrote:
> Hi!
>
> I have a problem with file-like objects for months now, and I hoped I could
> cope with it, but I keep using what seems to me like a newbie workaround...
>
> The question is: how can I read a file (more precisely, a file-like object)
> more than one single time?
>
I keep the original question:
Em Segunda 09 Outubro 2006 09:21, Tiago Saboga escreveu:
> Hi!
>
> I have a problem with file-like objects for months now, and I hoped I could
> cope with it, but I keep using what seems to me like a newbie workaround...
>
> The question is: how can I read a file (mor
Em Segunda 28 Agosto 2006 15:54, Kent Johnson escreveu:
> A 'space character' is the single character \x20. A 'whitespace
> character' is any character in a some set of non-printing (white)
> characters. I guess it is a subtle distinction but it's common usage,
> not just Python; it even has a Wiki
>From: Kent Johnson <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED] txtx back> >>
> >
> > It's easy ;-) It's the "whitespace" part. I read it as the space
>character,
> > not as any blank character. I should have noted that new lines are
>ignored
> > too, but I didn't.
> >
> > (I just looked a litt
Tiago Saboga wrote:
> Em Segunda 28 Agosto 2006 11:12, Kent Johnson escreveu:
>
>> Ahem. Which part of "Whitespace within the pattern is ignored" do you
>> not understand? :-)
>>
>
> It's easy ;-) It's the "whitespace" part. I read it as the space character,
> not as any blank character. I
Em Segunda 28 Agosto 2006 11:12, Kent Johnson escreveu:
> Ahem. Which part of "Whitespace within the pattern is ignored" do you
> not understand? :-)
It's easy ;-) It's the "whitespace" part. I read it as the space character,
not as any blank character. I should have noted that new lines are igno
Tiago Saboga wrote:
> The problem is: why the hell do I need
> to escape special caracters when in verbose mode? And why isn't it made clear
> on the re module doc page ( http://docs.python.org/lib/module-re.html ).
>
> I'll just paste below (or above? I never know how to say this in english) my
> I tried:
>
> class Omega:
>def Display(self):
>print self
>
> class Alpha(Omega):
>def __init__(self):
>self = Beta()
>
> class Beta(Omega):
>def __init__(self):
>pass
>
> objectus = Alpha()
> objectus.Display()
>
> which prints
>
> <__main__.Alpha instance at
> is it correct that an object cannot be re-instantiated within it's
> __init__ method?
There are some tricks you can pull but the object is actually instantiated
before the init gets called. Really init is for initialisation of the
instance,
it's not a true constructor.
> Background: I need to
Jan Eden wrote:
> Hi,
>
> is it correct that an object cannot be re-instantiated within it's __init__
> method?
>
> I tried:
>
> class Omega:
> def Display(self):
> print self
>
> class Alpha(Omega):
> def __init__(self):
> self = Beta()
>
> class Beta(
1 - 100 of 299 matches
Mail list logo