Re: Using Python for my web site

2006-08-01 Thread Conrad
On Mon, 31 Jul 2006 19:14:03 +0200, Bruno Desthuilliers wrote:

> northband wrote:
>> Hi, I am interested in re-writing my website in Python vs PHP but have a
>> few questions. Here are my specs, please advise as to which
>> configuration would be best:
>> 
>> 1.Dell Poweredge Server, w/IIS, currently Windows but considering
>> FreeBSD
> 
> I may be a bit biased, but I would not run a web server under Windows...
> 

That's not biased - that's just good sense. When I started in
this business, there was a saying "Nobody ever got fired for
recommending IBM" - even though there were sometimes better
solutions, IBM was the politically safe choice. Windows has now 
filled that niche, sadly. BSD is a hard sell in many shops,
and it has nothing to do with it's merits, which are considerable.
When you consider that you can build a BSD server with the
kernel stripped down to exactly the pieces you need, and load
only the packages you need, when you consider that the BSDs have
dominated the netcraft uptimes charts, one wonders just what
process is gone through to EVER select a Windows server platform.
I want, no, I demand a server to be secure, stable and efficient. 
On all three criteria, Windows loses hands-down.


>> 2. Site consists of result pages for auctions and items for sale (100
>> per page)
>> 3. MySQL (Dell Poweredge w/AMD) database server connected to my web
>> server
> 
> Have you considered Postgresql instead ?
> 

Ditto - I don't mind MySQL for serving up fairly static content,
but when the transactions get a bit more rough and tumble, I've
been very satisfied with PostgreSQL.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using Python for my web site

2006-08-01 Thread Conrad
On Mon, 31 Jul 2006 17:12:56 -0300, Gerhard Fiedler wrote:

> On 2006-07-31 15:00:15, Bruno Desthuilliers wrote:
> 
>> In fact, the real question IMHO is: what would MySQL advantage over
>> PostgreSQL be ?-)
> 
> A few years ago I did some research, and the result was that while
> PostgreSQL was claimed to have more features and a better design, the
> reports of database corruption seemed to have been more frequent than with
> MySQL. The usual reason given was that MySQL was more mature.
> 
> I assume you don't agree... :)
> 
> Gerhard

Maturity is an interesting word. The PostgreSQL pedigree 
reaches back about thirty years, which in some peoples minds, 
would constitute a degree of maturity. While I can't claim to 
have done your extensive (and well documented) research, I can 
say that I was a happy MySQL user a couple of years ago, using 
it to quickly serve up fairly static content. Happy, that is, 
until I put it into a more dynamic order entry/processing 
environment. I started finding glitches - orphaned records - 
one table totally corrupted. I found I was spending more and 
more time coding to make sure the transactions completed, and 
less time developing new code. I switched that client to
PostgreSQL and have had ZERO problems since. Many of the 
"features" that MySQL is only now adding are playing catchup 
to core data integrity values that PostgreSQL has had for much 
longer, so it could be argued that in some areas, MySQL can
be said to be much less "mature".


-- 
http://mail.python.org/mailman/listinfo/python-list


wxPython - Event processing order arbitrary across platforms?

2006-08-01 Thread Conrad
Greetings,

For user actions on a wxWidget that trigger multiple events for that
wxWidget, is the order those events are processed in undefined,
and therefore arbitrary from one platform (ie Windows) to the next
(ie Linux)?

Specifically, I have a convience aggregate class that combines
a wxStaticText with a wxComboBox, as I often need those two
at the same time. The aggregate catches events from the wxComboBox
and stores them in it's own class. The calling parent then catches
the event, uses the stored values and set's any variables and
does any processing it needs.

But I had a slight bug, which I didn't catch until a recent upgrade.
Suddenly, this technique still worked under windows - and didn't
under Linux. The bug? the wxComboBox and the parents were catching
two different events - oops. (I was catching the EVT_COMBOBOX in the
child widget - and EVT_TEXT in the parent methods - thanks to 
cut'n'paste an error I managed to propagate through most of my
code. Duh)

The reason the Windows version works, is because apparently the
EVT_COMBOBOX is processed first. By the time the parent catches
the EVT_TEXT evt, the aggregate widget has already caught the
EVT_COMBOBOX and set its local values. Under Linux, however, it 
appears that the EVT_TEXT is processed first - before the 
aggregate catches the EVT_COMBOBOX and has had a chance to set 
it's values - boom.

Hence the above question.

I know that the event propagation for any single event is pretty 
well defined, crawling up through the superclasses, and for wxCommand-
derived events, up through the container heirarchy. But I really
haven't found any docs that guarantee which events are processed
first when a user action fires multiple events.

My bug is fixed - but curiosity and coding go hand in hand.

Cheers,

Conrad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using Python for my web site

2006-08-01 Thread Conrad
On Tue, 01 Aug 2006 23:26:14 -0300, Gerhard Fiedler wrote:

> On 2006-08-01 21:04:07, Conrad wrote:
> 
>>> A few years ago I did some research, and the result was that while
>>> PostgreSQL was claimed to have more features and a better design, the
>>> reports of database corruption seemed to have been more frequent than
>>> with MySQL.
> 
>> I can't claim to have done your extensive (and well documented)
>> research,
> 
> You maybe should consider new reading glasses. Or learn how to respond to
> the correct message. Either you somehow got it all completely wrong, or
> you responded to the wrong message.
> 
> Or is there something in PostgreSQL that makes its users acidic? :)
> 
> Gerhard

Well, maybe so -

I followed up to this message:
Subject:  Re: Using Python for my web site
From: Gerhard Fiedler <[EMAIL PROTECTED]>
Newsgroups:   comp.lang.python
Date: Mon, 31 Jul 2006 17:12:56 -0300

Which begins "A few years ago" and is signed Gerhard. It appears
that Bruno and Sybren did the same, no? Perhaps we could get a
referal for all of us to an optician for group rates?

Here's my issue - someone, who according to my defective newsreader
and clearly myopic eyes appeared to be you, once again invoked the 
word research. Not only research, but results. I've done research. 
It's a rigorous pain in the kiester, and it's seldom as black and 
white as you hoped it would be going into the project. But due to
the blood I've donated to a couple of research projects, I would
hope that the words "research" and "results" carried some honest
syntactic weight. In other words, if I've done research, I would
hope it involved more than reading a couple of Linux Journal 
articles, and a blog posting by some kid who's been serving up 
pictures of his sister's kitties with MySQL for two years now with 
no problems.

I haven't seen any significant research on PosgreSQL vs. MySQL
in an apples-to-apples, detached, no-axes-to-grind study. I
have seen a number of "tastes great" "less filling" studies. 
I have seen MySQL bite me on the butt, more than once, and I'm 
deeply attached to my butt, however anectdotal that may be.

But I'll have the honesty to not claim it's "research". Just
hands-on experience with a tool.

And no, PostgeSQL admins didn't get acidic using PostgreSQL, 
which is proven to be calming, regrow hair, whiten your teeth 
and improve stamina (it really does - I've done research on it). 

We got that way from dealing with other DBs before we switched.

Cheers,

Conrad
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading variables from a forked child (Python C/API)

2005-07-15 Thread Jonathan Conrad
#ifdef def
Donn Cave wrote:
> Quoth MrEntropy <[EMAIL PROTECTED]>:
> 
> | I'm having a little trouble getting an idea running. I am writing a C 
> | program which is really a frontend to a Python program. Now, my C 
> | program starts up, does some initialisation like initialisation of it's 
> | variables and Py_Initialize() and then it fork()s. After forking the 
> | child launches the python program with Py_Main() and with the parent I 
> | want to be able to read the variables of the Python program. I have 
> | tried many ways but cannot find a solution to do this.
> 
> That's because there is no solution.  After a fork, the only effect
> observable in the parent process is the return value of fork, which
> will have a non-zero value.  Subsequent execution in the child process
> occurs completely independently from the parent, and leaves no trace
> whatever.  So you can't read variables from memory, that were set by
> the child.

Though there is probably some solution involving a third party 
such as POSIX threads, Linux has a clone(2) procedure which 
fork(2) is a macro of.  It is tricky to use, but allows for 
having the child process have the same pid, memory, memory 
mappings, file tables, etc.  BSD mmap(2) is more portable and can 
be used for interprocess sharing.  The solution which Don Cave 
provided is probably the one that Mr. Entropy needs to start 
with.  More specifically, ...

#else

int main (int argc, char **argv)
{
int fd0, fd1, fd2;
{
int fd_in [2], fd_out [2], fd_err [2];
pipe (fd_in);  fd0 = fd_in  [1];
pipe (fd_out); fd1 = fd_out [0];
pipe (fd_err); fd2 = fd_err [0];
if (!fork ()) {
dup2 (fd_in  [0], 0); close (fd0);
dup2 (fd_out [1], 1); close (fd1);
dup2 (fd_err [1], 2); close (fd2);
execl ("python", "python", 0);
perror ("execution failed");
exit (1);
}
}

write (fd0, "print None\n", 11);
write (1, b, read (fd1, b, sizeof (b) /* 5 or more */));

#define write0(q...) write (fd0, "print " #q "\n",  \
sizeof (#q) + 5 + 1 - 1)
write0 (True);  write (1, b, read (fd1, b, sizeof (b)));
write0 (5, str (5.0), ...);
write (1, b, read (fd1, b, sizeof (b)));
return write0 (True, False, None,
True and False,
True and None,
False and None,
True and False and None) && 0;
}

#endif
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What module to use to get a file from a website?

2005-07-16 Thread Jonathan Conrad
from os import system
system ("start http://www.python.org/";)

-- 
http://mail.python.org/mailman/listinfo/python-list


Chris Miles? TGBooleanFormWidget?

2014-02-01 Thread Len Conrad
trying to install zoner.

Needs 
http://www.psychofx.com/TGBooleanFormWidget/
 but that's giving "502 Bad Gateway"

can't find TGBooleanFormWidget anywhere else.

Suggestions?

Thanks
Len



-- 
https://mail.python.org/mailman/listinfo/python-list


Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Conrad Taylor
Hi, shouldn't pip be automatically installed for Python 3.4.0 release?  I have 
read through the release and the PEP 453.  Thus, can someone confirm whether or 
not this is the case?  BTW, I have installed Python 3.4.0 using MacPorts.

--

Think different and code well,

-Conrad

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Conrad Taylor


On Wednesday, July 2, 2014 6:29:53 PM UTC-7, Frank Liou wrote:
> it's truth
> 
> 
> 
> pip will be automatically install Python3.4.0
> 
> 
> 
> if you want to use another version
> 
> 
> 
> you should use wget

This doesn't appear to be the case when installing via MacPorts.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is pip being automatically installed for Python 3.4.0?

2014-07-04 Thread Conrad Taylor
On Wednesday, July 2, 2014 9:59:46 PM UTC-7, Ned Deily wrote:
> In article ,
> 
>  Conrad Taylor  wrote:
> 
> > Hi, shouldn't pip be automatically installed for Python 3.4.0 release?  I 
> 
> > have read through the release and the PEP 453.  Thus, can someone confirm 
> 
> > whether or not this is the case?  BTW, I have installed Python 3.4.0 using 
> 
> > MacPorts.
> 
> 
> 
> Like many other third-party package managers, MacPorts has chosen to 
> 
> continue to distribute pip as a separate item.  To install it and the 
> 
> MacPorts Python 3.4:
> 
> 
> 
> sudo port install py34-pip
> 

Yes, I have come to the same solution prior to the original post but I wanted 
to try the functionality in PEP 453 being that I would like to prepare 
instructions for others.

> 
> 
> -- 
> 
>  Ned Deily,
> 
>  [email protected]

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python advanced course (preferably in NA)

2011-11-03 Thread Len Conrad

http://www.dabeaz.com/pythonmaster.html


-- Original Message --
From: Emile van Sebille 
Date:  Thu, 03 Nov 2011 14:25:03 -0700

>On 11/3/2011 11:13 AM Behnam said...
>> Anybody is aware of any advanced course in Python preferably in north
>> america?
>>
>> I've been partly coding in Python for couple of years now and have
>> used PyQt. What I'd like to learn more is a kind of advance OOP in
>> python. Any idea?
>
>This list works well for that.  Try answering all OOP related questions 
>as completely as possible and provide example code.  Those that know the 
>difference will promptly point out the improved and generally preferred 
>approaches.  When no one corrects you, you're done.
>
>Only-slightly-tongue-in-cheek-ly y'rs,
>
>Emile
>
>-- 
>http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Christoph Conrad
Hello Roger,

> I'm looking for a regular expression that matches the first, and only
> the first, sequence of the letter 'a', and only if the length of the
> sequence is exactly 3.

import sys, re, os

if __name__=='__main__':

m = re.search('a{3}', 'xyz123aaabbaaaabaaabb')
print m.group(0)
print "Preceded by: \"" + m.string[0:m.start(0)] + "\""

Best wishes,
 Christoph
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Christoph Conrad
Hello Roger,

> since the length of the first sequence of the letter 'a' is 2. Yours
> accepts it, right?

Yes, i misunderstood your requirements. So it must be modified
essentially to that what Tim Chase wrote:

m = re.search('^[^a]*a{3}b', 'xyz123aabbaaab')

Best wishes from germany,
 Christoph
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Christoph Conrad
Hallo Alex,

>> r = re.compile("[^a]*a{3}b+(a+b*)*") matches = [s for s in
>> listOfStringsToTest if r.match(s)]

> Unfortunately, the OP's spec is even more complex than this, if we are
> to take to the letter what you just quoted; e.g. aazaaab SHOULD match,

Then it's again "a{3}b", isn't it?

Freundliche Grüße,
 Christoph
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OpenRTS - new OSS Python game

2006-02-01 Thread Christoph Conrad
Hello Sybren,

> To be honest, it looks very much like games from 1995...

You should notice: It's a first alpha version.

Freundliche Grüße,
 Christoph
-- 
http://mail.python.org/mailman/listinfo/python-list


help with Python C-API, tuple object

2007-05-11 Thread fabian . conrad
Hi,
sorry for the rather basic question but I've searched everywhere and
don't find an answer.
I want to call PyObject_CallObject from the Python C-API and pass a
tuple I've created from a C-array

How can I pass the tuple as an object rather then having to declare
the python function with the number of arguments equal to the no of
elements in the tuple?

Example:
C-Code fragment:
PyObject *pArgs =  PyTuple_New(3);
//module is imported and function object is build and checked
for (i=0; i<3; i++){
 pInt = PyInt_FromLong(i);
error = PyTuple_SetItem(pArgs, i, pInt);
}
pValue=PyObject_CallObject(pFunc, pArgs);//returns NULL!!!

Python Script:
def length(a):
length = len(a)
return length

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help with Python C-API, tuple object

2007-05-11 Thread fabian . conrad
On May 12, 2:49 pm, "Carsten Haese" <[EMAIL PROTECTED]> wrote:
> On 11 May 2007 21:11:06 -0700, fabian.conrad wrote
>
> > Hi,
> > sorry for the rather basic question but I've searched everywhere and
> > don't find an answer.
> > I want to call PyObject_CallObject from the Python C-API and pass a
> > tuple I've created from a C-array
>
> > How can I pass the tuple as an object rather then having to declare
> > the python function with the number of arguments equal to the no of
> > elements in the tuple?
>
> The documentation athttp://docs.python.org/api/object.htmllists various Call
> flavors. The one you chose will unpack the tuple as if you called
> pFunc(*pArgs), which results in the undesired behavior of pFunc receiving
> three arguments. You want it to receive one argument that is the tuple pArgs.
>
> One (bad) way of achieving this would be to build another tuple of size one,
> stick pArgs into it, and pass that size-one tuple to PyObject_CallObject. A
> better way is to use PyObject_CallFunctionObjArgs. If I'm not mistaken, you'll
> want something like
>
> pValue = PyObject_CallFunctionObjArgs(pFunc, pArgs, NULL);
>
> Hope this helps,
>
> --
> Carsten Haesehttp://informixdb.sourceforge.net

Thanks billions!!! Works perfect, the world would be a lot worse
without Pro's like you guys helping newbies like me ;-)

-- 
http://mail.python.org/mailman/listinfo/python-list


help with designing an app. based on ConfigParser

2006-04-06 Thread Alexandre CONRAD
Hello list !

I'm using the ConfigParser module to use configuration files (what else 
would it be for ?). But I have a dilema: I'd like to setup multiple 
"update server" for my application with update "priority".

At first, I thought about adding a new section in my actual existing 
config file such as:

   [UPDATE SERVERS]

and have options like that:

   server10 = ftp://user:[EMAIL PROTECTED]/remote/dir
   server20 = ftp://user:[EMAIL PROTECTED]/remote/dir

That way, I would simply parse all servers in the "UPDATE SERVERS" 
section and sort them so I could get the priority (lowest number is 
higgest prio).

But, with this option, I don't know how to download files to a specific 
local directory. Then I thought about adding some "local10", "local20" 
options that would have the same number as the server, but ... baah, it 
starts beeing a pain when you want to maintain and update the server 
list. Also I would like to set multiple kind of update servers, like 
http, rsync, having to parse split up the URL is also a pain.

So instead of having all the data in a URL and having to parse it, I 
thought I might specify an option for each params and then build the 
needed URL. Like

   proto = ftp
   ip = 0.0.0.0
   port = 21
   remote_dir = /remote/dir

And I could add extra info that would make my life simplier that I 
couldn't have in the URL:

   enable = True
   priority = 15
   local_dir = /local/dir
   args = ""

That way, if I need to do an rsync, I can look for specific rsync 
options if available.

But now, how do I hold multiple servers ? In this case, I thought about 
having multiple sections such as

   [SERVER 01]
   [SERVER 02]
   [SERVER 03]

But it's not very efficient when I want to parse the WHOLE config file 
to find which servers are available and retrive their options. (plus, 
"01", "02", "03" would be useless, just for anti-conflict section naming)

if section.startswith("SERVER"):
 ...

So I told my self, the best way would be able to have a "sub-section". I 
could then look for all servers (aka sub-sections) inside [UPDATE 
SERVERS] and retrieve the needed info. But AFAIK, it's not possible 
having sub-sections with ConfigParser. So I'm here to ask if anyone has 
an efficient trick for that ? Maybe an other module based on 
ConfigParser exists that would allow sub-sections ?

I might be looking for something too complicated and maybe some simplier 
alternative exists which doesn't cross my mind right now. (no, don't 
tell me to use XML for my config file, it has to be easely modifiable by 
the user using the most basic bloc-note).

Regards,
-- 
Alexandre CONRAD - TLV
Research & Development
tel : +33 1 30 80 55 05
fax : +33 1 30 80 55 06
6, rue de la plaine
78860 - SAINT NOM LA BRETECHE
FRANCE

-- 
http://mail.python.org/mailman/listinfo/python-list