esis subjects in
improving Shed Skin, such as transforming heap allocation into stack-
and static preallocation, where possible, to bring performance even
closer to manual C++. Please let me know if you are interested in
helping out, and/or join the Shed Skin mailing list.
Thanks!
Mark Dufour.
--
&qu
ever placed a GPL
> restriction on its output. Whether this is explicit or implicit doesn't
> matter, so long as it's there.
it's fine if people want to create non-GPL software with Shed Skin. it
is at least my intention to only have the compiler proper be GPL
(LICENSE states that th
eople have
managed to compile things with Visual Studio or whatever it is
called.
btw, the windows version of Shed Skin comes with GCC so it's easy to
compile things further (two commands, 'ss program' and 'make run'
suffice to compile and run some program 'progr
VB and it has not even much to do
> with what existed before in language design.
I think it's more Pythonic to just profile a program to learn about
actual types..
mark dufour (Shed Skin author).
--
http://mail.python.org/mailman/listinfo/python-list
they are some form of zip file for the distribution
of modules but beyond that I cannot find *any* docs for them
anywhere.
Where are they documented and how do I take advantage of them?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
* Rob Wolfe wrote (on 4/10/2007 1:38 PM):
> Mark Elston <[EMAIL PROTECTED]> writes:
>
>> This is probably a *really* stupid question but...
>> I have looked at all the documentation I have for 2.4.3
>> and all the docs I can download for 2.5 and I simply cannot
&
n xrange(min(k, n-k)):
ntok = ntok*(n-t)//(t+1)
return ntok
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ma
function instead. That is, the natural log of n choose k can be
computed much more quickly as
lngamma(n+1) - lngamma(k+1) - lngamma(n-k+1)
I assume that lngamma is implemented somewhere in either numpy or
scipy, but right now I can't find it...
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On 14 Sep, 02:35, Jürgen Urner <[EMAIL PROTECTED]> wrote:
> Puh, what a discussion... most common use case I can think of is
>
> >> d = {'a': 1, 'b': 2, 'c': 3}
> >> for key in d:
> >> # do something that relies on order of keys as specified in the
> >> constructor
>
> It's a bit tireing havin
I forgot one item in the proposed API:
ordereddict.delete(index : int)
Also, the API for keys() should be
ordereddict.keys(firstindex : int = None, secondindex : int = None)
If called with no args, returns list of all keys (in key order of
course); if one arg is given, returns keys with indexes
On 14 Sep, 10:49, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2007-09-14, Mark Summerfield <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 14 Sep, 02:35, Jürgen Urner <[EMAIL PROTECTED]> wrote:
> >> Puh, what a discussion... most common use case I can thin
On 14 Sep, 12:46, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2007-09-14, Mark Summerfield <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 14 Sep, 10:49, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> >> > # some time later
> >> > d["e"]
I would like to construct a class that includes both the integers and
None. I desire that if x and y are elements of this class, and both
are integers, then arithmetic operations between them, such as x+y,
return the same result as integer addition. However if either x or y
is None, these operati
On Sep 14, 10:30 am, Mark Morss <[EMAIL PROTECTED]> wrote:
> I would like to construct a class that includes both the integers and
> None. I desire that if x and y are elements of this class, and both
> are integers, then arithmetic operations between them, such as x+y,
> retu
On 14 Sep, 15:35, Antoon Pardon <[EMAIL PROTECTED]> wrote:
[snip]
> I wish you all the luck you can get. Maybe if you succeed I'll change
> my mind about writing a PEP myself.
>
> However I think your chances will increase if you write your module
> and have it available in the cheese shop. If peop
On 14 Sep, 20:25, James Stroud <[EMAIL PROTECTED]> wrote:
> Mark Summerfield wrote:
[snip]
> May I also make one more suggestion, to call it a "sort_ordered_dict"
> (or "sortordereddict", or even better a "sorteddict"--where the "ed"
&g
On 14 Sep, 21:23, James Stroud <[EMAIL PROTECTED]> wrote:
> Mark Summerfield wrote:
> > I guess I'll have to rename my module (although unfortunately, my book
> > has just gone into production and I have a (simpler) example of what I
> > considered to be an ordered
nt call last):
File "", line 1, in
KeyError: [1, 2, 3]
In other words, to repeat Sion Arrowsmith's question, what would you
expect d.keys() to return after a key of d has been modified?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
""
tree = ET.XML(source)
body = tree.find("body")
newdiv = ET.Element('div', {'class':'remapped'})
for e in body.getchildren():
newdiv.append(e)
newdiv.text = body.text
newdiv.tail = body.tail
body.clear()
body.append(newdiv)
ET.dump(tree)
Result:
Test
original contents... 2&3 some text
Another paragraph
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
".
If there is positive feedback I will submit the PEP to the reviewers,
so if you think it is a good idea please say so. (I'm sure that if you
_don't_ like it you'll tell me anyway:-)
PEP: XXX
Title: Sorted Dictionary
Version: $Revision$
Last-Modified: $Date$
Author: Mark Summer
On 25 Sep, 10:53, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote:
> On 2007-09-25, Mark Summerfield <[EMAIL PROTECTED]> wrote:
>
> > If there is positive feedback I will submit the PEP to the reviewers,
> > so if you think it is a good idea please say so. (I'
On 2007-09-25, Andrew Durdin wrote:
> On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote:
> > Since the sorteddict's data is always kept in key order, indexes
> > (integer offsets) into the sorteddict make sense. Five additional
> > methods are pr
On 2007-09-25, Andrew Durdin wrote:
> On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote:
> > Since the sorteddict's data is always kept in key order, indexes
> > (integer offsets) into the sorteddict make sense. Five additional
> > methods are pr
On 25 Sep, 12:11, Jeremy Sanders wrote:
> Mark Summerfield wrote:
> > If there is positive feedback I will submit the PEP to the reviewers,
> > so if you think it is a good idea please say so. (I'm sure that if you
> > _don't_ like it you'll tell me anyway
On 25 Sep, 12:19, Paul Hankin <[EMAIL PROTECTED]> wrote:
> Recall sorted...
> sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted
> list
>
> So why not construct sorteddicts using the same idea of sortedness?
>
> sorteddict((mapping | sequence | nothing), cmp=None, key=None,
> re
On 25 Sep, 20:28, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Sep 25, 7:58 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Paul Hankin wrote:
> > > ...
> > > class sorteddict(dict):
> > > "A sorted dictionary"
> > > def __init__(self, arg=None, cmp=None, key=None, reverse=False):
On 25 Sep, 22:33, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Sep 25, 9:55 pm, Mark Summerfield <[EMAIL PROTECTED]>
> wrote:
>
> > ...
> > class sorteddict(dict):
>
> > ...
> > if self.__keys is None:
> >
On 26 Sep, 09:51, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Duncan Booth <[EMAIL PROTECTED]> writes:
> > I that's the point though: you can't write one implementation that has good
> > performance for all patterns of use
>
> An implementation of sorted dict using a balanced tree as the
> underlyin
On 26 Sep, 11:27, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Mark Summerfield <[EMAIL PROTECTED]> writes:
> > On 26 Sep, 09:51, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> >> Duncan Booth <[EMAIL PROTECTED]> writes:
> >> > I that's the p
On 26 Sep, 13:22, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2007-09-26, Mark Summerfield <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 26 Sep, 11:27, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> >> Mark Summerfield <[EMAIL PROTECTED]> writes:
>
On 26 Sep, 14:59, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
> > Paul Hankin <[EMAIL PROTECTED]> wrote:
> > > More flexibly, keep a set of inserted keys that haven't yet been
> > > included in the sorted list, and a set of deleted keys tha
On 26 Sep, 16:20, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Sep 26, 3:24 pm, Mark Summerfield <[EMAIL PROTECTED]>
> wrote:
>
> > On 26 Sep, 14:59, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
> > > On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]
nt sd.keys() = ['a']
> > try:
> > del sd['b']
> > except:
> > pass
> > sd['b'] = 'b'
> > print sd.keys()
>
> > The second print statement produces ['a'] rather than ['a', 'b']
&g
On 26 Sep, 18:59, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [Mark Summerfield]
>
> > Below is a PEP proposal for a sorteddict. It arises out of a
> > discussion on this list that began a few weeks ago with the subject of
> > "An ordered dictionary for t
The Quick Screenshots Script (Python + PIL) is a "dream come true", and yet
so simple to use reliably. Does anyone have a suggestion or know how to
include in the script, the ability to email the attachment? This would make
the dream perfect! Thanks!
Mark Bratcher
Consolidated
need
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
COMMASPACE = ', '
# Create the container (outer) email message.
msg = MIMEMultipart()
msg['Subject'] = 'TEST'
# me == the sender's email address
# family = the l
the email package; it creates a MIME message
with an attachment and sends it using SMTP.
<http://docs.python.org/lib/node162.html>
Mark Bratcher
Consolidated Citrus, LP
4210-250 Metro, Parkway
Fort Myers, FL 33916
239-275-4060 ext 219
--
http://mail.python.org/mailman/li
lternative, quick and dirty way (quick for the human, not the
computer!) would be just to compute some large power of the transition
matrix and eyeball it to see if all columns are identical. If so, the
process converges.
> Thx!
Ur wlcm!
Mark
--
http://mail.python.org/mailman/listinfo/python-list
string, it returns the exact start,stop,step indices
used:
>>> mystr='my string'
>>> s=slice(None,3,-1)
>>> s.indices(len(mystr)) # start is the end of the string if step is
>>> negative
(8, 3, -1)
>>> mystr[8],mystr[3]
('g
> From: Tor Erik Sønvisen
> Date: October 8th 2007
> I've tried locating some code that can recreate an object from
> it's string representation...
On a related note I've wondered about this:
>>> class Foo(object): pass
>>> f = Foo()
>>> s = repr(f)
>>> s
'<__main__.Foo object at 0x007CBAB0>'
So
On 12 Oct, 09:17, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Mark Summerfield <[EMAIL PROTECTED]> writes:
> > Below is a PEP proposal for a sorteddict. ...
>
> Is this proposal dead? I'd been meaning to post some thoughts which I
> still haven't gotte
X-Replace-Address: [EMAIL PROTECTED]
On 12 Oct, 18:14, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-10-12 at 17:41 +0100, English, Mark wrote:
> > > From: Tor Erik Sønvisen
> > > Date: October 8th 2007
> > > I've tried locating some code th
ere any way I can force these to a log or
> print them to the screen? Thanks.
>
> Regards,
> Ken
>
www.wireshark.org
-Mark T.
--
http://mail.python.org/mailman/listinfo/python-list
rtain default arguments
-exhaustive checking of C++ keywords
-fix for some combinations of arguments to min, max
-several minor bug fixes
As always, I could really use more help in pushing Shed Skin forward.
Let me know if you'd like to help out, but are not sure where to
begin.
Thanks,
Mark.
--
page:
http://mark.dufour.googlepages.com
Thanks,
Mark.
--
"One of my most productive days was throwing away 1000 lines of code"
- Ken Thompson
--
http://mail.python.org/mailman/listinfo/python-list
tly and that you are connected to the server on
which the file resides.", None, 5003044, -2147467259), None)
Please note the strange insertion of double slashes in the indicated
'not valid path.' Also the insertion of 'c:' and the strange leading
double quotation mark.
Whe
I am a unix person, not new to Python, but new to Python programming
on windows. Does anyone know where to find documentation on
win32com.client? I have successfully installed this module and
implemented some example code. But a comprehensive explanation of the
objects and methods available is n
from recent Python training sessions.
For more details, see O'Reilly's web page:
http://www.oreilly.com/catalog/9780596513986/
O'Reilly also has a press release about the book here:
http://press.oreilly.com/pub/pr/1843
Thanks,
--Mark Lutz
--
http://mail.python.org/mailman/listinfo/python-list
You need to set the PATH environment variable to include C:\Python24.
That is where the Python executable is locate.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
to the file's close(). Is it perhaps "file.close" and not
"file.close()"? Forgotten parentheses won't give an error and won't close
the file.
>>> f=file('blah.txt','wt')
>>> f
>>> f.close
>>> f
>>> f.close()
>>> f
>>>
-Mark Tolonen
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 14, 7:49 pm, "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote:
> Mark wrote:[a lot of valid, but long concerns about types that return
> an object of their own type from some of their methods]
>
> I think that the best solution is to use an alternative constructor
denominator = self.denominator
> return obj
Thank you for this.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
> get *called by* the construction process).
Sorry---I'm well aware that __init__ isn't a constructor; I wasn't
being precise enough in my use of `used'.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 16, 10:25 am, "Mark Dickinson" <[EMAIL PROTECTED]> wrote:
> that is, I was working from the following two assumptions:
>
> (1) *Every* time a Rational is created, __init__ must eventually be
> called, and
> (2) The user of the class expects to call Rational(
with Shed Skin. these can be
downloaded from the Shed Skin homepage:
http://mark.dufour.googlepages.com
please let me know if you try out the latest release, and encounter
any problems or have any wishes.
thanks,
mark.
--
"One of my most productive days was throwing away 1000 lines of code&
test, please ignore
--
http://mail.python.org/mailman/listinfo/python-list
please ignore
--
http://mail.python.org/mailman/listinfo/python-list
/lib
does the trick. And by the way: the bash construct is far less error
prone regarding quoting when used in shell scripts.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
of about 40 times over CPython and 11 times over Psyco on my
computer), please visit the homepage at:
http://mark.dufour.googlepages.com
Thanks!
Mark Dufour.
--
"One of my most productive days was throwing away 1000 lines of code"
- Ken Thompson
--
http://mail.python.org/mailman/listi
find really counter-intuitive is that the cmath
functions will use __float__ if available, but completely ignore
__complex__.
Does anyone know of a good reason for the above behaviour? Would a
patch to complexobject.c that `fixes' this be of any interest to
anyone but me? Or would it likely break something else?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Some languages, such as Scheme, permit you to make a transcript of an
interactive console session. Is there a way to do that in Python?
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 16, 4:22 pm, [EMAIL PROTECTED] wrote:
> I am VB6 programmer and wants to start new programming language but i
> am unable to deciced.
>
> i have read about Python, Ruby and Visual C++. but i want to go
> through with GUI based programming language like VB.net
>
> so will you please guide me
d(("",port))
> i = 0
> while i<200:
>data[i],addr = s.recvfrom(1024)
>i = +1
>
> data[i] is illegal.
>
> Any suggestion welcome!
>
import socket
s=socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('',5000))
data=[]
for i in range(200):
e
who may never have seen such a thing themselves.
http://markshroyer.com/blog/2007/11/09/tilting-at-metaclass-windmills/
So what's the verdict? Incorrect? Missed the point completely?
Needs to get his head checked? I'd love to hear what
comp.lang.python has to (anthropomorphically) s
On 2007-11-10, Jonathan Gardner <[EMAIL PROTECTED]> wrote:
> On Nov 9, 7:12 pm, Mark Shroyer <[EMAIL PROTECTED]> wrote:
>> I guess this sort of falls under the "shameless plug" category, but
>> here it is: Recently I used a custom metaclass in a Python program
ful to realize that all those years learning OO design and
> design patterns just to make Java usable are wasted in the world of
> Python. I understand that because I've invested years mastering C++
> and perl before discovering Python. Your solace comes when you embrace
> that and see how much simpler life really is when the language gets
> out of your way.
It's just as harmful as to ignore the occasional usefulness of
object-oriented patterns as it is to abuse them left and right. My
approach on this project feels right, it produces legible and easily
extensible code, it's been a breeze to test and maintain so far...
if implementing different types of matching logic as classes here is
"wrong" by Python convention (and that would come as a rather big
surprise to me), then I don't want to be right.
--
Mark Shroyer
http://markshroyer.com/
--
http://mail.python.org/mailman/listinfo/python-list
; or "license" for more information.
>>> from decimal import Decimal, getcontext
>>> getcontext().prec = 32
>>> 1234**Decimal("10.9")
Decimal("4.9583278648155041477415234438717E+33")
>>>
Mark
--
http://mail.python.org/mailman/listinfo/python-list
gt;>> f2b(1.0)
1065353216
>>> hex(f2b(1.0))
'0x3f80'
>>> b2f(0x3f80)
1.0
>>> b2f(0x3f81)
1.001192092896
>>> b2f(0x3f7f)
0.9994039535522
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 22, 5:41 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> On Nov 21, 11:48 pm, "Mark T" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Here's some functions to get the binary representation of a float. Then
> > just manipulate the bits (an exercise f
On Nov 21, 11:48 pm, "Mark T" <[EMAIL PROTECTED]> wrote:
> Here's some functions to get the binary representation of a float. Then
> just manipulate the bits (an exercise for the reader):
>
> import struct
>
> def f2b(f):
> return struct.unpac
nceType at all ?
Not particularly vital. Just implementing __str__ on some class and if
one of the members was a sequence
I was going to format that bit of data in brackets.
Thanks,
Mark
__
This email is intended only for the use
machine code, is unimportant. Even if a significant performance
difference did result from this, keep in mind that the bulk of the
execution time of any Python app worth profiling is going to be after
this initial Python-to-bytecode compilation, during the execution of the
program's by
begins and ends with
\x00, so it doesn't look like utf-16-be. But replace works:
>>> L=['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00','\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\x002\x00']
>>> [s.replace('\x00','') for s in L]
['381475.502599', '213622.174282']
-Mark Tolonen
--
http://mail.python.org/mailman/listinfo/python-list
he supposed to patch the generated proxy instance (or proxy
class) after it's been created ?
I may have missed the point, but I ended up allowing the caller to
"proxy()" to specify a base class. Code included below. Original code
from the recipe, all mistakes are mine. Proxy renamed
This is quite possibly one of the funniest examples of how Duck Typing can break down that I have ever seen!On 4/18/06, Rene Pijlman <
[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED]:>If it looks like a duck, and quacks like a duck, then for all practical>purposes it supports the 'duck' interface.The p
t;>
>> http://www.spamcop.net/sc?track=72.231.179.135 posting host
>> http://www.spamcop.net/sc?track=xahlee.org spamvertized
>> site
>>
>>
>> If enough people complain with both, it might stop one day.
>
Ooooh! (Waggles fingers beneath chin)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
monitor. I am using wxPython. Does anyone know how to do it?
Thanks
Mark Rainess
--
http://mail.python.org/mailman/listinfo/python-list
I've got an API that deals with 64 bit int values. Is there
any way of handling this smoothly? Right now I'm casting
the values into and out of strings for the API.
If not, are there any nice alternatives to XML-RPC that
support this?
Many TIA!
Mark
--
Mark Harrison
Pixar Animati
, a simple way to also help out, is to send me bug reports of
small code fragments that SS does not compile correctly, or you can
just send me complete programs. Bug reports are always motivating,
make my work more time-efficient, and are the best way to getting your
own programs supported.
Th
elf." references, or is this
just something I need to get my brain to accept?
Many TIA,
Mark
--
Mark Harrison
Pixar Animaion Studios
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to automatically print all the instance
data in a class? This is for debugging, I would like
to do something like dump(self) to snapshot the state
of the object.
Many TIA!
Mark
--
Mark Harrison
Pixar Animation Studios
--
http://mail.python.org/mailman/listinfo/python-list
data via getters
and setters, etc.
It seems a first cut of this is pretty straightforward,
using introspection to get the required methods. Something
needs to be done to specify the C++ types of the parameters.
Is there any work being done in this area?
Many TIA,
Mark
--
Mark Harrison
Pix
Why this:
> lines = iter(infile.readline, "")
> # copy one line at a time
> for line in lines:
Rather than this?
> for line in infile:
..Mark
This email and any attachment may contain confidential, privileged information
for the sole use of the intended recipie
thing new out there? I would argue that software
needs innovation more than it needs philosophers.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
he ./configure and compilation output?
make might be rereporting an error that occurred further up.
I don't see anything related on the Python bug tracker. It might be
worth posting a bug report at bugs.python.org
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Anyone else here have any ideas how to proceed?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
except:
org_type,org_value,org_traceback = sys.exc_info()
raise SomeException,'had some problems with this code',org_traceback
## OUTPUT ##
Traceback (most recent call last):
File "exc.py", line 7, in
a=1/0
SomeException: had some problems with this code
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
for more details about the
release, or visit the new Google code hosting site:
http://shed-skin.blogspot.com
http://shedskin.googlecode.com
Thanks,
Mark Dufour.
--
"One of my most productive days was throwing away 1000 lines of code"
- Ken Thompson
--
http://mail.python.org/mailma
s how to handle this situation? I'd hate to
> have to give up using the log.exception(...) call as it's useful to
> get strack trace information in the log file.
>
> Thanks in advance,
> Doug Farrell
Check out the traceback module. It can translate the traceback into a
variety of formats (such as a string) that can be pickled.
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
a nan
> under Windows, it displays as "1.#QNAN".
I believe this will be fixed in Python 2.6 :)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
rent objects,
dammit!
Any change to Python that made == and != checks involving NaNs raise
an exception would have to consider the consequences for set, dict,
list membership testing.
Mark
and if Python had separate operators for these two purposes it
wouldn't be Python any more.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
n\lib\re.py", line 233, in _compile
raise error, v # invalid expression
error: look-behind requires fixed-width pattern
>>>
Python doesn't support lookbehind assertions that can vary in size. This
doesn't work either:
>>> re.search(r'(?
Here's some co
mat.FormatTime(112233)
Traceback (most recent call last):
File "", line 1, in
File "Format.py", line 13, in FormatTime
clock = Ftime.join()
AttributeError: 'tuple' object has no attribute 'join'
>>> Format.FormatTime('112233')
Traceback (most recent call last):
File "", line 1, in
File "Format.py", line 13, in FormatTime
clock = Ftime.join()
AttributeError: 'tuple' object has no attribute 'join'
Make sure to copy/paste the exact working code.
Look at the 'time' and 'datetime' modules and the functions and methods
'strftime' and 'strptime' for displaying and parsing times.
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
GetElement("foo/bar")
>
> ... to read the value of:
>
>
> 42
>
>
>
> Thanks
>
> Simon
>
> --
> Linux user #458601 - http://counter.li.org.
>
>
>
>>> from xml.etree import ElementTree as ET
>>> tree=ET.parse('file.xml')
>>> tree.find('bar').text
'42'
>>>
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
encodings can't be extended; it supports UTF-8, UTF-16, ISO-8859-1
(Latin1), and ASCII. If encoding is given it will override the implicit or
explicit encoding of the document.
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
time.strftime('%#c').decode(locale.getpreferredencoding()) # cp1252 on
>>> my system
u'Sunday, January 27, 2008 12:56:30'
>>> time.strftime('%#c').decode('cp932')
u'Sunday, January 27, 2008 12:56:40'
>>> time.strftime('%#c').decode('mbcs')
u'Sunday, January 27, 2008 12:56:48'
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
0 or 1) rather than as a boolean,
and goes back into the calculation in some way. On the other hand,
there are certainly situations where you want a comparison with a
NaN to raise an exception. I guess this is why IEEE-754r provides
two sets of comparison operators: signaling and non-signaling.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
#x27;real'
mathematics: most of it is devoted to dealing correctly with
infinities, NaNs, signed zeros, subnormals, `ideal' exponents, traps,
flags, etc.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ay: it returns a PyObject---in
this case, a PyObject corresponding to a Python tuple. As the
compiler says, a PyObject is neither an array nor a pointer, so when
you write
dummy_list[i]
the compiler doesn't know what you mean. You probably want to use
PySequence_Fast_GET_ITEM. See the docu
>
See the help for re.sub: "Backreferences, such as "\6", are replaced with
the substring matched by group 6 in the pattern."
This should work:
htmlStr = re.sub('(?P\d{6})','http://linky.com/\\1.html";>\\1',htmlStr)
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
4101 - 4200 of 5834 matches
Mail list logo