spir free.fr> writes:
> To avoid that, use non-grouping parens (?:...). This also avoids the need for
parens around the whole format:
> p = Pattern(r'abc(?:(?!abc).)+jk')
> print p.findall(s)
> ['abc789jk']
>
> Denis
This one works! Thank you Denis. I'll try it out on the actual much longer
(m
Andre Engels gmail.com> writes:
>
> 2009/4/28 Marek SpociĆski go2.pl,Poland 10g.pl>:
> > I suggest using r'abc.+?jk' instead.
> >
>
> That was my first idea too, but it does not work for this case,
> because Python will still try to _start_ the match as soon as
> possible.
yeah, i tried t
Hello,
The following code returns 'abc123abc45abc789jk'. How do I revise the pattern so
that the return value will be 'abc789jk'? In other words, I want to find the
pattern 'abc' that is closest to 'jk'. Here the string '123', '45' and '789' are
just examples. They are actually quite different in
Monika Jisswel googlemail.com> writes:
>
>
> Comment : I never did any VB so I am not sure if I understand you.supposing
your data comes like this :python code :
>
>
> Data = ( ('A', 1), ('B', 2), ('C', 3), ('D', 4) )#you can create a list of the
items like this : List_Letters = [ x[0] for x
Alan Gauld btinternet.com> writes:
> So if you pass in two Python lists containing:
>
> DataType = [1001,1070]
> Data = ["Test_Application", 600]
>
> Does it work?
>
> If not what error do you get? (The full text please)
>
Thanks Alan. This is the error I got:
Traceback (most recent call las
Andre Engels gmail.com> writes:
>
> So what does the code of line.SetXData(dataType, dataValue) look like?
> >From that code you should be able to discern what argument type is
> wanted.
>
Thanks Andre. I don't know how the correct code should look like in Python. In
VB, I've posted the code in
John,
Thanks for your reply. I'm aware of list, tuple, sets, etc. and have tried them,
which results in an error: Invalid argument type in SetXData method. My
understanding is that I do need an array here. Just don't know the correct way
of doing it.
__
Hello group,
I'm trying to translate the following VB code into Python and not sure how to
create an array of variants.
Thanks for your help!
VB Code:
Sub SetXdata()
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.Item(0)
Dim DataType(0 To 1) As Integer
Dim Dat
Alan Gauld btinternet.com> writes:
> To the OP:
> Are you importing any other modules? Is this a specific application's
> code you are looking at?
>
Thanks Alan. You're right. I was reading Ulipad's source code.
___
Tutor maillist - Tutor@python.or
Kent Johnson tds.net> writes:
> You have to find where tr() is being imported. From PyShell type
> tr.__module__
> that should print the name of the module containing tr().
>
Thanks Kent. Actually it isn't PyShell. It is in Ulipad's (Ulipad is a freeware
code editor) Python shell. I followed you
Hello,
I see a lots tr('some string') in codes, especially the ones related to
wxPython. Where is this tr function defined and what does it do? To make the
argument a raw string?
When I type print tr('some string') in PyShell that comes with wxPython, no
error. But if I type that line in a .py fi
wesley chun gmail.com> writes:
> one question i'd like to ask is, in what context is such a line part
> of your code? altho alan is correct in that syntactically, they're
> very similar, i'm wondering what you're using it for.
Wesley,
Thanks for your reply (also thanks to others who replied). I
Thanks Alan.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Mark Tolonen gmail.com> writes:
> re.compile(r'^_{0,3}[A-Z](?:[A-Z0-9]|-(?!-))*[A-Z0-9]$') # if rule 4 is an
> additional letter or digit
> re.compile(r'^_{0,3}[A-Z](?:[A-Z0-9]|-(?!-))*(? single-letter strings are allowed
>
Mark, single-letter strings are allowed and your regular expression w
Dick Moores gmail.com> writes:
> I'm not sure of your 5th condition. Do you mean, "A hyphen should not
> be immediately followed by a hyphen"? Could you give examples of what
> you will permit, and will not permit?
Dick, your are correct. A hyphen should not be immediately followed by a hyphen.
Hello,
I'm trying to write a regular expression to filter strings that meet the
following criteria:
1. Starts with 0-3 underscores;
2. Followed by one letter;
3. Then followed by 0 or more letters or digits or hyphens('-'),
4. Ends with one letter or digit; and
5. There should not be more than o
Hello,
Suppose var holds a reference to an objeect, my question is in the subject.
Thanks!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
17 matches
Mail list logo