Hmm. setattr() only does a shallow search. Good to know.
Your
if not name in dict: setattr(cls, name, value)
is a more succinct/better way of writing
if not cls.__dict__.has_key(var): setattr(cls, var, val)
Which i tested a fair bit.
OK it appears that both are working for the simple
Lenny G. wrote:
> What's the best way to do cross-platform hidden file detection? I want
> to do something like weed-out the files that should be 'hidden' from
> os.listdir() (which would be files that start with '.' under Unix,
> files that have the hidden attribute set on windows, and whatever i
hello sir i want to aceess database at any location i know my.ini config. setting but my problem is suppose my i have two database ie. abc & xyz abc database is stored at path c:\apache\mysql\data this path is also in my.ini . & xyz database at path c:\mydocument i want to access both database
Terry Hancock wrote:
> I disagree that transactions are bad for CAD -- they may have
> a different semantic role and the needed granularity may be
> different, but the need to roll data back to an earlier revision
> is just as present in drawings as it is for code or financial
> transactions.
Sure
bruno at modulix wrote:
> fin = open(path, 'r')
> fout = open(temp, 'w')
> for line in fin:
> if line.strip():
> fout.write(line)
> fin.close()
> fout.close()
>
> then delete path and rename temp, and you're done. And yes, this is
> actually the canonical way to do this !-)
What if there's a
Hello . . I am trying to control an NIDS (network intustion detection system) that uses Snort via mobile phones, but I need urgent help please in the following topics below: 1. How to send a text file from a PC running windows to a nokia mobile phone series 60, for example nokia 6680 via bluet
Ben Finney wrote:
>> I see what you mean, but I think that's why I like using open,
>> because I like having my functions be verbs instead of nouns.
>
> Note though that you're calling a class (in this case, type)
> constructor, to return a new object.
no, he's calling a factory function to get
Talin wrote:
> Specification
>
> Syntactically, the proposed changes are fairly simple. The first
> change is to allow regular arguments to appear after a varargs
> argument:
>
> def sortwords(*wordlist, case_sensitive=False):
>...
>
> This function accepts any
Isn't it a bit overkill to implement the whole .net framework 'Just'
for a GUI ??
If you want to build quickly nice GUI's for your python program, have a
look at wxpython & wxdesigner
Rony
> Is it possible to construct a C# form (using Visual Studio) but write only
> Python code for the even
All
would anyone happen to have code to generate Cutter Numbers:
eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm
or is anyone looking for something to do?-) (I'm under pressure!)
def cutter(lname, fname, book_title):
(maybe more to it than that).
cheers
Gerard
--
http:/
John Salerno wrote:
> Is it possible to construct a C# form (using Visual Studio) but write
> only Python code for the events? Is there some way to tell your program
> to run Python whenever code is run, since it will be all Python code
> (e.g. for button presses, etc.)?
>
> I know it's sort of si
Fredrik Lundh wrote:
> Cameron Laird wrote:
>
> > Guys, I try--I try *hard*--to accept the BetterToAskForgiveness
> > gospel, but this situation illustrates the discomfort I consistently
> > feel: how do I know that the NameError means VARIABLE didn't resolve,
> > rather than that it did, but that
Dennis Lee Bieber wrote:
> On Fri, 19 May 2006 14:41:13 +, [EMAIL PROTECTED] (Cameron Laird)
> declaimed the following in comp.lang.python: .
> > Guys, I try--I try *hard*--to accept the BetterToAskForgiveness
> > gospel, but this situation illustrates the discomfort I consistently
> >
PA wrote:
> On May 19, 2006, at 15:33, Diez B. Roggisch wrote:
>
> > And it seems as if you have some JAVA-background, putting one class in
> > one
> > file called the same as the class. Don't do that, it's a stupid
> > restriction
> > in JAVA and should be avoided in PYTHON.
>
> Restrictive or not
mardif wrote:
> OK OK GUYS
> I've found the solution: ( effectly, a friend of mine has found the
> solution )
>
> import os
>
> os.spawnl(os.P_WAIT, "c:\programmi\internet
> explorer\iexplore.exe",'"C:\Documents and
> Settings\michele\Desktop\ciccio.html"','"C:\Documents and
> Settings\michel
elventear wrote:
> Hi,
>
> I am the in the need to do some numerical calculations that involve
> real numbers that are larger than what the native float can handle.
>
> I've tried to use Decimal, but I've found one main obstacle that I
> don't know how to sort. I need to do exponentiation with re
Tim Peters wrote:
> The GNU GMP library (for which Python bindings are available) also
> supports "big floats", but their power operation is also restricted to
> integer powers and/or exact roots. This can be painful even to try;
> e.g.,
>
>>>> from gmpy import mpf
>>>> mpf("1e1") *
Kyler Laird wrote:
> Ivan Voras <[EMAIL PROTECTED]> writes:
>
>
>>Most of the problems are probably because I didn't mean it to be a
>>fully-compliant WebDAV server, but to serve my need at the time :)
>
>
> I am *so* close to having a WebDAV solution. Unfortunately when I finally
> moved to
achates wrote:
> Yeah - we've got to the repeating ourselves stage.
Actually a couple of the responses on this newsgroup
have settled the question for me. I did learn something
new by engaging in this holy war.
Tabs need not be evil, but ONLY if they are used in one
particular way:
If you rea
given i = 0,
I know i = i + 1 and i += 1 are all correct
but when I type:
>>> i++
the interpreter replies:
File "", line 1
i++
^
SyntaxError: invalid syntax
so I get the idea that suffix ++ is invalid in python
but when I input:
>>> ++i
and the interpreter replies
0
Don't you think it
[EMAIL PROTECTED] wrote:
> given i = 0,
> I know i = i + 1 and i += 1 are all correct
> but when I type:
>
i++
>
> the interpreter replies:
> File "", line 1
> i++
> ^
> SyntaxError: invalid syntax
>
> so I get the idea that suffix ++ is invalid in python
> but when I input:
>
>
[EMAIL PROTECTED] wrote:
> Don't you think it is misleading when you expect a variable to
> increment?
no. and in my experience, most people know that they cannot just type
random stuff into a computer and expect it to do what they want.
(have you figured out *why* this is valid syntax, and wh
>++i
>>
>>and the interpreter replies
>>0
>>
>>Don't you think it is misleading when you expect a variable to
>>increment?
>>
>
> Terribly. So stop expecting it to increment :)
>
> Seriously, --i is also valid Python. Both expressions apply two unary
> operators to a name. Would you have the
[EMAIL PROTECTED] wrote:
> but when I input:
++i
> and the interpreter replies
> 0
>
> Don't you think it is misleading when you expect a variable to
> increment?
You have been warned...
$ cat pp.py
i = 42
++i
print i
--i
$ pychecker pp.py
Processing pp...
42
Warnings...
pp.py:2: Operato
Gerard Flanagan wrote:
> All
>
> would anyone happen to have code to generate Cutter Numbers:
>
> eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm
>
> or is anyone looking for something to do?-) (I'm under pressure!)
>
> def cutter(lname, fname, book_title):
>
What do you use lna
Christopher Weimann wrote:
> On 05/19/2006-07:18AM, Duncan Booth wrote:
>>
>> My experience of programming with either spaces or tabs has taught me
>> that tabs are evil not for themselves, but simply because no matter how
>> hard you try they always end up being mixed with spaces.
>>
>
> Swap
> I am stumped about what to do when the first letter is Q not
> followed by U. It says to use numbers 2-29 for the second
> letters a-t, but that is obviously not right (for one thing t
> would be 21, not 29).
>
> Since you seem a little bit more experienced in library
> science could you ex
[EMAIL PROTECTED] wrote in news:1148133784.844430.23130@
38g2000cwa.googlegroups.com:
> Gerard Flanagan wrote:
>> All
>>
>> would anyone happen to have code to generate Cutter Numbers:
>>
>> eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm
>>
[...]
>
> I wrote a script to see if
[Raymond L. Buvel, on
http://calcrpnpy.sourceforge.net/clnumManual.html
]
> The clnum module handles this calculation very quickly:
>
> >>> from clnum import mpf
> >>> mpf("1e1") ** mpf("3.01")
> mpf('9.99932861e30099',26)
That's probably good enough for the OP's needs
Rony Steelandt wrote:
> Isn't it a bit overkill to implement the whole .net framework 'Just'
> for a GUI ??
>
> If you want to build quickly nice GUI's for your python program, have a
> look at wxpython & wxdesigner
wxdesigner looked good until I had to pay. :(
--
http://mail.python.org/mailma
Tim Peters wrote:
> [Raymond L. Buvel, on
>http://calcrpnpy.sourceforge.net/clnumManual.html
> ]
>
>> The clnum module handles this calculation very quickly:
>>
>> >>> from clnum import mpf
>> >>> mpf("1e1") ** mpf("3.01")
>> mpf('9.99932861e30099',26)
>
>
> That's pr
John,
I know you started out asking about .NET, but peruse this thread,
wherein some old hands recommend staying with what you know, if what
you know is VBA guis.
http://tinyurl.com/ehujm
rick
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Ben Finney <[EMAIL PROTECTED]> wrote:
>"Tim Peters" <[EMAIL PROTECTED]> writes:
>> [John Salerno, on the difference between `open` and `file`]
>>>
>>> Interesting. What is the difference between them now?
>>
>> In 2.5 `file` is unchanged but `open` becomes a functi
[EMAIL PROTECTED] wrote:
> Gerard Flanagan wrote:
> > All
> >
> > would anyone happen to have code to generate Cutter Numbers:
> >
> > eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm
> >
> > or is anyone looking for something to do?-) (I'm under pressure!)
> >
> > def cutter(lnam
Find Your Soul Mate !
Cheat Your Wife/Husband!
Try New Things!
Or Just Met Friends!
http://affiliatecash.designerlove.com/idevaffiliate.php?id=3537
--
http://mai
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm cataloging a small library and want to generate a unique id (called
> a 'call number') for each book. This id is composed of:
>
> * Dewey 3-digit Subject Classification Number
> * Dewey Decimal (always 0 for the
A little out-of-order execution seems useful here. ;)
John Bokma wrote:
> Edward Elliott <[EMAIL PROTECTED]> wrote:
>> I can readily believe that the "community" frequenting the newsgroups,
>> mailing lists, and blogs don't encourage it anymore. But that's a
>> tiny fraction of all perl programm
You may remember the request for comments at the start of this year:
http://groups.google.com/group/comp.lang.python/msg/b0e3487ef8b13eed
http://groups.google.com/group/comp.lang.ruby/msg/b0e3487ef8b13eed
-
The services of "Lazaridis System Design" have reached pre-release state
and will be soo
John D Salt wrote:
> Most things don't have names?
>
> I'll believe you if you can give me a list of ten things that don't have
> names.
Chairs, couches, tables, desks, beds, cars, pens, phones, trees, windows
(can you tell how I came up with this list? ;). Those are all object types
without n
[Raymond L. Buvel, on
http://calcrpnpy.sourceforge.net/clnumManual.html
]
>>> The clnum module handles this calculation very quickly:
>>>
>>> >>> from clnum import mpf
>>> >>> mpf("1e1") ** mpf("3.01")
>>> mpf('9.99932861e30099',26)
[Tim Peters]
>> That's probably good e
PythonCard is based on wxpython and it's free:
http://pythoncard.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
Yes! It is. Just make your GUI in C# and assign event handlers using
Python for .NET
http://www.zope.org/Members/Brian/PythonNet/
Python for .NET is a great tool and has a minimal learning curve.
Unfortunately, it hasn't attracted enough attention from the Python
community. It does not have a .NET
webfolders is broken, I have worked on webdav support at the isp level
( for millions of customers to use ) webfolders is NOT something you
should base compliancey on. It is broken so badly that we decided to
just not even test against it. We provide our customers with our own
application with whic
I have an application that runs on mod_python/apache using the publisher
handler. It uses an access db as the backend and connects via ADO. In a
test environment on XP it runs fine, but when on a win2k3 server it will
load one page, but all subsequent page loads throw a
pythoncom.CoInitialize
elventear wrote:
> Hello,
>
> I am working with Python 2.4.3 built from source courtesy of Fink. So
> far so good, until now. I want to use a module called GMPY
> (http://gmpy.sf.net/). I am able to build correctly the module, but
> once I try to import it I get the following error:
>
> ImportErr
Some details, and this is weirder than I thought.
It is working fine with internet explorer or mozilla as the client, but only
crashes with Firefox. Moreover, even while firefox is getting errors, IE
stilll works fine.
The error I get is:
Mod_python error: "PythonHandler mod_python.publisher"
I believe that the answer to my question is no, but I want to be sure that I
understand this issue correctly: Suppose that there are two classes
defined as follows:
class A(object):
def f1(self):
print 'In A.f1, calling func'
self.func()
def func(self):
print 'In
In <[EMAIL PROTECTED]>, Christophe wrote:
> Well, the main reason for such change is and will always be to catch
> bugs. The fact is, using duct typing is something very common with the
> Python language.
Duct typing? I guess you mean duct taping, or duck taping [1] or maybe
duck typing. :-)
http://daviderognoni.blogspot.com?locawapp
- MAIN NEWS
===
* add ajax
* new "Request" methods
* fixed editor.py
* fixed files.py
* ...
- DESCRIPTION
=
LocaWapp want use HTML and Python not only for the web, but also for
the local applications:
Local + HTML + Python = Loca
hello --
i'm running python/pygame on maemo (nokia 770). my situation is that
i'm continually scouring this one directory for incoming files. if i
see if there's a new file (coming in via wireless scp), i proceed to
load it and process it.
however, i think i am running into the issue that my prog
Hi everyone,
I am in the process of creating a file transmit/receiver program using
MQSeries.
The way it works is through creation of an XML message.
Elements within the XML message contain things such as file name, size,
and the file contents.
The file contents are encoded, currently using Bas
[EMAIL PROTECTED] wrote:
> hello --
>
> i'm running python/pygame on maemo (nokia 770). my situation is that
> i'm continually scouring this one directory for incoming files. if i
> see if there's a new file (coming in via wireless scp), i proceed to
> load it and process it.
>
> however, i think
I'm interested in taking the output of a daemonized shell script that
greps for patterns which would act as an argument to a script. Is it
better to write this stuff to file and visit the file every few seconds
or can this be done a better way. I'm hoping for a more elegant
solution. So far I've se
Edward Elliott <[EMAIL PROTECTED]> wrote:
> A little out-of-order execution seems useful here. ;)
No, not interested in a pissing contest. Your statement that the Perl
community encourages importing is *encouraged* (over using OO without
importing) is false.
--
John
John Bokma wrote:
> Edward Elliott <[EMAIL PROTECTED]> wrote:
>
>> A little out-of-order execution seems useful here. ;)
>
> No, not interested in a pissing contest. Your statement that the Perl
> community encourages importing is *encouraged* (over using OO without
> importing) is false.
The c
I'm trying to convert some PHP code using OpenSSL to Python and I'm stuck
on openssl_sign() which uses an RSA private key to compute a signature.
Example PHP code:
$privkeyid = openssl_get_privatekey($priv_key, $key_pass);
openssl_sign($data, $signature, $privkeyid);
openssl_free_key($privk
Jeffrey Barish wrote:
> I believe that the answer to my question is no, but I want to be sure that I
> understand this issue correctly: Suppose that there are two classes
> defined as follows:
>
> class A(object):
> def f1(self):
> print 'In A.f1, calling func'
> self.func()
>
[EMAIL PROTECTED] wrote:
> I'm interested in taking the output of a daemonized shell script that
> greps for patterns which would act as an argument to a script. Is it
> better to write this stuff to file and visit the file every few seconds
> or can this be done a better way. I'm hoping for a more
Edward Elliott wrote:
> John Bokma wrote:
>
> > Edward Elliott <[EMAIL PROTECTED]> wrote:
> >
> >> A little out-of-order execution seems useful here. ;)
> >
> > No, not interested in a pissing contest. Your statement that the Perl
> > community encourages importing is *encouraged* (over using OO w
Edward Elliott wrote:
> This is just anecdotal, but I still find it interesting. Take it for what
> it's worth. I'm interested in hearing others' perspectives, just please
> don't turn this into a pissing contest.
>
> I'm in the process of converting some old perl programs to python. These
> pr
Edward Elliott <[EMAIL PROTECTED]> wrote:
> You lecturing people on pissing contests, that's rich. Nice way to
> duck the issue and sound like a winner.
Then you've missed what a discussion really is. It's not about winning,
it's about learning. Sadly you missed that point.
> Wake me when you
"George Sakkis" <[EMAIL PROTECTED]> wrote:
> Not trying to be as ass, but can you take this offline or at least in
> a perl newsgroup ? Arguing on a particular fact or speculation about
> the perl community is rather unproductive and offtopic for a python
> newsgroup.
Use a real Usenet client, an
George Sakkis wrote:
> Not trying to be as ass, but can you take this offline or at least in a
> perl newsgroup ? Arguing on a particular fact or speculation about the
> perl community is rather unproductive and offtopic for a python
> newsgroup.
No offense taken. It's definitely OT. I left it
thanks - i'm looking, but i found this as well. actually, does this
work?
import os
os.access(file, os.R_OK) # is it readable?
is this valid:
{ i have my file identified }
isFileAccessible = os.access(file, os.R_OK)
while !isFileAccessible:
isFileAccessible = os.access(file, os.R_OK)
and t
In article <[EMAIL PROTECTED]>,
Andrew Robert <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] wrote:
>> hello --
>>
>> i'm running python/pygame on maemo (nokia 770). my situation is that
>> i'm continually scouring this one directory for incoming files. if i
>> see if there's a new file (coming in
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>I'm interested in taking the output of a daemonized shell script that
>greps for patterns which would act as an argument to a script. Is it
>better to write this stuff to file and visit the file every few seconds
>or can
I have one suggestion. It's a beautiful page, and one day I'll know
enough to appreciate the help it provides, but until then it's always a
big help to the novice (in many fields of knowledge) if the first use
of an acronym includes the words it stands for in parenthesis.
In law and medicine and m
Larry Bates wrote:
> Sorry, I don't buy this. I can write REALLY short programs that don't
> handle exceptions, don't provide for logging for debugging purposes, don't
> allow
> for future growth, etc. I find that 60% of my code has nothing to do with
> the actual algorithm or function I'm tryin
That's just it. I was hoping to have python listening for events and
responding continually according to the demaons stdout. That's why I
mention popen2.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
while playing with the rfc822 module and imaplib, I've found the
following weird behaviour. Quickstart: rfc822.Message(fp) instantiates
a rfc822.Message object from a file object fp. The docs for the rfc822
module say here:
Input lines as read from the file may either be terminated by
John Bokma wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> > Not trying to be as ass, but can you take this offline or at least in
> > a perl newsgroup ? Arguing on a particular fact or speculation about
> > the perl community is rather unproductive and offtopic for a python
> > newsgroup.
Peter Otten wrote:
class Int(object):
[snip]
> ... def __pos__(self):
> ... if self.half:
> ... self.value += 1
> ... self.half = not self.half
> ... return self
[snip]
i = Int()
which leads us to:
i
> 0
+i
> 0
Roy Smith wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
>> Currently there's no good duck-typing way to differentiate
>> strings from other sequences.
>
> I suppose you could do something like:
>
> try:
>foo.isalpha
> except AttributeError:
>print "foo is not a string"
Another way:
if
John Machin wrote:
> Use case?
quicksort! :)
--
Edward Elliott
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net
--
http://mail.python.org/mailman/listinfo/python-list
Hey
I'm trying to set up a WeakrefValueDictionary of callables however as
soon as my method that adds the callable to the dictionary exits the
value is removed? Is there any way around this?
Example:
import weakref
TEST_EVENT = 1
class TestBinder:
def __init__( self ):
"George Sakkis" <[EMAIL PROTECTED]> wrote:
> John Bokma wrote:
>
>> "George Sakkis" <[EMAIL PROTECTED]> wrote:
>>
>> > Not trying to be as ass, but can you take this offline or at least in
>> > a perl newsgroup ? Arguing on a particular fact or speculation about
>> > the perl community is rather
Hi all!
I have been translating some Python custom C extension code into Python,
as I need these modules to be portable and run on a PocketPC without the
need of compile (for the purpose its a must 2.4 as it is the last
PythonCE release with great improvements).
But I've been stuck with a scri
I reply again attaching a file as I see the editor wrecked the tab
indentation.
Gonzalo Monzón escribió:
Hi all!
I have been translating some Python custom C extension code into
Python, as I need these modules to be portable and run on a PocketPC
without the need of compile (for the purpose
I reply again attaching a file as I see the editor wrecked the tab
indentation.
Gonzalo Monzón escribió:
Hi all!
I have been translating some Python custom C extension code into
Python, as I need these modules to be portable and run on a PocketPC
without the need of compile (for the purpose
John Bokma wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> > John Bokma wrote:
> >
> >> "George Sakkis" <[EMAIL PROTECTED]> wrote:
> >>
> >> > Not trying to be as ass, but can you take this offline or at least in
> >> > a perl newsgroup ? Arguing on a particular fact or speculation about
>
The effbot wrote:
> George Sakkis wrote:
>
>>> It would be useful if list.sort() accepted two more optional
>>> parameters
>
> useful for what? what's the use case ?
>
John Machin then wrote, without quoting any context at all:
> Use case?
>
He means "under what circumstances do you see someo
Steve Holden wrote:
> The effbot wrote:
>
>>George Sakkis wrote:
>>
It would be useful if list.sort() accepted two more optional
parameters
>>
>>useful for what? what's the use case ?
>
> John Machin then wrote, without quoting any context at all:
>
>>Use case?
>
> He means "under what
Lloyd Weehuizen wrote:
> Hey
>
> I'm trying to set up a WeakrefValueDictionary of callables however as
> soon as my method that adds the callable to the dictionary exits the
> value is removed? Is there any way around this?
>
> Example:
> import weakref
> TEST_EVENT = 1
>
> class TestBinder:
>
Robert Kern wrote:
> Steve Holden wrote:
>
>>The effbot wrote:
>>
>>
>>>George Sakkis wrote:
>>>
>>>
>It would be useful if list.sort() accepted two more optional
>parameters
>>>
>>>useful for what? what's the use case ?
>>
>>John Machin then wrote, without quoting any context at all:
>>
Steve Holden wrote:
> Robert Kern wrote:
>>I believe that John was asking George for a use case rather than asking
>>Fredrik
>>what a use case was.
>
> In which case, as I pointed out, John would have done better to quote a
> little more context.
No argument here.
--
Robert Kern
"I have com
Jeffrey Barish wrote:
[overriding of base class member functions by subclass]
> but then B does not inherit other functions of A that I would like to use.
> It struck me that this must be a common problem in OOP, so I'm wondering
> whether there is a simple solution that I am missing.
In C++, o
None of you seem to know what you are talking about.
Flash should be used where one needs to use Flash, and HTML/JS/CSS
(+XML+XSLT) likewise.
Flash can play video. That is not possible w/ HTML/CSS/JS.
Flash also behaves consistently cross-browser, cross/platform -- and
most features cannot be di
"George Sakkis" <[EMAIL PROTECTED]> wrote:
> John Bokma wrote:
>> "George Sakkis" <[EMAIL PROTECTED]> wrote:
[ Xah Lee ]
>> [1] He is looking for another hoster btw.
>
> This must feel really empowering huh ?
I am sure I've had quite some help. Also, you made quite a mistake. I have
0 power,
88 matches
Mail list logo