your whining and get used to the idea that THE REST OF
THE WORLD uses PC to mean a Windows box.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpWskQ7X4hnX.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
ign mentioning PCs is
less than 10 years old (though I can't quickly find any references as
to the date). The popularization of the term PC to refer to
Intel-compatible machines running Microsoft OSes PREDATES APPLE'S AD
CAMPAIGN BY OVER 10 YEARS.
Therefore none of your points are val
t sell PCs. Apple's personal
computer is NOT a PC, and never was, and never will be. It's an
Apple.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpM3T8xzDRmR.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
aningful names, with fairly obvious and
well-understood exceptions.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpEV6qhBweow.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
def __init__():
@.increment = 2
def bar(a)
return a + @.increment
I'm sure all the Pythonistas will hate this idea though... ;-) To be
honest, it smacks a little of Perl's magic variables, which I actually
hate with a passion. This is the only p
o see what was used.
It's bad programming, but the world is full of bad programmers, and we
don't always have the choice not to use their code. Isn't one of
Python's goals to minimize opportunities for bad programming?
Providing a keyword equivalent to self and removing
wo good reason to keep it the way it is,
>which are simplicity (no special case) and consistency (no special
>case).
Clearly a lot of people find that it is less simple TO USE. The point
of computers is to make hard things easier... if there is a task that
is annoying, or tedious, o
he philosophy behind its design. THIS DOES
NOT RENDER WRONG OTHER TERMS OR USAGES. It merely augments the
already rich natural language we have to describe what we do.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpdANC3vBRJ5.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Apple started using it that way. And it does
not change the fact that you (and others like you) are being stubborn
by refusing to accept that simple truth. If you're unable to see that
by now, I don't imagine there's anything I can do to help you, so I
give up trying to convince you. [...and there was much rejoicing.]
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpjvVEriGABi.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
e.
Instead of just running xterm, you can run "xterm -e 'cmd foo bar'"
where cmd is the program to run and foo and bar are its arguments.
The problem is that as soon as the program exits, xterm will exit
also.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75
to use the above on files over 2Gb I get:
OverflowError: requested number of bytes is more than a Python string
can hold
Does anybody have an idea as to how I can get by this hurdle?
I am working in an environment that does not allow me to freely download
modules to use. Python version 2.5.1
R/S --
On Wed, Apr 02, 2008 at 10:59:57AM -0400, Derek Tracy wrote:
> I generated code that works wonderfully for files under 2Gb in size
> but the majority of the files I am dealing with are over the 2Gb
> limit
>
> ary = array.array('H', INPUT.read())
You're trying to r
On Wed, Apr 2, 2008 at 10:59 AM, Derek Tracy <[EMAIL PROTECTED]> wrote:
> I am trying to write a script that reads in a large binary file (over 2Gb)
> saves the header file (169088 bytes) into one file then take the rest of the
> data and dump it into anther file. I generated
On Wed, Apr 02, 2008 at 02:09:45PM -0400, Derek Tracy wrote:
> Both are clocking in at the same time (1m 5sec for 2.6Gb), are there
> any ways I can optimize either solution?
Buy faster disks? How long do you expect it to take? At 65s, you're
already reading/writing 2.6GB at
On Apr 3, 2008, at 3:03 AM, Paul Rubin <"http://
phr.cx"@NOSPAM.invalid> wrote:
> Derek Martin <[EMAIL PROTECTED]> writes:
>>> Both are clocking in at the same time (1m 5sec for 2.6Gb), are there
>>> any ways I can optimize either solution?
>
> G
---
Derek Tracy
[EMAIL PROTECTED]
---
On Apr 3, 2008, at 3:03 AM, Paul Rubin <"http://
phr.cx"@NOSPAM.invalid> wrote:
> Derek Martin <[EMAIL PROTECTED]> writes:
>>> Both are clocking in at the same time (1m
On Thu, Apr 03, 2008 at 02:36:02PM -0400, Derek Tracy wrote:
> I am running it on a RAID(stiped raid 5 using fibre channel), but I
> was expecting better performance.
Don't forget that you're reading from and writing to the same
spindles. Writes are slower on RAID 5, and you
s a test } missing close } BAD:
-> FAILED
Testing { a test ] this { a test } is a test } missing close [ BAD:
-> FAILED
Testing a test } { this { a test } is a test } BAD:
-> FAILED
Testing { a test } this { a test } is a test } BAD:
-> FAILED
In all cases, this code correctly identifies when the brackets are out
of order, or unbalanced.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgp2N52u418cU.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
uot;rm -rf directory"?
> If anyone can point me to some documentation I would be more than
> grateful.
I'd be happy to, but I can't imagine what sort of documentation would
help you. It sounds like what you want to do, basically, is write a
program to read commands from stdin
a == 0 or b == 0:
return True
return (abs(a) == a) == (abs(b) == b)
The first version *almost* works for the duplicitous zero:
>>> sign(-0, 1)
True
>>> sign(0, 1)
True
>>> sign(0, -1)
False
Close, but no cigar.
--
Derek D. Martin
http://www.pizzashack.org/
On Thu, Aug 21, 2008 at 05:17:41AM +, Marc 'BlackJack' Rintsch wrote:
> On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
>
> > How so? What could be easier than "rm -rf directory"?
>
> C:\>rm -rf directory
Yeah, except the application spe
l to see how it does what it does.
But, if I were you, I'd just download something like swatch, and be
done with it. :)
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpgsg6JnEM88.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
you are...
If you only want to learn to program to solve your own problems, then
it doesn't really matter. The only reason to learn additional
languages is if you find a case where what you've learned doesn't
solve your problem, or the solution is a lot harder than it should be.
On Wed, Aug 27, 2008 at 01:25:49AM -0300, Gabriel Genellina wrote:
> En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins
> >How can I get a list of available locales?
>
> I'd like to know how to retrieve that too...
On a Linux system (and likely most modern Unix systems): l
On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
> dirListFinal = []
> for item in dirList:
>print item
>if item.endswith('\\') == True:
if item[-1] == '\\':
--
Derek D. Martin
http://www.pizzas
On Fri, Aug 29, 2008 at 07:37:50PM +, Steven D'Aprano wrote:
> On Fri, 29 Aug 2008 14:46:53 -0400, Derek Martin wrote:
>
> > On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
> >> dirListFinal = []
> >> for item in dirList:
> >&
think you miss a
>
> grep -v grep
Indeed not. The brackets around the 'h' (which make it a character
class, or range if you prefer) prevent the regex from matching itself.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpsslNfAlrcv.pgp
Descriptio
s/provides. As such, "Popen" is a better name to describe this
object than "subprocess" would be.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpR91MGDIrTx.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
p.com/en/B9106-90010/popen.3S.html
http://www.faqs.org/docs/artu/ch07s02.html
The Linux man page unfortunately copies (verbatim) the FreeBSD man
page, which gets it wrong. You can not open a process, but you can
definitely open a pipe.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpmN360qDTwf.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
folks felt the need to quote "open", indicating
that clearly they knew that no process is being "opened" by the
function call. You start processes, you don't open them. This should
have been a clue to the BSD manual page writer that they had the sense
wrong; it's ver
on, but it is only that: an opinion. Yet some of you
state your case as if it is incontrovertable fact. I've given a good
case as to why it IS a good name (one which I genuinely support), and
disagree as you may, none of the points any of you have made
invalidate or even wea
On Tue, Sep 02, 2008 at 10:55:54PM +, Marc 'BlackJack' Rintsch wrote:
> On Tue, 02 Sep 2008 18:15:07 -0400, Derek Martin wrote:
>
> >> Classes represent "things", and class names should be nouns.
> >
> > Is that a law?
>
> It's a com
On Wed, Sep 03, 2008 at 12:20:18AM -0400, Miles wrote:
> Derek Martin wrote:
> > On Tue, Sep 02, 2008 at 10:55:54PM +, Marc 'BlackJack' Rintsch wrote:
> >> but the instances of `Popen` are no actions. There's no way to
> >> "execute" a `Pop
On Wed, Sep 03, 2008 at 12:20:18AM -0400, Miles wrote:
> Derek Martin wrote:
> > On Tue, Sep 02, 2008 at 10:55:54PM +, Marc 'BlackJack' Rintsch wrote:
> >> but the instances of `Popen` are no actions. There's no way to
> >> "execute" a `Pop
On Wed, Sep 03, 2008 at 06:40:10AM +, Marc 'BlackJack' Rintsch wrote:
> On Tue, 02 Sep 2008 19:54:12 -0400, Derek Martin wrote:
>
> >> And if they model an action there must be some way to activate the
> >> action
> >
> > That's a reasonab
On Wed, Sep 03, 2008 at 03:16:00PM -0700, Dennis Lee Bieber wrote:
> On Wed, 3 Sep 2008 03:09:18 -0400, Derek Martin <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> >
> > struct run {
> > int speed;
> > direction_type di
Sorry for the noise, my recent posts seem to have been eaten by the
list management software, as far as I can tell. Just testing if
that's still the case.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgp611hi0GmSx.pgp
Description: PGP signature
--
[0]
>>> find_needle_in_haystack([1,2,3], ["a","b",1,2,3,"9"])
>>>
[2]
>>> find_needle_in_haystack([1,2,3], ["a","b",1,2,3,"9","q",1,2,3])
>>>
[2, 7]
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpNKYFN6mu45.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
ou optimized,
I think you're better off leaving the optimizations out, for the sake
of code clarity.
At the very least, if you're going to write complicated optimizations,
you ought to have explained what you were doing in comments... :)
--
Derek D. Martin
http://www.pizzashack.org/
GPG
On Mon, Sep 29, 2008 at 04:12:13AM -0700, [EMAIL PROTECTED] wrote:
> Derek Martin:
> >Unless you're doing lots and lots of these in your application,<
>
> I don't agree. That's library code, so it has to be efficient and
> flexible, because it's designed
Again!
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
assed parameter value. Am I on the right track?
Thanks,
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
s variables is bad because they are not
related to the state of the "PeptideEvaluator". How can I avoid having
to pass the same parameters all over a class? I can';t quite seem to
wrap my head around this one.
Thanks again everyone,
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
What is the best way to count nested loop iterations? I can only figure
to use an index but that seems kludgy.
index = 0
for animal in zoo:
for color in animal:
index += 1
Thanks,
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> what's kludgy with using a counter to count things ?
Ohhh, nothing in particular. Just seeing if there is a better way to do
it.
> (the real question here is of course why you need the counter. what's
> the loop doing? if the code you posted is all you have, you can rep
> Depending on the types of the containers in question, you could use:
>
> len(zoo) * len(animal)
I think this would give me the total iterations but I wouldn't be able
to get a running count. Correct?
Thanks for the reply,
Derek Basch
--
http://mail.python.org/mailman/l
Carl Banks wrote:
> But even the clear version isn't as nearly clear and straightforward as
> the nested fors with the counter. I wouldn't forsake that clarity just
> so it isn't "kludgy".
>
>
> Carl Banks
Yeah, looks like using the counters is cleare
How can I return:
".666"
from float:
"0.666"
This is what I have so far:
>>> "%.6f" % x
Thanks Everyone,
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
Ahh yes you have to put parenthases around the string formatting to
remove the integer using indexes. Thanks, that's just what I needed!
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
(i,))
thread_list.append(x)
i+=1
while True:
pass
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgphh3xk5mOZY.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Aug 18, 2009 at 03:10:15PM -0500, Derek Martin wrote:
> I have some simple threaded code... If I run this
> with an arg of 1 (start one thread), it pegs one cpu, as I would
> expect. If I run it with an arg of 2 (start 2 threads), it uses both
> CPUs, but utilization of both
hout a community for the sake of avoiding a minor
inconvenience of the n00b is DUMB.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgp5360ytwKYC.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
a few of the other
seemingly arbitrary changes in 3.x) is annoying, but Python is still
one of the best languages to code in for any multitude of problems.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpqtjVMR59uV.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
— and we continue to think of them
> as decimal numbers regardless. Having the language syntax opposed to
> that is
...consistent with virtually every other popular programming language.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpaLprG9uUPz.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
write 0o12 instead of 012.
Computer languages are not write-only, excepting maybe Perl. ;-)
Writing 0o12 presents no hardship; but I assert, with at least some
support from others here, that *reading* it does.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgp2DtXpzfNjd.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
sent octal).
Including Python, for some 20 years or so.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpf8DJDYdSjx.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Aug 23, 2009 at 06:13:31AM +, Steven D'Aprano wrote:
> On Sat, 22 Aug 2009 22:19:01 -0500, Derek Martin wrote:
> > On Sat, Aug 22, 2009 at 02:55:51AM +, Steven D'Aprano wrote:
> >> And the great thing is that now you get to teach yourself to sto
rogramming. The
changing of this syntax seems like much ado about nothing to me, and
as such is annoying, consider that I use it very often.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpJdmZ75Hu7Q.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Aug 24, 2009 at 08:56:48AM -0500, Derek Martin wrote:
> On Sun, Aug 23, 2009 at 01:13:32PM +, Matthew Woodcraft wrote:
> > A more common case is dates.
>
> I suppose this is true, but [...]
> I tend to also discount this example, because when we write dates
&g
e (e.g. virtually anything that came out of
Microsoft). [That's just my opinion, of course... but shared by many.
:)] I don't think that happened by mere accident. That's not to say
they were perfect, but those guys had their proverbial $#!t together.
--
Derek D. Martin
http://www.
On Mon, Aug 24, 2009 at 08:31:13AM -0700, Carl Banks wrote:
> On Aug 24, 6:56 am, Derek Martin wrote:
> > I think hard-coding dates is more uncommon than using octal. ;-)
> > [It unquestionably is, for me personally.]
>
> You just don't get it, do you?
I think
, just
> like trailing zeroes after the decimal point:
>
> 9 = 09 = 009 = 9.0 = 9.00 = 0009.000 etc.
Dude, seriously. No one ever *uses* leading zeros in the context of
mathematics except in 2nd grade math class.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE7
On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote:
> On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote:
> > since the old syntax is prevalent both within and without the
> > Python community, making the change is, was, and always will be a
> > bad id
On Mon, Aug 24, 2009 at 04:40:14PM -0300, Gabriel Genellina wrote:
> En Mon, 24 Aug 2009 14:40:24 -0300, Derek Martin
> escribió:
>
> >Why is it so hard for you to accept that intelligent people can
> >disagree with you, and that what's right for you might be bad for
&g
7;s right. BIZZARE.
Of course, none of this is real. In the end, it's all just a bunch of
wires that either have current or don't. It's only how *WE* organize
and think about that current that gives it any meaning. So you're
free to think about it any way you like.
--
Derek
that they are just an abstraction on top of
current, as noted before). Python's model breaks down at that point;
it is not so with most other types of objects... their values remain
objects. And *that* is inconsistent. The same is true of character
data as for numeric data. And that, I
ython work will be.
While I did genuinely find the behavior bizarre when I encountered it,
and honestly still do, I learned it quickly and moved past it. I'm
not suggesting that it be changed, and I don't feel particularly
strongly that it even should change. It's not so much the l
On Sun, Aug 30, 2009 at 04:26:54AM -0700, Carl Banks wrote:
> On Aug 30, 12:33 am, Derek Martin wrote:
> [snip rant]
I was not ranting. I was explaining a perspective.
> > THAT is why Python's behavior with regard to numerical objects is
> > not intuitive, and frankly bi
ngs look like something familiar, but behave differently, they are
naturally unintuitive.
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgpMl4G8ABoo7.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Aug 30, 2009 at 05:43:42PM +, OKB (not okblacke) wrote:
> Derek Martin wrote:
>
> > If Python is to say that objects have values,
> > then the object can not *be* the value that it has, because that is a
> > paradoxical self-reference. It's an object, not
HI, I am trying to use python 3.10-1 on windows but, When I try to open
python, it crashes. Anaconda also does not work. When I try to use the
powershell, it gives me an error message saying that this is not recognized
as a valid cmdlet. Please help.
--
https://mail.python.org/mailman/listinfo/pyt
there any way I can get the size of a PyCodeObject so that I could
save it to a binary file? If I did that would it run correctly if I
reloaded it and tried to Eval it? Can I load a pyc file from memory
somehow?
Any guidance would be greatly appreciated.
Thanks,
Derek
--
http://mail.python.org/m
Another thing which may be important to note re: my constraints is that
each script is essentially being run as a function.
In fact, every script element I parse in XML gets wrapped in a function
def before I send it to Py_CompileString.
I then PyEval the result of that function, and then run
Py_
I probably should have also mentioned that my application is written in
C++ and using the Python/C API.
--
http://mail.python.org/mailman/listinfo/python-list
Using the Python/C API, is there a way I can import a pyc file that I
have in memory (as opposed to loading from disk)?
I'm trying to save compiled python code in a proprietary file format to
cut reduce the overhead of compiling all my scripts when my app starts
up.
Derek
--
Up to now, I've had all my python scripts defined in XML elements,
which were compiled when my program started up using Py_CompileString.
This has worked great, but I'm finding that most of the time my app
uses to start up is spent in that Py_CompileString, because of the
large number of scripts th
The second method you describe sounds like it is along the lines of
what I need to do. Is there a way to do this using the Python/C API?
For instance, if I have the contents of a pyc file loaded entirely into
memory, and I have a pointer to the beginning of the file and the size
in bytes at my dis
I do have to do everything you describe here in the current
implementation of my system. I realize that importing a pyc file and
compiling a string results in two different things. This is okay though
as I'm fairly sure this will still suit my needs.
As I said, the file format I plan to store thes
I’ve just begun a serious study of using Python as an aspiring programmer/data
scientist.
Can someone please walk me through how to download Python, SO THAT I will be
able to import numpy?
Thanks,
Derek
Sent from Mail for Windows 10
--
https://mail.python.org/mailman/listinfo/python-list
101 - 179 of 179 matches
Mail list logo