Martin v. Löwis wrote:
> Derek Basch wrote:
> > XHTML 1.0 specs, Appendix C
> > [EMAIL PROTECTED]
> > C.3 Element Minimization and Empty Element Content
> >
> > Given an empty instance of an element whose content model is not
EMPTY (for
> > example, an empty title or paragraph) do not use the mini
If I want to dump (for debugging) an instance and all
of it's member attributes, what's the simplest way?
print myInstance
just gives a pointer to its location in memory
Thanks!
__
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Ma
In article <[EMAIL PROTECTED]>,
gf gf <[EMAIL PROTECTED]> wrote:
> If I want to dump (for debugging) an instance and all
> of it's member attributes, what's the simplest way?
>
> print myInstance
>
> just gives a pointer to its location in memory
You need to write a str() method for the class.
Jaime Wyant wrote:
> You need to check out swig. It is the *only* way to setup a `c'
> library for use with python.
It's not.
Regards,
Yevgen
--
http://mail.python.org/mailman/listinfo/python-list
gf gf wrote:
If I want to dump (for debugging) an instance and all
of it's member attributes, what's the simplest way?
print myInstance
just gives a pointer to its location in memory
Roughly speaking, as a starting point:
from pprint import pformat
def dump(obj):
print repr(obj)
for name in
Is there a simple way to log to a debug console in
Python?
In .NET, you can Debug.Write(str), which does nothing
if there is no debug console open, but, if there is,
debugs the message. Is there something similar?
Alternatively, is there a very simple log4j type
setup? I emphasize very simple,
gf gf wrote:
Is there a simple way to log to a debug console in
Python?
In .NET, you can Debug.Write(str), which does nothing
if there is no debug console open, but, if there is,
debugs the message. Is there something similar?
Alternatively, is there a very simple log4j type
setup? I emphasize ve
Torsten Bronger wrote:
HallÃchen!
[EMAIL PROTECTED] (Paul Boddie) writes:
Torsten Bronger <[EMAIL PROTECTED]> wrote:
At first, I was very pleased by Python's syntax (and still I am).
Then, after two weeks, I learned about descriptors and
metaclasses and such and understood nothing (for the first
Maxim Kasimov wrote:
Diez B. Roggisch wrote:
Maxim Kasimov wrote:
there are a few questions i can find answer in manual:
1. how to define which is internal encoding of python unicode strings
(UTF-8, UTF-16 ...)
It shouldn't be your concern - but you can specify it using " ./configure
--enable-uni
Kent Johnson wrote:
It is in the latest docs.
Kent
No, it isn't. (But thanks for replying anyway!)
http://docs.python.org/lib/logging-config-fileformat.html
has all the others (OK, maybe not all, I haven't thoroughly checked, but
it's got nine of 'em) but nothing for RFH.
Or is that not "the la
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.
--
http://mail.python.org/mailman/listinfo/python-list
So I've encountered a strange behavior that I'm hoping someone can fill
me in on. i've written a simple handler that works with one small
exception, when the parser encounters a line with '&' in it, it
only returns the portion that follows the occurence.
For example, parsing a file with the lin
jrlen balane wrote:
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.
Use the "csv" module. Although that stands for "comma
separated values", it readily supports alternative
de
Rob Cranfill wrote:
Kent Johnson wrote:
It is in the latest docs.
No, it isn't. (But thanks for replying anyway!)
Can you prove it isn't? ;-)
http://docs.python.org/lib/logging-config-fileformat.html
has all the others (OK, maybe not all, I haven't thoroughly checked, but
it's got nine of 'em)
There are a bunch of new tests up at shootout.alioth.debian.org for which
Python does not yet have code. I've taken a crack at one of them, a task
to print the reverse complement of a gene transcription. Since there are a
lot of minds on this newsgroup that are much better at optimization than
I, I
Giovanni Bajo wrote:
Steven Bethard wrote:
I use something along these lines:
def safe_eval(expr, symbols={}):
return eval(expr, dict(__builtins__=None, True=True,
False=False), symbols)
import math
def calc(expr):
return safe_eval(expr, vars(math))
That offers only notional security:
>>> ca
Jacob Lee wrote:
By the way - is there a good way to find out the maximum memory a program
used (in the manner of the "time" command)? Other than downloading and
running the shootout benchmark scripts, of course.
Inserting appropriate pauses with raw_input() and recording the memory
usage using to
Giovanni Bajo wrote:
When __builtin__ is not the standard __builtin__, Python is in restricted
execution mode.
Do you know where this is documented? I looked around, but couldn't
find anything.
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
gf gf wrote:
Is there a simple way to log to a debug console in
Python?
Don't know exactly what you want, but you should check out the logging
module:
http://docs.python.org/lib/minimal-example.html
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Bellman wrote:
Torsten Bronger <[EMAIL PROTECTED]> wrote:
Just to amplify Thomas' statements...
...
And inflexibility will always make some situations horribly
daunting to get out of.
Powerful constructs like these can, in some cases, enable a
skilled package writer to design an API that
Jacob Lee wrote:
There are a bunch of new tests up at shootout.alioth.debian.org for which
Python does not yet have code. I've taken a crack at one of them, a task
to print the reverse complement of a gene transcription. Since there are a
lot of minds on this newsgroup that are much better at optim
Here's my solution to the problem[1]:
[1] http://shootout.alioth.debian.org/benchmark.php?test=revcomp
import sys
import string
basetable = string.maketrans('ACBDGHKMNSRUTWVYacbdghkmnsrutwvy',
'TGVHCDMKNSYAAWBRTGVHCDMKNSYAAWBR')
def revcomp(seqlines, linelength=60, base
Jacob Lee wrote:
There are a bunch of new tests up at shootout.alioth.debian.org for which
Python does not yet have code. I've taken a crack at one of them, a task
to print the reverse complement of a gene transcription. Since there are a
lot of minds on this newsgroup that are much better at optim
if i am going to do this, how should i continue:
how would i know the end of file?
table_data = open(filename, 'r')
table_data.readlines()
On Tue, 15 Mar 2005 23:37:50 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
> jrlen balane wrote:
> > how would i read a tab delimited file? at the same tim
> Peter Hansen wrote:
>
>>jrlen balane wrote:
>>
>>>how would i read a tab delimited file? at the same time put what i
>>>read in an array, say for example that i know that the file is an
>>>array with column= 5 and row=unknown.
>>
>>Use the "csv" module. Although that stands for "comma
>>separate
On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote:
> string.translate is a good idea. Note you can handle upper-casing and
> translation in one operation by adding a mapping from lower case to the
> complement i.e.,
>
> table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy',
>
jrlen balane <[EMAIL PROTECTED]> wrote:
>why is it that here:
>
>1)rx_data = ser.read(10)
>(rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
>pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data)
>print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
>pyra2,
On Tue, 15 Mar 2005 22:45:48 -0700, Steven Bethard wrote:
> # table as default argument value so you don't have to do
> # a global lookup each time it's used
>
> def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVY',
> 'TGVHCDM\nKNSYAAWBR')
> seq = s
Earl Eiland <[EMAIL PROTECTED]> wrote:
>
>A couple of you commented that I should be using os.path.join.
>Accordingly, I rewrote my code. Unfortunately, I still have the same
>problem. the following code snippet
>
>Results.SetOriginal(os.path.getsize(os.path.join(InputDirectory , x)))
>y = str(x
Jacob Lee wrote:
So here's a tentative contest version of the code:
import sys
import string
def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy',
'TGVHCDM\nKNSYAAWBRTGVHCDMKNSYAAWBR')):
seq = seq.translate(table)[::-1]
for i in ra
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
> > Yeah, except I actually left out one thing: I also want type(v)==e1.
>
> Why? In Python usually you rely on duck-typing and not explicit type
> checks. What is it that you're trying to gain by asserting type(v) ==
On Tue, 15 Mar 2005 03:21:19 -0800, George Jempty wrote:
> I'm noticing that Javascript's array/"hash" literal syntax is EXACTLY the
> same as that for Python lists/dictionaries.
No it isn't, quite.
Two differences of note, one literally syntax and one technically not but
you probably still want
On Tue, 15 Mar 2005 03:21:48 -0800, Paul Boddie wrote:
> Well, I've been using Python for almost ten years, and I've managed to
> deliberately ignore descriptors and metaclasses quite successfully. I get
> the impression that descriptors in particular are a detail of the
> low-level implementation
Jacob Lee wrote:
On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote:
string.translate is a good idea. Note you can handle upper-casing and
translation in one operation by adding a mapping from lower case to the
complement i.e.,
table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy',
anon <[EMAIL PROTECTED]> writes:
> So I've encountered a strange behavior that I'm hoping someone can fill
> me in on. i've written a simple handler that works with one small
> exception, when the parser encounters a line with '&' in it, it
> only returns the portion that follows the occurence.
Gregor Horvath wrote:
thanks are given to all
"problem" solved...
Personally I add a , after every list/tuple item. Also the last.
It also makes copy/pasting code easier.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Sara Khalatbari <[EMAIL PROTECTED]> wrote:
>Dear friends
>In a code, I'm opening a file to read. Like :
>lines = open(filename).readlines()
>& I'm never closing it.
>I'm not writing in that file, I just read it.
>
>Will it cause any problems if you open a file to read
>& never close it?
A fil
Tiziano Bettio <[EMAIL PROTECTED]> wrote:
>
>I'm looking for a simple solution of a win32 shell extension (virtual
>drive).
>
>It should make available a new drive with letter, which will be
>read-only. Instead of a network drive or similar it then should query a
>server application for directory/f
201 - 238 of 238 matches
Mail list logo