Quoting "Russ P." :
> On Jan 24, 9:54 pm, Luis Zarrabeitia wrote:
> > Quoting "Russ P." :
> >
> > It is. For starters, I'd lose the information of "this attribute was
> intended to
> > be internal and I'm accessing it anyway".
>
> Not really. When you get a new version of the library and try to
Hi,
There is more than one way to write a list/tuple/dict in Python,
and actually different styles are used in standard library.
As a hobgoblin of little minds, I rather like to know which style is
considered "Pythonic"
in the community.
I collected common layout from existing code and pasted the
> and pasted them below.
> My vote would go to d1. How about yours?
>
>
Whatever reads best within the context of the specific code is Pythonic.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
i try to write a plugin system that i want to use to let users extend
a module that i write.
Within the module there is an extension loader that loads an extension
module. This extension module should be able to import modules from
my system, which provides some extensions.
Basically, this
On Jan 25, 2:18 am, Akira Kitada wrote:
> Hi,
>
> There is more than one way to write a list/tuple/dict in Python,
> and actually different styles are used in standard library.
> As a hobgoblin of little minds, I rather like to know which style is
> considered "Pythonic"
> in the community.
>
> I
On Sat, 24 Jan 2009 01:02:01 +0100, Дамјан Георгиевски wrote:
>>> I don't know what an IBQ is.
>>
>> +IBQ- seems to be the way your newsreader displays the dashes that
>> where in Ben's posting. I see "em dash" characters there:
>
> I see IBQ too ... also weird is that he has Content-Type: text
> Wow! A Python debate over curly brace placement! Imagine that!
PEP8 even deals with tabs vs spaces, where to put a blank line, etc :)
--
http://mail.python.org/mailman/listinfo/python-list
En Sat, 24 Jan 2009 21:51:31 -0200, MRAB
escribió:
Gabriel Genellina wrote:
> En Sat, 24 Jan 2009 18:23:51 -0200, MRAB
> escribió:
>
>> Some time ago I discovered this difference between regular
expressions
>> in Python and Perl:
>>
>> Python
>>
>> \A matches at start of string
When the date was Sunday 25 January 2009, Akira Kitada wrote:
> There is more than one way to write a list/tuple/dict in Python,
> and actually different styles are used in standard library.
I would vote for d1, but I don't think that this is more "pythonic", I just
consider it more "clean", acc
Simple Python programs edited and run through IDLE work fine on my Ubuntu
Linux system without any editing.
However on my Asus EEE PC IDLE complains about incorrect formatting
(indentation) or possibly mixing tabs/spaces. The source code is exactly
the same. There is no incorrect formatting and
On 23 Jan., 13:28, unine...@gmail.com wrote:
> Hi,
> I want to add some properties dynamically to a class, and then add the
> corresponding getter methods. Something resulting in this:
>
> class Person:
> def Getname(self):
> return self.__name
>
> def Getage(self):
> return
Akira Kitada writes:
> I collected common layout from existing code and pasted them below.
> My vote would go to d1. How about yours?
>
> If there is consensus on this, that might be worth being included in
> PEP 8.
>
> Thanks,
>
> """
> d1 = {
> 0: "ham",
> 1: "jam",
> 2: "spam",
On Sun, 25 Jan 2009 17:18:28 +0900, Akira Kitada wrote:
> Hi,
>
> There is more than one way to write a list/tuple/dict in Python, and
> actually different styles are used in standard library. As a hobgoblin
> of little minds, I rather like to know which style is considered
> "Pythonic"
> in the
On Sun, 25 Jan 2009 03:07:04 +0200, Oktay Şafak wrote:
> The reason is that when
> someone writes (-1 == True) he is clearly, definitely, absolutely asking
> for a boolean comparison, not a numerical one.
If I wrote (-1 == True), and I'm not sure why I would, I would expect to
get the answer Fal
> BTW, there's no need to use such large examples. Three items per dict
> would be sufficient to illustrate the styles, using ten items doesn't add
> anything useful to the discussion.
I worried to be told
'you can make it in a line like {"ham": "jam", "spam": "alot"}'
;)
--
http://mail.python.org
> These are the only two that follow PEP 8; the others don't have
> four-space indent levels.
In those examples, the following sentence in PEP 8 would be applied.
"Make sure to indent the continued line appropriately."
> I actually use this style:
>
>foo = {
>0: 'spam',
>1: '
Steve Holden wrote:
W. eWatson wrote:
W. eWatson wrote:
r wrote:
here is a good explanation of control vars:
http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html
Here are 3 great Tkinter refernces in order:
http://infohost.nmt.edu/tcc/help/pubs/tkinter/
http://effbot.org/tkint
Hello,
I'va read a text file into variable "a"
a=open('FicheroTexto.txt','r')
a.read()
"a" contains all the lines of the text separated by '\n' characters.
Now, I want to work with each line separately, without the '\n'
character.
How can I get variable "b" as a list of such lines?
vsoler schrieb:
Hello,
I'va read a text file into variable "a"
a=open('FicheroTexto.txt','r')
a.read()
"a" contains all the lines of the text separated by '\n' characters.
No, it doesn't. "a.read()" *returns* the contents, but you don't assign
it, so it is discarded.
Now, I wan
Hi,
this is to inform everybody about the availability of the Pylons plugin
for eric4. It adds Pylons support to the eric4 Python IDE. The Plugin is
available via the eric4 web site at
http://eric-ide.python-projects.org/index.html
What is eric4
-
eric4 is a Python IDE, that comes wi
> Is anybody else having trouble accessing sites (including www, docs,
> wiki) in the python.org tree, or is it just me? (Or just .au?)
Yes, connecting to python.org sites has been problematic
for me as well
I don't remember when the trouble started, but it's been
problematic for a
The idiomatic way would be iterating over the file-object itself - which
will get you the lines:
with open("foo.txt") as inf:
for line in inf:
print line
In versions of Python before the "with" was introduced (as in the
2.4 installations I've got at both home and work), this can
On 25 ene, 14:36, "Diez B. Roggisch" wrote:
> vsoler schrieb:
>
> > Hello,
>
> > I'va read a text file into variable "a"
>
> > a=open('FicheroTexto.txt','r')
> > a.read()
>
> > "a" contains all the lines of the text separated by '\n' characters.
>
> No, it doesn't. "a.read()" *returns* t
Cousin Stanley wrote:
>> Is anybody else having trouble accessing sites (including www, docs,
>> wiki) in the python.org tree, or is it just me? (Or just .au?)
>
> Yes, connecting to python.org sites has been problematic
> for me as well
>
> I don't remember when the trouble started,
On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> It is documented:
>
http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range
But then again, the opposite is also documented,
since `range` is a sequence type. Quoting:
Sequences also support
Alex van der Spek wrote:
Simple Python programs edited and run through IDLE work fine on my Ubuntu
Linux system without any editing.
However on my Asus EEE PC IDLE complains about incorrect formatting
(indentation) or possibly mixing tabs/spaces. The source code is exactly
the same. There is
http://downforeveryoneorjustme.com/
On Sun, Jan 25, 2009 at 10:06 AM, wrote:
> Hi all,
>
> Is anybody else having trouble accessing sites (including www, docs,
> wiki) in the python.org tree, or is it just me? (Or just .au?)
>
> Cheers,
>
> Tim
> --
> http://mail.python.org/mailman/listinfo/pyth
How to manage a module with several versions on MacOS X ?
All modules are installed in :
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pa
ckages/"
This is the default path for Mac.
But for some modules i need several version (stable 1.8.1 and test 1.9.0
for example : for p
> Take a look at the struct and ctypes modules.
struct is really not the choice. it returns an expanded string of the
data and this means larger latency over bluetooth.
ctypes is basically for the interface with libraries written in C
(this I read from the python docs)
--
http://mail.python.org
On Jan 25, 12:52 am, "Martin v. Löwis" wrote:
> > packet_type (1 byte unsigned) || packet_length (1 byte unsigned) ||
> > packet_data(variable)
>
> > How to construct these using python data types, as int and float have
> > no limits and their sizes are not well defined.
>
> In Python 2.x, use the
> Have you made some benchmarks like pystone?
> Cheers,
> Cesare
Cesare, hi, thanks for responding: unfortunately, there's absolutely
no point in making any benchmark figures under an emulated environment
which does things like take 2 billion instruction cycles to start up a
program named "c:/msy
Pierre-Alain Dorange schrieb:
How to manage a module with several versions on MacOS X ?
All modules are installed in :
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pa
ckages/"
This is the default path for Mac.
But for some modules i need several version (stable 1.8.1 an
In article ,
koranthala wrote:
> Is it possible somehow to have the logging module rotate the files
>every time I start it.
If you're on Linux, why not use logrotate?
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
Weinberg's Second Law: If builders built bui
Hi,
I'm attempting to read the first MB of a binary file and then do a md5
hash on it so that i can find the file later despite it being moved or
any file name changes that may have been made to it. These files are
large (350-1400MB) video files and i often located on a different
computer and I fi
Luke Kenneth Casson Leighton wrote:
>this is a progress report on compiling python using entirely free
>software tools, no proprietary compilers or operating systems
>involved, yet still linking and successfully running with msvcr80
>assemblies.
MSVCR80.DLL is part of the Microsoft Visual C++ ru
Max Leason wrote:
> Hi,
>
> I'm attempting to read the first MB of a binary file and then do a
> md5 hash on it so that i can find the file later despite it being
> moved or any file name changes that may have been made to it. These
> files are large (350-1400MB) video files and i often located on
Is there an efficient way to multi-slice a fixed with string into
individual fields that's logically equivalent to the way one
would slice a delimited string using .split()?
Background: I'm parsing some very large, fixed line-width text
files that have weekly columns of data (52 data columns plus
r
Ravi wrote:
>> Take a look at the struct and ctypes modules.
>
> struct is really not the choice. it returns an expanded string of the
> data and this means larger latency over bluetooth.
>
If you read the module documentation more carefully you will see that it
"converts" between the various nat
Hi,
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
class a(object):
counter = 0
def __new__(cls, *args, **kwargs):
a.counter += 1
return object.__new__(cls,
Kottiyath wrote:
> Hi,
> I am creating a class called people - subclasses men, women, children
> etc.
> I want to count the number of people at any time.
> So, I created code like the following:
>
> class a(object):
> counter = 0
> def __new__(cls, *args, **kwargs):
> a.counter +=
On 2009-01-25, Ravi wrote:
>
>> Take a look at the struct and ctypes modules.
>
> struct is really not the choice. it returns an expanded string of the
> data and this means larger latency over bluetooth.
I don't know what you mean by "returns an expanded string of
the data".
I do know that stru
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
> Hi,
> I am creating a class called people - subclasses men, women, children
> etc.
> I want to count the number of people at any time.
> So, I created code like the following:
>
> class a(object):
> counter = 0
> def __new__(cls
"Russ P." writes:
> Calling a one-word change a "fork" is quite a stretch, I'd say.
I wouldn't. I've forked a project P if I've made a different version of
it which isn't going to be reflected upstream. Now I've got to maintain
my fork, merging in changes from upstream as they happen, and upgr
"Russ P." writes:
> Imagine a person who repairs computers. He is really annoyed that he
> constantly has to remove the cover to get at the guts of the computer.
> So he insists that computers cases should be made without covers.
Poor analogy. He gets fed up that the computers he's meant to be
d1
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 25, 10:04 am, Mark Wooding wrote:
> "Russ P." writes:
> > Calling a one-word change a "fork" is quite a stretch, I'd say.
>
> I wouldn't. I've forked a project P if I've made a different version of
> it which isn't going to be reflected upstream. Now I've got to maintain
> my fork, mergi
Any suggestions on a best practice way to monitor a remote FTP
site for the arrival of new/updated files? I don't need specific
code, just some coaching on technique based on your real-world
experience including suggestions for a utility vs. code based
solution.
My goal is to maintain a local colle
pyt...@bdurham.com wrote:
Is there an efficient way to multi-slice a fixed with string into
individual fields that's logically equivalent to the way one would slice
a delimited string using .split()?
Background: I'm parsing some very large, fixed line-width text files
that have weekly columns
On Sun, Jan 25, 2009 at 7:27 AM, Ravi wrote:
>
> > Take a look at the struct and ctypes modules.
>
> struct is really not the choice. it returns an expanded string of the
> data and this means larger latency over bluetooth.
Noo... struct really IS the choice; that is the explicit purpose of the
>>> Take a look at the struct and ctypes modules.
>> struct is really not the choice. it returns an expanded string of the
>> data and this means larger latency over bluetooth.
>
> I don't know what you mean by "returns an expanded string of
> the data".
>
> I do know that struct does exactly wh
Steven D'Aprano writes:
> On Fri, 23 Jan 2009 21:36:59 -0500, Luis Zarrabeitia wrote:
>> It makes sense... if the original author is an egotist who believes he
>> must control how I use that library.
>
> Then I guess Guido must be such an egotist, because there's plenty of
> internals in Python
On Jan 25, 10:04 am, Mark Wooding wrote:
> > But what if I want an automatic check to verify that I am using it as
> > the author intended? Is that unreasonable?
>
> You mean that you can't /tell/ whether you typed mumble._seekrit?
> You're very strange. It's kind of hard to do by accident.
But
On Jan 26, 12:54 am, Tim Chase wrote:
> One other caveat here, "line" contains the newline at the end, so
> you might have
>
> print line.rstrip('\r\n')
>
> to remove them.
I don't understand the presence of the '\r' there. Any '\x0d' that
remains after reading the file in text mode and is rem
pyt...@bdurham.com wrote:
> Any suggestions on a best practice way to monitor a remote FTP site for
> the arrival of new/updated files? I don't need specific code, just some
> coaching on technique based on your real-world experience including
> suggestions for a utility vs. code based solution.
>
On 2009-01-25, Martin v. Löwis wrote:
>
Take a look at the struct and ctypes modules.
>>> struct is really not the choice. it returns an expanded string of the
>>> data and this means larger latency over bluetooth.
>>
>> I don't know what you mean by "returns an expanded string of
>> the dat
Steve Holden writes:
> No, you aren't mistaken. Looking at the "*" symbol in the 2.6
> documentation index it lists only two references. The first is the
> language manual's explanation of its use in the def statement, the
> second is a transitory reference to its use in function calls, but
> tha
>> I disagree. He has a format (type, length, value), with the
>> value being variable-sized. How do you do that in the struct
>> module?
>
> You construct a format string for the "value" portion based on
> the type/length header.
Can you kindly provide example code on how to do this?
> I don't
> Well, the ftpmirror will cope with most of what you want to do as it is, but
> I am unsure how you can determine whether a file is in the process
of being written on the server.
Looks like that may be a fit. Thank you Steve!
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 25 Jan 2009 08:37:07 -0800, Max Leason wrote:
> I'm attempting to read the first MB of a binary file and then do a md5
> hash on it so that i can find the file later despite it being moved or
> any file name changes that may have been made to it. These files are
> large (350-1400MB) video
Hi,
is there a way to make itertools.product generate triples instead of
pairs from two lists?
For example:
>>> list1 = [1, 2]; list2 = [4, 5]; list3 = [7, 8]
>>> from itertools import product
>>> list(product(list1, list2, list3))
[(1, 4, 7), (1, 4, 8), (1, 5, 7), (1, 5, 8), (2, 4, 7), (2, 4, 8
raise ValueError(errmsg("Expecting property name", s, end))
http://docs.python.org/library/json.html
What am I doing wrong ?
--
http://mail.python.org/mailman/listinfo/python-list
Akira Kitada writes:
> I collected common layout from existing code and pasted them below.
> My vote would go to d1. How about yours?
It seems that I use both d1 and d4, though in both cases I omit the
trailing commas. I use d1 when each item is on a separate line, and d4
when I'm packing them
On Jan 26, 2:28 am, Ravi wrote:
> On Jan 25, 12:52 am, "Martin v. Löwis" wrote:
>
> > > packet_type (1 byte unsigned) || packet_length (1 byte unsigned) ||
> > > packet_data(variable)
>
> > > How to construct these using python data types, as int and float have
> > > no limits and their sizes are
> Looks to me like there was already a reasonable way of getting a bytes
> object containing a variable number of zero bytes. Any particular
> reason why bytes(n) was given this specialised meaning?
I think it was because bytes() was originally mutable, and you need a
way to create a buffer of n b
gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.python.org/library/json.html
> What am I doing wrong ?
You need proper quotation marks:
>>> s = json.dumps({'test':'test'})
>>> s
'{"test": "test"}'
>>> json.loads(s)
{u'test': u'test'}
The JSON format is de
On Jan 26, 5:12 am, gert wrote:
> raise ValueError(errmsg("Expecting property name", s,
> end))http://docs.python.org/library/json.html
> What am I doing wrong ?
You use wrong quotes, it should be wrapped by double quotes not single
quotes. Read http://json.org/:
"A string is a collection of
Please include all relevant information in the *body* of your message,
not just in the subject. It's a pain having to piece a question back
together between the subject.
On Sun, 2009-01-25 at 13:12 -0800, gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.pyth
On 2009-01-23 08:26, kt83...@gmail.com wrote:
> My company provides some services online, which now they are planning
> to make it offline and sell to customers who can use it in their
> networks.
>
> One of our major moneywinners is some data which is stored in a
> database. Now, this data inside
On 2009-01-25, Martin v. Löwis wrote:
>> You construct a format string for the "value" portion based on
>> the type/length header.
>
> Can you kindly provide example code on how to do this?
OK, something like this to handle received data where there is
an initial 8-bit type field that is 1 for 1
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.python.org/library/json.html
> What am I doing wrong ?
try this
v = json.loads('{"test":"test"}')
JSON doesn't support single quotes, only double quotes.
--
дамјан ( http://softver.org.mk/damjan/ )
A: Because it revers
On Jan 25, 3:12�pm, Thorsten Kampe wrote:
> Hi,
>
> is there a way to make itertools.product generate triples instead of
> pairs from two lists?
>
> For example:>>> list1 = [1, 2]; list2 = [4, 5]; list3 = [7, 8]
> >>> from itertools import product
> >>> list(product(list1, list2, list3))
>
> [(1,
Hi,
Hereafter is an example using super.
At the execution, we obtain:
coucou
init_coucou2
coucou1
coucou2
Traceback (most recent call last):
File "essai_heritage.py", line 34, in
print b.a
AttributeError: 'coucou' object has no attribute 'a'
Why Python does not enter in the __init__ metho
On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
> > raise ValueError(errmsg("Expecting property name", s, end))
> >http://docs.python.org/library/json.html
> > What am I doing wrong ?
>
> try this
> v = json.loads('{"test":"test"}')
>
> JSON doesn't support single quotes, only double quotes.
the f
> dtype = ord(rawdata[0])
> dcount = struct.unpack("!H",rawdata[1:3])
> if dtype == 1:
> fmtstr = "!" + "H"*dcount
> elif dtype == 2:
> fmtstr = "!" + "f"*dcount
> rlen = struct.calcsize(fmtstr)
>
> data = struct.unpack(fmtstr,rawdata[3:3+rlen])
>
> leftover = rawdata[
En Sun, 25 Jan 2009 16:06:47 -0200, Andreas Waldenburger
escribió:
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
En Sun, 25 Jan 2009 16:06:47 -0200, Andreas Waldenburger
escribió:
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
gert schrieb:
On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
raise ValueError(errmsg("Expecting property name", s, end))
http://docs.python.org/library/json.html
What am I doing wrong ?
try this
v = json.loads('{"test":"test"}')
JSON doesn't support single quotes, only double quotes.
the fu
Xah Lee wrote:
For those of you using emacs, here's the elisp code that allows you to
syntax color computer language source code in your blog or website.
http://xahlee.org/emacs/elisp_htmlize.html
to comment, here:
http://xahlee.blogspot.com/2009/01/dehtmlize-source-code-in-emacs-lisp.html
Xah
TP schrieb:
Hi,
Hereafter is an example using super.
At the execution, we obtain:
coucou
init_coucou2
coucou1
coucou2
Traceback (most recent call last):
File "essai_heritage.py", line 34, in
print b.a
AttributeError: 'coucou' object has no attribute 'a'
Why Python does not enter in the
On 2009-01-25, Martin v. Löwis wrote:
>> dtype = ord(rawdata[0])
>> dcount = struct.unpack("!H",rawdata[1:3])
>> if dtype == 1:
>> fmtstr = "!" + "H"*dcount
>> elif dtype == 2:
>> fmtstr = "!" + "f"*dcount
>> rlen = struct.calcsize(fmtstr)
>>
>> data = struct.unpack(fmtstr
On Jan 25, 11:51 pm, "Diez B. Roggisch" wrote:
> gert schrieb:
>
> > On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
> >>> raise ValueError(errmsg("Expecting property name", s, end))
> >>>http://docs.python.org/library/json.html
> >>> What am I doing wrong ?
> >> try this
> >> v = json.loads('{"te
Cliff MacGillivray wrote:
> Xah Lee wrote:
>> For those of you using emacs, here's the elisp code that allows you
>> to syntax color computer language source code in your blog or
>> website.
>>
>> http:/
>>
>> to comment, here:
>> http://...
> Xah,
> Very nice!
> If nothing else you
One other caveat here, "line" contains the newline at the end, so
you might have
print line.rstrip('\r\n')
to remove them.
I don't understand the presence of the '\r' there. Any '\x0d' that
remains after reading the file in text mode and is removed by that
rstrip would be a strange occurrenc
>> Unfortunately, that does not work in the example. We have
>> a message type (an integer), and a variable-length string.
>> So how do you compute the struct format for that?
>
> I'm confused. Are you asking for an introductory tutorial on
> programming in Python?
Perhaps. I honestly do not know
But all of this is not JSON.
Yes it is, you just make it more python dictionary compatible :)
No, what you do is to make it more incompatible with other
json-implementations. Which defies the meaning of a standard.
Besides, {foo : "bar"} is *not* python dictionary compatible, at least
not
On 2009-01-25, Martin v. Löwis wrote:
>>> Unfortunately, that does not work in the example. We have
>>> a message type (an integer), and a variable-length string.
>>> So how do you compute the struct format for that?
>>
>> I'm confused. Are you asking for an introductory tutorial on
>> programmin
> It deals with variable sized fields just fine:
>
> dtype = 18
> dlength = 32
> format = "!BB%ds" % dlength
>
> rawdata = struct.pack(format, (dtype,dlength,data))
I wouldn't call this "just fine", though - it involves
a % operator to even compute the format string. IMO,
it is *much* better not
On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
wrote:
> gert schrieb:
> > {'test': 'test'}
> > {"test": "test"}
> >
> > It can not be that hard to support both notation can it ?
>
> It's not hard, but it's not standard-conform.
>
OK, playing the devil's advocate here: Doesn't practicali
En Sun, 25 Jan 2009 21:08:04 -0200, gert escribió:
On Jan 25, 11:51 pm, "Diez B. Roggisch" wrote:
gert schrieb:
> On Jan 25, 11:16 pm, Дамјан Георгиевски wrote:
>>> raise ValueError(errmsg("Expecting property name", s, end))
>>>http://docs.python.org/library/json.html
>>> What am I doing wro
Andreas Waldenburger wrote:
> On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
> wrote:
>
>> gert schrieb:
>>> {'test': 'test'}
>>> {"test": "test"}
>>>
>>> It can not be that hard to support both notation can it ?
>> It's not hard, but it's not standard-conform.
>>
> OK, playing the devil's
On 2009-01-25, Martin v. Löwis wrote:
>> It deals with variable sized fields just fine:
>>
>> dtype = 18
>> dlength = 32
>> format = "!BB%ds" % dlength
>>
>> rawdata = struct.pack(format, (dtype,dlength,data))
>
> I wouldn't call this "just fine", though - it involves
> a % operator to even comp
On Jan 26, 12:40 am, "Diez B. Roggisch" wrote:
> >> But all of this is not JSON.
>
> > Yes it is, you just make it more python dictionary compatible :)
>
> No, what you do is to make it more incompatible with other
> json-implementations. Which defies the meaning of a standard.
>
> Besides, {foo :
Hello,
I am writing an extension using shared memory. I need a data type
that is able to reassign its 'ob_type' field depending on what process
is calling it.
Object 'A' is of type 'Ta'. When process 'P' is looking at it, it
needs to have an 'ob_type' that is 'Ta' as process 'P' sees it. When
On Jan 25, 2:28 pm, Alan G Isaac wrote:
> On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> > It is documented:
> >http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-b...
>
> But then again, the opposite is also documented,
> since `range` is a sequence type. Quoting:
>
>
On 26/01/2009 10:34 AM, Tim Chase wrote:
I believe that using the formulaic "for line in file(FILENAME)"
iteration guarantees that each "line" will have at most only one '\n'
and it will be at the end (again, a malformed text-file with no terminal
'\n' may cause it to be absent from the last l
Is there an efficient way to multi-slice a fixed with string
into individual fields that's logically equivalent to the way
one would slice a delimited string using .split()? Background:
I'm parsing some very large, fixed line-width text files that
have weekly columns of data (52 data columns plus
John Machin wrote:
On 26/01/2009 10:34 AM, Tim Chase wrote:
I believe that using the formulaic "for line in file(FILENAME)"
iteration guarantees that each "line" will have at most only one '\n'
and it will be at the end (again, a malformed text-file with no
terminal '\n' may cause it to be ab
On Sun, 25 Jan 2009 19:04:44 -0500 Steve Holden
wrote:
> Andreas Waldenburger wrote:
> > On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
> > wrote:
> >
> >> gert schrieb:
> >>> {'test': 'test'}
> >>> {"test": "test"}
> >>>
> >>> It can not be that hard to support both notation can it ?
>
On Sun, 25 Jan 2009 17:34:18 -0600, Tim Chase wrote:
> Thank goodness I haven't found any of my data-sources using "\n\r"
> instead, which would require me to left-strip '\r' characters as well.
> Sigh. My kingdom for competency. :-/
If I recall correctly, one of the accounting systems I used e
On Sun, 25 Jan 2009 12:01:16 -0800, Russ P. wrote:
> On Jan 25, 10:04 am, Mark Wooding wrote:
>
>> > But what if I want an automatic check to verify that I am using it as
>> > the author intended? Is that unreasonable?
>>
>> You mean that you can't /tell/ whether you typed mumble._seekrit?
>> Yo
1 - 100 of 156 matches
Mail list logo