python --version reports 3.4.2, which is what I expected. I see no PYTHONPATH
variable, or any environment variable with a name beginning PY (either upper or
lower case).
--
https://mail.python.org/mailman/listinfo/python-list
It runs and creates a classes.txt file with 803 lines. The first few:
class 'str' - '$cpfile12'
class 'str' - '$crfile12'
class 'str' - '$cxfile12'
class 'str' - '*'
class 'str' - '.$cp'
class 'str' - '.$cr'
class 'str' - '.$cx'
class 'str' - '.386'
class 'str' - '.3ds'
A few lines in the middle
Not sure that would be a good idea: There are 22 such keys, as opposed to only
two keys with Windows ID strings that don't end in nulls. I found this article:
http://www.swarley.me.uk/blog/2014/04/23/python-pip-and-windows-registry-corruption/
with the comment If you are happy to completely
Fixed it!
The aforementioned article is correct. I downloaded the RegDelNull program
mentioned in the article
(http://technet.microsoft.com/en-us/sysinternals/bb897448.aspx) and ran it on
hkcr, hkcu, hklm, hku, and hkcc (short for HKEY_CLASSES_ROOT,
HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE,
Downloaded and installed 64-bit Python 3.4 and pywin32-219. Both installed
smoothly on my 64-bit Win7 machine. I added C:\Python34 to the search path.
If I launch a Windows command window and run
python -m ensurepip
I get the following:
Ignoring indexes:
andrew cooke and...@acooke.org wrote in message
news:mailman.464.1235320654.11746.python-l...@python.org...
as far as i understand things, the best model is:
1 - everything is an object
2 - everything is passed by reference
3 - some objects are immutable
4 - some (immutable?) objects are
Peter Otten [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
How do I do in Python?
if condition1 and condition2: #
doThis
elif condition3 or condition4: # ||
doThat
See the pattern?
if condition1 and condition2:
doThis
elif condition3 or condition4:
doThat
--
Gary Herron [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
return chr( random.randrange(0, 26) + [26,97][random.randrange(0,
100) 50]
return chr(random.randrange(0, 26) + (97 if random.randrange(0,100) 50
else 26))
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I want to emphasize a point here, as i have done quite emphatically in
the past. The Python documentation, is the world's worst technical
writing. As far as technical writing goes, it is even worse than
Perl's in my opinion.
I think
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm parsing a simple file and given a line's keyword, would like to call
the equivalently named function.
No, actually, you woudn't :-) Doing so means that if your programs input
specification ever changes, you have to rename all of
if type(a) is dict:
print a is a dictionnary!
class MyDict(dict):
pass
a = MyDict()
type(a) is dict
= False
isinstance(a, dict)
= True
So the question you need to answer is whether you want to determine whether
an object is exactly of type dict, or whether it you are willing
Colin J. Williams [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Alternatively, as someone else suggested, an analogue of the Pascal with
could be used:
def abs(self):
with self:
return math.sqrt(x**2 + y**2 + z**2)
How does your suggested with statement know to transform
I am not advocating this, but this could be:
def abs(self):
with self:
with math:
return sqrt(x**2 + y**2 + z**2)
The idea being that with self use
creates a new namespace:
newGlobal= oldGlobal + oldLocal
newLocal= names from self
You don't know what those names
Aurélien Campéas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I mean : aren't C variables also bindings from names to objects ? Or what
?
No, they're not.
In C, when you execute
x = y;
you cause x to become a copy of y. In Python, when you execute
x = y
you cause x
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I would want to sort by name first, then sub sort by location. Any
ideas? Thanks!
In Python 2.3 and later, sorting is stable -- so you can sort successively
in reverse order. In other words, sort the list by location, then sort the
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Have you ever been interested in software testing? Giving you an in
depth analysis/knowledge on software testing!!
Looking around the site at random, I saw no in depth analysis/knowledge of
anything.
--
The answer to this question probably involves pywin32 or a similar library.
I would like to copy a file from one place to another on a Windows machine
while preserving as much of the file permissions as it is possible to
preserve with whatever my program's privileges happen to be. If the file
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi, I have the following functions, but ' dx = abs(i2 - i1)/min(i2,
i1)' always return 0, can you please tell me how can i convert it from
an integer to float?
I don't think that's what you really want to do.
What you really want is
redawgts [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I keep getting this error local variable 'f' referenced before
assignment in the finally block when I run the following code.
try:
f = file(self.filename, 'rb')
f.seek(DATA_OFFSET)
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
class MultipleRegression:
def __init__(self, dbh, regressors, fund):
self.dbh = dbh
self.regressors = regressors
and I want to be able to enter regressors as a list like
MultipleRegression(dbh, [1,2,3,4], 5). But
Andrew Koenig [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I disagree. For any two floating-point numbers a and b, with b != 0, it
is always possible to represent the exact value of a mod b as a
floating-point number--at least on every floating-point system I have ever
This may be a foolish question, but what's the most straightforward way to
plot a bunch of data in Python?
That is, I want to write a program that does some number crunching, and then
I want to change some parameters and watch how the changes affect the
results. I could produce a file to hand
PAolo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
for i in range(1,10):
if i%2:
odd.append(i)
else:
even.append(i)
In 2.5 you'll be able to say
for i in range(1,10):
(odd if i%2 else even).append(i)
Whether you want to
Christoph Zwerschke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Anyway this would be an argument only against the variant of typecasting a
float with a fractional part. But what about the other variant which
raises an error if there is a fractional part, but works if the float
http://www.python.org/community/pycon/dc2004 seems to have vanished...
--
http://mail.python.org/mailman/listinfo/python-list
Try here:
http://us.pycon.org/zope/original/pycon/pastevents/dc2004
I see summaries of the paper, but when I follow the link for the papers
themselves, it leads to the same dead end.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Boots [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Paul Boots
[EMAIL PROTECTED]
+354 664 1748
Iceland? really??
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone think of an easy technique for creating an object that acts like
a generator but has additional methods?
For example, it might be nice to be able to iterate through an associative
container without having to index it for each element. Right now, I can say
i = iter(d)
and then
Andy Leszczynski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
How can do elegantly in Python:
if condition:
a=1
else:
a=2
I believe that before long Python will support
a=1 if condition else 2
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Andrew Koenig wrote:
I'm pretty sure that there was a change to the copyright laws a few years
ago (perhaps as part of the DMCA), that made it clear that you own
everything you produce, unless you're a W-2 employee
Mike Meyer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Definitely not. The most recent change to the copyright laws made
works of music recorded to fullfill a contract work for hire by
default.
If there's a contract -- i.e., a written agreement, then why does it matter?
--
mojosam [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I will be doing the bulk of the coding on my own time, because I need
to be able to take these tools with me when I change employers.
However, I'm sure that in the course of using these tools, I will need
to spend time on the
Björn Lindström [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Mike Meyer [EMAIL PROTECTED] writes:
If they have the rights to the code, they can sell it, under the GPL or
any license of their choosing. In addition, if you GPL it, your employer
will be able to sell it, just like
mojosam [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I would have to talk to a lawyer to be sure, but right now, I think I
can argue that anything I do on my own time belongs to me. I'm
technically a consultant right now (even though I'm spending 40
hours/week with the one
Robert Kern [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You're in something of a gray area, but one that has seen a lot of
litigation. Although you are technically a consultant, you are
probably considered an employee with regards to the work made for hire
doctrine. You should
John Perks and Sarah Mount [EMAIL PROTECTED] wrote
in message news:[EMAIL PROTECTED]
we have some Python code we're planning to GPL. However, bits of it were
(This assumes the wxPython Licence is compatible with the GPL -- if not,
do we just cosmetically change any remaining lines, so none
Peter Hansen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Dave Hansen wrote:
So lose the if.
R = C then A else B
I think that part of the argument for the A if C else B syntax is that
then is not currently a reserved word.
--
rbt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
What is the appropriate way to break out of this while loop if the for
loop finds a match?
Make it a function and use a return statement to break out.
--
http://mail.python.org/mailman/listinfo/python-list
Ralf W. Grosse-Kunstleve [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
class grouping:
def __init__(self, .x, .y, .z):
# real code right here
Emulation using existing syntax::
def __init__(self, x, y, z):
self.x = x
del x
Sakesun Roykiattisak [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Does c++ call base class constructor automatically ??
If I'm not wrong, in c++ you also have to call base class constructor
explicitly.
In C++, if you don't call a base-class constructor (I am saying a rather
max(01)* [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
is there a way to define a class method which prints the instance name?
The term the instance name is misleading, because it assumes, without
saying so explicitly, that every instance has a unique name.
In fact, there is no
Suppose I want to define a class hierarchy that represents expressions, for
use in a compiler or something similar.
We might imagine various kinds of expressions, classified by their top-level
operator (if any). So, an expression might be a primary (which, in turn,
might be a variable or a
Carl Banks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Well, Python seems to get along fine without the ability to do
isinstance(foo,file_like_object); probably better off in the end for
it. So I'd say you should generally not do it. Inheritence is for
when different classes
Martin v. Löwis [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You would normally try to avoid type queries, and rely on virtual
methods instead, if possible.
Of course.
It seems likely for the application
that code can be shared across different subclasses, for example,
you
Lonnie Princehouse [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If you try this sort of inheritance, I'd recommend writing down the
formal grammar before you start writing classes. Don't try to define
the grammar through the inheritance hierarchy; it's too easy to
accidentally
Jordan Rastrick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
But I'm not so much interested in alternate solutions to the problem
itself, which is to be honest trivial. I'm intereseted in the
implications of the imaginary solution of the Acceptor function.
Of course.
But you'll
Jordan Rastrick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
def combineIntoRecord(): # This is an acceptor function
optionalline = None # We may not get given a value for this line
accept firstline
accept secondline
if condition(secondline):
Xah Lee [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
globe=0;
def myFun():
globe=globe+1
return globe
apparently it can't be done like that. I thought it can probably be
done by prefixing the variable with some package context...
You can do this:
globe=0
def
Fredrik Lundh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
in some early C++ compilers, the scope for x was limited to the scope
containing the for loop, not the for loop itself. some commercial
compilers
still default to that behaviour.
Indeed--and the standards committee
Paul Rubin http://[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
It's really irrelevant whether anyone is using a feature or not. If
the feature is documented as being available, it means that removing
it is an incompatible change that can break existing code which
currently
Paul Rubin http://[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
It's not obvious to me how the compiler can tell. Consider:
x = 3
if frob():
frobbed = True
squares = [x*x for x in range(9)]
if blob():
z = x
Should the compiler issue a warning
Steve Holden [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The error you get is NOT a syntax error:
cmd = '%s format %s \
... over %d lines' % ('my', 'string', 2)
cmd
'my format string over 2 lines'
The interpreter is probably complaining because it needs six values
brucoder [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Are there runtime settings that can be used to adjust the default 1024
byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a
need to pump this up to permit input of a large data block via stdin.
What do you
It's me [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
What's the best way to count number of items in a list?
For instance,
a=[[1,2,4],4,5,[2,3]]
I want to know how many items are there in a (answer should be 7 - I don't
want it to be 4)
How about this?
def totallen(x):
Peter Maas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
This leads to the question:
Why does (t1 == t2 = d[t1] identical to d[t2]) hold for user defined
objects and not for lists? My answer: because the cmp function looks at
id() for user defined objects and at list content for
Are there widely used and recommended Python libraries that will let me
1) Interpret and generate MIDI messages easily?
2) Allow me to select and communicate with MIDI devices attached to my
computer?
I know that (2) is platform-dependent, so if there isn't a multiplatform
version of
This reply is off topic but I couldn't resist:
The best way to get rid of thread is to adopt a kitten.
In fact, one of my cats is named Snobol because she is such a good string
manipulator.
--
http://mail.python.org/mailman/listinfo/python-list
57 matches
Mail list logo