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
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
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 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
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
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
>>> 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
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
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
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
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
d1
--
http://mail.python.org/mailman/listinfo/python-list
"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
"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
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
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
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 +=
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,
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
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
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
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
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
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
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
> 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
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
> 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
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
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
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
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
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 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
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
> 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
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
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
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?
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
> 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: '
> 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
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
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
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 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
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
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
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
> 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
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
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
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
> 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,
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
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
101 - 156 of 156 matches
Mail list logo