How about:
mov = open(afile)
line = mov.readline()
...(process your ':' line)
for line in mov.readlines():
...
On May 20, 1:34 pm, [EMAIL PROTECTED] wrote:
> i have a big file with sentences, the first file of each sentence
> contains a colon(:) somewher eon that line
> i want to jump past th
--
http://mail.python.org/mailman/listinfo/python-list
" for more information.
>>> a = 1e16-2.
>>> a
9998.0
>>> a+0.999 # gives expected result
9998.0
>>> a+0. # doesn't round correctly.
1.0
The last result here should be 9998.0,
not 100
ug report: it's
not clear how to fix this, or whether it's worth fixing, but it
seems like something that should be documented somewhere...
Thanks again, everyone!
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ly, it looks as though libm (and hence the Python
math module) might need the extended precision: on my machine
there's a line in /usr/include/fpu_control.h that says
#define _FPU_EXTENDED 0x300 /* libm requires double extended
precision. */
Mark
--
http://mail.python.org/mailman/listinfo/python-list
d the above mentioned paper; I found it
extremely helpful.
http://bugs.python.org/issue2937
Mark
--
http://mail.python.org/mailman/listinfo/python-list
f math.pi.
math.pi is exactly equal to 884279719003555/281474976710656,
which is the closest C double to the actual value of pi.
The problem in (2) occurs because floating-point numbers
are stored in binary, but printed in decimal.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
)
George
tagData still contains your data, but it is being displayed two different
ways. Consult the documentation about str() and repr().
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I need to generate single EXEcutable via PyInstaller.
It will be genereated -> i get one single executable.
AFTER CALL (exe) I get an error: "no module named _gt"
Build command:
1. Configure.py
2. Makespec.py -F
xcept myff()"
-
出错提示为 ctypes.ArgumentError: argument 1: 'exceptions.TypeError'>:
Don't know how to convert parameter 1
这是什么原因?
--Mark (马克)
--
http://mail.python.org/mailman/listinfo/python-list
r(value)) # call the function with a pointer
to the instance
value
c_long(10)
Hope that helps.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
ath,abspath
x=r'\foo\\bar/baz//spam.py'
normpath(x)
'\\foo\\bar\\baz\\spam.py'
normpath(abspath(x))
'C:\\foo\\bar\\baz\\spam.py'
normpath(abspath(x)).split(os.sep)
['C:', 'foo', 'bar', 'baz', 'spam.py']
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
rftime('%I:%M:%S %p',localtime(time()))
'07:23:24 AM'
strftime('%I:%M:%S %p',gmtime(time()))
'02:23:39 PM'
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
look at Norvig's analysis which supports your view
about Python being slow.
http://norvig.com/python-lisp.html
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> This is bogus about 95% of the time though. For the cases where it is
> really desired, I think it's best to require the target class to be
> enable it specifically somehow, maybe by inheriting from a special
> superclass. That could let the compiler statically resolve membe
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> How about #define class struct
Won't work. Consider `template ...'.
-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list
Russ P. <[EMAIL PROTECTED]> wrote:
> The idea of being able to discern properties of an object by its name
> alone is something that is not normally done in programming in
> general.
Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML,
or Erlang then. And that's just the ones
Fuzzyman <[EMAIL PROTECTED]> wrote:
> So, you are stating that no API programmer using Python *ever* has a
> valid or genuine reason for wanting (even if he can't have it) genuine
> 'hiding' of internal state or members from consumers of his (or
> her...) API?
I don't want to speak for whoever yo
Johannes Bauer <[EMAIL PROTECTED]> wrote:
> import time
> localtime = time.localtime(1234567890)
> fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % (localtime[0], localtime[1],
> localtime[2], localtime[3], localtime[4], localtime[5])
> print fmttime
>
> fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % ([l
t os.path.abspath(__file__)
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
y idea...
Best Regards
Mark
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
--
http://mail.python.org/mailman/listinfo/python-list
e good enough
for plotting.
How straightforward any of this is depends entirely on the nature of
your functions.
Regards
Mark
On Jun 13, 7:34 am, [EMAIL PROTECTED] wrote:
> Is there anyway one could find ot the point of intersection between
> any two plotted functions and also display them usin
for i in range(10):
code = "%d + %d" % (i, i)
print eval(code)
Don't do this. You want
for idx in range(10):
setattr(self, 'checkbox_%i' % idx)
Assuming create_checkbox() is the function to create a checkbox, this will
create a list of 25 checkboxes::
checkbox = [create_checkbox() for i in xrange(25)]
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
asdf <[EMAIL PROTECTED]> wrote:
(Presumably nothing to do with the Common Lisp system-definition utility.)
> So for example if I know that var1=jsmith. Can I somehow do
> var1=User().
Something like this might work.
class User (object):
def __init__(me, name):
me.name = name
class Users
Michael Press <[EMAIL PROTECTED]> wrote:
> I already compiled and installed the GNU multiprecision library
> on Mac OS X, and link to it in C programs.
> How do I link to the library from Python?
You know that Python already supports multiprecision integer arithmetic,
right? If you desperately
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> [(not x%3 and not x%5 and "FizzBuzz") or (not x%3 and "Fizz") or (not x%5
> and "Buzz") or x for x in xrange(1,101)]
Rather unpleasant. Note that a number is zero mod both 3 and 5 if and
only if it's zero mod 15. But we can do better.
A simple
Duncan Booth <[EMAIL PROTECTED]> wrote:
> [['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i in
> xrange(1, 101)]
Cute! ;-)
-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list
g the results of a successful match will help you
debug the problems also.
matchobj = richre.match(value)
if matchobj:
print matchobj.group()
else:
print 'no match'
As written you will only get a successful match if your string starts with
a-zA-Z0-9, which is why #1 and #3 p
Terry Reedy <[EMAIL PROTECTED]> wrote:
> The lookup table is a constant. If made a tuple, it will be compiled as
> a constant (as least in 2.6, maybe 2.5).
Force of habit. I tend to work on lists by indexing and/or iterating,
and on tuples by destructuring, and choose types based on the kind
Jeff Keasler <[EMAIL PROTECTED]> wrote:
> In a scripting environment, I often want to strip some of the command
> line options off the argument list, and then pass the remaining
> options to another module that is deeper in the tool chain.
The difficulty is that you can't do an accurate parse wit
John Salerno <[EMAIL PROTECTED]> wrote:
> Generally speaking, what tools would I use to do this? Is there a built-in
> module for it?
There's paramiko (q.g.). I can't personally vouch for it, but it seems
popular... It seems to depend on a separate crypto library.
> Is Telnet and SSH even th
4 May 13 2004 aclget
12020 May 13 2004 aclput
115734 Jun 2 2004 adb
46518 Jun 4 2004 admin
66750 Sep 16 2002 ali
1453 Sep 15 2002 alias
28150 Jun 4 2004 alog
15 May 12 2005 alstat
'''.split('\n')
for line in data:
elements = line.split()
print '%-11s%-6s%-4s%-8
ine 1, in
ValueError: too many values to unpack
v1,v2,v3 = s.split(' ',2)# limit to two splits maximum
v1
'this'
v2
'is'
v3
'a test'
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
t;>> bin(13)
'0b1101'
Interestingly, unlike hex and oct, bin doesn't add a trailing
'L' for longs:
>>> bin(13L)
'0b1101'
I wonder whether this is a bug...
Mark
--
http://mail.python.org/mailman/listinfo/python-list
I typically use pass for a place holder.
try:
# Do some code here
var = 1 # For example
except:
pass
HTH,
Mark
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Ampedesign
Sent: Thursday, June 26, 2008 12:04 PM
To: python-list
You could set "I = 1j" at the start of your scripts. Then you can
happily write your complex numbers in the form:
3+4*I
Mark
--
http://mail.python.org/mailman/listinfo/python-list
'c']
slave2=[1,4,3,2]
Hope it is more clear now.
Thanks, leodp
How about:
master=[1,4,3,2]
slave1='d c b a'.split()
slave2=[1,2,3,4]
x=zip(master,slave1,slave2)
x.sort()
master,slave1,slave2=zip(*x)
master
(1, 2, 3, 4)
slave1
('d', 'a', 'b', 'c')
slave2
(1, 4, 3, 2)
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
or: _type_ must have storage info
x=c_int(5)# make an instance (C equiv. is "int x=5;")
px=pointer(x) # int* px = &x;
ppx=pointer(px) # int** ppx = &px;
x
c_long(5)
px
ppx
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
s a lack of agreement on what
'regular expression' means. Strictly speaking, PCREs aren't
regular expressions at all, for some values of the term
'regular expression'. See
http://en.wikipedia.org/wiki/Regular_expression
Mark
--
http://mail.python.org/mailman/listinfo/python-list
6) (
5, 7) (5, 8) (5, 9) (6, 0) (6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6) (6, 7)
(6,
8) (6, 9) (7, 0) (7, 1) (7, 2) (7, 3) (7, 4) (7, 5) (7, 6) (7, 7) (7, 8) (7,
9)
(8, 0) (8, 1) (8, 2) (8, 3) (8, 4) (8, 5) (8, 6) (8, 7) (8, 8) (8, 9) (9, 0)
(9,
1) (9, 2) (9, 3) (9, 4) (9, 5) (9, 6) (9, 7) (9,
Dieter Maurer <[EMAIL PROTECTED]> wrote:
> I met the following surprising behaviour
[code moved until later...]
> The apparent reason is that the free variables in nested generator
> definitions are not bound (to a value) at invocation time but only at
> access time.
No. This is about the diff
Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote:
> I just wanted to illustrate, that the speed of the given search is somehow
> related to the complexity of the engine.
>
> Btw, other pcre implementation are as slow as Python or "grep -P". I tried
> a sample C++-code using pcre++ (a wrapper
Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote:
> # perl -e '("a" x 10) =~ /^(ab?)*$/;'
> zsh: segmentation fault perl -e '("a" x 10) =~ /^(ab?)*$/;'
(Did you really run that as root?)
> It'd be interesting to know, how CL-PPCRE performs here (I don't know this
> library).
Stack o
list('foo')
a += list('bar')
a
['f', 'o', 'o', 'b', 'a', 'r']
b
['f', 'o', 'o', 'b', 'a', 'r']
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
ds a Decimal to the current context, and it also
(mistakenly, in my opinion) changes -0.0 to 0.0:
>>> +Decimal('-0.0')
Decimal("0.0")
>>> +Decimal('123456789123456789123456789123456789')
Decimal("1.234567891234567891234567891E+35")
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ata
(287454020,)
hex(data[0])
'0x11223344'
Yes, it treats the incoming data as big-endian. The Python data type
returned varies as needed to hold the value. You'd get the same results on
a big-endian and little-endian local machine. How the Python data type is
represented
g/peps/pep-0263.html for details
The encoding of the source file can be declared:
# coding: latin-1
units = u"°"
import test
test.units
u'\xb0'
print test.units
°
Make sure to use the correct encoding! Here the file was saved in latin-1,
but declared utf8:
# c
I'm trying to read one byte from stdin, without the newline.
If I try something like:
>>> import os, sys
>>> os.read(sys.stdin.fileno(),1)
I can input a character, but then I have to press enter, which leaves
a newline character in the stdin buffer and requires two keypresses.
Is there any
te('abcde'))
...
eee
dee
dde
ddd
cee
cde
cdd
cce
ccd
ccc
bee
bde
bdd
bce
bcd
bcc
bbe
bbd
bbc
bbb
aee
ade
add
ace
acd
acc
abe
abd
abc
abb
aae
aad
aac
aab
aaa
Generalization left as an exercise for the reader.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
o handle this style for
loop in Python and haven't been able to find an appropriate way to handle
this control style. We have this style for loop all over the place and not
being able to find a similar structure in Python could be a problem. Any
pointers to a Python equivalent structure would be much appreciated
- Mark
--
http://mail.python.org/mailman/listinfo/python-list
n yes, I'd agree that's less than ideal, though I
don't consider it a particularly serious bug.
It's been on my list of things to fix for a while.
(See http://bugs.python.org/issue1869 ).
Contributions welcome!
Mark
--
http://mail.python.org/mailman/listinfo/python-list
rintf
does correct rounding:
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 3499.35
>>> x
3499.34999
>>> print '%.1f' % x
3499.3
>>> print round(x, 1)
3499.4
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 19, 12:20 am, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> > for more information. But I'm guessing that you're
> > questioning the fact that a value that's apparently
> > *le
ith_statement
class ExceptionManager(object):
def __enter__(self):
pass
def __exit__(self,exc_type,exc_value,tb):
if exc_type == IOError:
print 'IOError',exc_value[1]
return True # suppress it
with ExceptionManager():
with open('test.txt') as f:
f.read()
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
_', '__file__', 'func', '__name__', 'os', '__doc__']
Traceback (most recent call last):
File
"C:\dev\python\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 414, in ImportFile
exec codeObj in __main__.__dict__
File "", line 1, in
File "test.py", line 10, in
func()
File "test.py", line 7, in func
print os
UnboundLocalError: local variable 'os' referenced before assignment
Check in the function that caused the error to see if later in the code the
module name is being used as a local variable.
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
tions?
Try:
cbfunc = CFUNCTYPE(c_int, c_char_p, c_int)
ctypes understands c_char_p as a null-terminated character string and will
pass a string to your callback instead of a list of ints.
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
I am inside a Pdb-like Plone debugging tool and I get the following
error at the prompt. I was wondering how to find out from inside the
debugger which namespace the collective.dancing.channel object is
located in. :
collective.dancing.channel.tool_added(DelegateNichols.portal_newsletters,
None)
c
Never mind. I had to run "import collective.dancing" first.
--
http://mail.python.org/mailman/listinfo/python-list
On 7 Aug, 21:10, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Aug 7, 1:12 pm, Beliavsky <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Aug 6, 4:08 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
>
> > > On Aug 6, 2:56 pm, Edward Cormier <[EMAIL PROTECTED]> wrote:
>
> > > > Which computer books are the best
make fails:
There was a thread on the Pythonmac-SIG about this recently. See e.g.
http://mail.python.org/pipermail/pythonmac-sig/2008-June/020095.html
and the following messages.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> You could do it "in place" in all those systems afaik, either opening
> the file for both reading and writing, or using something like mmap.
> Basically you'd leave the file unchanged up to line N, then copy lines
> downward starting from line N+1. At the end you'd use ftrunc
Paddy <[EMAIL PROTECTED]> wrote:
> Why not use the fileinput modules functionality to iterate over a file
> in-place,printing just those lines you want?
>From the Python 2.5 manual:
: *Optional in-place filtering:* if the keyword argument `INPLACE=1' is
: passed to `input()' or to the `FileInput
.isdigit() -> bool
Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Astan Chee <[EMAIL PROTECTED]> wrote:
> I have a math function that looks like this
> sin (Theta) = 5/6
> How do I find Theta (in degrees) in python?
import math
theta = math.asin(5/6) * 180/math.pi
-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list
en fixed for Python 3.0.
It was decided not to risk breakage by changing this in
Python 2.x. See:
http://bugs.python.org/issue1779
Mark
--
http://mail.python.org/mailman/listinfo/python-list
iate place in the documentation. And
I agree that it could be made clearer exactly what strings are
acceptable here.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
16.
The only base 0 versus base 10 difference I could find was the
following:
>>> int('033', 0)
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal for int() with base 0: '033'
[38720 refs]
>>> int('033')
33
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 7, 3:53 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> The only base 0 versus base 10 difference I could find was the
> following:
>
> >>> int('033', 0)
>
> Traceback (most recent call last):
> File "", line 1, in
> ValueError:
On Apr 7, 4:59 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Mark Dickinson" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> Thank you for the corrections. Here is my revised proposal:
>
> int([number | string[, radix])
&g
ation) and on the number of bits required to
represent 10**600.
You're not going to learn much about math function implementations
from mathmodule.c: all it does it wrap the platform libm functions.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
airly efficient.
An alternative representation that's gained popularity recently is
DPD (densely packed decimal), which packs 3 decimal digits into 10
bits in a clever way that allows reasonably efficient extraction
of any one of the 3 digits. Decimal doesn't use this either. :)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
on my todo list to try this, but so far down that it's
not looking like it'll end up at the top of the list before
Christmas 20??.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
e:
>>> x = -0.5 + 2**-54
>>> x # not an exact half...
-0.49994
>>> x % 1 # ... and yet x%1 == 0.5
0.5
But for x positive, it should be safe. And for this
particular application, it turns out that it doesn't
matter: it gives the right result
'll get many takers for this point of view. If X is
a random variable uniformly distributed on the interval [0, 1) then
the probability that X == 0.5 is indeed exactly 0, using conventional
definitions. (And if you're not using conventional definitions, you
should say so)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
ents don't change the fact that the
average rounding error is strictly positive for positive
quantized results, under round-half-away-from-zero.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
a "real" NNTP client for whatever platform you're on and
give its spam filter a shot; clearly Google is not interested in
fighting spam itself.
--
Mark Shroyer
http://markshroyer.com/contact/
--
http://mail.python.org/mailman/listinfo/python-list
lidOperation: 0 ** 0
Most mathematicians consider 0**0 to be either 1 or undefined. Which
answer you get depends on who you ask (or in Python, whether you're
working with floats or Decimals, as you see above).
Mark
--
http://mail.python.org/mailman/listinfo/python-list
both operands are zero, or if the left-hand operand is less than
zero and the right-hand operand does not have an integral value[7] or
is infinite, an Invalid operation condition is raised, the result is
[0,qNaN], and the following rules do not apply."
I'm hoping that this will change
In article <[EMAIL PROTECTED]>,
Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2008-04-16, Mark Shroyer <[EMAIL PROTECTED]> wrote:
> > In article
> ><[EMAIL PROTECTED]>,
> > Mensanator <[EMAIL PROTECTED]> wrote:
> >
> >> On Apr
bdsatish <[EMAIL PROTECTED]> wrote:
> How does (a/b) work when both 'a' and 'b' are pure integers ?
>
>>> (9/2)
> 4
>
>>> (-9/2)
> -5
>
> Why is it -5 ? I expect it to be -4 ? Because, in C/C++, 9/2 is 4 and
> so negative of it, (-9/2) is -4.
Some background on the situation:
Integer division and
Is there an easy_installable egg with an interface to libtidy? I
found µTidy, but it looks like an inactive project, with no updates
since 2004, so I'm skeptical of its reliability. I found mxTidy, but
it's only available as part of some larger distribution, and I don't
want to replace my Python
You could use the module compileall to create .pyc and .pyo
(http://www.python.org/doc/1.5.1p1/tut/node43.html)
and do this in your %build stage.
Or if you don't need to ship them, strike them from the package as they will
be generated as necessary.
On 4/17/08 2:19 PM, "John Sutherland" <[EMAI
message is actually trying to tell you is that
you are attempting to call a module as a function somewhere -- and in
this particular case, I think it's referring to the time module. Are
you sure that line 98 in Hook_m.py should not instead be:
dt = self.Date(time.time())
The time mod
luge of backscatter and filling up your inbox,
should be groveling on their knees and begging *you* for forgiveness. ;)
(I haven't seen any such spam messages myself; but the way I'm set up, I
wouldn't receive them even if that is the case.)
--
Mark Shroyer, http://marks
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:
> If anyone has time, I was wondering if you could share your thoughts
> on whether this is an efficient way to do something like this, if it's
> horrible and slow, etc.
If your lists are fairly short then your algorithm is probably the best
way to d
sven _ <[EMAIL PROTECTED]> wrote:
> In short: unless specifically told not to, normal C stdio will use
> full output buffering when connected to a pipe. It will use default
> (typically unbuffered) output when connected to a tty/pty.
Wrong. Standard output to a terminal is typically line-buffere
Mitko Haralanov <[EMAIL PROTECTED]> wrote:
> value = PyDict_GetItem (new_dict, key);
You're not calling Py_DECREF on this value are you? That's a no-no,
since you're borrowing the dictionary's reference.
-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> Harishankar <[EMAIL PROTECTED]> wrote:
>> 1. Create non-blocking pipes which can be read in a separate thread
>> [...]
>
> You are correct on both of those points.
I must be missing something. What's wrong with spawning the subprocess
with subprocess
Kenneth McDonald <[EMAIL PROTECTED]> wrote:
> Sadly.
python-beautifulsoup is a Debian package, so
ftp://ftp.debian.org/debian/pool/main/b/beautifulsoup/beautifulsoup_3.0.4.orig.tar.gz
should be a copy of the (unmodified) upstream source.
-- [mdw]
--
http://mail.python.org/mailman/listinfo/p
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> Because Python doesn't follow the "boxed variables" model.
Be careful here. `Boxed types' or `boxed objects' is a technical term
essentially meaning `heap-allocated objects, probably with reference
semantics', which Python most definitely does use
Harishankar <[EMAIL PROTECTED]> wrote:
> On Wednesday 23 Apr 2008 15:11:21 Ben Kaplan wrote:
>> I don't know about all Linux distros, but my Ubuntu machine (8.04 Beta),
>> has the 'TERM' (xterm) and 'COLORTERM' (gnome-terminal) keys in os.environ.
> This is set on Debian too. Thanks. I should be ab
So the return value from getopt.getopt() is a list of tuples, e.g.
>>> import getopt
>>> opts = getopt.getopt('-a 1 -b 2 -a 3'.split(), 'a:b:')[0]; opts
[('-a', '1'), ('-b', '2'), ('-a', '3')]
what's the idiomatic way of using this result? I can think of several
possibilities.
For options not a
Eric Wertman <[EMAIL PROTECTED]> wrote:
> I have a set of files with this kind of content (it's dumped from
> WebSphere):
>
> [propertySet "[[resourceProperties "[[[description "This is a required
> property. This is an actual database name, and its not the locally
> catalogued database name. The
file objects? Maybe unbuffered?
I think you meant:
while totalsent < len(data):
Python also has the sendall() function.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
pls dont learn it
Move on
The world is full enough of 9 to 5 coders
Mark> From: [EMAIL PROTECTED]> Subject: Newbie to python --- why should i learn
!> Date: Thu, 8 May 2008 03:25:17 -0700> To: [email protected]> > Hi,> > i
was reading/learning some hello wor
t problem is that the character in the OP's example string 'Ł' is not
present in the latin-1 encoding, but using utf-8 encoding demonstrates that
the full two-byte UTF-8 encoded character is collected:
>>> import urllib
>>> name = urllib.quote(u'Ł
Python author and trainer Mark Lutz will be teaching another
3-day Python class at a conference center in Longmont, Colorado,
on October 15-17, 2008.
This is a public training session open to individual enrollments,
and covers the same topics as the 3-day onsite sessions that Mark
teaches, with
chema:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
As can XML IDEs such as Stylus Studio and XML Spy.
-- Mark.
--
http://mail.python.org/mailman/listinfo/python-list
his requirement?
For other arithmetic operations: should the sum of a float and a
Decimal
produce a Decimal or a float? Why? It's not at all clear to me that
either of these types is 'higher up' the numerical tower than the
other.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
lessly.
But then there are a whole host of decisions one has to make
about rounding, significant zeros, ... (And then, as you point
out, Cowlishaw might come out with a new version of the standard
that does include interactions with floats, and makes an entirely
different set of decisions...)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
4601 - 4700 of 5838 matches
Mail list logo