Re: shelve error

2007-04-04 Thread 7stud
On Apr 4, 10:22 pm, [EMAIL PROTECTED] wrote: > how did you generate aaa.txt? Ok, I got it to work by supplying a filename that didn't previously exist. Neither the book I am reading, "Beginning Python: From Novice to Professional" nor the book I am using as a reference, "Python in Nutshell", happ

Re: problem with my urllib.urlopen() function

2007-04-04 Thread Gabriel Genellina
En Thu, 05 Apr 2007 02:40:38 -0300, Xell Zhang <[EMAIL PROTECTED]> escribió: > hello all, > I am a newbie in Python. > In my module, if I call urllib.urlopen() function like: > url = "http://www.google.com/"; > source = urllib.urlopen(url) > > Then in the output there will be an exception: > Exc

Re: shelve error

2007-04-04 Thread 7stud
[EMAIL PROTECTED] wrote: > On Apr 5, 12:14 pm, "7stud" <[EMAIL PROTECTED]> wrote: > > test1.py: > > > > import shelve > > > > s = shelve.open("/Users/me/2testing/dir1/aaa.txt") > > s['x'] = "red" > > s.close() > > output:-- > > > > $ python test1.py > > Traceback (

Why does my callback funtion collapse?

2007-04-04 Thread lialie
Hi,all I try to callback from a thread in C. But it collapsed. I can't figure it out. My test files attached. Thanks. #include #include "Python.h" #include static PyObject *my_callback = NULL; DWORD threadId; HANDLE thread; static PyObject * callback_set_callback(PyObject *dummy, PyObject *a

Re: How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Sergio Correia
Larry, Gabriel Thanks for the replies. Both ways work great. Sergio On 4/4/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 04 Apr 2007 20:14:37 -0300, Larry Bates <[EMAIL PROTECTED]> > escribió: > > > Sergio Correia wrote: > >> I have a program in 'C:\Python25\Lib\site-packages\spam\

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Peter Otten
Scott wrote: > sentence = raw_input('Sentence: ') > > screen_width = 80 > text_width = len(sentence) > box_width = text_width + 6 > left_margin = (screen_width - box_width) // 2 > > print > print ' ' * left_margin + '+'   + '-' * (box_width-2)  +  '+' > print ' ' * left_margin + '|  ' + ' ' * te

Re: ok

2007-04-04 Thread Astan Chee
How much does it pay? [EMAIL PROTECTED] wrote: > hi looking for someone to bult my web site for me > > -- http://mail.python.org/mailman/listinfo/python-list

ok

2007-04-04 Thread moiseau
hi looking for someone to bult my web site for me -- http://mail.python.org/mailman/listinfo/python-list

Python and Java

2007-04-04 Thread Sreelatha G
Hi I am new to python .I need your help in solving my problem. Is there any way to call python files in a java file .How is it possible? Thanks Sreelatha -- http://mail.python.org/mailman/listinfo/python-list

Re: Prevent Modification of Script?

2007-04-04 Thread half . italian
Just throw out the .py files and let it run on the .pyc's alone. ~Sean On Apr 4, 8:03 pm, James Stroud <[EMAIL PROTECTED]> wrote: > ts-dev wrote: > > The root of my question is verifying the integrity of the application > > and the scripts being run. > > Google "md5sum". Then google "birthday att

problem with my urllib.urlopen() function

2007-04-04 Thread Xell Zhang
hello all, I am a newbie in Python. In my module, if I call urllib.urlopen() function like: url = "http://www.google.com/"; source = urllib.urlopen(url) Then in the output there will be an exception: Exception exceptions.AttributeError: "'NoneType' object has no attribute 'print_exc'" in > ignore

AW: Write to a binary file

2007-04-04 Thread Thomi Aurel RUAG A
Hy Mike Thanks for your links, unfortunately they weren't very usefull for my specific problem. Hy Grant Edwards Thanks for your hints. A simplified test programm to compare the function for opening a file i used ("file()") and your suggested "os.open()" showed different behaviour. My simple test

Re: Prevent Modification of Script?

2007-04-04 Thread James Stroud
ts-dev wrote: > On Apr 4, 6:10 pm, Michael Ekstrand <[EMAIL PROTECTED]> wrote: > >>One significant factor: are you worried about other >>users on your systems (or other users who share systems with you under a >>third party's control), or are you worried about what people will do on >>their own sy

Re: Prevent Modification of Script?

2007-04-04 Thread Ben Finney
"ts-dev" <[EMAIL PROTECTED]> writes: > If the scripts can be modified (very easily), how can the > application be trusted? This sounds far more that you don't trust the application *user*. If that's the case, don't deploy the application such that the user possesses it. Run it as a service on a

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > > This sounds suspiciously like a homework assignment. > > I don't think you'll get much help for this one, unless > > you show some code you wrote yourself already with a specific > > question about problems you're having > > Well you have some right. I will make

Re: function for counting items in a sequence

2007-04-04 Thread Alex Martelli
Steven Bethard <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > If we had a "turn sequence into bag" function somewhere > > (and it might be worth having it for other reasons): > > > > def bagit(seq): > > import collections > > d = collections.defaultdict(int) > > for x in seq: d

Re: shelve error

2007-04-04 Thread mik3l3374
On Apr 5, 12:14 pm, "7stud" <[EMAIL PROTECTED]> wrote: > test1.py: > > import shelve > > s = shelve.open("/Users/me/2testing/dir1/aaa.txt") > s['x'] = "red" > s.close() > output:-- > > $ python test1.py > Traceback (most recent call last): > File "test1.py", line

shelve error

2007-04-04 Thread 7stud
test1.py: import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s['x'] = "red" s.close() output:-- $ python test1.py Traceback (most recent call last): File "test1.py", line 3, in ? s = shelve.open("/Users/me/2testing/dir1/aaa.txt") File "/Syste

function for counting items in a sequence

2007-04-04 Thread Steven Bethard
Alex Martelli wrote: > If we had a "turn sequence into bag" function somewhere > (and it might be worth having it for other reasons): > > def bagit(seq): > import collections > d = collections.defaultdict(int) > for x in seq: d[x] += 1 > return d I use this function all the time --

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread 7stud
On Apr 4, 2:07 pm, [EMAIL PROTECTED] wrote: > My question is how to get word frequencies from this files? > I will be glad to get any help. > --files have a read(), readline(), and readlines() method --strings have a split() method, which splits the string on whitespace(e.g. spaces) --lists have a

Re: how to build a forum in Python?

2007-04-04 Thread kath
On Apr 4, 9:18 pm, "Goldfish" <[EMAIL PROTECTED]> wrote: > Sounds like phpBB (http://www.phpbb.com/) would do great. I'm not sure > why you want to go write another forum management tool when others are > already out there for usage. I know its not in python, but not > everything has to be in pytho

Re: Where to find pywin32/win32all for Python 1.5.2?

2007-04-04 Thread Gabriel Genellina
En Wed, 04 Apr 2007 01:39:32 -0300, Jack <[EMAIL PROTECTED]> escribió: > Thanks Jay. When I searched the net, I also found mentioning of > win32all-125.exe > but I couldn't find a download link. Does anyone still have it in the HD? Earliest I have is release 147 for Python 2.1, if you want. --

Re: Prevent Modification of Script?

2007-04-04 Thread ts-dev
On Apr 4, 6:10 pm, Michael Ekstrand <[EMAIL PROTECTED]> wrote: > One significant factor: are you worried about other > users on your systems (or other users who share systems with you under a > third party's control), or are you worried about what people will do on > their own systems? Michael, Be

Re: pyc file [Newbie Question]

2007-04-04 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 03 Apr 2007 12:40:23 -0300, Jim Aikin <[EMAIL PROTECTED]> > escribió: > > > The Tutorial is very good, but there are numerous topics that it slides > > past > > (as it would have to do, in order to avoid being ten times as long). I > > haven'

Re: Calling Fortran from Python

2007-04-04 Thread Lenard Lindstrom
Mangabasi wrote: > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mangabasi wrote: >>> Would Python 2.5 work with Visual Studio 6.6? >> No. >> >> -- >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless enigma >> that is made terrible by our own m

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-04 Thread Alex Martelli
alf <[EMAIL PROTECTED]> wrote: > Hi, > > I want to add some library but it can not be comipled? Here is an output: If you don't have the needed compiler installed (in this case, VS 2003, while it looks like your installation has VS 2005 instead), sure. > D:\>cl > Microsoft (R) 32-bit C/C++ Opt

Re: Prevent Modification of Script?

2007-04-04 Thread Alex Martelli
Ben Finney <[EMAIL PROTECTED]> wrote: > "ts-dev" <[EMAIL PROTECTED]> writes: > > > Is it possible to prevent modification of a python file once its been > > deployed? > > Prevent modification by whom? > > You can't prevent modification by the person who owns the > machine. It's in their possess

Re: Prevent Modification of Script?

2007-04-04 Thread James Stroud
ts-dev wrote: > The root of my question is verifying the integrity of the application > and the scripts being run. Google "md5sum". Then google "birthday attack". James -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove multiple occurrences of a string within a list?

2007-04-04 Thread Paul Rubin
"bahoo" <[EMAIL PROTECTED]> writes: > I have a list like ['0024', 'haha', '0024'] > and as output I want ['haha'] > > If I > myList.remove('0024') > > then only the first instance of '0024' is removed. [x for x in myList if x != '0024'] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove multiple occurrences of a string within a list?

2007-04-04 Thread Alex Martelli
Amit Khemka <[EMAIL PROTECTED]> wrote: > On 3 Apr 2007 11:20:33 -0700, bahoo <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a list like ['0024', 'haha', '0024'] > > and as output I want ['haha'] > > > > If I > > myList.remove('0024') > > > > then only the first instance of '0024' is removed. >

compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-04 Thread alf
Hi, I want to add some library but it can not be comipled? Here is an output: D:\>cl Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ] D:\> pyth

Re: Prevent Modification of Script?

2007-04-04 Thread Ben Finney
"ts-dev" <[EMAIL PROTECTED]> writes: > Is it possible to prevent modification of a python file once its been > deployed? Prevent modification by whom? You can't prevent modification by the person who owns the machine. It's in their possession, and presumably it's out of yours; they can do whatev

Re: Newbie Question about sequence multiplication

2007-04-04 Thread 7stud
On Apr 4, 4:48 pm, "John Machin" <[EMAIL PROTECTED]> wrote: >copied straight from "Beginning Python: From Novice to >Professional", > > > Any help would be greatly appreciated > I suggest you get another book. I am currently reading that book, and unless you are an experienced programmer that can

Re: pyc file [Newbie Question]

2007-04-04 Thread Gabriel Genellina
En Tue, 03 Apr 2007 12:40:23 -0300, Jim Aikin <[EMAIL PROTECTED]> escribió: > The Tutorial is very good, but there are numerous topics that it slides > past > (as it would have to do, in order to avoid being ten times as long). I > haven't yet gotten deep enough into Python to even know where

Re: Resume of Steve Snow : Database SQL Applications Programmer

2007-04-04 Thread Peter Decker
On 4/4/07, stevesnow <[EMAIL PROTECTED]> wrote: > -- > > Please forward this work experience & skills summary > to your Database & software development, MIS/IT/Software Department for > review. > > -- > > He

Re: Over a billion people believe Allah will provide 72 virgins to some Muslims.

2007-04-04 Thread Dr. V I Plankenstein
> I am surprised at the number of un-informed, ill-informed sheeple on > earth as well as politically correct hypocrites. > > Several polls have consistently shown that about 84% of the American > people believe that 911 was an inside job. I dont know where you got that statistic - unless maybe y

Re: Why NOT only one class per file?

2007-04-04 Thread Sherm Pendley
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Chris Lasher a écrit : > >> so I thought I'd ask here to >> see why the Python idiom is the way it is: why should we NOT be >> placing classes in their own separate files? > > Because it just sucks. ... > Just ask him why Java insists on 'one-(pu

Re: Prevent Modification of Script?

2007-04-04 Thread Michael Ekstrand
On Wed, 04 Apr 2007 18:04:57 -0700, ts-dev wrote: > Is it possible to prevent modification of a python file once its been > deployed? File permissions of the OS could be used..but that doesn't > seem very secure. > > The root of my question is verifying the integrity of the application > and the

Resume of Steve Snow : Database SQL Applications Programmer

2007-04-04 Thread stevesnow
-- Please forward this work experience & skills summary to your Database & software development, MIS/IT/Software Department for review. -- Here is my full resume in Microsoft Word format. To use, click y

Prevent Modification of Script?

2007-04-04 Thread ts-dev
Is it possible to prevent modification of a python file once its been deployed? File permissions of the OS could be used..but that doesn't seem very secure. The root of my question is verifying the integrity of the application and the scripts being run. Is this possible, if so, how? -- http://m

Re: How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Gabriel Genellina
En Wed, 04 Apr 2007 20:14:37 -0300, Larry Bates <[EMAIL PROTECTED]> escribió: > Sergio Correia wrote: >> I have a program in 'C:\Python25\Lib\site-packages\spam\spam.py' >> >> Importing and everything works fine: > from spam import spam >> >> But the program calls a file located on the same

Re: Newbie Question about sequence multiplication

2007-04-04 Thread attn . steven . kuo
On Apr 4, 3:19 pm, "Scott" <[EMAIL PROTECTED]> wrote: (snipped) > > print > print ' ' * left_margin + '+' + '-' * (box_width-2) + '+' > print ' ' * left_margin + '| ' + ' ' * text_width + ' |' > print ' ' * left_margin + '| ' + ' ' sentence + ' |' > print ' ' * left_margin + '|

Re: Hellow World:)

2007-04-04 Thread Gabriel Genellina
En Thu, 29 Mar 2007 16:19:24 -0300, void pointer <[EMAIL PROTECTED]> escribió: > Hi All ..I am looking for PDF version of " Practical Python" and a > language to stick to .Should I find that book ,I wil lconsder this > Python :) Try another book from this list, some have a downloadabl

Re: CRC CCITT UPDATE in Python

2007-04-04 Thread Gabriel Genellina
En Sun, 01 Apr 2007 10:10:04 -0300, [Py Thorneiro] <[EMAIL PROTECTED]> escribió: [Py Thorneiro] >> > uint16_t >> > crc_ccitt_update (uint16_t crc, uint8_t data) >> > { >> >data ˆ= lo8 (crc); >> >data ˆ= data << 4; >> >return uint16_t)data << 8) | hi8 (crc)) ˆ (uint8_t)(data >> 4)

Re: how can I clear a dictionary in python

2007-04-04 Thread Steven Howe
Tempest in a teapot guys. Aahz wrote: > In article <[EMAIL PROTECTED]>, > Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> On 2007-04-03, Aahz <[EMAIL PROTECTED]> wrote: >> >>> In article <[EMAIL PROTECTED]>, >>> Larry Bates <[EMAIL PROTECTED]> wrote: >>> Aahz wrote:

Re: string templates

2007-04-04 Thread Facundo Batista
David Bear wrote: > I was justing wondering how safe python string templates are to use with > unicode. I was just scanning pep 292 and it seems to say that they are -- > or can by with inheritance... but I don't quite understand. What do you mean with "safe"? I use string.Template a lot, don't w

Re: how to remove multiple occurrences of a string within a list?

2007-04-04 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "bahoo" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list like ['0024', 'haha', '0024'] > and as output I want ['haha'] > > If I > myList.remove('0024') > > then only the first instance of '0024' is removed. > > It seems like regular expressions is the rescue,

Re: operator overloading

2007-04-04 Thread Lenard Lindstrom
looping wrote: > Hi, > for the fun I try operator overloading experiences and I didn't > exactly understand how it works. > > Here is my try: class myint(int): > def __pow__(self, value): > return self.__add__(value) > a = myint(3) a ** 3 > 6 > > OK, it works.

Re: how can I clear a dictionary in python

2007-04-04 Thread Aahz
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: >On 2007-04-03, Aahz <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, >> Larry Bates <[EMAIL PROTECTED]> wrote: >>>Aahz wrote: In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: >>

Re: Why NOT only one class per file?

2007-04-04 Thread Dillon Collins
On Wednesday 04 April 2007, Chris Lasher wrote: > He doesn't find my arguments convincing, so I thought I'd ask here to > see why the Python idiom is the way it is: why should we NOT be > placing classes in their own separate files? Because it really just provides as an artificial limitation that

Re: Why NOT only one class per file?

2007-04-04 Thread Terry Reedy
"Chris Lasher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |A friend of mine with a programming background in Java and Perl places | each class in its own separate file in . I informed him that keeping | all related classes together in a single file is more in the Python | idiom t

Re: operator overloading

2007-04-04 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | FWIW: | Python 2.5 (r25:51908, Jan 21 2007, 03:10:25) | [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on HOSTNAME_REDACTED | Type "help", "copyright", "credits" or "license" for more information. | >>> class MyInt(int): | ... __pow__ = in

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Willy
sentence = raw_input('Sentence: ') screen_width = 80 text_width = len(sentence) box_width = text_width + 6 left_margin = (screen_width - box_width) // 2 print print ' ' * left_margin + '+' + '-' * box_width + '+' print ' ' * left_margin + '|' + ' ' * box_width + '|' print ' ' * left_margin + '|

RE: how can I clear a dictionary in python

2007-04-04 Thread Delaney, Timothy (Tim)
Antoon Pardon wrote: > People are often enough not very exact in their communication and > that goes double for people who are new in a particular subject. > So I think it is entirely appropiate to think about the real question > the person is strugling with that hides between the question > actua

Re: way to extract only the message from pop3

2007-04-04 Thread flit
Yep you are right.. I made an filter to get the data in the message I want.. So it´s not the most beatiful code, but works. :) On Apr 4, 4:11 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > "flit" <[EMAIL PROTECTED]> wrote: > > >Using poplib in python I can extract only the headers using the .top, >

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Would Python 2.5 work with Visual Studio 6.6? > > No. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret i

Re: How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Larry Bates
Sergio Correia wrote: > I have a program in 'C:\Python25\Lib\site-packages\spam\spam.py' > > Importing and everything works fine: from spam import spam > > But the program calls a file located on the same folder (that is: > C:\Python25\Lib\site-packages\spam\). > > How do i do that? > >>>

How to open a txt file from the same folder as my module (w/out changing the working dir)

2007-04-04 Thread Sergio Correia
I have a program in 'C:\Python25\Lib\site-packages\spam\spam.py' Importing and everything works fine: >>> from spam import spam But the program calls a file located on the same folder (that is: C:\Python25\Lib\site-packages\spam\). How do i do that? >>> spam.eggs() Traceback (most recent call

Re: calling super()

2007-04-04 Thread Bruno Desthuilliers
John Clark a écrit : > Yeah!!! One I can actually answer!!! > +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: calling super()

2007-04-04 Thread Bruno Desthuilliers
Jarek Zgoda a écrit : > [EMAIL PROTECTED] napisał(a): > > (snip) >>class NewPage(HTMLMain): >>def __init__(self): >>print 'derive2 init' >>super(NewPage, self).__init__(); > > > This should read: super(HTMLMain, self).__init__() Nope. It's just how it should be. -- http:

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Bruno Desthuilliers
Scott a écrit : (snip) > print ' ' * left_margin + '| ' + ' ' sentence + ' |' ^ a '+' is missing here (snip) > Now if i put * before sentence as it is with the rest of the variables, it > actually gets to the point w

Re: Why NOT only one class per file?

2007-04-04 Thread Fuzzyman
On Apr 4, 11:38 pm, "Klaas" <[EMAIL PROTECTED]> wrote: > On Apr 4, 2:52 pm, Thomas Krüger <[EMAIL PROTECTED]> wrote: > > > > > At first: if he really like it he can place every class in a single > > file. But there are some reasons why Python "allows" you to place many > > classes in one file: > >

Re: operator overloading

2007-04-04 Thread [EMAIL PROTECTED]
On Apr 4, 4:55 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | This looks like a bug in Python. It works for all the other > | operators: [SNIP] > | >>> i ** 3 > | 74088 > | > | You should submit a bug report to the

Re: Why NOT only one class per file?

2007-04-04 Thread Fuzzyman
On Apr 4, 10:23 pm, "Chris Lasher" <[EMAIL PROTECTED]> wrote: > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file p

Re: Newbie Question about sequence multiplication

2007-04-04 Thread John Machin
On Apr 5, 8:19 am, "Scott" <[EMAIL PROTECTED]> wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty wei

Re: Why NOT only one class per file?

2007-04-04 Thread Bruno Desthuilliers
Chris Lasher a écrit : > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file per class. He asked why, Why not ? >

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > Would Python 2.5 work with Visual Studio 6.6? No. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://ma

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Steve Holden
Scott wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty weird in this format but it was copied exac

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 4:39 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > I am using Visual Studio 6.0 and Compaq Visual Fortran 6.6. > > Ah. You can't use VS6 with that version of Python. I believe you need the .NET > SDK 2003. > > You could also use gcc, but I'm not sure if that will work

Re: Why NOT only one class per file?

2007-04-04 Thread Klaas
On Apr 4, 2:52 pm, Thomas Krüger <[EMAIL PROTECTED]> wrote: > > At first: if he really like it he can place every class in a single > file. But there are some reasons why Python "allows" you to place many > classes in one file: > > - It's (a little bit) faster, no additional file system lookup is n

Re: Requirements For A Visualization Software System For 2010

2007-04-04 Thread Lew
galathaea wrote: > On Apr 3, 12:23 pm, "Xah Lee" <[EMAIL PROTECTED]> wrote: > [top posting for clarity] You mean to reduce clarity. Please do not top-post - instead, trim the post and respond in line. It makes the messages easier for the rest of us. -- Lew -- http://mail.python.org/mailman/

string templates

2007-04-04 Thread David Bear
I was justing wondering how safe python string templates are to use with unicode. I was just scanning pep 292 and it seems to say that they are -- or can by with inheritance... but I don't quite understand. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- --

Newbie Question about sequence multiplication

2007-04-04 Thread Scott
Alright, so I've been trying to teach myself Python which, when compared to my attempt to learn C++, is going pretty well. But I've come across an issue that I can't figure out, so I figured I'd ask the pro's. Now it looks pretty weird in this format but it was copied exactly from IDLE *code

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Robert Kern
Carl Banks wrote: > On Apr 4, 4:55 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: Carl Banks wrote: > On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]> wrote: >> BeautifulSoup can't parse this page usefully

Re: Numeric compiling problem under QNX 4.25

2007-04-04 Thread Robert Kern
ZMY wrote: > I finally figured out how to install Numeric Python on QNX4. To my > understanding of a QNX programmer's lecture, the problem of QNX4 is > that it doesn't support dynamic linking, so the linker can't link the > new compiled object files with existing python binary. The new module > mus

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Carl Banks
On Apr 4, 4:55 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Carl Banks wrote: > > On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Carl Banks wrote: > >>> On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]> wrote: > BeautifulSoup can't parse this page usefully at all. > It tre

Re: Why NOT only one class per file?

2007-04-04 Thread Thomas Krüger
Chris Lasher schrieb: > why should we NOT be > placing classes in their own separate files? > > Thoughts, comments, and insight much appreciated, At first: if he really like it he can place every class in a single file. But there are some reasons why Python "allows" you to place many classes in o

Re: how to remove multiple occurrences of a string within a list?

2007-04-04 Thread Steven Bethard
Ayaz Ahmed Khan wrote: > "kyosohma" typed: > >> If you want to get really fancy, you could do a list comprehension >> too: >> >> your_list = ["0024","haha","0024"] >> new_list = [i for i in your_list if i != '0024'] > > Or, just: > > In [1]: l = ["0024","haha","0024"] > In [2]: filter(lambda x:

ImageGrab

2007-04-04 Thread gslm
Hi, My application's base is a button, namely all of frames, labels on a button.And I want to print this view when click the button. For this I want to use ImageGrabe.grab(bbox) function.But unfortunately, I can't use this for taking buttons area as bbox. How can i do these? -- http://mail.pyth

Re: Numeric compiling problem under QNX 4.25

2007-04-04 Thread ZMY
On Apr 3, 2:52 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > ZMY wrote: > > On Apr 3, 10:51 am, Robert Kern <[EMAIL PROTECTED]> wrote: > >> ZMY wrote: > >>> Is "ld" part of make command? I am not familiar with compiling with > >>> make in general. > >> No, it's the linker. I takes the object files (

Re: Indentifying the LAST occurrence of an item in a list

2007-04-04 Thread John Machin
On Apr 5, 1:58 am, [EMAIL PROTECTED] wrote: > For any list x, x.index(item) returns the index of the FIRST > occurrence of the item in x. Is there a simple way to identify the > LAST occurrence of an item in a list? My solution feels complex - > reverse the list, look for the first occurence of the

Re: Why NOT only one class per file?

2007-04-04 Thread Steve Holden
Jarek Zgoda wrote: > Chris Lasher napisał(a): > >> A friend of mine with a programming background in Java and Perl places >> each class in its own separate file in . I informed him that keeping >> all related classes together in a single file is more in the Python >> idiom than one file per class.

Re: Newbie - needs help

2007-04-04 Thread Larry Bates
Anbeyon wrote: > Hi > > I have not yet programmed in Python but am experienced in a number o > other languages. > > I'd like to start to use Python to develop cross platform applications > but havin kust started to investigate tols, libraries etc I feel a > little overwhelmed. > > I'm hoping so

Re: Requirements For A Visualization Software System For 2010

2007-04-04 Thread Stef Mientki
Xah Lee wrote: > REQUIREMENTS FOR A VISUALIZATION SOFTWARE SYSTEM FOR 2010 > > Xah Lee, 2007-03-16 > > In this essay, i give a list of requirements that i think is necessary > for a software system for creating scientific visualization for the > next decade (2007-2017). > > (for a HTML version w

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > I am using Visual Studio 6.0 and Compaq Visual Fortran 6.6. Ah. You can't use VS6 with that version of Python. I believe you need the .NET SDK 2003. You could also use gcc, but I'm not sure if that will work well with Compaq Visual Fortran; you might have to use gfortran. h

Re: Why NOT only one class per file?

2007-04-04 Thread Jarek Zgoda
Chris Lasher napisał(a): > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file per class. He asked why, and frankly,

Why NOT only one class per file?

2007-04-04 Thread Chris Lasher
A friend of mine with a programming background in Java and Perl places each class in its own separate file in . I informed him that keeping all related classes together in a single file is more in the Python idiom than one file per class. He asked why, and frankly, his valid question has me flummox

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-04 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am needing to build python 2.5 on Windows XP x64 Windows Server 2003 > sp1 Platform SDK and am not finding anything documented on the process > to use. Has anyone had any success with this? I did - I built the official binaries with it. > If so has anyone > document

Re: Problem installing Python 2.5

2007-04-04 Thread Martin v. Löwis
> After a lot of output, got this: You will need to check this output line-for-line to see why it fails. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: operator overloading

2007-04-04 Thread Terry Reedy
"Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | This looks like a bug in Python. It works for all the other | operators: | | >>> class MyInt(int): | ... __sub__ = int.__add__ | ... __mul__ = int.__add__ | ... __div__ = int.__add__ | ... __truediv__ =

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Robert Kern
Carl Banks wrote: > On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]> wrote: BeautifulSoup can't parse this page usefully at all. It treats the entire page as a text chunk. It's actually HTMLParser th

Re: calling super()

2007-04-04 Thread Jarek Zgoda
Laszlo Nagy napisał(a): > Definitely, this is not true. Well, it depends what the OP wanted to do > here, but in 99.9% of the cases, you want to use Hah! I cancelled this message but seconds too late... -- Jarek Zgoda http://jpa.berlios.de/ -- http://mail.python.org/mailman/listinfo/python-lis

Re: How can I make sure my python exit

2007-04-04 Thread bearophileHUGS
> Typically when the last piece of code executes, the program ends. You > could import sys and explicitly exit by calling sys.exit(0). > Mike raise SystemExit works too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Paul Boddie
John Nagle wrote: > The syntax that browsers understand as HTML comments is much less > restrictive than what BeautifulSoup understands. I keep running into > sites with formally incorrect HTML comments which are parsed happily > by browsers. Here's yet another example, this one from > "http://ww

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | My question is how to get word frequencies from this files? | I will be glad to get any help. Go to http://groups.google.com/group/comp.lang.python/topics and search on "count word frequency" and you will find several previous post

RE: calling super()

2007-04-04 Thread John Clark
Please be aware that super() has it's own set of gotchas - it's not as clean as you would hope. For more info: http://fuhm.org/super-harmful/ (I'm not the author, I was referred to this article while struggling with wxPython and super()) -John Clark -Original Message- From: [EMAIL PRO

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 12:22 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Robert, > > > Thanks for your prompt response. I think I got a lot closer but no > > cigar yet. > > > This is the output > > > C:\fortrandll>f2py -c -m sample sample.pyf sample.for > > numpy_info: > > FOUND: > >

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Carl Banks
On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Carl Banks wrote: > > On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]> wrote: > >> BeautifulSoup can't parse this page usefully at all. > >> It treats the entire page as a text chunk. It's actually > >> HTMLParser that parses comments, s

Re: Getting word frequencies from files which are in folder.

2007-04-04 Thread krisbee1983
> This sounds suspiciously like a homework assignment. > I don't think you'll get much help for this one, unless > you show some code you wrote yourself already with a specific > question about problems you're having Well you have some right. I will make it more specific. I have got something

Re: calling super()

2007-04-04 Thread Laszlo Nagy
Jarek Zgoda wrote: >> Hello, I have been trying to call the super constructor from my >> derived class but its not working as expected. See the code: >> >> class HTMLMain: >> def __init__(self): >> self.text = ""; >> print(self.text); >> def __del__(self): >> self.te

  1   2   3   >