On 2006-02-28, Felipe Almeida Lessa [EMAIL PROTECTED] wrote:
# He meant calling direct vs. subclassing. In your example you called
the Thread class directly, but you could have subclassed it.
Yup. I should have realized that.
# In your case, Edwards, I'd prefer subclassing because then
D wrote:
My question is, how would I go
about creating the thread? I have seen examples that used classes, and
other examples that just called one thread start command - when should
you use one over another?
For simple use it doesn't matter. Use a class when you want to add more
state or
Frank Niessink wrote:
Rajesh Sathyamoorthy:
Hi,
I would know how to minimize a program (wxpython app) into an icon on
the taskbar on windows (the one at the side near the clock, i can't
remember what is it called.)
Is it easy to be done? Is there a way to do the same thing on Linux?
Did
G. Völkl wrote:
Hello
I am looking for examples of Pythonic Thinking:
One example I found:
Here some lines of the web side of Bruce Eckel:
http://www.mindview.net/WebLog/log-0053
How to read a text file:
for line in file(FileName.txt):
# Process line
It is a easy and sophisticated
Guys - I appreciate the clarification. So it looks like they used a
class for the ping thread because they were a) running multiple
instances of the thread concurrently and b) needing to keep track of
the state of each instance, correct? I believe that in my case, since
I will be just running
Larry Bates:
Its called the system tray and here is a link to some sample code
for Windows I found via Google:
But, but, but, ... the OP was talking about a wxPython app.
wx.TaskBarIcon is the wxPython builtin support for making an icon in the
system tray. Nothing else is needed.
Cheers,
I have a simple client/server file server app that I would like to
convert to a single .exe. The client is just uses Tkinter and displays
a simple GUI. The server has no GUI and just listens for and processes
connections. How can I convert these 2 files to an .exe, while
enabling the server app
On 26 Feb 2006 22:21:26 -0800
[EMAIL PROTECTED] wrote:
I am a newbie to Python. I am mainly using Eric as the IDE
for coding. Also, using VIM and gedit sometimes.
I had this wierd problem of indentation. My code was 100%
right but it wont run because indentation was not right. I
checked
Illuminated manuscripts, 13 volumes
http://ptlslzb87.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
On 28 Feb 2006 09:58:47 -0800
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Add me to the me, too! list of people who think
enumerations would be better off without or
comparison.
+1 on unordered
Comparable enums do have use-cases (like the days of the
week), but I can't think of many of them.
First google.com hit using your title.
http://www.google.com/search?q=py2exe
--
http://mail.python.org/mailman/listinfo/python-list
Thanks again. Here is the finished product. Maybe it will help someone
in the future:
from pylab import *
def log_10_product(x, pos):
The two args are the value and tick position.
Label ticks with the product of the exponentiation
return '%1i' % (x)
ax = subplot(111)
# Axis scale
Jay - what I'm not sure of is the syntax to use. I have downloaded and
installed py2exe.
--
http://mail.python.org/mailman/listinfo/python-list
D wrote:
Jay - what I'm not sure of is the syntax to use. I have downloaded and
installed py2exe.
First a question:
Have you written the server program as a windows service? You can't
just run something as a service, it has to be written to be a service.
Your setup files will look
Nicolas Fleury wrote:
I was wondering if it would make sense to make staticmethod objects
callable, so that the following code would work:
class A:
@staticmethod
def foo(): pass
bar = foo()
Do you have a real-world use case? I pretty much never use
staticmethods (preferring
Em Ter, 2006-02-28 às 15:17 -0500, Nicolas Fleury escreveu:
class A:
@staticmethod
def foo(): pass
bar = foo()
# Why not:
def foo(): pass
class A:
bar = foo()
foo = staticmethod(foo)
--
Quem excele em empregar a força militar subjulga os exércitos dos
outros
rh0dium wrote:
Hi all,
Has any of you fine geniuses figured out a nice python script to go to
the Southwest airlines website and check in, and retrieve your boarding
pass - automatically 24 hours in advance
Not yet, but I think you are the real genius here. Brilliant idea.
--
Fredrik Lundh wrote:
James Stroud wrote:
Perhaps you did not know that you can inheret directly from dict, which
is the same as {}. For instance:
class Dict({}):
pass
I must have been hallucinating. I swear I did this before and it worked
just like class Dict(dict). Since it doesn't
Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:
10**3 = 1000
x = 4978
10**4 = 1
x = 1
Thanks Everyone!
Derek Basch
--
http://mail.python.org/mailman/listinfo/python-list
Derek Basch wrote:
Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:
10**3 = 1000
x = 4978
10**4 = 1
x = 1
how about
import math
def roundup(x):
...return
Quoting Derek Basch [EMAIL PROTECTED]:
Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:
How about this:
def roundup(x):
if x 1:
return 1
else:
return '1' + ('0' * len(str(int(x
Em Ter, 2006-02-28 às 17:47 -0500, [EMAIL PROTECTED] escreveu:
Quoting Derek Basch [EMAIL PROTECTED]:
Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:
How about this:
def roundup(x):
if x 1:
[EMAIL PROTECTED] wrote:
Can anyone offer any assistance on this one?
Look here:
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall
-D_FORTIFY_SOURCE=2 -g -fPIC -I/usr/include/mysql
-I/usr/include/python2.4 -c _mysql.c -o
build/temp.linux-x86_64-2.4/_mysql.o
Thanks effbot. I knew their had to be something buried in the math
module that could help. ceil() it is!
/dTb
--
http://mail.python.org/mailman/listinfo/python-list
haxier wrote:
All the info you need is in the kinterbasdb module. I've worked with it
under windows and Linux and... it just works. Really well indeed. I'd
recommend it a lot.
http://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_embedded_using_with
--
Asier.
Thanks - you
On 2006-02-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Quoting Derek Basch [EMAIL PROTECTED]:
Given a value (x) that is within the range (1e-1, 1e7) how do I round
(x) up to the closest exact logarithmic decade? For instance:
How about this:
def roundup(x):
if x 1:
return
Felipe Almeida Lessa wrote:
Em Ter, 2006-02-28 às 15:17 -0500, Nicolas Fleury escreveu:
class A:
@staticmethod
def foo(): pass
bar = foo()
# Why not:
def foo(): pass
class A:
bar = foo()
foo = staticmethod(foo)
Well, you could even do:
class A:
Steven Bethard wrote:
Nicolas Fleury wrote:
I was wondering if it would make sense to make staticmethod objects
callable, so that the following code would work:
class A:
@staticmethod
def foo(): pass
bar = foo()
Do you have a real-world use case? I pretty much never use
I like Fredrik's solution. If for some reason you are afraid of
logarithms, you could also do:
x = 4978
decades = [10 ** n for n in xrange(-1,8)]
import itertools
itertools.ifilter(lambda decade: x decade, decades).next()
1
BTW, are the python-dev guys aware that 10 ** -1 =
Hi Kai!
Kai Teuber wrote:
Hi Fabian,
override the accept() method and call self.showListViewItems() there.
But remember to call QDialog.accept() at the end.
def accept( self ):
self.showListViewItems()
QDialog.accept( self )
Thank you very much, I got it working :-)
Cheers,
Download from
http://sourceforge.net/project/showfiles.php?group_id=61395package_id=175827
On-line documentation is at
http://bashdb.sourceforge.net/pydb/pydb/lib/index.html
Changes since 1.12
* Add MAN page (from Debian)
* Bump revision to 0.12 to 1.13 to be compatible with Debian pydb package.
On 2006-02-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I like Fredrik's solution. If for some reason you are afraid of
logarithms, you could also do:
x = 4978
decades = [10 ** n for n in xrange(-1,8)]
import itertools
itertools.ifilter(lambda decade: x decade, decades).next()
1
It seems that lots of people don't like having to prefix self. in front
of instance variables when writing methods in Python. Of course,
whenever someone suggests doing away with 'self' many people point to
the scoping advantages that self brings. But I hadn't seen this
proposal when I searched
[EMAIL PROTECTED] wrote:
BTW, are the python-dev guys aware that 10 ** -1 = 0.10001 ?
http://docs.python.org/tut/node16.html
/F
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
It seems that lots of people don't like having to prefix self. in front
...
But what if we keep the '.' and leave out the self.
...
Any comments? Has this been discussed before?
Yes, at least once (found by group-googling for removing self in this
newsgroup):
This is off topic, but if read the documentation is the answere to
everything why do we need news groups? The problem with the
documentation for Python is that I can't find what I'm looking for (and
I didn't even know what I was looking for either). And since every
language is well documented...
Thanks Larry - that is exactly what I needed! I do have the program
written to be a service, and now plan to use py2exe and Inno Setup to
package it up.
Doug
--
http://mail.python.org/mailman/listinfo/python-list
In my current project I expect the total size of the indexes to exceed
by far the size of the data indexed, but because Berkeley does not
support multiple indexed columns (i.e. only one key value column as
index) if I access the database files one after another (not
simultaneously) it should
Thanks a lot for the links that you gave me. I will look into that
today! :-)
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin http://[EMAIL PROTECTED] writes:
Ben Finney [EMAIL PROTECTED] writes:
If an enumeration object were to be derived from, I would think it
just as likely to want to have *fewer* values in the derived
enumeration. Subclassing would not appear to offer a simple way to
do that.
Paul Rubin http://[EMAIL PROTECTED] writes:
say that
Weekdays = enum('mon', 'tue', ...)
What is the type of Weekdays.mon supposed to be?
The specification doesn't mention that; it should.
I'm calling them EnumValue, but that makes it difficult to talk
about. The term value is commonly
Paul Rubin http://[EMAIL PROTECTED] writes:
Do you anticipate having parameters like socket.AF_INET that are
currently integers, become enumeration members in future releases?
That, and the 're' flags referred to earlier, seems to be a good
application of enumerations.
--
\ Jealousy: The
I want to set default values for a ConfigParser. So far, its job is
very small, so there is only one section heading, ['Main']. Reading the
docs, I see that in order to set default values in a ConfigParser, you
initialize it with a dictionary or defaults. However, I'm not quite
sure of the syntax
Roy Smith [EMAIL PROTECTED] writes:
A few random questions:
a = enum ('foo', 'bar', 'baz')
b = enum ('foo', 'bar', 'baz')
Two separate enumerations are created, and bound to the names 'a' and
'b'. Each one has three unique member values, distinct from any
others.
what's the value of the
Thanks. I thought for sure it must have been discussed before but for
whatever reason, my googling skills couldn't locate it.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
We've managed to cross-compile (from i686 targeting ppc) python (2.4.2)
binaries and
extension modules.
However we cannot figure out how to cross-compile the .py (of
distribution) files and
generate the .pyc files for the target ppc from an i686 system. Is it
possible to cross
compile
James Stroud wrote:
Fredrik Lundh wrote:
James Stroud wrote:
Perhaps you did not know that you can inheret directly from dict, which
is the same as {}. For instance:
class Dict({}):
pass
I must have been hallucinating. I swear I did this before and it worked
just like class
Steven Bethard [EMAIL PROTECTED] writes:
Ben Finney wrote:
This PEP specifies an enumeration data type for Python.
An enumeration is an exclusive set of symbolic names bound to
arbitrary unique values. Values within an enumeration can be iterated
and compared, but the values have no
Toby Dickenson [EMAIL PROTECTED] writes:
On Monday 27 February 2006 02:49, Ben Finney wrote:
Coercing a value from an enumeration to a ``str`` results in the
string that was specified for that value when constructing the
enumeration::
That sentence seems to assume that all enumeration
Ben Finney [EMAIL PROTECTED] writes:
PEP:354
Title: Enumerations in Python
Version:$Revision: 42186 $
Last-Modified: $Date: 2006-01-26 11:55:20 +1100 (Thu, 26 Jan 2006) $
Most people seem to be unopposed or in favour of some kind of
enumeration mechanism making
In article [EMAIL PROTECTED],
Tim Roberts [EMAIL PROTECTED] wrote:
One thing that can be helpful in situations like this is to remember that
+= in Python isn't quite as special as it is in C. So,
f() += [4]
is the same as
f() = f() + [4]
and I think you can see why that is a problem.
Ben Finney [EMAIL PROTECTED] writes:
These don't seem simple or elegant. I don't see a particular benefit
to doing it that way, rather than being explicit about manipulating
the member list::
pentium_instructions = enum('add', 'sub', 'mul')
athlon64_instructions = enum(
*[
Em Seg, 2006-02-27 às 17:10 -0800, Paul Rubin escreveu:
Ben Finney [EMAIL PROTECTED] writes:
If an enumeration object were to be derived from, I would think it
just as likely to want to have *fewer* values in the derived
enumeration. Subclassing would not appear to offer a simple way to do
Ben Finney [EMAIL PROTECTED] wrote:
a = enum ('foo', 'bar', 'baz')
b = enum ('foo', 'bar', 'baz')
Two separate enumerations are created
OK, most of the rest follows from that.
str (a)
Not defined in the current specification. Suggestions?
Well, by analogy with
a = set ((1, 2, 3))
[EMAIL PROTECTED] wrote:
Any comments? Has this been discussed before?
Yes. To death. Executive summary: self is here to stay.
--
http://mail.python.org/mailman/listinfo/python-list
On 28 Feb 2006 15:54:06 -0800
[EMAIL PROTECTED] wrote:
The issue I have with self. is that is makes the code
larger and more complicated than it needs to be.
Especially in math expressions like: self.position[0] =
self.startx + len(self.bitlist) * self.bitwidth
It really makes the code
On 28 Feb 2006 17:05:32 -0800
mwt [EMAIL PROTECTED] wrote:
I want to set default values for a ConfigParser. So far,
its job is very small, so there is only one section
heading, ['Main']. Reading the docs, I see that in order
to set default values in a ConfigParser, you initialize it
with a
Terry Hancock [EMAIL PROTECTED] wrote:
However, there is a slightly less onerous method which
is perfectly legit in present Python -- just use s
for self:
This is being different for the sake of being different. Everybody *knows*
what self means. If you write your code with s instead of
Title: RE: MySQLdb compile error with AMD64
Found it.
Had to change
Extra_compile_args = config(cflags) to the actual list with march=athlon64
Now just realized that I didnt download the right RPMs for MySQL for SUSE on AMD64 (so got lib errors I am assuming cos of that).
Will download
On 2006-03-01, John Salerno [EMAIL PROTECTED] wrote:
Yes. To death. Executive summary: self is here to stay.
A related thing I was wondering about was the use of 'self' in
class methods as the first parameter.
It's not a related thing, it's the same thing.
I understand that right now it
Mel Wilson wrote:
James Stroud wrote:
Fredrik Lundh wrote:
James Stroud wrote:
Perhaps you did not know that you can inheret directly from dict, which
is the same as {}. For instance:
class Dict({}):
pass
I must have been hallucinating. I swear I did this before and it
worked
You have a text-database, each record has some header info and some
data (text-blob). e.g.
HEADER
name = Tom
phone = 312-996-
/HEADER
I last met tom in 1998. He was still single then.
blah
blah
HEADER
name = John
birthday = 1976-Mar-12
/HEADER
I need to ask him his email
Grant Edwards wrote:
A related thing I was wondering about was the use of 'self' in
class methods as the first parameter.
It's not a related thing, it's the same thing.
Oh sorry. I thought the OP was asking about having to use self when
qualifying attributes, or even if he was, I didn't
John Salerno wrote:
Grant Edwards wrote:
A related thing I was wondering about was the use of 'self' in
class methods as the first parameter.
It's not a related thing, it's the same thing.
Oh sorry. I thought the OP was asking about having to use self when
qualifying attributes, or
A small problem has come to light with PyGUI 1.6
on MacOSX systems.
If you get the following exception:
File GUI/Generic/BaseAlertFunctions.py, line 5, in ?
ImportError: No module named Alerts
it's probably because you don't have PyObjC installed.
I will fix this to produce a more
Renato wrote:
If you use vi (vim, I hope), then place something like this in your
.vimrc
set ts=4
set sw=4
set expandtab
set ai
Or, more verbose:
set tabstop=4
set shiftwidth=4
set autoindent
There are a lot more tricks for python in vim (and plugins, and
helpers, and so on), but
[EMAIL PROTECTED] wrote:
[snip] Now I'm
looking to build a GUI in python with the rendering engine as an
integrated window. I will most likely use wxPython for the GUI and I
know it has support for adding an OpenGL canvas.
You might look into PyFLTK (which I think was just recently
On Tue, 21 Feb 2006 15:05:40 -0500, rumours say that Steve Holden
[EMAIL PROTECTED] might have written:
Chris Mellon wrote:
[...]
Torstens definition isn't useful for quantifying a difference between
interpeted and compiled - it's a rough sort of feel-test. It's like
how much of a naked body
Cruella DeVille wrote:
This is off topic, but if read the documentation is the answere to
everything why do we need news groups?
Because read the documentation is NOT the answer to
everything. However, it was the answer to your question.
The problem with the
documentation for Python is
Ben Finney [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Should I amend the PEP to propose either in the builtins or in the
collections module?
Yes, if the idea is accepted, Guido and devs will debate and decide that
anyway ;-)
Or should I propose two PEPs and let them compete?
Bugs item #1440472, was opened at 2006-02-28 12:11
Message generated for change (Settings changed) made by bwarsaw
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1440472group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1438537, was opened at 2006-02-25 03:41
Message generated for change (Comment added) made by logistix
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1438537group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #518846, was opened at 2002-02-17 12:09
Message generated for change (Comment added) made by bcannon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=518846group_id=5470
Please note that this message will contain a full copy of the comment thread,
101 - 173 of 173 matches
Mail list logo