English
has taken over its position as the working class accent these days,
but with a much wider regional distribution.
How off topic is this? Marvellous!
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
s-beta.google.com/group/comp.lang.python/browse_thread/thread/fd150297c201f814
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
can crash Python. I don't know about you, but that's
I interpret this -
<http://mail.python.org/pipermail/python-dev/2004-January/041856.html>.
I am prepared to be wrong, though. Only Tim can channel Guido!
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/si
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl
installations worldwide?" - Ivan Van Laningham
"Floating point is about nothing if not being usefully wrong." - Robert Kern
Sibylle Koczian needs to sort part of a list. His first attempt made
the natural mistake - sort
On 7/1/05, Peter Maas <[EMAIL PROTECTED]> wrote:
> Simon Brunning schrieb:
> > Sibylle Koczian needs to sort part of a list. His first attempt made
> > the natural mistake - sorting a *copy* of part of the list:
>
> I think it was _her_ first attempt.
Ooops!
On 4 Jul 2005 01:04:47 -0700, jwaixs <[EMAIL PROTECTED]> wrote:
> arg... I've lost 1.5 hours of my precious time to try letting re work
> correcty. There's really not a single good re tutorial or documentation
> I could found!
http://www.amk.ca/python/howto/regex/
--
(use Windows' task scheduler or
> *n*x's cron).
I was playing about with the 1st problem a couple of years ago:
http://www.brunningonline.net/simon/blog/archives/winDesktop.py.html
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
now if this will work, but you might try win32com.client.CastTo().
Something like:
my_MItem = win32com.client.CastTo(my_DItem, 'MItem')
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
Most have already been said, but have a look at
http://docs.python.org/ref/slots.html for authoritative documentation.
--
http://mail.python.org/mailman/listinfo/python-list
ive the answer, it will be helpful for me.
The __init__.py files make Python treat the directories as packages -
see http://docs.python.org/tut/node8.html#SECTION00840.
We have to do something about those URLs!
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonl
QOTW: "That's what I love in that news group. Someone comes with a stupid
and arrogant question, and someone else answers in a calm and reasonable
way." - Gustavo Niemeyer
"After 25 years doing this, I've become something of a Luddite as far as
fancy IDEs and non-standard features go... and a huge
owing his lack of regex nouce here. Clearly he
wanted 'f.*cking':
>>> print re.match('f.*cking', 'firetrucking')
<_sre.SRE_Match object at 0x01196058>
;-)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "That's what I love in that news group. Someone comes with a stupid
and arrogant question, and someone else answers in a calm and reasonable
way." - Gustavo Niemeyer
"After 25 years doing this, I've become something of a Luddite as far as
fancy IDEs and non-standard features go... and a huge
t string and
> warn user about it.
http://wiki.python.org/moin/PythonDecoratorLibrary?#head-de01988728ccdec415708f10928cc6feb022e7bb
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
uot; [2], but i don't quite see how i can
use it while maintaining python source compatability.
bye!
Simon.
[1]: http://occs.cs.oberlin.edu/~jwalker/nullObjPattern/
[2]: http://students.ceid.upatras.gr/~sxanth/pyc/
--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph
QOTW: "The posts do share an erroneous, implied assumption that the
investment in learning each language is equal. Python has a strong
competitive advantage over Java and C++ in terms of learnability. A
person can get up to speed in a few days with Python." - Raymond Hettinger
"You know, this is
Hi,
Can somebody please explain to me why:
class SomeClass:
def __init__(self, contents=[]):
self.contents = contents[:]
def add(self, element):
self.contents.append(element)
when called a second time (i.e. to create a new instance of a SomeClass
object) results in self.c
On Thu, 14 Jul 2005 08:38:36 +0200, Peter Otten wrote:
> Maybe, after a little renaming you can see it yourself:
>
> class SomeClass:
> def __init__(self, default_contents=[]):
> # make a copy of default_contents that is # kept in a SomeClass
> instance
> self.contents
ches one to get
> going.
http://wiki.python.org/moin/BeginnersGuide
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "The posts do share an erroneous, implied assumption that the
investment in learning each language is equal. Python has a strong
competitive advantage over Java and C++ in terms of learnability. A
person can get up to speed in a few days with Python." - Raymond Hettinger
"You know, this is
Are you aware of http://mathschallenge.net/index.php?section=project ?
The "The focus will be on algorithms that require a bit of thought
to design but not much code to implement." part seems common, although
your problem domain probably is larger.
/Simon
--
http://mail.python.o
Re: assigning a PyStr object to __doc__, take a look at Py_InitModule3,
which does that for you.
Then you have the PyDoc_STRVAR macro in python.h that you might want to
use (see definition below). But as Robert already told you, you'll need
to provide the necessary information about i.e. parameter
Oooh.. you make my eyes bleed. IMO that proposal is butt ugly (and
looks like the C++.NET perversions.)
--
http://mail.python.org/mailman/listinfo/python-list
You cannot really do that*. Use a flag or something that the thread
checks if it should shut down.
/Simon
* well actually you can, sort of by using
int PyThreadState_SetAsyncExc( long id, PyObject *exc) from C API.
However, if you do that you swap one problem for a sh*tload of others,
because of
On 7/18/05, Hayri ERDENER <[EMAIL PROTECTED]> wrote:
> hi,
> what is the equivalent of C languages' goto statement in python?
> best regards
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/832906c6122dc137
Let's not go through *that* agai
+) '''
> MatSearch = re.compile(matsearch, re.VERBOSE, re.IGNORECASE)
MatSearch = re.compile(matsearch, re.IGNORECASE + re.VERBOSE)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
if you mean that you want to figure out which way the image is
depending on the actual data in the image, then you'll most likely get
to do the image processing yourself, on the other hand, if you are
talking jpegs from a relatively new camera then I suppose that you
should be able to get that info
My console follows documentation:
C:\tmp\GspRegTestApp>c:\Python24\python
ActivePython 2.4.1 Build 245 (ActiveState Corp.) based on
Python 2.4.1 (#65, Mar 30 2005, 09:33:37) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z
C:\tmp
Short answer: Not using HTTP.
However, you can use something like AJAX to just load new data from
time to time and not the entire page.
Or you might be able to keep the connection alive and occationally send
stuff to the client using chunked transfer.
I'd go for the ajax route if you don't need
On 7/20/05, Mage <[EMAIL PROTECTED]> wrote:
> Or is there better way?
>
> for (i, url) in [(i,links[i]) for i in range(len(links))]:
for i, url in enumerate(links):
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/m
as you have been told, there is no way to get a variable's name, take a
look at http://effbot.org/zone/python-objects.htm to find out why this
is so.
--
http://mail.python.org/mailman/listinfo/python-list
basically, you can just stack an outer vertical box sizer with two
items and in the upper "slot" you put a horizontal box sizer with your
two buttons and in the bottom slot you put the big button
hope this helps
/Simon
ps. as this is a wxpython related question, you might get better
ng
tentacles and impossible angles.' - Robert Kern
Highlight of the week; Jython 2.2a1:
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/9c3b6b2e10d8a490
Nearly-highlight of the week; Simon Willison introduces Django, the
web framework for perfecti
ows what causes
this?
/Simon
--
http://mail.python.org/mailman/listinfo/python-list
ourceforge.net/mechanize/>
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
g then I did not get
any syntax error.
/Simon
--
http://mail.python.org/mailman/listinfo/python-list
ng
tentacles and impossible angles.' - Robert Kern
Highlight of the week; Jython 2.2a1:
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/9c3b6b2e10d8a490
Nearly-highlight of the week; Simon Willison introduces Django, the
web framework for perfecti
lly go away.
A fiver says you need to commit your changes.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
to display the .00 even if it does not have a .00 value
> like this
> if Var is 50, i need to display .50 instead of just .5
>>> import decimal as dec
>>> dec.Decimal('250.00')/100
Decimal("2.50")
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.b
If you actually want that kind of syntax, then why don't you use Visual
Basic? ;)
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "Guido has marked the trail; don't ignore the signs unless you really
know where you're going." - Raymond Hettinger
'Proverbs 28:14 JPS "Happy is the man that feareth alway; but he that
hardeneth his heart shall fall into evil." Obviously an exhortation to not
ignore raised exceptions with "
QOTW: "Guido has marked the trail; don't ignore the signs unless you really
know where you're going." - Raymond Hettinger
'Proverbs 28:14 JPS "Happy is the man that feareth alway; but he that
hardeneth his heart shall fall into evil." Obviously an exhortation to not
ignore raised exceptions with "
ict__["__all__"] = dir(master)
def __getattr__(self, name):
attr = getattr( self._master, name )
return attr
# ... end of file:
sys.modules["mymod"] = ModuleProxy("mymod",sys.modules["mymod"])
--Simon Burton
--
http://mail.python.org/mailman/listinfo/python-list
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote:
> I have lots of code that looks like:
> keys = mydict.keys()
> keys.sort()
keys = sorted(mydict.keys())
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/m
rks, but it feel like a kludge to me.
To me, it's elegant. Want the keys? Call .keys(). Want them sorted?
Call sorted(). Each tool does one job well.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
x=x
> def getx(self): return self._x
> def delx(self): del(self._x)
> x=property(getx,setx,delx,"XXX")
> t=test_property()
> t.x=1
> print t.x
Properties only work with new style classes, so try:
class test_property(object):
--
Cheers,
Simon B,
[EMAIL PR
On 8/12/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Any recommendations on a editior/IDE for programming in python?
http://wiki.python.org/moin/PythonEditors
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman
sql_statement)
descriptor = dtuple.TupleDescriptor(cursor.description)
for row in (dtuple.DatabaseTuple(descriptor, row) for row in cursor.fetchall()):
print row.name # Prints "Evelyn"
# etc...
If your result set will be large, see also ResultIter[2].
--
Cheers,
Simon B,
[EMAIL PROTECTED],
On 8/15/05, Rocco Moretti <[EMAIL PROTECTED]> wrote:
> Which lead me to the question - what's the difference between a library
> and a framework?
If you call its code, it's a library. If it calls yours, it's a framework.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://w
On 8/15/05, Terry Hancock <[EMAIL PROTECTED]> wrote:
> On Monday 15 August 2005 09:54 am, Simon Brunning wrote:
> > If you call its code, it's a library. If it calls yours, it's a framework.
>
> Such concision deserves applause. ;-)
Thank you. ;-)
As others have
scripts use the copy library, I think it
> worthwhile to implement this lib in C.
>
> What are your opinions?
I think that copy is very rarely used. I don't think I've ever imported it.
Or is it just me?
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
o machines, one Debian stable and the other
Debian testing. Same results on both.
It's like I'm missing a library or something, any ideas ?
Cheers,
Simon Newton
--
http://mail.python.org/mailman/listinfo/python-list
lists are a little
less rare, but you can make those without the copy module:
new_list = list(old_list) # or old_list[:]
new_dict = dict(old_dict) # or old_dict.copy()
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
gt;
> How to do that ?
Lift would be much easier if you held your 'linenn' lineedit fields in
a list instead. Is that possible? If so, you could do something like
(untested):
for index, line in enumerate(mylinelist):
self.lines[index].setText(line)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2005-08-17 at 09:52 +0200, "Martin v. Löwis" wrote:
> Simon Newton wrote:
> > gcc main.c -c -I-I/usr/include -I/usr/include -I/usr/include/python2.4
> > -I/usr/include/python2.4 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
> > gcc main.o -L/usr/lib -lpthrea
Yeha, sure. The Royal Institute of Technology in Stockholm, Sweden
teaches Python for some of its introductory programming and algorithm
courses.
--
http://mail.python.org/mailman/listinfo/python-list
e to demonstrate this, so far)
> > hint:
> > http://mail.google.com/support/bin/answer.py?answer=6554
>
> I don't see anything about Python at that url.
Don't look at the page the URL returns - look at the URL itself. ;-)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
On 8/23/05, Konrad Mühler <[EMAIL PROTECTED]> wrote:
> How can i convert a float value into a string value?
>
> string_value1 = string(float_value) + ' abc'
string_value1 = str(float_value) + ' abc'
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brun
an instance of your WasRun class, and I don't see a wasSetUp
attribute being set anywhere.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
That's great! Congratulations!
--
http://mail.python.org/mailman/listinfo/python-list
Take a look at the struct module
(http://docs.python.org/lib/module-struct.html), it does what you want.
--
http://mail.python.org/mailman/listinfo/python-list
I ended up monkey-patching doRollover to do a number of retries before
giving up. (In our case the failures is due to our log browser
happening to read the latest changes when logging wants to rollover)
(Actually, I implemented a simple QueueHandler and do all file
operations from a different logg
On 13 Sep 2005 11:32:05 -0700, Chuck <[EMAIL PROTECTED]> wrote:
> BTW, where is the DB-API docs for python?
Google is your friend - <http://www.google.co.uk/search?q=DB-API>, 1st hit.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://
the commit at
the end of the loop. Otherwise, do one after each update. (What does a
logical transaction consist of? Only you can answer that! It's a
domain question. A transaction is a set of changes that should be
applied atomically - i.e., you want them all to happen, or none of
them.)
I should have said connection.commit(). Posting before thinking again.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
Have you read the "Metaclasses" part of "Unifying types and classes in
Python 2.2"? (http://www.python.org/2.2.3/descrintro.html#metaclasses)
It discusses and explains the issues you seem to have.
--
http://mail.python.org/mailman/listinfo/python-list
If you have read the document I referred you to, did you also read the
example where classes M1, M2, M3 and M4 were defined?
A quote from the discussion of that example:
"For class D, the explicit metaclass M1 is not a subclass of the base
metaclasses (M2, M3), but choosing M3 satisfies the constr
I definitely think that it's the intended behaviour: the example shows
how and why it works; and I definitely agree that it should be
documented better.
--
http://mail.python.org/mailman/listinfo/python-list
Why do you check if the module threading is less than 50? (this is why
nothing happens, it's always false).
>From where do you get port_counter in method run() of scanThread? (this
would make every call to run() raise an exception.
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
[snip]
> > http://pyinstaller.hpcf.upr.edu/pyinstaller
> That's one short "indefinitely":
>
> Not Found
> The requested URL /pyinstaller was not found on this server.
> Apache/2.0.53 (Fedora) Server at pyinstaller.hpcf.upr.edu Port 80
It seems that the URL is http://pyinstall
ie-tool.net/>. I've never used it myself,
but I can confirm that its author, Chris, is a good bloke and can hold
his ale, for what that's worth. ;-)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
Tim Hoffman wrote:
> Have you tried Boa Constructor ?
>
> http://boa-constructor.sourceforge.net/
Yeah, I was never very impressed with it either. The current version
doesn't seem to work with wxPython 2.5.3.1 though
I guess there isn't a GUI builder that does what I want, back to the
manual
With the news of a GPL Qt4 for Windows, I decided to go with PyQt:
http://mats.imk.fraunhofer.de/pipermail/pykde/2005-February/009527.html
I just knocked up my application (GUI, backend is still in progress)
using QtDesigner in about 5 minutes, and it's layout is just how I want
it!
--
http://m
ed result.
However, reading from foe succeeds only if fin has been closed before.
An fi.flush() seems to be not sufficient. But if one wants Python to
interactivly communicate with some shell on a remote machine, it is
inconvenient to have to close and reopen the connection all the
ioned in most books, provided that it's vaguely
recent and covers Python 2.0 or later.
List comps have a cool new little sister, generator expressions - see
<http://www.brunningonline.net/simon/blog/archives/001025.html>.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
script.
<http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain>
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
After quite a while of wxPython I'm getting back into PyQt, mainly due
to the announcement by Trolltech that they will make a GPL version of
Qt4 for Windows (and Phil-T said he will make a PyQt to go with it
eventually!)
I'm currently using PyQt 3.12 that comes with the BlackAdder demo, it
seems t
Yeah I had a look at the Qt Free/Win project, but I think it offers me
less than the current official 3.12 from BlackAdder, which is only $80
without the hassle of following those convoluted build instructions (I
did try yesterday).
As far as XMMS/Gtk goes, it's a remote client for XMMS, designed
e...
>
> 107 % 4 = 3
> 7 % 3 = 1
It;'s modular aritmetic. See
<http://en.wikipedia.org/wiki/Modular_arithmetic> and
<http://www.python.org/doc/2.3.4/ref/binary.html>.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
I've just read the Qt4 GPL for Windows will only support gcc (and maybe
MinGW) anyway, not BCC or VisualC++ (or it's free equivalents), so it
looks like it would be a daunting task to actually build PyQt
See http://osnews.com/comment.php?news_id=9675
I guess the Qt used in PyQt from BlackAdde
I've just read the Qt4 GPL for Windows will only support gcc (and maybe
MinGW) anyway, not BCC or VisualC++ (or it's free equivalents), so it
looks like it would be a daunting task to actually build PyQt
See http://osnews.com/comment.php?news_id=9675
I guess the Qt used in PyQt from BlackAdde
On Thu, 10 Feb 2005 23:03:43 +, Alan Kennedy <[EMAIL PROTECTED]> wrote:
> In my circles, VSS is most often referred to as Visual Source Unsafe.
I always find it amusing that VSS's icon is a safe - with the door wide open.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brun
On Fri, 11 Feb 2005 17:26:04 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote:
> I need something like "Press any key to continue" code for my program.
> Currently I use : raw_input("Press Enter to continue ") but it's lame.
Err, why?
--
Che
if you're referring to the installshield x/mp products, forget it, they
are really bad.
the last company i worked for who used x/mp actually went back to shell
scripts for unix and installshield pro for windows, as the java thing
was abismall, and even the ide was written in java, so horribly slow
I've just got Qt 3.3.3 and PyQt 3.1.3 compiled for Python 2.4 using the
instructions for MinGW here:
http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml
It was a pretty nasty experience, hacking python24.dll and patching
sip/PyQt, but i got it all working after about 4
[snip]
> Ha anyone tried cross compiling python with mingw? At work we
compile
> our software for lots of platforms (including windows) on a linux
> build host. The windows builds are done with a mingw cross compiler.
> It would be interesting if we could do this with python + extensions
> also.
After building with MSVC6 (Python 2.3.5 and 2.4 versions) I've noticed
that the ToolTips don't seem to work in the GPL version.
MSVC6 is about twice as fast to build as MinGW.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 11 Feb 2005 17:37:19 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote:
> It looks to ugly this way. I want to press
> any key without ENTER to continue
You'll only got your users complaining that they haven't got an 'any' key...
--
Cheers,
essential needs and
> requirements.
I couldn't agree more. You need to find a community that *does* care
about essential needs. Might I recommend Perl or Ruby?
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 14 Feb 2005 14:12:57 +0100, bruno modulix <[EMAIL PROTECTED]> wrote:
>
> Why do you hate Perl and Ruby community that much ?
Oh, I don't. But fair's fair - we've carried our share of the burden, surely?
But-don't-get-me-started-on-those-Groovy-bastards-ly
n the morning. But, it was unusal by %s. %s pillow
> was with %s. %s didn't want to wake up But, %s tried my best and woke up.
> it was so amazing!""" % (I,me,my,me,I,I)
One thing that you might want to do is to use a dictionary to provide
the values, like so:
my_values =
7;,...]
>
> So how can I test if a variable 'a' is either a single character string
> or a list? I tried:
>
> if a is list:
>
> but that does not work. I also looked in the tutorial and used google
> to find an answer, but I did not.
>
> Has anyone an idea
What's the difference between ctypes, SWIG and SIP?
I've used SWIG to "convert" C source to Python (as I believe SIP
does?), so does ctypes wrap functions from binaries (e.g. DLL's)?
--
http://mail.python.org/mailman/listinfo/python-list
I'm writing a PyQt network client for XMMS, using the InetCtrl plugin,
that on connection receives a track length.
To save on bandwidth, I don't want to be continually querying the
server for updates (e.g. has the current track finished yet?) so I
figured the best thing to do is just update after
I don't think time.sleep() will work too well, I think it will cause
the program to hang around in the foreground, and prevent the GUI
updating.
I'll give it a try just to make sure, as I can't figure out the
signal/alarm thing (the alarm only seems to trigger when I click a
button, not after n-se
Damn! signal is not supported on Windows.
time.sleep() doesn't work, as I suspected::
def info(self):
sleep(5)
self.info()
Basically causes the function to pause, then call itself again, all in
the foreground :-(
I'm thinking some sort of thread timer is the way to go, but really
don't un
Hmm, yes I had thought of looking around PyQt for a timer, forgot about
it though.
As far as querying the server every few seconds, it does make sense
(you don't miss events) and is the recommended way of doing things with
InetCtrl, but I'd prefer to save the bandwidth/server load than have
realti
Jeff Shannon wrote:
[snip]
> The amount of bandwidth and server load that will be used by a
> once-a-second query is probably pretty trivial (unless you're
> expecting this to run over internet or dialup networks -- and even
> then, it's probably not going to be worth worrying about). Even on
an
OK, I've implemented the 2sec threaded update, but I'm having some
problems with it.
Basically the thread will have to just run constantly, never exiting
(just sleeping for 2secs), which seems to work OK except when I try to
get the thread to do anything with the main program's window.
As the thr
Damn, seems Qt GUI objects (windgets) aren't thread-safe:
http://doc.trolltech.com/3.3/threads.html#11
So I'm going to have to find a way of using a thread to fetch the data,
and then using the main program to update the GUI... Someone suggested
using events:
http://mail.python.org/pipermail/pyt
201 - 300 of 1585 matches
Mail list logo