Re: "also" to balance "else" ?

2005-06-13 Thread Donn Cave
Quoth Ron Adam <[EMAIL PROTECTED]>: | ... The current for-else | is IMHO is reversed to how the else is used in an if statement. Is that all? As a matter of opinion, this one is fairly simply an arbitrary choice to assign a positive sense to completion of the loop predicate. For search loops, f

Re: regarding cgi

2005-06-13 Thread Fredrik Lundh
"praba kar" wrote: > I have doubt regarding headers in cgi > programming. If I gives "Content-Type:text/plain" > then I try to print html contents. Is right or wrong > after giving content-type: text/plain? if you expect the HTML contents to appear as HTML, it's wrong. (some web bro

Re: Tiff Image Reader/writer

2005-06-13 Thread Fredrik Lundh
"PyPK" wrote: > nothing fancy. I just want to be able to read a tiff image, get pixel > values, write back to a tiff file. so why doesn't PIL or ImageMagick work for you? here's a minimal PIL version: from PIL import Image im = Image.open("myfile.tiff") value = im.getpixel((12, 34)

regarding cgi

2005-06-13 Thread praba kar
Dear All, I have doubt regarding headers in cgi programming. If I gives "Content-Type:text/plain" then I try to print html contents. Is right or wrong after giving content-type: text/plain? regards Prabahar ___

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread Fredrik Lundh
John Machin wrote: > Many people don't appear to want to know why; they only want a solution > to what they perceive to be their current problem. and many people can identify a short HOWTO when they see it, and look things up in the documentation when they want the full story. reposting the docu

stuck in cgi-image mess

2005-06-13 Thread nephish
i have an html form with a drop-down list that lists a bunch of images. how can i get my cgi script to load the image ? i have imported cgi and os text entered from a form and read from a file do ok, but i cant seem to get it to load an image. the form writes all of the entries as lines in a .txt

Re: ElementTree Namespace Prefixes

2005-06-13 Thread Fredrik Lundh
Oren Tirosh wrote: > It all boils down to how you define "the same". Which parts of the XML > document are meaningful content that needs to be preserved and which > ones are mere encoding variations that may be omitted from the internal > representation? > > Some relevant references which may be u

Re: "also" to balance "else" ?

2005-06-13 Thread Ron Adam
Terry Hancock wrote: > On Monday 13 June 2005 11:09 pm, Ron Adam wrote: >>My suggestion is to use, also as the keyword to mean "on normal exit" >>'also' do this. > > > Unfortunately, "also" is also a bad keyword to use for this, IMHO. > I don't find it any more intuitive than "else". (And sin

Re: "also" to balance "else" ?

2005-06-13 Thread Ron Adam
Andrew Dalke wrote: > Ron Adam wrote: > >>It occurred to me (a few weeks ago while trying to find the best way to >>form a if-elif-else block, that on a very general level, an 'also' >>statement might be useful. So I was wondering what others would think >>of it. > > >>for x in : >>BLOC

Which Python Wiki engine?

2005-06-13 Thread Kenneth McDonald
I'm looking for a Wiki engine to set up for my company, so that we can incrementally add user documentation for a fairly complex program, plus allow users to add their own comments for the benefit of others. I'd strongly prefer a Python-based Wiki, since that allows me the chance to add plu

Re: "also" to balance "else" ?

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 11:09 pm, Ron Adam wrote: > John Roth wrote: > > "Ron Adam" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > The difficulty you're having with this is that else > > is a very bad keyword for this particular construct. > > I'd prefer something like "on norm

Re: implicit variable declaration and access

2005-06-13 Thread Christopher Subich
Cameron Laird wrote: > cleaner algorithm somewhere in the neighborhood. In general, > "application-level" programming doesn't need exec() and such. > > PyPy and debugger writers and you other "systems" programmers > already know who you are. Out of curiosity, where would you classify interprete

Re: What is different with Python ?

2005-06-13 Thread Steven D'Aprano
D H wrote: > But what you are getting at is more akin to our mental model of what the > computer is doing when we write and run a program. Without a > fundamental understanding of memory and addresses, a programmer can make > certain mistakes that reveal this lack of understanding. But that

Re: How to get/set class attributes in Python

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 03:50 pm, Kalle Anke wrote: > On Mon, 13 Jun 2005 20:41:48 +0200, Terry Hancock wrote > (in article <[EMAIL PROTECTED]>): > > > 1) Assume the variables are of a sensible type (not > > necessarily the one you expected, though), and provide > > exception handling to catch the

Re: What is different with Python ?

2005-06-13 Thread Andrew Dalke
Andrea Griffini wrote: > This is investigating. Programming is more similar to building > instead (with a very few exceptions). CS is not like physics or > chemistry or biology where you're given a result (the world) > and you're looking for the unknown laws. In programming *we* > are building the

Re: ANN: pyparsing-1.3.1 released

2005-06-13 Thread Christopher Subich
Paul McGuire wrote: > (sorry if this is a double-post - I tried posting this last night but I > think GoogleGroups ate it) > > Pyparsing is a pure-Python class library for quickly and easily > constructing recursive-descent parsers. Pyparsing takes a > "building-block" approach to parser construc

Re: "also" to balance "else" ?

2005-06-13 Thread Ron Adam
John Roth wrote: > > "Ron Adam" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> Currently the else block in a for loop gets executed if the loop is >> completed, which seems backwards to me. I would expect the else to >> complete if the loop was broken out of. That seems m

Re: circular import Module

2005-06-13 Thread Greg Ewing
Magnus Lycka wrote: > Due to the cycle, you can never use file1 without > file2 or vice versa. Why do you then want it to be > two different modules instead of one? Perhaps because it would then be too big and unwieldy to maintain? Sometimes there are legitimate reasons for mutually-dependent mod

Re: What is different with Python ?

2005-06-13 Thread Terry Reedy
"Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrea Griffini <[EMAIL PROTECTED]> wrote: >> Hehehe... a large python string is a nice idea for modelling >> memory. > > Actually, a Python string is only good for modelling ROM. If you want to > model read-write memory,

RE: Controlling a generator the pythonic way

2005-06-13 Thread Delaney, Timothy C (Timothy)
FWIW, PEP 342 is now titled "Coroutines via Enhanced Iterators" :) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-13 Thread D H
Andrea Griffini wrote: > On Mon, 13 Jun 2005 22:23:39 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > >>Being familiar with >>fondamental *programming* concepts like vars, branching, looping and >>functions proved to be helpful when learning C, since I only had then to >>focus on p

Re: What is different with Python ?

2005-06-13 Thread D H
Andrea Griffini wrote: > On Sat, 11 Jun 2005 21:52:57 -0400, Peter Hansen <[EMAIL PROTECTED]> > wrote: > > >>I think new CS students have more than enough to learn with their >>*first* language without having to discover the trials and tribulations >>of memory management (or those other things

Re: "also" to balance "else" ?

2005-06-13 Thread John Roth
"Ron Adam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Currently the else block in a for loop gets executed if the loop is > completed, which seems backwards to me. I would expect the else to > complete if the loop was broken out of. That seems more constant with > if's el

Re: recursive import list

2005-06-13 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> I have a fairly large project going on and would like to figure out >> automatically from the source which files are being imported. > If you use your own import function, like below, you could create a > list of all imported modules. Why not use

Re: "also" to balance "else" ?

2005-06-13 Thread Ron Adam
Eloff wrote: > My first reaction was that this is terrible, else clauses on loops are > confusing enough. But if I think about it more, I'm warming up to the > idea. Also/Else for loops is clear, symmetrical, and would be useful. > > Reversing the meanign of else will break code, but it's not used

Re: What is different with Python ?

2005-06-13 Thread D H
Philippe C. Martin wrote: > Yet for the first time I get (most) of my questions answered by a language I > did not know 1 year ago. ^^ You're in the Python honeymoon stage. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-13 Thread Mike Meyer
Kalle Anke <[EMAIL PROTECTED]> writes: > On Mon, 13 Jun 2005 20:41:48 +0200, Terry Hancock wrote > (in article <[EMAIL PROTECTED]>): > >> 1) Assume the variables are of a sensible type (not >> necessarily the one you expected, though), and provide >> exception handling to catch the case where the

Re: The need to put "self" in every method

2005-06-13 Thread D H
Steve Holden wrote: > Fernando M. wrote: > >> Hi, >> >> i was just wondering about the need to put "self" as the first >> parameter in every method a class has because, if it's always needed, >> why the obligation to write it? couldn't it be implicit? >> >> Or is it a special reason for this being

Re: case/switch statement?

2005-06-13 Thread D H
Peter Hansen wrote: > With a case statement, on the other hand, you *know* that it must be > just simple conditionals (a series of x == some_constant tests), so you > don't need to look at all the cases, just the one that interests you. Since you and Steve Holden agree that a case statement is u

Re: What is different with Python ?

2005-06-13 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Mon, 13 Jun 2005 01:54:53 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >>Andrea Griffini <[EMAIL PROTECTED]> writes: >>I disagree. If you're going to make competent programmers of them, >>they need to know the *cost* of those details, but not necessa

Re: just learning eric ide

2005-06-13 Thread McBooCzech
Try this: http://www.pycs.net/lateral/stories/16.html HTH Petr -- http://mail.python.org/mailman/listinfo/python-list

Re: "also" to balance "else" ?

2005-06-13 Thread Andrew Dalke
Ron Adam wrote: > It occurred to me (a few weeks ago while trying to find the best way to > form a if-elif-else block, that on a very general level, an 'also' > statement might be useful. So I was wondering what others would think > of it. > for x in : > BLOCK1 > if : break # do else

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Brian
Hi Rbt, To give an example of processing a lot of data, I used Python to read and process every word in a single text file that contained the entire King James Bible version. It processed it within about one second -- split the words, etc. Worked quite well. Hope this helps, Brian --- rbt

Re: searching for IDE

2005-06-13 Thread Steve Holden
alexrait1 wrote: > I need an IDE for python that has the ability to show the filds of a > class when I write "." > Just the way it works in eclipse/JBuilder with java or visual studio > with c++ > For now I treid eric3 and IDLE they don't do this... > Wing IDE gives you a completion drop-down when

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread John Machin
rbt wrote: > Here's the scenario: > > You have many hundred gigabytes of data... possible even a terabyte or > two. Within this data, you have private, sensitive information (US > social security numbers) about your company's clients. Your company has > generated its own unique ID numbers to re

Re: Going crazy...

2005-06-13 Thread Irmen de Jong
Jan Danielsson wrote: > Hello all, > >I'm 100% sure that I saw an example which looked something like this > recently: > > a=(1, 2, 3, 4, 5, 6) b=(2, 3, 6) a - b > > (1, 4, 5) > >The only new language I have been involved in lately is Python. Is my > memory failing me, or h

Re: Going crazy...

2005-06-13 Thread Chinook
On Mon, 13 Jun 2005 20:52:43 -0400, Gary Herron wrote (in article <[EMAIL PROTECTED]>): > Jan Danielsson wrote: > >> Hello all, >> >> I'm 100% sure that I saw an example which looked something like this >> recently: >> >> >> > a=(1, 2, 3, 4, 5, 6) > b=(2, 3, 6) > a - b >

Re: implicit variable declaration and access

2005-06-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ali Razavi <[EMAIL PROTECTED]> wrote: >Tom Anderson wrote: >> On Mon, 13 Jun 2005, Ali Razavi wrote: >> >>> Is there any reflective facility in python that I can use to define a >>> variable with a name stored in another variable ? .

Re: win32evtlog

2005-06-13 Thread J Correia
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Doh! I didn't think to look in the demo directory. Silly me. > http://www.win32com.de/index.php?option=com_content&task=view&id=163&Itemid=189 -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling a generator the pythonic way

2005-06-13 Thread Thomas Lotze
Thomas Lotze wrote: > I'm trying to figure out what is the most pythonic way to interact with a > generator. JFTR, so you don't think I'd suddenly lost interest: I won't be able to respond for a couple of days because I've just incurred a nice little hospital session... will be back next week. -

Re: What is different with Python ?

2005-06-13 Thread Andrea Griffini
On Mon, 13 Jun 2005 22:23:39 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Being familiar with >fondamental *programming* concepts like vars, branching, looping and >functions proved to be helpful when learning C, since I only had then to >focus on pointers and memory management. If y

Re: What is different with Python ?

2005-06-13 Thread Andrea Griffini
On Mon, 13 Jun 2005 01:54:53 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >Andrea Griffini <[EMAIL PROTECTED]> writes: >>>In short, you're going to start in the middle. >> >> I've got "bad" news for you. You're always in the >> middle :-D. > >That's what I just said. Yeah. I should stop replying

Re: Going crazy...

2005-06-13 Thread Gary Herron
Jan Danielsson wrote: >Hello all, > > I'm 100% sure that I saw an example which looked something like this >recently: > > > a=(1, 2, 3, 4, 5, 6) b=(2, 3, 6) a - b >(1, 4, 5) > > The only new language I have been involved in lately is Python. Is my >memory failin

Re: win32evtlog

2005-06-13 Thread sigzero
Doh! I didn't think to look in the demo directory. Silly me. -- http://mail.python.org/mailman/listinfo/python-list

Going crazy...

2005-06-13 Thread Jan Danielsson
Hello all, I'm 100% sure that I saw an example which looked something like this recently: >>> a=(1, 2, 3, 4, 5, 6) >>> b=(2, 3, 6) >>> a - b (1, 4, 5) The only new language I have been involved in lately is Python. Is my memory failing me, or have I seen such an Python-example somewhere? I

Re: win32evtlog

2005-06-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Is anyone versed in pulling out information from the Windows (2000) > event log? I have looked at the docs and I am in the dark as to how to > do it. Do what? I am looking to pull out all events with "error" as the > type. Generally there are a few things you can do to h

Re: "also" to balance "else" ?

2005-06-13 Thread Eloff
My first reaction was that this is terrible, else clauses on loops are confusing enough. But if I think about it more, I'm warming up to the idea. Also/Else for loops is clear, symmetrical, and would be useful. Reversing the meanign of else will break code, but it's not used that frequently, and i

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread Peter Hansen
Steven D'Aprano wrote: > So going back to the original question... if I open in "r" mode a text > file which was created under Windows, I will get \r characters in the > text and have to deal with them regardless of what platform I am running > Python under. Correct? Almost, but the way you phrase

Re: What is different with Python ?

2005-06-13 Thread Andrea Griffini
On Mon, 13 Jun 2005 13:35:00 +0200, Peter Maas <[EMAIL PROTECTED]> wrote: >I think Peter is right. Proceeding top-down is the natural way of >learning. Depends if you wanna build or investigate. To build top down is the wrong approach (basically because there's no top). Top down is however great

Re: What is different with Python ?

2005-06-13 Thread Roy Smith
Andrea Griffini <[EMAIL PROTECTED]> wrote: > Hehehe... a large python string is a nice idea for modelling > memory. Actually, a Python string is only good for modelling ROM. If you want to model read-write memory, you need a Python list. -- http://mail.python.org/mailman/listinfo/python-list

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread John Machin
Steven D'Aprano wrote: > On Mon, 13 Jun 2005 11:53:25 +0200, Fredrik Lundh wrote: > > >><[EMAIL PROTECTED]> wrote: >> >> >>>It means in windows we should use 'wb' to write and 'rb' to read ? >>>Am I right? >> >>no. >> >>you should use "wb" to write *binary* files, and "rb" to read *binary* >>file

Re: Get drives and partitions list (Linux)

2005-06-13 Thread Peter Hansen
cantabile wrote: > Hi, Peter > Thanks for the reply. I'll check popen(). > But you said I should not rely on fdisk... Why ? And should I prefer > sfdisk ? Why ? I was under the impression that fdisk was older and more primitive, but a quick check shows I'm probably not only wrong, but had it back

just learning eric ide

2005-06-13 Thread David Bear
Eric is the first IDE I have used since the borland c++ ide for dos many many years ago. Aside from the docs that come in the help system, I'm looking for a quick tutorial that gives me an overview of the test, debug cycle that is considered -- for beginners. any pointers or books. This seems like

Re: implicit variable declaration and access

2005-06-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Peter Dembinski <[EMAIL PROTECTED]> wrote: >Benji York <[EMAIL PROTECTED]> writes: > >[snap] > >>> code = x + '= 0' >>> exec(code) >> >> You should generally stay away from exec for lots of reasons. > >Code 'refactorizability' is one of them. There's an affirmative

Re: What is different with Python ?

2005-06-13 Thread Andrea Griffini
On Mon, 13 Jun 2005 09:22:55 +0200, Andreas Kostyrka <[EMAIL PROTECTED]> wrote: >Yep. Probably. Without a basic understanding of hardware design, one cannot >many of todays artifacts: Like longer pipelines and what does this >mean to the relative performance of different solutions. I think that p

"also" to balance "else" ?

2005-06-13 Thread Ron Adam
There seems to be a fair amount of discussion concerning flow control enhancements lately. with, do and dowhile, case, etc... So here's my flow control suggestion. ;-) It occurred to me (a few weeks ago while trying to find the best way to form a if-elif-else block, that on a very general

reading a python file object in c extension crashes python

2005-06-13 Thread travis ray
Hi, I have an extension in which a file object is created in python and passed down to a c extension which attempts to read from it or write to it. Writing to the file pointer seems to work okay, but reading from it results in EBADF. It also causes python to crash on exit. I've attached the min

Re: What is different with Python ?

2005-06-13 Thread Andrew Dalke
Peter Maas wrote: > I think Peter is right. Proceeding top-down is the natural way of > learning (first learn about plants, then proceed to cells, molecules, > atoms and elementary particles). Why in the world is that way "natural"? I could see how biology could start from molecular biology - how

win32evtlog

2005-06-13 Thread sigzero
Is anyone versed in pulling out information from the Windows (2000) event log? I have looked at the docs and I am in the dark as to how to do it. Do what? I am looking to pull out all events with "error" as the type. Robert -- http://mail.python.org/mailman/listinfo/python-list

reading a python file object in c extension crashes python

2005-06-13 Thread travis ray
Hi, I have an extension in which a file object is created in python and passed down to a c extension which attempts to read from it or write to it. Writing to the file pointer seems to work okay, but reading from it results in EBADF and causes python to crash on exit. I've attached the minimal (

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread Steven D'Aprano
On Mon, 13 Jun 2005 10:52:52 -0400, Peter Hansen wrote: > Steven D'Aprano wrote: >> When you read a Windows text file using "r" mode, what happens to the \r >> immediately before the newline? Do you have to handle it yourself? Or will >> Python cleverly suppress it so you don't have to worry about

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 09:34 am, Steven D'Aprano wrote: > On Mon, 13 Jun 2005 11:53:25 +0200, Fredrik Lundh wrote: > > <[EMAIL PROTECTED]> wrote: > >> It means in windows we should use 'wb' to write and 'rb' to read ? > >> Am I right? > > no. > > you should use "wb" to write *binary* files, and "rb

Re: implicit variable declaration and access

2005-06-13 Thread Steven D'Aprano
On Mon, 13 Jun 2005 12:18:31 -0400, Ali Razavi wrote: > Is there any reflective facility in python > that I can use to define a variable with a > name stored in another variable ? > like I have : > x = "myVarName" > > what can I do to declare a new variable with the name of the string > stored in

Re: implicit variable declaration and access

2005-06-13 Thread Tom Anderson
On Mon, 13 Jun 2005, Peter Dembinski wrote: > Tom Anderson <[EMAIL PROTECTED]> writes: > > [snap] > >> The MAtrix had evarything in it: guns, a juimping off teh walls, flying >> guns, a bullet tiem, evil computar machenes, numbers that flew, flying >> gun bullets in slowar motian, juimping into

Re: implicit variable declaration and access

2005-06-13 Thread Ali Razavi
Tom Anderson wrote: > On Mon, 13 Jun 2005, Ali Razavi wrote: > >> Is there any reflective facility in python that I can use to define a >> variable with a name stored in another variable ? >> >> like I have : >> x = "myVarName" >> >> what can I do to declare a new variable with the name of the st

Re: Request for help on naming conventions

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 03:59 am, Steven D'Aprano wrote: > Are there any useful naming conventions for modules, classes and functions? > > For instance, should I name functions as verbs and classes as nouns? Hmm. Okay, here's a few I use: Classes are generally: Capitalized or CapWords and I use

Re: How to use 8bit character sets?

2005-06-13 Thread John Roth
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: >>> That is the default. >> >> >> As far as I can tell, there are actually two defaults, which tends >> to confuse things. > > Notice that there are two defaults already in the operating system: > Wi

Re: BBC R&D White Paper on Kamaelia Published (Essentially a framework using communicating python generators)

2005-06-13 Thread pmaupin
Yes, the question was about the lack of full coroutine support in Python, and whether in practice that was a problem or not. It's interesting that you think it may actually be a strength -- I'll have to mull that over. Thanks! Pat -- http://mail.python.org/mailman/listinfo/python-list

RE: Controlling a generator the pythonic way

2005-06-13 Thread Delaney, Timothy C (Timothy)
Steve Holden wrote: > Sigh indeed. But if you allow next() calls to take arguments you are > effectively arguing for the introduction of full coroutines into the > language, and I suspect there would be pretty limited support for > that. You mean `PEP 342`_ which I posted earlier and is consider

Re: Get drives and partitions list (Linux)

2005-06-13 Thread cantabile
Hi, Peter Thanks for the reply. I'll check popen(). But you said I should not rely on fdisk... Why ? And should I prefer sfdisk ? Why ? Peter Hansen wrote: > cantabile wrote: > >> Hi, I'd like to get drives and partitions (and their size too) with >> python under Linux. So far, I thought of read

Re: BBC R&D White Paper on Kamaelia Published (Essentially a framework using communicating python generators)

2005-06-13 Thread Michael Sparks
[EMAIL PROTECTED] wrote: > >> I've written up the talk I gave at ACCU Python UK on the Kamaelia >> Framework, and it's been published as a BBC R&D White Paper and is >> available here: >> >>* http://www.bbc.co.uk/rd/pubs/whp/whp113.shtml > I enjoyed the paper. I'm pleased to hear that and I

Re: Get drives and partitions list (Linux)

2005-06-13 Thread cantabile
Hi, Jeff Great help : this works like a charm. I think I can customize it to read from sfdisk. Do you agree with Peter Hansen (post below) about fdisk ? Jeff Epler wrote: > Using /proc/partitions is probably preferable because any user can read > it, not just people who can be trusted with read a

Re: Show current ip on Linux

2005-06-13 Thread David Van Mosselbeen
Lee Harr wrote: > On 2005-06-13, David Van Mosselbeen <[EMAIL PROTECTED]> > wrote: >> Hi, >> Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine >> man :-) >> >> My question is : How can i rwite a script that show my current ip. If i >> have more than one network card, the script

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
When i try this i get this error: import Image >>> im = Image.open('image.tif') >>> im.getpixel((10,19)) Traceback (most recent call last): File "", line 1, in ? File "Image.py", line 858, in getpixel self.load() File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line 180, i

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
PyPK wrote: > One reason why I don't want to use PIL is it seems very slow for tiff > images of very large sizes(2400x4800). So I am looking for a better > tool than does the right job faster. This isn't fast enough? In [8]: %time img2 = Image.open('foo.tiff') CPU times: user 0.00 s, sys: 0.01 s,

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
One reason why I don't want to use PIL is it seems very slow for tiff images of very large sizes(2400x4800). So I am looking for a better tool than does the right job faster. -- http://mail.python.org/mailman/listinfo/python-list

Re: Show current ip on Linux

2005-06-13 Thread Lee Harr
On 2005-06-13, David Van Mosselbeen <[EMAIL PROTECTED]> wrote: > Hi, > Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine > man :-) > > My question is : How can i rwite a script that show my current ip. If i have > more than one network card, the script must then show all used ip

wxpython wxlistctrl with combo

2005-06-13 Thread Fabio Pliger
Hi all, i'm working on a very large project using wx 2.5... On one frame i have a wx.lib.mixins.listctrl widget, wich is a listctrl extended with the possibility to edit the columns text entrys Anyone know if it's possible (or if there's a widget...) to have also the possbility to have a comboB

Re: How to get/set class attributes in Python

2005-06-13 Thread Kalle Anke
On Mon, 13 Jun 2005 20:41:48 +0200, Terry Hancock wrote (in article <[EMAIL PROTECTED]>): > 1) Assume the variables are of a sensible type (not > necessarily the one you expected, though), and provide > exception handling to catch the case where their interface > does not match what you expect.

Re: How to use 8bit character sets?

2005-06-13 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
John Roth wrote: >> That is the default. > > > As far as I can tell, there are actually two defaults, which tends > to confuse things. Notice that there are two defaults already in the operating system: Windows has the notion of the "ANSI code page" and the "OEM code page", which are used in dif

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
PyPK wrote: > nothing fancy. I just want to be able to read a tiff image, get pixel > values, write back to a tiff file. [An aside: please quote the message you are replying to.] Why doesn't the PIL satisfy this need? Or are you just collecting a list of packages with this capability? -- Rober

Re: Controlling assignation

2005-06-13 Thread Bruno Desthuilliers
Xavier Décoret a écrit : (snip) > What I wanted to do is something like this: > > def change(x,v): > x = v > > class A(object): > def __init__(self,v): > self.x = v > > a = A(3) > print a.x # displays 3 > change(a.x,4) > print a.x # still displays 3 > > > It may seem weird,

Re: What is different with Python ?

2005-06-13 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Philippe C. Martin <[EMAIL PROTECTED]> wrote: >> So you're arguing that a CS major should start by learning electronics >> fundamentals, how gates work, and how to design hardware(*)? Because >> that's what the concrete level *really* is. Start anywhere above that, >

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
nothing fancy. I just want to be able to read a tiff image, get pixel values, write back to a tiff file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python Suitable for Large Find & Replace Operations?

2005-06-13 Thread Bruno Desthuilliers
rbt a écrit : > Here's the scenario: > > You have many hundred gigabytes of data... possible even a terabyte or > two. Within this data, you have private, sensitive information (US > social security numbers) about your company's clients. Your company has > generated its own unique ID numbers to

Re: recursive import list

2005-06-13 Thread [EMAIL PROTECTED]
If you use your own import function, like below, you could create a list of all imported modules. #!/usr/bin/env python mod_list = [] def my_import(name, globals = None, locals = None, fromlist = None): mod_list.append(name) mod = __import__(name, globals, locals, fromlist) return mo

Re: Tiff Image Reader/writer

2005-06-13 Thread James Carroll
What sort of things do you want to do with the TIFFs? How heavy-weight or light-weight are you interested in? For heavy-weight there are: - wxPython will do a bunch of tiff reading, and some image processing http://www.wxpython.org - GDAL >(quoting Khalid Zuberi:) >GDAL supports GeoTIFF and inc

Re: case/switch statement?

2005-06-13 Thread Philippe C. Martin
Any speed issue ? [EMAIL PROTECTED] wrote: > Philippe C. Martin wrote: >> Leif K-Brooks wrote: >> >> > Joe Stevenson wrote: >> >> I skimmed through the docs for Python, and I did not find anything >> >> like >> >> a case or switch statement. I assume there is one and that I just >> >> missed it

Re: searching for IDE

2005-06-13 Thread Philippe C. Martin
pydev for eclipse ? alexrait1 wrote: > I need an IDE for python that has the ability to show the filds of a > class when I write "." > Just the way it works in eclipse/JBuilder with java or visual studio > with c++ > For now I treid eric3 and IDLE they don't do this... -- http://mail.python.org

Re: implicit variable declaration and access

2005-06-13 Thread Peter Dembinski
Tom Anderson <[EMAIL PROTECTED]> writes: [snap] > The MAtrix had evarything in it: guns, a juimping off teh walls, > flying guns, a bullet tiem, evil computar machenes, numbers that > flew, flying gun bullets in slowar motian, juimping into a gun, dead > police men, computar hackeing, Kevin Mitni

Re: What is different with Python ?

2005-06-13 Thread Bruno Desthuilliers
Andrea Griffini a écrit : (snip) > What I know is that every single competent programmer > I know (not many... just *EVERY SINGLE ONE*) started > by placing firmly concrete concepts first, and then > moved on higher abstractions (for example like > structured programming, OOP, functional languages

Access Database Using Python

2005-06-13 Thread Karthish
I'm writing a script to look through DNA sequences in a database and select sequences I require. So far, my code looks like this for authentication: import os import Bio.Clustalw from Bio.Alphabet import IUPAC import pdb import sys import os import urllib import urllib2 import urllib userid = 's

Re: Slicing an IXMLDOMNodeList

2005-06-13 Thread marcel . vandendungen
For future reference: The solution to this problem is a simple one. rgelem = list(xmldoc.selectNodes('/root/elem')) returns a real list of IXMLDOMElements that can be sliced. -- Marcel -- http://mail.python.org/mailman/listinfo/python-list

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
Is there any package out there which handles Tiff Images other than PIL or ImageMagic . -- http://mail.python.org/mailman/listinfo/python-list

Access Database Using Python

2005-06-13 Thread Karthish
I'm writing a script to look through DNA sequences in a database and select sequences I require. So far, my code looks like this for authentication: import os import Bio.Clustalw from Bio.Alphabet import IUPAC import pdb import sys import os import urllib import urllib2 import urllib userid = 'k

Re: Dealing with marketing types...

2005-06-13 Thread Thomas Bartkus
"fuzzylollipop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > man this is the worst advice I have ever heard, you can't "walk away > with code" someone else paid you to write. Regardless of what your > perceived slight is. > > NEVER take code you were paid to write unless you have i

Re: Adding to Exception.args

2005-06-13 Thread Scott David Daniels
Andreas Beyer wrote: > I came up with the following code: >inp = file(file_name) >for n, line in enumerate(inp): >try: ># parse line ... >except Exception, e: >inp.close() # Is this necessary for 'r' files? >args = list(e.args) >

Re: What is different with Python ?

2005-06-13 Thread Philippe C. Martin
> I don't buy that. I think there's a world of difference between knowing > what something does and how it does it; a black-box view of the memory > system (allocation + GC) is perfectly sufficient as a basis for > programming using it. That black-box view should include some idea of how > long the

Re: What is different with Python ?

2005-06-13 Thread Philippe C. Martin
> So you're arguing that a CS major should start by learning electronics > fundamentals, how gates work, and how to design hardware(*)? Because > that's what the concrete level *really* is. Start anywhere above that, > and you wind up needing to look both ways. Some very good schools still believe

recursive import list

2005-06-13 Thread Philippe C. Martin
Hi, I have a fairly large project going on and would like to figure out automatically from the source which files are being imported. ex: find_out mymain.py Is there an easy way to achieve that ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >