I couldn't help but make an even better list in reference to this thread:
http://mail.python.org/pipermail/python-list/2005-July/288678.html
Type Convention
Example
funtion
action_with_underscores
find_all
vari
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
Hi,
We program in Delphi in our shop and are generally very happy with it.
We are now looking at cross-platform options especially for middle
tier and web server.
I have been doing a lot of reading and testing of Python, I am falling
in love with the language :-)
But seems to be be very difficul
"Derek van Vliet" <[EMAIL PROTECTED]> writes:
> 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 t
"George Sakkis" <[EMAIL PROTECTED]> writes:
> "Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
>
>> But it doesn't make sense to say that two flags are equal:
>>
>> keep_processing = True
>> more_reading_needed = True
>> while more_reading_needed and keep_processing:
>> get_more_records()
>>
Peter Hansen wrote:
> [str(parrot) for parrot in sequence], for example, tells you much more
> about what is going on than str(x) does.
>
> Exactly what, I have no idea... but it says _so_ much more. ;-)
Yarr! Avast! Etc!
--
http://mail.python.org/mailman/listinfo/python-list
I don't know of a portable way for an inetd-style daemon to "listen" for
user logins.
On some systems (including RedHat/Fedora and debian), you may be able to
use PAM to do this. (pam modules don't just perform authentication,
they can take other actions. As an example, pam_lastlog "prints the
l
Carl Banks wrote:
> I suspect you're misunderstanding what I mean by heavily functional.
> Heavily functional programming is a different mindset altogether. In
> heavily functional programming, things like maps and filters and
> function applications are actually what you're thinking about. map
This stupid code works for modules, but not for packages. It probably has bugs.
import marshal, types
class StringImporter:
def __init__(self, old_import, modules):
self._import = old_import
self._modules = modules
def __call__(self, name, *args):
module = self.
The curve may take a while, but I'd definately recommend it.
While you're at it, why not switch th front end to python too?
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis wrote:
> Ron Adam wrote:
>
>> In this case sum and product fulfill 90% (estimate of course) of
>> reduces use cases. It may actually be as high as 99% for all I know.
>> Or it may be less. Anyone care to try and put a real measurement on it?
>
> Well, reduce covers 100% of th
"Mike Meyer" <[EMAIL PROTECTED]> wrote:
> "George Sakkis" <[EMAIL PROTECTED]> writes:
> > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> >
> >> But it doesn't make sense to say that two flags are equal:
> >>
> >> keep_processing = True
> >> more_reading_needed = True
> >> while more_reading_needed
On Mon, 04 Jul 2005 19:25:13 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote:
>"Derek van Vliet" <[EMAIL PROTECTED]> writes:
>
>> 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
Hello. I am very new to Python, and have been unable to figure out how
to check if a variable exists or not. In the following code I have made
a kludge that works, but I think that it would be clearer to check if
closest exists and not have to initialize it in the first place. How is
that check don
On Monday 04 July 2005 07:42 am, Ivan Van Laningham wrote:
> Terry Hancock wrote:
> > I also got "space_hi.vim" which highlights tabs
> > and trailing spaces, which made it a lot easier to fix the
> > problem.
>
> Is that really the name? I tried searching for it & got no hits.
Sorry, no unders
In article <[EMAIL PROTECTED]>,
Peter Hansen <[EMAIL PROTECTED]> wrote:
>
>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 believer in strict
>decoupling between my tools, to the point of ignoring things that bundle
Derek van Vliet enlightened us with:
> 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_CompileS
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
"A.M. Kuchling" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 1 Jul 2005 14:22:51 -0400,
> Terry Reedy <[EMAIL PROTECTED]> wrote:
>> Thanks for posting this and thanks for coordinating the PSF effort.
>
> I did little beyond writing up that wiki page. David Ascher
> has b
Josiah Manson wrote:
> Hello. I am very new to Python, and have been unable to figure out how
> to check if a variable exists or not. In the following code I have made
> a kludge that works, but I think that it would be clearer to check if
> closest exists and not have to initialize it in the first
"Dark Cowherd" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> We program in Delphi in our shop and are generally very happy with it.
> We are now looking at cross-platform options especially for middle
> tier and web server.
>
> I have been doing a lot of reading and testing of Pyt
How is your Firebird database configured -- Classic Server or Super
Server? If it's in classic server mode, you don't need to worry about
the host portion. You do need to worry about permissions on the
database file. I got it to work by making it 664 and owner + group
firebird.
Grig
--
http://ma
Josiah Manson wrote:
> Hello. I am very new to Python, and have been unable to figure out how
> to check if a variable exists or not. In the following code I have made
try:
variable
except NameError:
# variable doesn't exist
else:
# variable exists
But it is rare that you actually ne
Hello all,
I am in the process of writing a multithreading program and what I was
wondering is a sleep command in an executing function will affect the
threads below it? Here is a basic example of what I mean.
def main():
temp_var = True
while temp_var == True:
if
t = threa
"Josiah Manson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello. I am very new to Python, and have been unable to figure out how
> to check if a variable exists or not. In the following code
Python does not have variables is the sense some other languages do. It
has (typele
> > the only thing I want are the number of places blabla, Re modules
> > sucks! and blabla are.
>
> Your question is still not clear. What you're searching for is
> '', which isn't there, so .search returns None, and so
> you get that exception (.group takes an argument, anyway).
That's what
Steven D'Aprano wrote:
> James Dennett wrote:
>
>> > Yes: 5^2 + -2^2 is 29, however you write it.
>>
>> *If* you take -2 as a number, but not if you take the number
>> as 2 and the unary minus as an operator with lower precedence
>> than exponentiation.
>
>
> [snip]
>
>> Not in this respect.
Hi Josiah,
> Hello. I am very new to Python, and have been unable to figure out how
> to check if a variable exists or not. In the following code I have made
> a kludge that works, but I think that it would be clearer to check if
> closest exists and not have to initialize it in the first place. H
I could not find another example of this via internet searches, so here
it is... I am wondering if this is a python bug or otherwise. The
first example of this happened in a larger program of mine, and the
traceback reports the problem at the start of a "for" loop (making no
sense), but I cannot
Steven Bethard wrote:
> And it's almost two times slower:
That's because you're not using operator.add.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Virtue has never been as respectable as money.
-- Mar
Joe Peterson wrote:
> I could not find another example of this via internet searches, so here
> it is... I am wondering if this is a python bug or otherwise. The
> first example of this happened in a larger program of mine, and the
> traceback reports the problem at the start of a "for" loop (mak
George Sakkis wrote:
> Hi Josiah,
>
>> Hello. I am very new to Python, and have been unable to figure out how
>> to check if a variable exists or not. In the following code I have made
>> a kludge that works, but I think that it would be clearer to check if
>> closest exists and not have to initi
Christopher Subich wrote:
> That said, Python itself is mostly a procedural language, with the
> functional tools really being bolted on[1].
[etc., snip]
Yeah, that's pretty much what I said in the first place.
--
CARL BANKS
--
http://mail.python.org/mailman/listinfo/python-list
I am relatively new to Python ...
I have a script that uses urllib2 to open another XML file off of the
same server the PY file is living on.
urllib2.urlopen(url).read()
I changed a bit of it to use:
open(filename, 'r').read()
to open the file locally rather than making an HTTP call however the
"tiissa" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Variables are stored in two dictionnaries: globals() (for global
> variables) and locals() (for the local ones, which are also global on
> top level).
Within a function, the local namespace is usually *not* a dictionary.
D=lo
On Monday 04 July 2005 13:49, Jeff Epler wrote:
> I don't know of a portable way for an inetd-style daemon to "listen" for
> user logins.
>
> On some systems (including RedHat/Fedora and debian), you may be able to
> use PAM to do this. (pam modules don't just perform authentication,
> they can ta
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I came up with a simpler testcase. Strangely, the exception occurs in
> the statement *following* the os.utime() call:
>
> >>> import os, sys
> >>> os.utime("foo_test_file", (0, float(sys.maxint+1)))
> >>> print "hi"
George Sakkis wrote:
> And finally for recursive flattening:
>
> def flatten(seq):
> return reduce(_accum, seq, [])
>
> def _accum(seq, x):
> if isinstance(x,list):
> seq.extend(flatten(x))
> else:
> seq.append(x)
> return seq
>
>
flatten(seq)
>
> [1, 2, 3,
Erik Max Francis wrote:
> Steven Bethard wrote:
>
>> And it's almost two times slower:
>
> That's because you're not using operator.add.
Huh? Please re-read my post. That's exactly what I used.
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
os.utime("foo_test_file", (0, float(sys.maxint+1)))
> Traceback (most recent call last):
> File "", line 1, in ?
> TypeError: utime() arg 2 must be a tuple (atime, mtime)
>
> which is quite sane. So maybe bug was introduced in 2.3 which you were
> running.
But arg 2 *is*
I wrote the following to prove to myself that
deepcopy would copy an entire dictionary
which contains an instance of a class to
one key of another dictionary.
Note that after copying adict to ndict['x']
I delete adict.
Then ndict['x'] contains a good copy of adict.
works great.
class aclass:
Jeffrey Maitland wrote:
> I am in the process of writing a multithreading program and what I was
> wondering is a sleep command in an executing function will affect the
> threads below it?
Note that the "executing function" is itself running inside a thread,
specifically the "main thread". The
On Monday 04 July 2005 12:39 pm, Gustavo Niemeyer wrote:
> > > the only thing I want are the number of places blabla, Re modules
> > > sucks! and blabla are.
> >
> > Your question is still not clear. What you're searching for is
> > '', which isn't there, so .search returns None, and so
> > you ge
On Mon, 04 Jul 2005 15:35:56 +0100, Tom Anderson wrote:
>>> Also, would it be a good idea for (-1.0) ** 0.5 to evaluate to 1.0j? It
>>> seems a shame to have complex numbers in the language and then miss this
>>> opportunity to use them!
>>
>> It's generally true in Python that complex numbers are
James Stroud wrote:
> Its perhaps that they remember the frustration of being new to programming.
> Those "wasted" 1.5 hr sessions getting nowhere add up pretty fast and then
> the explicatives begin to flow.
Also because the best way to make someone who's having a tantrum look
foolish in publ
On Mon, 04 Jul 2005 21:17:21 +0200, tiissa wrote:
> Josiah Manson wrote:
>> Hello. I am very new to Python, and have been unable to figure out how
>> to check if a variable exists or not. In the following code I have made
>> a kludge that works, but I think that it would be clearer to check if
>>
Mathias Waack wrote:
> Maurice LING wrote:
>
>
>>I've been using FB1.5 and access the database using Kinterbasdb +
>>Python. My connection is established using kinterbasdb.connect() method
>>and the parameters host, dns, database, user, password are all defaulted
>>to 'None'.
>>
>>On my own machi
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> Should we *really* be encouraging newbies to mess with globals() and
> locals()? Isn't that giving them the tools to shoot their foot off before
> teaching them how to put shoes on?
Why risk damaging perfectly good footwear?
But, seriously, I agree wit
Hi,
I actually replied saying that the process dies when close(wait=0) is
done (the reply doesn't show up yet). It is not correct. The process
actually runs but ends up in zombie status (defunct).
Raghu.
--
http://mail.python.org/mailman/listinfo/python-list
anybody know why "edit-and-execute-command" doesn't work in python's readline?
it doesn't even show up in a dump of readline functions:
$ cat fc_test
>> My question isn't as all-encompassing as the subject would
>> suggest...
>>
>> I am almost a Python newbie, but I have discovered that I don't
>> get along with IDLE, as i can't work out how to run and rerun a
>> routine without undue messing about.
>>
>> What I
+1 on investing in emacs. There's a shiny new release of the Oreilly,
which is (a really large book) that a lot of people teach themself out
of:
http://www.oreilly.com/catalog/gnu3/
But i would also recommend komodo from activestate's IDE, easy and
powerful, once you understand what all's in the
Ok, I've attached the proto PEP below.
Comments on the proto PEP and the implementation are appreciated.
Sw.
Title: Secure, standard serialization of simple python types.
Abstract
This PEP suggests the addition of a module to the standard library,
which provides a serialization class
I am a C# programmer and new to the language and I am trying to debug some
code which uses this feature. Can anyone elaborate on what it is and how it
is used?
Regards,
Ric
--
http://mail.python.org/mailman/listinfo/python-list
Ric Da Force wrote:
> I am a C# programmer and new to the language and I am trying to debug
> some code which uses this feature. Can anyone elaborate on what it
> is and how it is used?
__slots__ is used for memory and performance gains in classes that need
them. A class with __slots__ has a fix
To save a a few bytes (10?) per instance instead of having a dict to
hold attributes one has slots!
Designed for having lots of instances (millions?) at the same time to
save space!
"Ric Da Force" <[EMAIL PROTECTED]> wrote:
>I am a C# programmer and new to the language and I am trying to debug s
Patrick Rutkowski wrote:
> I couldn't help but make an even better list in reference to this thread:
>
I'll go you one better :<))
I found the source of what I pulled that table from:
http://jaynes.colorado.edu/PythonGuidelines.html
Lee C
--
http://mail.python.org/mailman/listinfo/python-l
Stupid of me.
I want some feedback on folllwing:
anybody who has experience in writing SOAP servers in Python and data
entry heavy web applications.
Any suggestions?
darkcowherd
On 7/4/05, Dark Cowherd <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We program in Delphi in our shop and are generally very
Yep, my thinking too. Well, maybe it's all related to the same bug
somehow. OK, I submitted a bug report, and I included a slight
modification of the test case you guys suggested:
import sys
import os
t = 2147483648L
os.utime("foo_test_file", (t, t))
print "hi"
---
Gustavo Niemeyer wrote:
> 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.
...and then someone else comes along and calls the first person stupid
and arrogant, which is deemed QOTW. :)
--
http://m
[EMAIL PROTECTED] wrote:
> Currently, I am spawning a new thread
> that just does pexpect_spawned_child.close(wait=1). It seems to work in
> some cases but the child process is occassionally getting deadlocked.
I think your only cross-platform option will be to fix the child
process to die nicely
Hello fowlertrainer,
> Hi !
>
> The problem that when I started the program from CMD, the sys.argv is
> show the good path (in my machine the c:\dev\...) from Dialog1.py.
> But when I compile it with Py2Exe, and try to start the exe, it has been
> not found the hwinfo.ini file what store th
Hello all,
I have a Tcldot package which I am using with Tcl (I source the package
by 'load .\libtcldot.so.0' command.
Now I want to use this package in Tkinter.
Can anyone suggest me how to do this?
I tried the foll:
root=Tk()
root.tk.eval('load ..\libtcldot.so.0')
root.mainloop()
But I ge
Maurice LING wrote:
> What I am trying to do is "port" a workable program from my own machine
> (Mac OSX) to a larger machine (Linux). So, the DB and the program are
> also on the same Linux machine.
>
> On the Linux machine, I cannot use localhost, so I set host parameter in
> kinterbasdb.connec
101 - 165 of 165 matches
Mail list logo