Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 1:07 pm, Diez B. Roggisch de...@nospam.web.de wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: DatafilePath = C:\\C8Example1.slc ResourcefilePath = DatafilePath + .rsc DatafileFH =

Re: the 'right way' to distribute and access data files in a packaged Python module

2009-02-02 Thread David Moss
There is a zip-safe flag that you can specify that tells setuptools that installing your egg only works if it is unarchived. However, there is also the pkg_resources-package that allows you to access streams from within a package, even if it is zipped. You should investigate these two

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 9:02 am, thmpsn@gmail.com wrote: On Feb 2, 2:55 am, Stephen Hansen apt.shan...@gmail.com wrote: This is proven by your statement above, whereby you are driving a user away, simply because the language, in one small aspect, does not give him what he wants, and the tenor

Re: is python Object oriented??

2009-02-02 Thread Diez B. Roggisch
The reason is that I see a level of abstraction that makes it kind of irrelevant whether something is run as a process, a thread, a time multiplexed mainloop, on one or more processors, wherever or whatever - almost like a fractal structure spread across the total addressable space - and I

Re: key capture

2009-02-02 Thread Tino Wildenhain
Hi, swamynathan wrote: hello, im making a virtual piano in python where on key stroke a wav is played from a location now to implement a fully functional piano i need to have multiple key stroke captures ie if 2 or 3 keys pressed then the function which playes the wav is called with 3

Re: what IDE is the best to write python?

2009-02-02 Thread Christof Donat
Hi, Just to register a contrary opinion: I *hate* syntax highlighting With vim you simply don't turn it on. Would that be OK for you? No. Even the /possibility/ of having syntax highlighting would indicate wimpness and thus humiliate me. Ah, I guess you are using butterflies then:

Re: Where to put configuration/data files

2009-02-02 Thread Tim Chase
Is there a nice cross-platform way to figure out the Right (tm) place to store configuration files and other data? For what purpose? Global program config, user config, what? I've found three main categories of settings like Aahz describes (of which I've used all in a single application):

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
Stephen Hansen apt.shan...@gmail.com wrote: 8--- arguments for the status quo -- I'm missing the careful explanation. What I've heard is that the lack of enforced encapsulation is a danger. What I've heard is that people want it because they've been told they should want it and

Re: What is wrong in my list comprehension?

2009-02-02 Thread Peter Otten
Jason Scheirer wrote: On Feb 1, 3:37 am, Peter Otten __pete...@web.de wrote: Hussein B wrote: Hey, I have a log file that doesn't contain the word Haskell at all, I'm just trying to do a little performance comparison: ++ from datetime import time, timedelta, datetime

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 3:43 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 1:07 pm, Diez B. Roggisch de...@nospam.web.de wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: DatafilePath = C:\\C8Example1.slc

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring is not in the given

Re: what IDE is the best to write python?

2009-02-02 Thread Thorsten Kampe
* Christof Donat (Mon, 02 Feb 2009 11:14:25 +0100) Just to register a contrary opinion: I *hate* syntax highlighting With vim you simply don't turn it on. Would that be OK for you? No. Even the /possibility/ of having syntax highlighting would indicate wimpness and thus humiliate me.

sorting mesh data an from abaqus simulation

2009-02-02 Thread Alessandro Zivelonghi
Hello there :) , I am a python newbie who needs help with tables(lists?) and other data structures. My mechanical engineering simulation program (Abaqus) use a Python env to access model data and results from a simulation. For me a model means a mesh of that model, i.e. a lists of nodes and

Re: Import without executing module

2009-02-02 Thread Steve Holden
Taskinoor Hasan wrote: [...] It make sense :-). So my reasoning..let A is imported in B, i.e. name A is put in B's namespace. When we call something like A.a then the interpreter first resolve A in B's namespace, then to get a, it need to look up A's namespace. And there is no way to

Re: Membership of multiple items to a list

2009-02-02 Thread Steve Holden
Stephen Hansen wrote: On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney bignose+hates-s...@benfinney.id.au wrote: rdmur...@bitdance.com writes: I don't even see Stephen Hansen's posts. My newsreader just shows the header and says [HTML part not displayed]. Likewise. Yeah, I know HTML is bad on

Re: Exception error when accessing the class variable at the termination of the program

2009-02-02 Thread Chris Rebert
On Sun, Feb 1, 2009 at 11:52 PM, jwal...@vsnl.net wrote: Hi All, Here is a sample piece of code with which I am having a problem, with Python version 2.4.4 class Person: Count = 0 # This represents the count of objects of this class def __init__(self, name): self.name

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 2:01 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 3:43 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 1:07 pm, Diez B. Roggisch de...@nospam.web.de wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output

MySQLdb and MySQL stored functions

2009-02-02 Thread Kurt Forrester
Hello All, I am running - Ubuntu 8.10 - Python 2.5.2 - MySQLdb (1, 2, 2, 'final', 0) - MySQL Server/Client 5.0.67 I am trying to write an authentication script for a python application that connects to a MySQL database. The database has a table named `user` which has the fields `id`,

Python patch module

2009-02-02 Thread Minesh Patel
Hi, I was wondering if there is any patch management module for Python. Basically I am looking to only apply a hunk from a patch if the file exists. -- Thanks, Minesh -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-02 Thread Diez B. Roggisch
I wonder why the designers of processors do such silly things as having user and supervisor modes in the hardware - according to your arguments a code review would solve the problem, and then they could use the silicon saved to do other usefull stuff. - then any process could use any

Re: Membership of multiple items to a list

2009-02-02 Thread D'Arcy J.M. Cain
On Mon, 02 Feb 2009 17:34:51 -0500 Steve Holden st...@holdenweb.com wrote: Or configure multiple personalities with the same email address but different settings, so all you have to do is switch personalities appropriately. They have pills for that now. -- D'Arcy J.M. Cain da...@druid.net

Re: importing module-performance

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 1:29 AM, S.Selvam Siva s.selvams...@gmail.com wrote: Hi all, I have a small query, Consider there is a task A which i want to perform. To perform it ,i have two option. 1)Writing a small piece of code(approx. 50 lines) as efficient as possible. 2)import a suitable

Re: ElementTree and clone element toot

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan grflana...@gmail.com escribió: e = ET.fromstring(s) def clone(elem): ret = elem.makeelement(elem.tag, elem.attrib) ret.text = elem.text for child in elem: ret.append(clone(child)) return ret f = clone(e) You

Re: install modules for specific python version

2009-02-02 Thread M.-A. Lemburg
On 2009-02-01 02:00, Brendan Miller wrote: I have several version of python running side by side on my ubuntu install (2.5,2.6,3.0). I'm installing a module with a setup.py script, in this case logilab-common, so that I can get pylint going. However, I need to install into python 2.6, but

Financial aid for PyCon 2009 is now available

2009-02-02 Thread Ted Pollari
I'm happy to announce that the Python Software Foundation has allocated some funds to help people attend PyCon 2009! If you would like to come to PyCon but can't afford it, the PSF may be able to help you pay for registration, lodging/hotel costs and transportation (flight etc.). Please

Re: is python Object oriented??

2009-02-02 Thread Tim Rowe
2009/2/2 Russ P. russ.paie...@gmail.com: Are we supposed to believe that the designers of C++, Java, Ada, and Scala are all idiots? No, we're supposed to believe that the designers of C++, Java, Ada, and Scala are all designers of languages that are not Python. If all languages had the same

Re: is python Object oriented??

2009-02-02 Thread Luis Zarrabeitia
On Monday 02 February 2009 04:51:11 pm Russ P. wrote: As I said before, as an aeronautical engineer I don't know if enforced access restriction can be added to Python without compromising or unduly complicating the language. Maybe it can't. If that's the case, then people should make that

Re: importing module-performance

2009-02-02 Thread S.Selvam Siva
On Mon, Feb 2, 2009 at 3:11 PM, Chris Rebert c...@rebertia.com wrote: On Mon, Feb 2, 2009 at 1:29 AM, S.Selvam Siva s.selvams...@gmail.com wrote: Hi all, I have a small query, Consider there is a task A which i want to perform. To perform it ,i have two option. 1)Writing a small

Re: Number of bits/sizeof int

2009-02-02 Thread casevh
On Jan 30, 11:03 pm, Jon Clements jon...@googlemail.com wrote: Hi Group, This has a certain amount of irony (as this is what I'm pretty much after):- Fromhttp://docs.python.org/dev/3.0/whatsnew/3.1.html: The int() type gained a bit_length method that returns the number of bits necessary to

Re: is python Object oriented??

2009-02-02 Thread Bruno Desthuilliers
Michael Torrie a écrit : Steve Holden wrote: You can think what you like, but there is a fundamental difference between methods of a class and functions of a module. Until you appreciate that you will likely make mistakes. Don't worry, though, we all learn from our mistakes. And this

Re: [2.5.1] Comparing dates?

2009-02-02 Thread Martin
Hi, 2009/2/2 Gilles Ganault nos...@nospam.com: Thanks guys. For those interested, here's how to perform the conversion from DD/MM/ to -MM-DD: as suggested, the DBA should seriously think about defining the correct type of the column here, for intermediate use and getting stuff to work

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Wolfgang Keller
David, I would really recommend that you seriously consider using the Tcp/Tk toolkit. I would seriously disrecommend using Tcl/Tk. Why ? Because it doesn't allow to build a GUI application with not-ridiculous functionality, look-and-feel and quirk-free behaviour. Because of my point above,

ElementTree and clone element toot

2009-02-02 Thread m.banaouas
Hi all, Working with the ElementTree module, I looked for clone element function but not found such tool: def CloneElment(fromElem, destRoot = None) fromElem is the element to clone destRoot is the parent element of the new element ; if None so the new element will be child of fromElem parent.

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
rdmur...@bi..nce.com wrote: Quoth Hendrik van Rooyen m...@microcorp.co.za: rd.mur...@bitdance.com wrote: You, sir, should be programming in some language other than Python. 8- reasons given This is IMO an arrogant attitude - My apologies!!

Re: what IDE is the best to write python?

2009-02-02 Thread Willi Richert
Hi, I used eclipse/pydev quite some time. What pulled me back into the arms of emacs was: - ability to save bookmarks (meaning a point in a file) at all the keystrokes. Never found out how to do that in eclipse. In emacs I have now all the times j save at the current working position, f at

Where how to deallocate resources in Python C extension

2009-02-02 Thread fredbasset1000
Hi, I've written a C extension, see code below, to provide a Python interface to a hardware watchdog timer. As part of the initialization it makes some calls to mmap, I am wondering should I be making balanced calls to munmap in some kind of de-init function? Do Python extensions have d'tors?

Re: Python patch module

2009-02-02 Thread Robert Kern
On 2009-02-02 16:39, Minesh Patel wrote: Hi, I was wondering if there is any patch management module for Python. Basically I am looking to only apply a hunk from a patch if the file exists. Google's diff-match-patch library might be up your alley.

Re: ElementTree and clone element toot

2009-02-02 Thread Gerard Flanagan
m.banaouas wrote: Hi all, Working with the ElementTree module, I looked for clone element function but not found such tool: def CloneElment(fromElem, destRoot = None) fromElem is the element to clone destRoot is the parent element of the new element ; if None so the new element will be child of

Re: faster scipy.percentileofscore ?

2009-02-02 Thread Vincent Davis
Did not know about http://www.scipy.org/Mailing_Lists but did not look, Thanks for the help Vincent Davis On Mon, Feb 2, 2009 at 11:28 AM, Robert Kern robert.k...@gmail.com wrote: On 2009-02-02 12:08, Vincent Davis wrote: Currently I am using the following: pgrades =

Re: Get thread pid

2009-02-02 Thread Alejandro
On Feb 2, 3:01 am, Ove Svensson ove.svens...@jeppesen.com wrote: If you find a way to get to the real TID, that will be specific to your architecture. If htop (or any other application) returns a TID, that is either artificial or architecture specific. Right know I only need the TID for

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 2:46 pm, Tim Rowe digi...@gmail.com wrote: 2009/2/2 Russ P. russ.paie...@gmail.com: Are we supposed to believe that the designers of C++, Java, Ada, and Scala are all idiots? No, we're supposed to believe that the designers of C++, Java, Ada, and Scala are all designers of

Re: Reading text file with wierd file extension?

2009-02-02 Thread MRAB
Lionel wrote: On Feb 2, 1:07 pm, Diez B. Roggisch de...@nospam.web.de wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: DatafilePath = C:\\C8Example1.slc ResourcefilePath = DatafilePath + .rsc DatafileFH =

Re: Extreme Yaro weirdness

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 06:59:16 -0200, Ron Garret rnospa...@flownet.com escribió: I'm running the following WSGI app under Yaro: def error(req): try: req.non_existent_key except: try: return cgitb.html(sys.exc_info()) except: return 'foo' The result of running this

handy way to spot-profile a python program (watch+pstat+tac)

2009-02-02 Thread Mike
Someone (forget who) mentioned recently that you could get some poor man's profiling info by attaching to a running python with gdb, and periodically grabbing a stack trace. I figured out that there's a handy way to do this with this command: watch -n 1 'pstack 30154 | tac' which will show

Re: ElementTree and clone element toot

2009-02-02 Thread m.banaouas
My python version is 2.4.4 def SubElement(parent, tag, attrib={}, **extra): Can you tell me how does parent issue could be solved by SubElement ? I'm looking for how to determine element parent just by asking element it self. It seems like element doesn't know witch is its parent, while any

Re: what IDE is the best to write python?

2009-02-02 Thread andrew cooke
Just to register a contrary opinion: I *hate* syntax highlighting you can use it in surprising ways, if the implementation is good enough. when i used intellij with java i had the syntax highlighting set so that everything was simple black+white, but mutable state (i can't remember the exact

Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
Hi, I am trying to get and then refresh a page in IE with a Python script. I just want to get a page, then refresh it every 5 minutes. Below is the code I am attempting. It is erroring out on the id=ie.Document.Script._oleobj_.GetIDsOfNames('window.location.reload()') #tried with and without

function scope

2009-02-02 Thread Baris Demir
Hi everybody, I am quite new to python and using it for my thesis. Luckily I found out some kind of behavior surprising to me and so unwanted in my code. I could not find any explanation, so solution for the code. It is simply like this: /*li = another_module.global_variable f=simpleCut(li)

Re: is python Object oriented??

2009-02-02 Thread rdmurray
Quoth Hendrik van Rooyen m...@microcorp.co.za: Now there are a LOT of dicey statements in the above passionate plea - python is a language, and not a philosophy, but I won't go into that, as that would lead off onto a tangent, of which there have been a surfeit in this thread. Ah, now I

Re: what IDE is the best to write python?

2009-02-02 Thread Tim Rowe
2009/2/1 MattBD matthewbd...@googlemail.com: Really it depends what you are doing. Some languages are very tightly integrated with an IDE, such as MS Visual C#, and as far as I can see it would be extremely difficult, if not impossible to use a text editor with that language. Why so? I don't

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring is not in the given

Re: Monitor Internet connections in XP/Vista

2009-02-02 Thread Giampaolo Rodola'
On 2 Feb, 10:05, pranav pra...@gmail.com wrote: Hi Folks, I am designing a project for Windows XP/Vista, one part of which is a background process that monitors internet connections. If the user tries to connect to any particular site, say myDummySite.com in then some actions are taken,

Re: [2.5.1] Comparing dates?

2009-02-02 Thread Gilles Ganault
On Mon, 02 Feb 2009 20:06:02 +1100, Ben Finney bignose+hates-s...@benfinney.id.au wrote: The Python data types for date and time are in the ‘datetime’ module URL:http://www.python.org/doc/2.6/library/datetime. Create a ‘datetime’ object for each value you want, then compare them. Thanks guys. For

Re: Membership of multiple items to a list

2009-02-02 Thread rdmurray
My client can handle your Mime and shows me the text part of the signed message. It's not as pretty as just seeing an unsigned text message, but that's a client problem, not yours :) I would like to think that all newsreader clients could handle mime at this point, but who knows. --RDM --

Re: what IDE is the best to write python?

2009-02-02 Thread Christof Donat
Hi, Just to register a contrary opinion: I *hate* syntax highlighting With vim you simply don't turn it on. Would that be OK for you? Christof -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: MyTextFile.slc.rsc My code is as follows: Filepath = C:\\MyTextFile.slc.rsc FileH = open(Filepath) The above

Re: is python Object oriented??

2009-02-02 Thread Benjamin Kaplan
On Mon, Feb 2, 2009 at 4:51 PM, Russ P. russ.paie...@gmail.com wrote: On Feb 2, 9:02 am, thmpsn@gmail.com wrote: On Feb 2, 2:55 am, Stephen Hansen apt.shan...@gmail.com wrote: This is proven by your statement above, whereby you are driving a user away, simply because the

Re: Question about wx folder browser widget

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 02:58:07 -, Steve Holden st...@holdenweb.com wrote: Sam Price wrote: Is there any good wx widgets that provide the same feel as folder/file browser. I want to be notified when a user tries to drag and drop a file/folder on the widget, and then copy that file/folder to

Re: function scope

2009-02-02 Thread MRAB
Baris Demir wrote: Hi everybody, I am quite new to python and using it for my thesis. Luckily I found out some kind of behavior surprising to me and so unwanted in my code. I could not find any explanation, so solution for the code. It is simply like this: /*li =

Re: function scope

2009-02-02 Thread Stephen Hansen
On Mon, Feb 2, 2009 at 3:40 PM, Baris Demir demirba...@gmail.com wrote: Hi everybody, I am quite new to python and using it for my thesis. Luckily I found out some kind of behavior surprising to me and so unwanted in my code. I could not find any explanation, so solution for the code. It

Re: function scope

2009-02-02 Thread Stephen Hansen
If you want a copy when you have to do so explicitly with temp=d.copy(). Or that! I forgot about that method. :) Curiously, in 160k lines of code, I haven't explicitly copied a dictionary once. I find that odd. --S -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-02 Thread Tim Rowe
2009/2/2 Russ P. russ.paie...@gmail.com: On Feb 2, 2:46 pm, Tim Rowe digi...@gmail.com wrote: No, we're supposed to believe that the designers of C++, Java, Ada, and Scala are all designers of languages that are not Python. If all languages had the same philosophy what would be the point of

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 13:54:08 -, Hendrik van Rooyen m...@microcorp.co.za wrote: r..@bi...nce.com wrote: PS: More accurately, Python _embodies_ a philosophy, and to advocate changes that go against that philosophy is to advocate changing Python into something that would no longer be

Re: function scope

2009-02-02 Thread Mike Kent
On Feb 2, 6:40 pm, Baris Demir demirba...@gmail.com wrote: def simpleCut(d=dict()):        temp=d        for i in temp.keys():            if    (temp[i] == ...) :               temp[i]=new_value return temp You have been bitten by the shared default parameter noobie trap:

Re: Reading text file with wierd file extension?

2009-02-02 Thread Denis Kasak
On Mon, Feb 2, 2009 at 10:43 PM, Lionel lionel.ke...@gmail.com wrote: snip ResourcefilePath 'C:\\C8Example1.slc.rsc' snip C:\C8Example1.slc.src The extension you used in the interactive shell differs from the one you used in the class code (i.e. rsc vs src). -- Denis Kasak --

Re: what IDE is the best to write python?

2009-02-02 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: In article 874ozd3cr3@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Just to register a contrary opinion: I *hate* syntax highlighting On what basis? It makes my eyes bleed Okay. I'll

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 4:50 pm, Denis Kasak denis.ka...@gmail.com wrote: On Mon, Feb 2, 2009 at 10:43 PM, Lionel lionel.ke...@gmail.com wrote: snip ResourcefilePath 'C:\\C8Example1.slc.rsc' snip C:\C8Example1.slc.src The extension you used in the interactive shell differs from the one you used

Re: what IDE is the best to write python?

2009-02-02 Thread Patrick Steiger
2009/2/2 Joe Riopel goo...@gmail.com I typically use vim/vi, because it's usually already installed on the OS's I work with and vim for Windows works the same. Also, using the same editor across these different OS's, I don't have to worry too much soft/hard tabs. You shouldn't even think

Re: ElementTree and clone element toot

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 14:21:29 -0200, m.banaouas banaouas.media...@wanadoo.fr escribió: My python version is 2.4.4 def SubElement(parent, tag, attrib={}, **extra): Can you tell me how does parent issue could be solved by SubElement ? Simply because you *have* to pass a parent to the

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Wooding
John Machin sjmac...@lexicon.net writes: 3 can be represented in 2 bits and at the same time -3 can be represented in 2 bits?? But 2 bits can support only 2 ** 2 == 4 different possibilities, and -3 .. 3 is 7 different integers. Yeah, I made some arbitrary choices about what to do with

Re: what IDE is the best to write python?

2009-02-02 Thread Jervis Whitley
On Mon, Feb 2, 2009 at 2:46 PM, Chris Jones cjns1...@gmail.com wrote: On Sun, Feb 01, 2009 at 07:26:24PM EST, Ben Finney wrote: a...@pythoncraft.com (Aahz) writes: Just to register a contrary opinion: I *hate* syntax highlighting On what basis? Real men hate syntax highlighting. --

Re: Reading text file with wierd file extension?

2009-02-02 Thread Rhodri James
[Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 2:01 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 3:43 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 1:07 pm, Diez B. Roggisch de...@nospam.web.de wrote: This is

Re: key capture

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 10:45:21 -, Tino Wildenhain t...@wildenhain.de wrote: Hi, swamynathan wrote: hello, im making a virtual piano in python where on key stroke a wav is played from a location now to implement a fully functional piano i need to have multiple key stroke captures ie if 2

Re: Searching a file for multiple strings

2009-02-02 Thread gotbyrd
On Jan 31, 2:45 pm, Tim Chase python.l...@tim.thechases.com wrote: I'm fairly new with python and am trying to build a fairly simple search script.  Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords.  I've already written a script that can search

Re: Searching a file for multiple strings (PS)

2009-02-02 Thread gotbyrd
On Jan 31, 11:39 pm, Shawn Milochik sh...@milochik.com wrote: On Sat, Jan 31, 2009 at 3:00 PM, Tim Chase python.l...@tim.thechases.com wrote: I'm fairly new with python and am trying to build a fairly simple search script.  Ultimately, I'm wanting to search a directory of files for

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 5:40 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: [Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 2:01 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 3:43 pm, Lionel lionel.ke...@gmail.com wrote: On

Re: is python Object oriented??

2009-02-02 Thread Mark Wooding
Russ P. russ.paie...@gmail.com writes: I am not sure why people keep mentioning that Python is not Java. As a slogan, it is rather misleading. Python is not C++, Ada, or Scala either. All of those languages have enforced access restriction. Why only mention Java? Because Java is a well-known

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 4:35 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: This really, really, *really* isn't a tangent. It's the heart of the matter. You are advocating a change that doesn't fit with Python's consenting adults approach to programming. It's trivial to enforce hiding using static

Code critique xmlrpclib

2009-02-02 Thread flagg
This xmlrpc server is designed to parse dns zone files and then perform various actions on said files. \ It uses dnspython, and xmlrpclib I'd like to know what some of the more experienced python users think. Where I could improve code, make it more efficient, whatever. All suggestions are

Re: Import without executing module

2009-02-02 Thread Ray
Hi all, On Feb 3, 1:11 am, John Machin sjmac...@lexicon.net wrote: On Feb 2, 11:51 pm, pyt...@bdurham.com wrote: If the output is coming from a print command, couldn't the OP temporarily redirect STDIO to a file to prevent the output from being displayed? He could, but that'd be a

Re: is python Object oriented??

2009-02-02 Thread Grant Edwards
On 2009-02-02, Russ P. russ.paie...@gmail.com wrote: I am not sure why people keep mentioning that Python is not Java. As a slogan, it is rather misleading. Because other people keep insisting that it ought to be. Python is not C++, Ada, or Scala either. All of those languages have enforced

Re: Reading text file with wierd file extension?

2009-02-02 Thread Grant Edwards
On 2009-02-03, Rhodri James rho...@wildebst.demon.co.uk wrote: [Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 2:01 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 3:43 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2,

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
On Tue, 03 Feb 2009 02:16:01 -, Russ P. russ.paie...@gmail.com wrote: Here we go again. If you have access to the source code (as you nearly always do with Python code), then breaking the language-enforced data hiding is a trivial matter of deleting the word private (or equivalent). If

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 8:08 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 5:40 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: [Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 2:01 pm, Mike Driscoll kyoso...@gmail.com wrote:

Re: function scope

2009-02-02 Thread Steven D'Aprano
On Mon, 02 Feb 2009 16:37:07 -0800, Mike Kent wrote: On Feb 2, 6:40 pm, Baris Demir demirba...@gmail.com wrote: def simpleCut(d=dict()):        temp=d        for i in temp.keys():            if    (temp[i] == ...) :               temp[i]=new_value return temp You have been bitten

Re: Source code for csv module

2009-02-02 Thread Tim Roberts
vsoler vicente.so...@gmail.com wrote: I'm still interested in learning python techniques. Are there any other modules (standard or complementary) that I can use in my education? Are you serious about this? Are you not aware that virtually ALL of the Python standard modules are written in

Re: function scope

2009-02-02 Thread Tim Roberts
Mike Kent mrmak...@cox.net wrote: On Feb 2, 6:40 pm, Baris Demir demirba...@gmail.com wrote: def simpleCut(d=dict()):        temp=d        for i in temp.keys():            if    (temp[i] == ...) :               temp[i]=new_value return temp You have been bitten by the shared default

Re: is python Object oriented??

2009-02-02 Thread Luis Zarrabeitia
Quoting Russ P. russ.paie...@gmail.com: I know ... changing one word constitutes a fork. Yeah, right. Yeah, right. You can't be bothered to change one word, but the library developer should be required to litter his code with leading underscores everywhere, No, instead they will have to

Re: Using lxml to screen scrap a site, problem with charset

2009-02-02 Thread Tim Arnold
?? ??? gdam...@gmail.com wrote in message news:ciqh56-ses@archaeopteryx.softver.org.mk... So, I'm using lxml to screen scrap a site that uses the cyrillic alphabet (windows-1251 encoding). The sites HTML doesn't have the META ..content-type.. charset=.. header, but does have a

Re: what IDE is the best to write python?

2009-02-02 Thread Aahz
In article 87y6woz659@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: In article 874ozd3cr3@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Just to register a contrary

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 7:48 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Tue, 03 Feb 2009 02:16:01 -, Russ P. russ.paie...@gmail.com wrote: Here we go again. If you have access to the source code (as you nearly always do with Python code), then breaking the language-enforced data hiding is

Re: what IDE is the best to write python?

2009-02-02 Thread Peter Anderson
I have a thing about editors; a good editor is my tool of trade! I have tried many editors over the years mainly in the MS Windows, Linux and IBM mainframe environments. After all this I really like EditPlus (and the a slightly lesser extent Textpad). What both have in common is their Clip

Varibles -- copies and references

2009-02-02 Thread Ferdinand Sousa
Hi Some weeks back I had been following the thread Why can't assign to function call. Today, I saw the function scope thread, and decided I should ask about the behaviour below: # Simple variables p=55 q=p q 55 q=44 p 55

Re: what IDE is the best to write python?

2009-02-02 Thread Russ P.
On Feb 2, 9:09 pm, a...@pythoncraft.com (Aahz) wrote: You favor bleeding eyes? If I am going to bleed anywhere, I'd actually prefer it be somewhere other than the eyes. Well, maybe not the gonads either. That's a tough call. In any case, I use xemacs, and I've always liked color highlighting.

Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Address already in use')

2009-02-02 Thread Aahz
In article qaidnuxdgsrtwhjunz2dnuvz_vzin...@posted.usinternet, Grant Edwards gra...@visi.com wrote: On 2009-02-01, Steve Holden st...@holdenweb.com wrote: I believe this is because Microsoft failed to understand the original meaning of ___, and persisted with this ghastly

rfi : bestpractises for implementing secure policies in python

2009-02-02 Thread Banibrata Dutta
Hi, Wondering if it is at-all possible to implement secure (s.a. not viewable / tunable / tweakable) Policies in python ? Use-cases: 1) License enforcement -- Same application, licensed at differential price levels, based on various feature-sets. 2) Parental-Control enforcement. Application

global variable confusion

2009-02-02 Thread Robert D.M. Smith
I have a question on global variables and how to use them. I have 2 files; a.py b.py # a.py - myvar = { 'test' : '123' } # --- # b.py - from a import myvar def test(): a.myvar = { 'blah' : '456' } # - If I *'import a*' type *'a.myvar'* it prints 'test' '123'. Now,

Re: global variable confusion

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 10:25 PM, Robert D.M. Smith robert.dm.sm...@gmail.com wrote: I have a question on global variables and how to use them. I have 2 files; a.py b.py # a.py - myvar = { 'test' : '123' } # --- # b.py - from a import myvar def test(): a.myvar = {

Re: Varibles -- copies and references

2009-02-02 Thread Stephen Hansen
Guess the simple types show the expected behaviour (even though they are technically instances of existing classes). The user defined classes seem to be references/shallow copies. I prefer to avoid the term reference when talking about Python semantics, because it tends to make a lot of

Re: Reading text file with wierd file extension?

2009-02-02 Thread john
On Feb 2, 7:57 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 8:08 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 5:40 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: [Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel lionel.ke...@gmail.com wrote:

<    1   2   3   4   >