Re: help with class

2008-11-26 Thread Arnaud Delobelle
tekion <[EMAIL PROTECTED]> writes: > Hello, > I am playing with class. Below is the code snippet: > #!/usr/bin/python > 2 > 3 class test_class: > 4#import gzip > 5def __init__(self,file): > 6 self.file = file > 7def open_file(self): > 8

Re: help with class

2008-11-26 Thread r
On Nov 26, 4:08 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > tekion <[EMAIL PROTECTED]> writes: > > Hello, > > I am playing with class.  Below is the code snippet: > > #!/usr/bin/python > >       2 > >       3 class test_class: > >       4    #import gzip > >       5    def __init__(self,file)

Re: what's so difficult about namespace?

2008-11-26 Thread Wojtek
Kaz Kylheku wrote : Javascript programs are scanned at the character level by the browser as part of loading a page. So there are severe practical limitations on how large Javascript programs can be. Namespaces are useful only in very large programs. But even more useful where you are getti

Re: hello from colombia

2008-11-26 Thread r
On Nov 26, 2:58 pm, fel <[EMAIL PROTECTED]> wrote: > I work in a small software company using php all day, I wish the usage > of Python was more common within my company > they are starting a new project (insurance stuff) using Java, and I > just hate that eventually I'l be debugging someone-else's

Re: Apache & mod_python: I don't receive anything with POST method

2008-11-26 Thread Graham Dumpleton
On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm using a simple form to make possible the users of our site upload > files. > > >     >     >     >         >         >     >     > > > The "upload.py" looks like this: > > from mod_python import apache, util; > > def index(req): >

Re: Python/C API: using from a shared library

2008-11-26 Thread Graham Dumpleton
On Nov 26, 10:29 pm, Robie Basak <[EMAIL PROTECTED]> wrote: > On 2008-11-25, Robie Basak <[EMAIL PROTECTED]> wrote: > > > If I use dlopen() to open a shared library that I've written, and that > > shared library tries to use the Python/C API, then it fails. I've > > reduced the problem to the test

Re: hello from colombia

2008-11-26 Thread fel
On Nov 26, 5:17 pm, r <[EMAIL PROTECTED]> wrote: > On Nov 26, 2:58 pm, fel <[EMAIL PROTECTED]> wrote: > > > I work in a small software company using php all day, I wish the usage > > of Python was more common within my company > > they are starting a new project (insurance stuff) using Java, and I

Re: hello from colombia

2008-11-26 Thread bearophileHUGS
fel: > they are starting a new project (insurance stuff) using Java, and I > just hate that eventually I'l be debugging someone-else's java code > how can I convince them that Python is better, and get them to re- > think their strategy? The choice of the language for a program isn't easy. Maintai

tkFileDialog, askopenfiles in v2.6 question

2008-11-26 Thread fransstil
To select a group of files works fine in 2.5 ... from tkFileDialog import askopenfiles fnames = askopenfiles(title = "Select files", initialdir = "C:\\temp", filetypes=[("All", "*.*")]) for i in range(len(fnames)): fnames[i]

Matplotlib on Leopard Mac OS

2008-11-26 Thread Massi
Hi everyone, I've got some problems trying to install matplotlib on my mac (Leopard OS). I'm following the instructions I found in the official site to install it from the egg file (http:// matplotlib.sourceforge.net/users/installing.html), but when I run easy_install ./matplotlib-0.98.3-py2.5-maco

Re: what's so difficult about namespace?

2008-11-26 Thread Xah Lee
Dear Kaz Kylheku, your post is too much verbiage and enthusiasm. Why? because you went into the la la land of philosophy. Although, i do think you did give some good exposition on your views. Now, let me detail some analysis of your post. In summary, you are saying a few things about namespace

Re: asp oddness , why specify ASP twice

2008-11-26 Thread Rob Williscroft
davidj411 wrote in news:a08906ab-ba98-4ce0-a5f9-330f4b287423 @z27g2000prd.googlegroups.com in comp.lang.python: > > for some reason this code works: > * > <%@ LANGUAGE = Python%> The above is a Directive, in this case it tells ASP what language to use,

Re: Python C/API simple debugging

2008-11-26 Thread Aaron Brady
On Nov 26, 5:27 am, k3xji <[EMAIL PROTECTED]> wrote: > Hi all, > > I am new to Python C API and finding it difficult to debug C > extensions. So, basically I want to see the value of an integer value > during the C API. Here is the code: > > #define LAST_MIX_VAL 0xDEADBEEF > > static PyObject * > c

Re: Getting in to metaprogramming

2008-11-26 Thread Aaron Brady
On Nov 26, 10:41 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >  "Steven D'Aprano" wrote: > > > > > Well, I don't know about "any problem". And it's not so much about > > whether metaprograms can solve problems that can't be solved by anything > > else, as whether metaprograms can solve pro

Re: How to get a directory file descriptor?

2008-11-26 Thread greg
Steve Holden wrote: Anyway, when I try to use O_RDONLY on Vista I get "Permission denied": According to the library ref, fchdir() is Unix-only, so there probably isn't a use case for getting a file descriptor for a directory on Windows in the first place. -- Greg -- http://mail.python.org/mail

Re: tkFileDialog, askopenfiles in v2.6 question

2008-11-26 Thread MRAB
fransstil wrote: To select a group of files works fine in 2.5 ... from tkFileDialog import askopenfiles fnames = askopenfiles(title = "Select files", initialdir = "C:\\temp", filetypes=[("All", "*.*")]) for i in range(len(fnames)):

Re: Python+Pyjamas+V8=ftw

2008-11-26 Thread alex23
On Nov 27, 6:20 am, "inhahe" <[EMAIL PROTECTED]> wrote: > Python should [...] The problem with statements like this is that Python itself can't do anything, only members of the Python community can. But I do understand and agree with your main point. I'm hoping that the PyPy project will allow fo

is it possible to integrate Python into VBS ?

2008-11-26 Thread Stef Mientki
hello, We use a commercial database application (Ultimo), that has embedded VBS (Visual Basic Script) editor / execution. Knowing Python now, VBS seems quit clumsy. We can't replace the build-in scripting completely, because the VBS (which has to have some predefined strctures) is interpreted b

[2.5.1] ShiftJIS to Unicode?

2008-11-26 Thread Gilles Ganault
Hello I'm trying to read pages from Amazon JP, whose web pages are supposed to be encoded in ShiftJIS, and decode contents into Unicode to keep Python happy: www.amazon.co.jp But this doesn't work: == m = try.search(the_page) if m: #UnicodeEncodeError: 'charmap' codec can'

Re: hello from colombia

2008-11-26 Thread alex23
On Nov 27, 8:25 am, fel <[EMAIL PROTECTED]> wrote: > perhaps a python advocacy page? http://www.google.com/search?q=python advocacy -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting in to metaprogramming

2008-11-26 Thread Steven D'Aprano
On Thu, 27 Nov 2008 06:41:47 +0200, Hendrik van Rooyen wrote: > I am using the term in the restricted sense of Python writing Python > source. > > Given that, can anybody think of an example that you could not do with a > class? (excepting the "stored procedure" aspect) GUI designer. You write

Re: [2.5.1] ShiftJIS to Unicode?

2008-11-26 Thread skip
Gilles> == Gilles> m = try.search(the_page) Gilles> if m: Gilles> #UnicodeEncodeError: 'charmap' codec can't encode characters in Gilles> position 49-55: character maps to Gilles> title = m.group(1).decode('shift_jis').strip() Gilles> ==

Iowa Python Users Group Meeting (Dec. 1, 2008)

2008-11-26 Thread Mike Driscoll
Hi, The 3rd meeting of the Iowa Python Users Group (Pyowa) is getting together next Monday, December 1st, 7-9 p.m. Be sure to mark your calendars! We currently have one presentation scheduled and a workshop where we hope to have teams work on easy to intermediate problems in an effort to learn and

Re: what's so difficult about namespace?

2008-11-26 Thread alex23
On Nov 27, 9:28 am, Xah Lee <[EMAIL PROTECTED]> wrote: > Hi Stefan, try not to be a moron. Hi Xah, try not to be an asshole. [and in a separate post] > your post is too much verbiage and enthusiasm. The hypocrisy here would be funny if I didn't think you were serious. -- http://mail.python.org/m

Re: what's so difficult about namespace?

2008-11-26 Thread Steven D'Aprano
On Wed, 26 Nov 2008 17:42:43 +0100, Stefan Behnel wrote: > Xah Lee wrote: >>> The IT community has enough trouble getting a few ISPs to upgrade >>> their DNS software. How are you going to get millions of general users >>> to upgrade? >> >> alright, that's speaks for Javascript. >> >> But how's

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Steven D'Aprano
On Wed, 26 Nov 2008 13:24:25 -0800, Jason Scheirer wrote: > On Nov 26, 11:40 am, Terry Reedy <[EMAIL PROTECTED]> wrote: >> def Skipper(object): >>      def Skip(): pass >> skipper = Skipper() >> >> def _On_Menu_File_Open ( self, event = skipper ): >>     event.Skip () >> >> etc. > > I think this

Re: what's so difficult about namespace?

2008-11-26 Thread Kaz Kylheku
On 2008-11-26, Xah Lee <[EMAIL PROTECTED]> wrote: > Can you see, how you latched your personal beef about anti software > crisis philosophy into this no namespace thread? I did no such thing. My post was about explaining the decision process that causes humans to either adopt some technical soluti

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Steven D'Aprano
On Wed, 26 Nov 2008 11:17:21 -0500, Steve Holden wrote: > Xah Lee wrote: ... >> your remark is a bit overzealous. After all, we all know that site is >> websearh based. Although it not some kinda scientific report, but it >> does give some good indication of language popularity, however you >> def

Re: [2.5.1] ShiftJIS to Unicode?

2008-11-26 Thread MRAB
Gilles Ganault wrote: Hello I'm trying to read pages from Amazon JP, whose web pages are supposed to be encoded in ShiftJIS, and decode contents into Unicode to keep Python happy: www.amazon.co.jp /> But this doesn't work: == m = try.search(the_page) How can you have name "try

Re: is it possible to integrate Python into VBS ?

2008-11-26 Thread alex23
On Nov 27, 10:15 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > How can I call Python from within VBS ? Hey Stef, The Windows Scripting Host (WSH) allows you to add other scripting languages, such as Python (I _think_ this might even happen automatically with ActivePython.) Script Components are a

Re: Getting in to metaprogramming

2008-11-26 Thread Aaron Brady
On Nov 26, 6:29 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 27 Nov 2008 06:41:47 +0200, Hendrik van Rooyen wrote: > > I am using the term in the restricted sense of Python writing Python > > source. > > > Given that, can anybody think of an example that you could not do with a > > clas

Re: hello from colombia

2008-11-26 Thread Tim Rowe
2008/11/26 fel <[EMAIL PROTECTED]>: > how can I convince them that Python is better You can't, because it isn't. I'd better explain that, before I'm lynched. The thing is, no language is better than another language. A language is better than another language *for a particular purpose*. SPARK Ada

Re: what's so difficult about namespace?

2008-11-26 Thread Aaron Brady
On Nov 26, 6:57 pm, Kaz Kylheku <[EMAIL PROTECTED]> wrote: > The theory is that the adoption of some technology is driven by > a function of the ratio: > >    perceived crisis >     >    perceived pain of adoption > > These perceptions may not be accurate. The crisis may be larger

Re: help with class

2008-11-26 Thread tekion
Hi, so I am assuming global name space refers to the location of where the module is imported, for example my previous example where I call the gzip module from test_class class, like so: class test_class: import gzip did not work because of scoping. So global name space in this case is declar

Re: help with class

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 5:21 PM, tekion <[EMAIL PROTECTED]> wrote: > Hi, > so I am assuming global name space refers to the location of where the > module is imported, for example my previous example where I call the > gzip module from test_class class, like so: > > class test_class: > import gzi

Re: what's so difficult about namespace?

2008-11-26 Thread Dimiter "malkia" Stanev
Hi Xah, I myself am proponent of namespace-lessness... That was until I discovered CLOS and the multi-methods... For any other language I would pick Apple's approach approach to Objective C, and the frameworks that they've put (libraries) - e.g. use couple of letters to prefix your class/fun

Exhaustive Unit Testing

2008-11-26 Thread Emanuele D'Arrigo
Hi everybody, another question on unit testing, admittedly not necessarily a python- specific one... I have a class method about 60 lines long (*) and due to some 9 non- trivial IFs statements (3 and 2 of which nested) the number of possible paths the program flow can take is uncomfortably large,

Re: hello from colombia

2008-11-26 Thread fel
On Nov 26, 8:19 pm, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/11/26 fel <[EMAIL PROTECTED]>: > > > how can I convince them that Python is better > > You can't, because it isn't. you are right, it isn't, but for the particular task at hand (DB Sybase programming) I feel somehow that the team i

Re: Is the behavior expected?

2008-11-26 Thread Alphones
On 11月27日, 上午12时07分, Peter Otten <[EMAIL PROTECTED]> wrote: > Alphones wrote: > > On 11月26日, 下午9时28分, [EMAIL PROTECTED] wrote: > >> Alphones: > > >> > it is a little deferent from other script language. > > >> See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping > > >> Python do

Re: Is the behavior expected?

2008-11-26 Thread Alphones
all the discussions are very helpful to me. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

dateing girls - Free Access

2008-11-26 Thread porphyrymoralesnh
dateing girls . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/dateing-girls * . Free Online Dating . . . . . . . . . . dateing girls -- http://mail.python.org/mailman/listinfo/python-list

free online dateing - Free Access

2008-11-26 Thread porphyrymoralesnh
free online dateing . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/free-online-dateing * . Free Online Dating . . . . . . . . . . free online dateing -- http://mail.python.org/mailman/listinfo/python-list

black dateing - Free Access

2008-11-26 Thread porphyrymoralesnh
black dateing . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/black-dateing * . Free Online Dating . . . . . . . . . . black dateing -- http://mail.python.org/mailman/listinfo/python-list

internet dateing - Free Access

2008-11-26 Thread porphyrymoralesnh
internet dateing . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/internet-dateing * . Free Online Dating . . . . . . . . . . internet dateing -- http://mail.python.org/mailman/listinfo/python-list

online dateing service - Free Access

2008-11-26 Thread porphyrymoralesnh
online dateing service . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/online-dateing-service * . Free Online Dating . . . . . . . . . . online dateing service -- http://mail.python.org/mailman/listinfo/python-list

datig girls - Free Access

2008-11-26 Thread porphyrymoralesnh
datig girls . . . Free Online Dating . ***CLICK HERE*** http://dating365.co.cc/datig-girls * . Free Online Dating . . . . . . . . . . datig girls -- http://mail.python.org/mailman/listinfo/python-list

rejecting newlines with re.match

2008-11-26 Thread r0g
Hi, I want to use a regex to match a string "poo" but not "poo\n" or "poo"+chr(13) or "poo"+chr(10) or "poo"+chr(10)+chr(13) According to http://docs.python.org/library/re.html '.' (Dot.) In the default mode, this matches any character except a newline. If the DOTALL flag has been specified, thi

Re: Exhaustive Unit Testing

2008-11-26 Thread Steven D'Aprano
On Wed, 26 Nov 2008 18:54:52 -0800, Emanuele D'Arrigo wrote: > Hi everybody, > > another question on unit testing, admittedly not necessarily a python- > specific one... > > I have a class method about 60 lines long (*) and due to some 9 non- > trivial IFs statements (3 and 2 of which nested) th

Re: Getting in to metaprogramming

2008-11-26 Thread Rafe
On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >  "Steven D'Aprano" wrote: > > > > > Well, I don't know about "any problem". And it's not so much about > > whether metaprograms can solve problems that can't be solved by anything > > else, as whether metaprograms can solve pro

Re: newbie question

2008-11-26 Thread Asun Friere
On Nov 27, 6:11 am, Nan <[EMAIL PROTECTED]> wrote: > Hello, >    I just started to use Python. I wrote the following code and > expected 'main' would be called. > > def main(): >   print "hello" > > main Not an answer to your question, but I dislike functions named 'main' because the situation the

Confused about class relationships

2008-11-26 Thread John O'Hagan
Apologies if this is a D.Q., I'm still learning to use classes, and this little problem has proved too specific to find in the tutorials. I have two classes with a relationship that I find confusing. One is called Engine, and it has a method (bar_builder) which generates instances of the other

Re: Getting in to metaprogramming

2008-11-26 Thread Rafe
On Nov 27, 12:11 pm, Rafe <[EMAIL PROTECTED]> wrote: > On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> > wrote: > > > > >  "Steven D'Aprano" wrote: > > > > Well, I don't know about "any problem". And it's not so much about > > > whether metaprograms can solve problems that can't be s

Re: special editor support for indentation needed.

2008-11-26 Thread Eric S. Johansson
Andreas Roehler wrote: > > with python-mode.el from > > http://sourceforge.net/projects/python-mode/ I think there's something wrong with the site because it tells me it's version 1.0 from year 2005. > Meanwhile I'll reflect a draft addressing your needs. there is a rather sizable set of thin

Re: end of print = lower productivity ?

2008-11-26 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >When I write "print", it is both effortless and instantaneous : my >hands do not move, a wave goes through my fingers, it all happens in a >tenth of a second. > >Contrast this with what one has to go through to catch the SHIFT key, >and then the "(" : move the left hand,

Re: asp versus cgi

2008-11-26 Thread Tim Roberts
davidj411 <[EMAIL PROTECTED]> wrote: > >when i use cgi, i never get a 500 error but i can see how it might >take on overhead if many users are hitting the site at once. so to >avoid this, i looked into registering the python engine for ASP >requests. It is easy to overestimate the overhead of CGI.

WSDL and SSL certification

2008-11-26 Thread jineshpmj
Hi, I have a problem with processing WSDL file using SOAP. I want to call Rhapsody webservice using Python. But i have SSL certification key and cert , how to pass this information when i calling wsdl file. eg: Expand|Select|Wrap|Line Numbers file = 'RhapsodyDirectSearch.wsdl' file1= "RhapsodyD

<    1   2