On 5 May 2005 10:37:00 -0700, mrstephengross <[EMAIL PROTECTED]> wrote:
> Hi all... How can I find out the number of significant digits (to the
> right of the decimal place, that is) in a double? At least, I *think*
> that's what I'm asking for. For instance:
>
> 0.103 --> 3
> 0.0103 --> 4
> 0.001
On 20 May 2005 15:35:10 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
> Is there a better way to code nested for loops as far as performance is
> concerned.
>
> what better way can we write to improve the speed.
> for example:
> N=1
> for i in range(N):
>for j in range(N):
>d
may (but probably won't) have extensions
that allow you to pass an array of character pointers.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
>
> from itertools import izip
> pos = map(dict(izip(l2, count())).__getitem__, l1)
or probably less efficiently ...
>>> l1 = [ 'abc', 'ghi', 'mno' ]
>>> l2 = [ 'abc', 'def', 'ghi', '
]
should all take take running time proportional to
(len(l1)+len(l2))*log(len(l2))
For len(l1)=4,000 and len(l2)=10,000,000
Paul's suggestion is likely to take
about 1/100th of the time to run, ie
be about 100 times as fast. I was trying
to point out a somewhat clearer and simpler
(but sl
led to ensure (as far as possible)
that the cleanup occurs if the process is killed. This also
applies to vi and similar programs that take total control of
the terminal.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
these algorithms are the basis of lex/flex and
similar utilities, as well as the regular expression handling
of many languages.
Of course, I would like to emphasise that all this is based on
memory of university courses more than 20 years ago, so the
details could be wrong.
Charles
--
http://m
indow (ie you call the destroy method
on the main window) or if it has some special Tkinter meaning.
Presumably this routine cleans things up before calling sys.exit
or an equivalent.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
top of the
heap exceeds the threshold.
> Asking on the gnu libc mailing list would probably provide a
> more authoritative answer. I'd wager that they even know what
> other non-Gnu libc implementations do.
Agreed, they would be authoritative for GNU libc.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
-minvalue)
yield min(top,max(0,scaled_value))
clearer, but I am aware that others disagree with this.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
v = y.eval() # Evaluates all elements, returning Xarray
z = ((a+b)*(c+d)).eval() # Also evaluates all elements
Whether it would be any faster is doubtful, but it would eliminate
the temporaries.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
es. NaNs
and infinities would add additional cases, as may the need
to preserve accuracy near zero.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
27;ca', 'cb', 'cc']
len(permute('13579',3)) = 125
or even this monstrosity ...
def permute2( s, n ):
return [ ''.join([ s[int(i/len(s)**j)%len(s)]
for j in range(n-1,-1,-1)])
for i in range(len(s)**n) ]
print "permute2(
r,f) in re_list:
matchob = r.match(line)
if matchob:
f( line, matchob )
break
f(line,m)
Probably better ways than this exist.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> On May 9, 1:13 am, Charles Sanders <[EMAIL PROTECTED]>
> wrote:
[snip]
>> or even this monstrosity ...
>>
>> def permute2( s, n ):
>>return [ ''.join([ s[int(i/len(s)**j)%len(s)]
>> for j in range(n-1,-1,-1)
mmands can be used to reduce the typing if you are
fanatical.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
rint "Guarded search text='%s' excluding %s %s matches" %
(txt,exc,len(mtch))
for m in mtch:
print m.group(), 'at', m.start()
Guarded search text='axbycz' excluding [3] 2 matches
x at 1
z at 5
Guarded search text='Hollo' excluding [4] 0 matches
Simply finds all the (non-overlapping) matches and rejects any
that include one of the excluded columns (the "y" in the first
case and the final "o" in the second).
Charles
--
http://mail.python.org/mailman/listinfo/python-list
>> doesn't matter. What matters is the value that the name has
>> at the time the command is run:
[snip]
> Just tried on a FreeBSD 6.1 development box with stock /bin/sh and it
> works there too...
As far as I know, it has been like this since the introduction
of the Bourne shel
mpiling Python, Python Float object
becomes "long double" C type instead of "double" ?
2nd solution : Numpy. In memory, a "numpy.longdouble" is a C "long double" or
a string ?
Thank you.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
n.
I try to build a module with Swig but I didn't find the C function to use in
the wrapper to have a "numpy.longdouble" (or the equivalent in gmpy). Is it
something possible ?
Charles
--
http://mail.python.org/mailman/listinfo/python-list
;t know if any still do it, but old unices
used to detect on logon if you typed your user name and
password in all caps and then turned on the iuclc and
olcuc options, assuming that the reason for the all caps
was a upper case only terminal - great fun if you hit caps
lock by accident.
Charles
I've just started playing around with Python, as a possible
replacement for a mix of C++, Matlab and Lisp. The language looks
lovely and clean with one huge exception: I do a lot of numerical
modeling, so I deal with objects (like neurons) described
mathematically in papers, by equations like
Thanks guys -- yeah these two stategies (short s.varname; and explicit
rescoping, a=self.a etc) are more or less what I was using. That's
still kind of annoying though.
The s.varname approach still makes numerical code much harder to read.
I had a nasty bug with the boilerplate approach when for
hmm, I guess this is the difference between numerical programming and
the rest -- sure, if I was writing a database server or something it
would be great to have thisObject.veryLongName to know what everything
is -- however when you are implementing a model from a published
paper, the variables ten
installed, while
still installing any other dependencies ?
Would the best option be to just use the --no-deps option and see if
it works ?
Charles
--
http://mail.python.org/mailman/listinfo/python-list
z
zx
zy
zz
for y in m_from_n( [0,1], 3 ):
print y
[0, 0, 0]
[0, 0, 1]
[0, 1, 0]
[0, 1, 1]
[1, 0, 0]
[1, 0, 1]
[1, 1, 0]
[1, 1, 1]
for y in m_from_n( "abcdefghijklmnopqrstuvwxyz", 4 ):
print ''.join(y)
should more or less do what you want.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
sion instead of iteration.
I have yet to completely wean myself off Fortran style thinking.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
m $HOST)
'critical'(From $SEVERITY)
'"192.168.1.101' (Leading '"' from \", rest from
$TRAP, blank seperated)
'192.168.1.101' (from $TRAP, blank seperated)
'SNMPv2-MIB::sysUpTime.0'
and so on for the rest of the $TARP string, splitting it at
white space. The last part of $TRAP, '"public"', has a double
quote appended from the \".
Python is giving exactly what the shell has given it in both cases.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
t;
should pass TRAP as a single arg
Charles
--
http://mail.python.org/mailman/listinfo/python-list
Hi guys,
I'm playing with Python in emacs, with python mode.
I'd like to be able to press a key to toggle the code comments on and
off -- to switch between beautiful clean Python code, and the full
text that tells me what's going in in English.
Is this currently possible? I know there is a hide
"early" compared to most course sequences:
<http://www4.ncsu.edu/~rwchabay/mi/>
--
Charles Allen
--
http://mail.python.org/mailman/listinfo/python-list
Hi I need a list of games on ps2 and I'm in the united states, oklahoma
<*Charli jo*>
--
http://mail.python.org/mailman/listinfo/python-list
ceback (most recent call last):
File "", line 1, in ?
TypeError: 'tuple' object is not callable
>>>
thanks
charles
--
http://mail.python.org/mailman/listinfo/python-list
uld devolve into a pissing contest.
This subject thread may be of great interest but I think an language
advocacy mailing list would be a better forum.
--
Charles DeRykus
--
http://mail.python.org/mailman/listinfo/python-list
Really thanks for quickly reply Chris!
Actually I tried BeautifulSoup and it's great.
But I'm not very familiar with it and it need more codes to parse the html
and get the right text.
I think regexp is more convenient if there is a way to filter out the list
just in one line:)
I did this all the w
[0]
c.execute("select * from stocks where price<20")
for s in c:
print ' '+s[0]
c.close()
-
It is a adapted copy of the example in the Python documentation. But I was
expecting the output as with MySQL engine but, here, I get only:
2006-01-05
2006-01-07
2006-01-08
It seems the second call to execute modify the first cursor. Is it normal ?
How am I suppose to write this ?
Thanks
Charles
--
http://mail.python.org/mailman/listinfo/python-list
t ' '+sp[0]
c.close()
This solution gives the correct answer:
2006-01-05
2006-01-07
2006-01-08
2006-01-06
2006-01-07
2006-01-08
2006-01-07
2006-01-07
2006-01-08
2006-01-08
2006-01-07
2006-01-08
Do you think it is a good solution (any drawbacks ?) ?
Thanks again.
Charles
--
http://mail.python.org/mailman/listinfo/python-list
en for MySQLdb won't be compatible with sqlite3 (even
if I am using standard SQL). In fact I don't really understand why the
iterator isn't in some way "encapsulated". Does anybody tried to implemented
this functionality ?
Cheers,
Charles
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday 22 May 2008 13:30:07 Nick Craig-Wood wrote:
> ...
> >From Armstrong's book: The expression Pattern = Expression causes
>
> Expression to be evaluated and the result matched against Pattern. The
> match either succeeds or fails. If the match succeeds any variables
> occurring in Pattern
And for such a behavior they've termed "monkeying"
Thus, the coinage "Monkeypatching" for what you want to do:
http://mail.python.org/pipermail/python-dev/2008-January/076194.html
There are a group of people who think "monkeypatching is destroying ruby."
You still probably should avoid it for p
If you can imply a partial order on your ranges then you can get O(n lg n)
random access using a heap data structure.
You'll have to implement your own heap, but heap search is easy to implement
(it's Heapify that might require a little thinking).
This will only work, of course, if your ranges ar
List,
I'd like to do the following with Tkinter's Frame() object:
1. Display a collection of pack()-able objects. Easy. Done. I hold
the objects in a dictionary, mostly so that the owning program can refer
to them uniformly.
2. Whenever the collection is added to or deleted from, re-pack() th
On 2006-03-26, Andrew Gwozdziewycz <[EMAIL PROTECTED]> wrote:
> If you want something that won't get in your way, you should really
> use /bin/ed. It's probably simpler to use then searching the archives.
> /bin/ed will also run in cygwin for windows.
>
>>> Can one of you say to me what's the bes
I am so far unable to find the information I want about the Exception
class. Information like the signature of __init__ seems to be
unavailable. Any suggestions where I might find such information?
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 5, 2010, at 2:13 PM, Gerald Britton wrote:
On Fri, Feb 5, 2010 at 12:55 PM, Charles Yeomans > wrote:
I am so far unable to find the information I want about the
Exception class.
Information like the signature of __init__ seems to be
unavailable. Any
suggestions where I might f
On Feb 6, 2010, at 8:09 AM, Gerald Britton wrote:
If you browse the Python source tree, you should be able to find it.
http://svn.python.org/view/python/trunk/Objects/exceptions.c?revision=77045&view=markup
Perfect (even if I have to read C). Thanks.
Charles Yeomans
--
HI All,
I'm fiddling around with Python and I'm trying to get tktable to work
with Python 3.1 on Apple OS X 10.6 (Snow Leopard). Has anyone
successfully accomplished this task, and if so, can you share how that
you got it working? I've got Darwin Ports installed (current version)
and I'm using Pyt
Hi-
Do you knowof Christopher Ariza's AthenaCL?
<http://www.flexatone.net/athenaInfo.html#athenaFeatAnalytic>
HTH, Charles
--
http://mail.python.org/mailman/listinfo/python-list
move in that direction) for
career-defining opportunities. If there are individuals and organizations that
I should reach out to, please do let me know -- my office contact information
is below.
Google office:
Charles Jo
Sales Recruiter, Google
650.253.0375 office
408.668.4226 cell
charle
he meaning of this:
if a in (1,2,3):
Actually, I might be -- I think of a tuple first as a single thing, as
opposed to a list or map, which I see first as a collection of other
things.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
uniformly. On a closed interval,
any continuous function is uniformly continuous.
Isn't (-∞, ∞) closed?
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
ider this practice to be kludgy; my
experience with RAII is pretty good.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 17, 2009, at 9:43 PM, Steven D'Aprano wrote:
On Wed, 17 Jun 2009 07:49:52 -0400, Charles Yeomans wrote:
Even CPython doesn't rely completely on reference counting (it has a
fallback gc for cyclic garbage). Python introduced the "with"
statement to get away fro
On Jun 18, 2009, at 2:19 PM, David C. Ullrich wrote:
On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans
wrote:
On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote:
Jaime Fernandez del Rio writes:
I am pretty sure that a continuous sequence of
curves that converges to a continuous curve
atters, but his defintion of "polygonal path"
is, _if_ we're being very careful, self-contradictory.
So I don't think we can count that paper as a suitable
reference for what the _standard_ definitions are;
the standard definitions are not self-contradictory this way.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
ation.
Ie, a curve in the plane _is_ a continuous function from
an interval to the plane, and a subset of the plane is
not a curve.
Officially, anyway.
This simply isn't true.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 22, 2009, at 8:46 AM, pdpi wrote:
On Jun 19, 8:13 pm, Charles Yeomans wrote:
On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote:
Hmm. You left out a bit in the first definition you cite:
"A simple closed curve J, also called a Jordan curve, is the image
of a continuou
On Jun 22, 2009, at 2:16 PM, David C. Ullrich wrote:
On Mon, 22 Jun 2009 10:31:26 -0400, Charles Yeomans
wrote:
On Jun 22, 2009, at 8:46 AM, pdpi wrote:
On Jun 19, 8:13 pm, Charles Yeomans wrote:
On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote:
Hmm. You left out a bit in the
Or you could try my approach and write your own web app.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
is always evolving and there might be new tutorials out
there.
As an alternative to Python, I'd suggest REALbasic. Its main
disadvantage is that it is not free. But you get a language, editor,
and two application frameworks in one package.
Charles Yeomans
--
http://mail.python.org/mailman/
On Jun 29, 2009, at 7:28 AM, Elf Scripter wrote:
Hi, i have a console application that i want to ran (invisible) as a
daemon, how can i do that?
Search the web for python + daemon. I found plenty of code, including
mostly prewritten solutions, for my own work.
Charles Yemans
--
http
ord: ")
guess = str(guess)
if guess != password:
print "Access Denied"
attemptcount = attemptcount + 1
else:
print "Password Confirmed"
correct_password_given = True
break
Charles Yeomans
On Jul 1, 2009, at 3:58 AM, sato.ph...@gmail.com wro
, MD5 was intended to be a cryptographic hash function,
not a checksum.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
I figured some sort of HTTP event / RPC type of would
be a good idea?
Are there any modules I should know about, or guidelines I could
read, that could aid me in the design of the API?
Thank you,
:)
I'd suggest the O'Reilly book "RESTful Web Services".
Cha
code as data sanitizing, but rather as a precondition. And with that
description, the use of an assert statement that might be compiled
away is not unreasonable; indeed, it certainly is so in the context of
design by contract.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
remove the first occurence. Doing that while no exception is
raised is also uncool, right?
Some suggestions?
L = [0, 0, 0, 1, 1, 1, 0]
M = [x for x in L if x !=0]
Charles Yeomans--
http://mail.python.org/mailman/listinfo/python-list
for enforcing pre-conditions and
post-
conditions, unless such conditions are mere "guidelines", because
assert
can be switched off at runtime.
Unless, of course, you want to switch off such checking at runtime, as
you might when using a design-by-contract approach.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
the input/output of
functions; on the contrary, Bertrand Meyer, the inventor of DbC,
claims that DbC allows one to eliminate such redundancy, and the
resulting overhead.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 14, 2009, at 12:09 AM, Scott David Daniels wrote:
Charles Yeomans wrote:
On Aug 11, 2009, at 3:30 PM, Ethan Furman wrote:
Ethan Furman wrote:
Greetings!
I have seen posts about the assert statement and PbC (or maybe it
was DbC), and I just took a very brief look at pycontract (http
sorts
of functions and types (strictly "categories") they can accept,
presumably to make them mathematically well-behaved.
Have I got it correct?
I don't think so. Paul Rubin's square example was, I thought,
particularly instructive.
Charles Yeomans--
http://mail.python.org/mailman/listinfo/python-list
faster all the time and languages like python or ruby are fast
enough.
any comment ?
Many developers suffer from performance anxiety.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
nally:
f = f.close()
In addition to fixing the latent bug in the second simple template, I
took the opportunity to correct your heinous violation of command-
query separation.
Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list
still seeing data being sent out of
order.
Honestly, I suspect some sort of Windows issue; as Windows is the only
thing that's changed recently. But I'm running Win10 and another developer
that's seeing it is running Win8.
I'd appreciate any guidance you may have.
Thank you,
Charles Wilt
--
https://mail.python.org/mailman/listinfo/python-list
python3 --version
Python 3.5.3
Running on Debian stretch
In this code s is a string parameter
while (j < k and \
(s[j].isalnum()) or \
(s[j] in seps and s[j+1].isalnum()) ):
j = j + 1
print ("i = {0}, j = {1}, k = {2}, len[s] = {3}". \
format(i,
I want to process a bunch of processes that all talk to each other. I've
figured out how to do this using queues with the main process as the mail
handler, but I'd rather have them talk directly. If I use connections, then I
can pass the pipes to the processes, but there doesn't seem to be anythin
I just tried to write a recursive method in python - am I right that local
variables are only lexically local scoped, so sub-instances have the same
ones? Is there a way out of that? Do I have to push and pop my own simulated
stack frame entry?
--
https://mail.python.org/mailman/listinfo/python
On Wed, 06 Apr 2016 20:28:47 +, Rob Gaddi wrote:
> Charles T. Smith wrote:
>
>> I just tried to write a recursive method in python - am I right that local
>> variables are only lexically local scoped, so sub-instances have the same
>> ones? Is there a way out of that
Hi,
How can I get *all* the names of an object's attributes? I have legacy
code with mixed new style classes and old style classes and I need to
write methods which deal with both. That's the immediate problem, but
I'm always running into the need to understand how objects are linked, in
par
On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote:
> Hi,
>
> How can I get *all* the names of an object's attributes? I have legacy
> code with mixed new style classes and old style classes and I need to
> write methods which deal with both. That's the imm
On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote:
> Hi,
>
> How can I get *all* the names of an object's attributes? I have legacy
> code with mixed new style classes and old style classes and I need to
> write methods which deal with both. That's the imm
Hello,
I thought __getitem__() was invoked when an object is postfixed with an
expression in brackets:
- abc[n]
and __getattr__() was invoked when an object is postfixed with an dot:
- abc.member
but my __getitem__ is being invoked at this time, where there's no
subscript (going into a s
On Wed, 30 Dec 2015 23:50:03 +1100, Chris Angelico wrote:
> On Wed, Dec 30, 2015 at 11:40 PM, Charles T. Smith
> wrote:
>> Oh!
>>
>> Although the referenced doc says:
>>
>> "For compatibility reasons, classes are still old-style by default."
>
On Thu, 31 Dec 2015 00:11:24 +1100, Chris Angelico wrote:
> On Wed, Dec 30, 2015 at 11:57 PM, Charles T. Smith
> wrote:
>> Hello,
>>
>> I thought __getitem__() was invoked when an object is postfixed with an
>> expression in brackets:
>>
>> - abc[n]
&
On Wed, 30 Dec 2015 14:10:14 +, Mark Lawrence wrote:
> On 30/12/2015 11:51, Charles T. Smith wrote:
>> Hi,
>>
>> Does anyone know *why* the __members__ method was deprecated, to be
>> replaced by dir(), which doesn't tell the truth (if only it took an
&
On Wed, 30 Dec 2015 08:35:57 -0700, Ian Kelly wrote:
> On Dec 30, 2015 7:46 AM, "Charles T. Smith"
> wrote:
>> As is so often the case, in composing my answer to your question, I
>> discovered a number of problems in my class (e.g. I was calling
>> __getitem__()
On Wed, 30 Dec 2015 13:40:44 -0700, Ian Kelly wrote:
> On Wed, Dec 30, 2015 at 9:58 AM, Charles T. Smith
>> The problem is that then triggers the __getitem__() method and I don't
>> know how to get to the attributes without triggering __getattr__().
>>
>> It
On Wed, 30 Dec 2015 22:54:44 +, Charles T. Smith wrote:
> But I concede I must be doing something fundamentally wrong because this
> assert is triggering:
> def __getattr__ (self, name):
> print "attrdict:av:__getattr__: entered for ", name
> ass
On Thu, 31 Dec 2015 10:13:53 +1100, Ben Finney wrote:
> "Charles T. Smith" writes:
>
>> I don't understand this distinction between an "attribute" and a "dict
>> item".
>
> When did you most recently work through the Python tutorial
&
On Thu, 31 Dec 2015 10:58:17 +1100, Steven D'Aprano wrote:
(some very good information)
Thank you.
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 31 Dec 2015 10:50:53 +1100, Steven D'Aprano wrote:
> I'm not sure what distinction you're referring to, can you explain?
Ian Kelly had said:
>> How precisely are you trying to store these: as an attribute, or as a
>> dict item? If it's supposed to be in the dict, then why is your
>> __ge
On Thu, 31 Dec 2015 11:21:59 +1100, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> On Thu, 31 Dec 2015 10:13 am, Ben Finney wrote:
>>
>> > You may be familiar with other languages where the distinction
>> > between “attribute of an object” is not distinct from “item in a
>> > dictionary”. Pyth
On Wed, 30 Dec 2015 17:31:11 -0700, Ian Kelly wrote:
>> In any case, I thought that class attributes were, in fact, items of
>> __dict__?
>
> That's correct, but as I said in my previous message, self.attrs and
> self.attrs.__dict__ are two different dicts, and you're confusing one
> for the othe
On Thu, 31 Dec 2015 12:12:43 +, Oscar Benjamin wrote:
> When you write x.attr the name 'attr' is looked up on the object x. This
> calls x.__getattribute__('attr'). In turn this checks the dict
> associated with the object x i.e. x.__dict__['attr']. This in turn calls
> x.__dict__.__getitem__
while ($str != $tail) {
$str ~= s/^(head-pattern)//;
use ($1);
}
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 15 Jan 2016 11:42:24 +0100, Wolfgang Maier wrote:
> On 15.01.2016 10:43, Peter Otten wrote:
>> Charles T. Smith wrote:
>>
>>> while ($str != $tail) {
>>> $str ~= s/^(head-pattern)//;
>>> use ($1);
>>> }
>>
>
On Fri, 15 Jan 2016 11:04:32 +, Charles T. Smith wrote:
> capability, somehow, but that was apparently overlooked. For example,
> by storing string state in the match object and having a *sub* method without
> a string parameter.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 15 Jan 2016 14:20:17 +0100, Wolfgang Maier wrote:
> pattern = pattern_str.compile()
> try:
> matches = pattern.findall(some_str, endpos=some_str.index(tail))
> except ValueError:
> # do something if tail is not found
> pass
Oh! I think that's it!
matches = findall (patte
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(0) is int
True
...
(PDB)type(0) is int
False
(PDB)type(1) is int
False
(PDB)p 5 + 0
5
(PDB)class c (object): pass
(PDB)type (c()) is c
T
On Tue, 19 Jan 2016 03:19:59 +1100, Chris Angelico wrote:
> On Tue, Jan 19, 2016 at 3:11 AM, Charles T. Smith
> wrote:
>> $ python
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2
>> Type "help", "copyright", "credits&quo
What does "from (module) import (func)" do?
Please don't tell me that I shouldn't ask because real programmers
know not to have circular dependencies ...
I have no idea what was imported before. I just want to import hexdump().
Unfortunately, this does not work:
from utilities import hexdump
201 - 300 of 349 matches
Mail list logo