Problems getting Python scripts to run on server

2008-01-23 Thread Yansky
Hi, I'm having a lot of problems getting any Python scripts to run on my website. I have put them in the cgi-bin directory and chmodded both the directory and files to 755. But when I try to access the script, I get a 404 error: http://forboden.com/cgi-bin/wp.py I also tried running them from anot

Re: Linux Journal Survey

2008-01-23 Thread George Sakkis
On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > The annual Linux Journal survey is online now for any Linux users who > want to vote for Python. http://www.linuxjournal.com/node/1006101 ... 18. What is your favorite programming language? (15 choices, Python not included) 19. What is your favor

Some questions about decode/encode

2008-01-23 Thread glacier
I use chinese charactors as an example here. >>>s1='你好吗' >>>repr(s1) "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" >>>b1=s1.decode('GBK') My first question is : what strategy does 'decode' use to tell the way to seperate the words. I mean since s1 is an multi-bytes-char string, how did it determine to seper

Re: newbie question: On installation of additional packages to Python

2008-01-23 Thread Steve Holden
Gabriel Genellina wrote: > En Tue, 22 Jan 2008 00:36:34 -0200, Nasser Abbasi <[EMAIL PROTECTED]> > escribió: > >> I am running on windowz. I have downloaded and installed 2.5.1 Python. >> >> my question is on installing additional packages. >> >> What is the easiest way to do that? I read about

Terminology: "script" versus "program" (was: Linux Journal Survey)

2008-01-23 Thread Ben Finney
George Sakkis <[EMAIL PROTECTED]> writes: > On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > The annual Linux Journal survey is online now for any Linux users > > who want to vote for Python. > > http://www.linuxjournal.com/node/1006101 > > ... > 18. What is your favorite programming language? >

Re: Some questions about decode/encode

2008-01-23 Thread Ben Finney
glacier <[EMAIL PROTECTED]> writes: > I use chinese charactors as an example here. > > >>>s1='你好吗' > >>>repr(s1) > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > >>>b1=s1.decode('GBK') > > My first question is : what strategy does 'decode' use to tell the way > to seperate the words. I mean since s1 is an

Re: os.system behavior when calling SQLPlus with spooling

2008-01-23 Thread Martin v. Löwis
> I would prefer not to use os.system() since I want to analyze the > results. Can anyone suggest how I should go about executing sqlplus > in this case? You need to find out why it hangs. Perhaps sqlplus tries to read from its stdin, asking the user for input, yet your script doesn't provide any

Issue with docking wx.listctrl window

2008-01-23 Thread tarun
Hello All, I'm trying to create a Frame with AuiManager. The code is attached. *Problem:* - I want 2 windows to be docked in the frame. One is a text control and other is a list control. - The text control gets docked, but on trying to dock the list control, all the tabs dis-appear. The tabs ap

Re: Some questions about decode/encode

2008-01-23 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > glacier <[EMAIL PROTECTED]> writes: > > > I use chinese charactors as an example here. > > > > >>>s1='你好吗' > > >>>repr(s1) > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > >>>b1=s1.decode('GBK') > > > > My first question is : what strategy does 'decode' use to

Re: Some questions about decode/encode

2008-01-23 Thread bbtestingbb
On Jan 23, 8:49 pm, glacier <[EMAIL PROTECTED]> wrote: > I use chinese charactors as an example here. > > >>>s1='你好吗' > >>>repr(s1) > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > >>>b1=s1.decode('GBK') > > My first question is : what strategy does 'decode' use to tell the way > to seperate the words.

Re: Problems getting Python scripts to run on server

2008-01-23 Thread I V
On Wed, 23 Jan 2008 19:41:17 -0800, Yansky wrote: > Hi, I'm having a lot of problems getting any Python scripts to run on my > website. I have put them in the cgi-bin directory and chmodded both the > directory and files to 755. But when I try to access the script, I get a > 404 error: http://forbo

Re: pairs from a list

2008-01-23 Thread Paddy
On 23 Jan, 22:39, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 23, 4:48 pm, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > > As for your other points, I think we're actually very much in agreement, > > except for your tolerance of random posters asking what I believe is an

Re: Terminology: "script" versus "program" (was: Linux Journal Survey)

2008-01-23 Thread Paddy
On 24 Jan, 04:59, Ben Finney <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > > The annual Linux Journal survey is online now for any Linux users > > > who want to vote for Python. > > >http://www.linuxjournal.com/node/10061

Re: Problems getting Python scripts to run on server

2008-01-23 Thread 7stud
On Jan 23, 8:41 pm, Yansky <[EMAIL PROTECTED]> wrote: > Hi, I'm having a lot of problems getting any Python scripts to run on > my website. I have put them in the cgi-bin directory and chmodded both > the directory and files to 755. But when I try to access the script, I > get a 404 error:http://fo

Re: handling asynchronous callbacks from c++ in a python script

2008-01-23 Thread castironpi
On Jan 23, 5:46 pm, Tim Spens <[EMAIL PROTECTED]> wrote: > I have a c++ program running that has boost python hooks for the c++ api. > I'm running a python client that makes calls into the c++ api. The problem > is there are c++ > asynchronous callbacks that need to pass information to the python

Re: Function wrappers

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 00:16:01 -0200, <[EMAIL PROTECTED]> escribió: > def f( callback, *bar, **bkwar ): > def preg ( callfore, *far, **fkwar ): > return g( callback, callfore, bar, bkwar, far, fkwar ) > return preg > > Does anyone see a way to

Re: Some questions about decode/encode

2008-01-23 Thread glacier
On 1月24日, 下午1时41分, Ben Finney <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > glacier <[EMAIL PROTECTED]> writes: > > > > I use chinese charactors as an example here. > > > > >>>s1='你好吗' > > > >>>repr(s1) > > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > > >>>b1=s1.decode('GBK')

Re: Can someone explain this unexpected raw_input behavior?

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 01:00:53 -0200, Mike Kent <[EMAIL PROTECTED]> escribió: > Gabriel, thank you for clarifying the source of this behavior. Still, > I'm surprised it would be hard-coded into Python. Consider an > interactive program, that asks the user several questions, and > displays paragrap

Smart factory class

2008-01-23 Thread kramer31
Can anyone tell me if there is a way in python that I can implement a factory function which takes as input a string ClassName and returns an object of type ClassName? -- http://mail.python.org/mailman/listinfo/python-list

Re: Module/package hierarchy and its separation from file structure

2008-01-23 Thread Peter Schuller
>> I do *not* want to simply break out X into org.lib.animal.x, and >> have org.lib.animal import org.lib.animal.x.X as X. > > Nevertheless, that seems the best (indeed, the Pythonic) solution to > your problem as stated. Rather than just shooting it down, we'll have > to know more about ehat actua

Re: Creating new types and invoking super

2008-01-23 Thread Arnaud Delobelle
On Jan 23, 11:51 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: Oops: > > class callsuper(object): >     def __init__(self, f): >         self.f = f >     def __get__(self, obj, cls=None): >         def newfunc(*args, **kwargs): >             super(self.cls, obj).__init__() Change this line to:

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 6:30 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 9:50 am, ryan k <[EMAIL PROTECTED]> wrote: > > > Steven D'Aprano, you are a prick. > > And your reasons for coming to that stridently expressed conclusion > after reading a posting that was *not* addressed to you are .? Be

Re: Some questions about decode/encode

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 04:52:22 -0200, glacier <[EMAIL PROTECTED]> escribió: > According to your reply, what will happen if I try to decode a long > string seperately. > I mean: > ## > a='你好吗'*10 > s1 = u'' > cur = 0 > while cur < len(a): > d = min(len(a)-i

Re: Smart factory class

2008-01-23 Thread Arnaud Delobelle
On Jan 24, 7:11 am, kramer31 <[EMAIL PROTECTED]> wrote: > Can anyone tell me if there is a way in python that I can implement a > factory function which takes as input a string ClassName and returns > an object of type ClassName? >>> def mkobj(classname, ns=globals()): return ns[classname]() ... >

Re: Creating new types and invoking super

2008-01-23 Thread Arnaud Delobelle
On Jan 24, 7:19 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: Oops again > > Change this line to: >               getattr(super.cls, obj), self.f.__name__)() I mean getattr(super(self.cls, obj), self.f.__name__)() -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions about decode/encode

2008-01-23 Thread glacier
On 1月24日, 下午1时49分, [EMAIL PROTECTED] wrote: > On Jan 23, 8:49 pm, glacier <[EMAIL PROTECTED]> wrote: > > > I use chinese charactors as an example here. > > > >>>s1='你好吗' > > >>>repr(s1) > > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > > >>>b1=s1.decode('GBK') > > > My first question is : what strategy

Re: Smart factory class

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 05:11:19 -0200, kramer31 <[EMAIL PROTECTED]> escribió: > Can anyone tell me if there is a way in python that I can implement a > factory function which takes as input a string ClassName and returns > an object of type ClassName? def InstanceFactory(classname): cls = glo

<    1   2   3