Newby Q: nested classes, access of upper method

2004-12-03 Thread Gregor Horvath
Hello, class A(self): def A1(): pass class B(self): def B1(): # #*** How can I access A1 here *** # self.A1() # doesnet work because self references to B self.self.A

Re: debian python2.4

2004-12-03 Thread Ganesan R
> "Marcos" == Marcos Dione <[EMAIL PROTECTED]> writes: > On Fri, Dec 03, 2004 at 08:57:46PM +0530, km wrote: >> >> Hi all, >> is there a debian binary of python2.4 ? > well, 2.4 cvs is in since a couple of weeks in unstable. release will come > up soon I guess. 2.4c1 has already made i

Quixote+Nevow+LivePage

2004-12-03 Thread Mir Nazim
Hi I am a PHP developer and in trying to get a better tool for developing web apps, I have been strugling with zope for past few months and still could not get anything useful work up and going. I really felt that "Z" shaped learning curve. Yesterday I was looking at quixote. I was surprized how s

Help me asap!!

2004-12-03 Thread the_proud_family
HELP ME PLEASE!! I can't get the ball to go up right side and then I need it to turn around and keep turning until velocity=0 I have been at it for the past 2 weeks now i give up and call for help. Please if anyone can gide me through i will be so grateful!! I have pasted my code below

Re: Help With Hiring Python Developers

2004-12-03 Thread William Park
fuego <[EMAIL PROTECTED]> wrote: > My company (http://primedia.com/divisions/businessinformation/) has > two job openings that we're having a heckuva time filling. We've > posted at Monster, Dice, jobs.perl.org and python.jobmart.com. Can > anyone advise other job boards that might be helpful? A

Re: How did you learn Python?

2004-12-03 Thread rakanishu
I started with the official tutorial, then Dive Into Python, followed by Learning Python. I also regularly read the python-tutor mail list. -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonwin broke

2004-12-03 Thread Peter Hansen
Jive wrote: "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] . You might consider asking on the python-win32 list, which is more specifically directed at Mark Hammond's stuff. Okay. How do I find the python-win32 list? It's not a newsgroup, apparently. What happened when

Re: Help With Hiring Python Developers

2004-12-03 Thread Ed Leafe
On Dec 1, 2004, at 12:18 PM, Bill McClain wrote: My company (http://primedia.com/divisions/businessinformation/) has two job openings that we're having a heckuva time filling. Allow offsite workers and you'll have all the candidates you want. Exactly. I'm 5 hours away in Rochester, NY, and might b

Re: debian python2.4

2004-12-03 Thread Marcos Dione
On Fri, Dec 03, 2004 at 08:57:46PM +0530, km wrote: > > Hi all, > is there a debian binary of python2.4 ? well, 2.4 cvs is in since a couple of weeks in unstable. release will come up soon I guess. -- (Not so) Random fortune: sos fanático del fútbol? añorás el prode? http://ega.zidev.com/

Re: Replace string except inside quotes?

2004-12-03 Thread Raymond Hettinger
<[EMAIL PROTECTED]> wrote > The code > > for text in open("file.txt","r"): > print text.replace("foo","bar")[:-1] > > replaces 'foo' with 'bar' in a file, but how do I avoid changing text > inside single or double quotes? For making changes to Python code, I > would also like to avoid changing

Re: Need help on program!!!

2004-12-03 Thread Dan Perl
"Miklós P" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Dan Perl" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "Hopefully" for whom? For us, who may have to work with him someday or > use >> a product that he developed? Most of us here have been studen

Re: Need help on program!!!

2004-12-03 Thread Miklós P
"Brad Tilley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > elif first in (2,3,7): > > I think you mean 'elif first in (2,3,12):' > Seems you've grown out of school.. So why make the little rascal even lazier? :-\ M. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help on program!!!

2004-12-03 Thread Brad Tilley
Max M wrote: Dan Perl wrote: That was also my impression. Even the description of the problem looks like it's just copied from the assignment, so probably didn't even take the time to restate the problem in his own words. But we're speculating. Either way, this is not a normal request: "I nee

Re: Need help on program!!!

2004-12-03 Thread Miklós P
"Dan Perl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Hopefully" for whom? For us, who may have to work with him someday or use > a product that he developed? Most of us here have been students (or still > are) and may sympathize with the OP, but personally I have been also

Re: Need help on program!!!

2004-12-03 Thread Brad Tilley
Darth Haggis wrote: I need help writing a program You are to write a python program to accomplish the following: a.. Play a dice game of Craps using a random number generator to simulate the roll of the dice, the code for the rolling of the dice should take place in a user written module nam

Same-O with ActiveState 2.3.4

2004-12-03 Thread Jive
I installed ActivePython2.3. It does the same thing. I am wondering if I have a corrupted MS Windows DLL somewhere. If so, is there any chance I can figure out which one it is? Jive -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonwin broke

2004-12-03 Thread Jive
Do an experiment for me. Open Pythonwin from the start menu. Use the FILE menu to open a .py file. Now try to close the window you just opened using the X button in the upper right. Did it close? Try closing Pythonwin using its X button. -- http://mail.python.org/mailman/listinfo/python-li

Re: Pythonic use of CSV module to skip headers?

2004-12-03 Thread Skip Montanaro
Ramon> I'm using the csv module to parse a tab-delimited file and Ramon> wondered whether there was a more elegant way to skip an possible Ramon> header line. Assuming the header line has descriptive titles, I prefer the DictReader class. Unfortunately, it requires you to specify the

Re: pythonwin broke

2004-12-03 Thread Jean Brouwers
Well, we made several attempts to install Python 2.4 with a number of extension packages on Windows XP and used the binaries from the Python site, not ActivePython. Previous to 2.4, we did have several versions of Python installed on Windows XP without any problem. We installed 2.4 as usual in

Re: pythonwin broke

2004-12-03 Thread Jive
"Jean Brouwers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > We just went through a similar install-uninstall-reinstall cycle with > Python 2.4 and 2.3 on Windows XP SP2. Just uninstalling 2.4 and > reinstalling 2.3 was not sufficient. > > It took several attempts to get things

Re: Need help on program!!!

2004-12-03 Thread Max M
Dan Perl wrote: "Max M" <[EMAIL PROTECTED]> wrote in message Most of us here have been students (or still are) and may sympathize with the OP, but personally I have been also a TA so I have seen the other side and that's where my sympathy lies now. My reply was a joke... My normal response has

Re: pythonwin broke

2004-12-03 Thread Jive
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >. You might consider > asking on the python-win32 list, which is more specifically directed at > Mark Hammond's stuff. Okay. How do I find the python-win32 list? It's not a newsgroup, apparently. -- http://mail.pyth

pythonwin still broke

2004-12-03 Thread Jive
I uninstalled Python and Pythonwin. I verified that there was nothing left in the registry or the startup folder. I reinstalled Python using Python-2.3.4.exe and Pythonwin using win32all-163.exe. It's still broke. The shortcut in the startup folder says Target: C:\Python23\Pythonwin.exe

Re: Semaphore or what should I use?

2004-12-03 Thread Josiah Carlson
Pierre Barbier de Reuille <[EMAIL PROTECTED]> wrote: > > Ville Vainio a écrit : > >>"Bastian" == Bastian Hammer <[EMAIL PROTECTED]> writes: > > > > > > Bastian> Now I have to make sure, that both threads are > > Bastian> synchronal, 1 thread edits something and the other is > >

Re: Need help on program!!!

2004-12-03 Thread Brad Tilley
Grant Edwards wrote: On 2004-12-03, Max M <[EMAIL PROTECTED]> wrote: That was also my impression. Even the description of the problem looks like it's just copied from the assignment, so probably didn't even take the time to restate the problem in his own words. [...] Hopefully his teacher doesn

why no python setup.py uninstall?

2004-12-03 Thread Alia Khouri
If the cannonical way to install a python app is python setup.py install one would expect the following to uninstall it python setup.py uninstall However, distutils doesn't automatically take care of that for you. Is this by design? Or is this something that could/should be addressed in

Re: assymetry between a == b and a.__eq__(b)

2004-12-03 Thread Nick Coghlan
Steven Bethard wrote: Mel Wilson wrote: In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: I believe what Peter Otten was pointing out is that calling __eq__ is not the same as using ==, presumably because the code for == checks the types of the two objects and returns False

Re: using cmd.exe as a telnet client

2004-12-03 Thread Josiah Carlson
Donnal Walter <[EMAIL PROTECTED]> wrote: > > Several months ago I tried using the telnet module (on Windows XP) to > communicate with a proprietary host on our network. This was > unsuccessful due to problems with "option negotiation", and I gave up on > the project for a while. I still have n

Re: pre-PEP generic objects

2004-12-03 Thread Istvan Albert
Steven Bethard wrote: module) not to the __builtins__. I don't see how this "litters the standard namespace". Maybe then it doesn't. but what are you saying? that a man cannot exaggerate and fudge the facts in order to embellish his argument? :-) Istvan. -- http://mail.python.org/mailman/listinfo

Re: Python and generic programming

2004-12-03 Thread Phillip J. Eby
Ian Bicking <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Jive Dadson wrote: > > If you have, for example, several data-types for matrices, how do you > > write code that will automatically find the right routine for quickly > > multiplying a vector by a diagonal matrix represe

Re: Python 3000 and "Python Regrets"

2004-12-03 Thread Nick Coghlan
Tim Peters wrote: [EMAIL PROTECTED] Is there a list of expected incompatibilities with Python 2.3? No. PEP 3000 doesn't count? Actually, PEP 3000 should be taken with a (large) grain of salt, since it's only updated somewhat irregularly - but it's the closest thing I know of to a proposed feature

Re: How is Python designed?

2004-12-03 Thread Arthur Rambo
Limin, Look at this: http://wiki.cs.uiuc.edu/cs427/PYTHON I think it may help. Arthur Limin Fu <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > To clarify, I mean the internal structure and design > of python interpreter. Any hint? Thanks. > Regards, > Limin > > >

Re: PyQT Licensing and plugins/scripting

2004-12-03 Thread Phil Thompson
On Friday 03 December 2004 2:50 pm, Fabio wrote: > Hi all, > I'm about to write an application, and I'd like to use PyQt, but before > choosing this toolkit I would like to clarify some particular licensing > issues; if some user has already touched these, I would like to hear from > his experience

Re: Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-03 Thread "Martin v. Löwis"
Michael Ströder wrote: I'm trying to build Python2.4 on a rather old Debian machine. I only have a shell account there. That's why I'm very limited in my actions. Building _socket fails (see below) although I tried to use configure --disable-ipv6 Any clue? Hard to say, since you don't indicate wh

Re: assymetry between a == b and a.__eq__(b)

2004-12-03 Thread Steven Bethard
Mel Wilson wrote: In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: I believe what Peter Otten was pointing out is that calling __eq__ is not the same as using ==, presumably because the code for == checks the types of the two objects and returns False if they're different b

Re: Replace string except inside quotes?

2004-12-03 Thread Jeff Shannon
Michael J. Fromberger wrote: It's not the most elegant solution in the world. This code does NOT deal with the problem of commented text. I think it will handle triple quotes, though I haven't tested it on that case. I believe that it will probably work for triple quotes that begin and end

Re: Rounding the elements of a Python array (numarray module)

2004-12-03 Thread Chris P.
S I wasn't sure if no one replied because a) this question was too dumb or b) this question was too hard... it was definitely the former. But I'll post the answer, anyway: I forgot to keep in mind - when reading the documentation, assume that a >>> from numarray import * occurred first. So h

Re: pre-PEP generic objects

2004-12-03 Thread Steven Bethard
Ian Bicking wrote: class bunch(object): def __init__(self, **kw): for name, value in kw.items(): # IMPORTANT! This is subclass friendly: updating __dict__ # is not! setattr(self, name, value) Good point about being subclass friendly... I wonder if t

ANN: python-ldap-2.0.6

2004-12-03 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. pro

Re: How is Python designed?

2004-12-03 Thread Terry Reedy
"Limin Fu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks a lot for the explanations. > So CPython used more or less the standard technique to > implement the interpreter. Yes. Moreover, the code is still pretty clean (in most places, at least) after 15 years of developme

ANN: python-ldap-2.0.6

2004-12-03 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. pro

Help with modules/packages.

2004-12-03 Thread Christopher J. Bottaro
Hello, I want to be able to say stuff like "import CJB.ClassA" and "import CJB.ClassB" then say "c = CJB.ClassA()" or "c = CJB.ClassB()". CJB will be a directory containing files "ClassA.py" and "ClassB.py". Now that I think about it, that can't work because Python allows you imp

Re: using cmd.exe as a telnet client

2004-12-03 Thread Jp Calderone
On Fri, 03 Dec 2004 16:31:40 -0600, Donnal Walter <[EMAIL PROTECTED]> wrote: >Several months ago I tried using the telnet module (on Windows XP) to > communicate with a proprietary host on our network. This was > unsuccessful due to problems with "option negotiation", and I gave up on > the proj

Re: pre-PEP generic objects

2004-12-03 Thread Steven Bethard
Istvan Albert wrote: On the other hand, it would be nice to have a module that implements various design patterns. The Bunch, the Borg, the Null, the Proxy all nicely documented tucked away in their separate module. That would feel a lot less like littering the standard name space with an class tha

Re: assymetry between a == b and a.__eq__(b)

2004-12-03 Thread Steven Bethard
Mel Wilson wrote: In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: I believe what Peter Otten was pointing out is that calling __eq__ is not the same as using ==, presumably because the code for == checks the types of the two objects and returns False if they're different b

Re: PyQT Licensing and plugins/scripting

2004-12-03 Thread Kevin Walzer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 PyQt on OS X is also available under a GPL version. I have a binary installer available at http://www.wordtech-software.com/pyqt-mac.html Fabio wrote: | Hi all, | I'm about to write an application, and I'd like to use PyQt, but before | choosing this t

Re: using cmd.exe as a telnet client

2004-12-03 Thread Grant Edwards
On 2004-12-03, Donnal Walter <[EMAIL PROTECTED]> wrote: > Several months ago I tried using the telnet module (on Windows XP) to > communicate with a proprietary host on our network. This was > unsuccessful due to problems with "option negotiation", and I gave up on > the project for a while. I

Re: GUI Frames and classmethod

2004-12-03 Thread Scott David Daniels
Zak Arntson wrote: Note the last line. When programming EVERY child I have to remember to add this self.create_empty_state_methods() line. My question: What are Pythonic alternatives to this sort of thing? Now I can't be the first person to want a pre- and post- child init code! > I'm worried that

Re: How did you learn Python?

2004-12-03 Thread howardrh
"Shawn Milo" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > I was just wondering what the best books were for learning Python. > > Which books are good for getting started, and which should be saved for > later, or or not useful except as a reference for the learned? If you h

using cmd.exe as a telnet client

2004-12-03 Thread Donnal Walter
Several months ago I tried using the telnet module (on Windows XP) to communicate with a proprietary host on our network. This was unsuccessful due to problems with "option negotiation", and I gave up on the project for a while. I still have need for this, however, so I recently started thinkin

Re: Book Recommendations

2004-12-03 Thread Sean Dolan
Nathan Weston wrote: I'm new to Python and am looking for a book to get me up to speed quickly. I'm an experienced programmer and very proficient with Ruby, so Python is coming easily to me and I don't need a gentle introduction -- I just need a quick way to get familiar with common Python idioms a

Re: Need help on program!!!

2004-12-03 Thread Jerry Sievers
"Darth Haggis" <[EMAIL PROTECTED]> writes: > I need help writing a program > > You are to write a python program to accomplish the following: > > a.. Play a dice game of Craps using a random number generator to simulate > the roll of the dice, the code for the rolling of the dice should ta

Re: Book Recommendations

2004-12-03 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] (Nathan Weston) wrote: >I'm new to Python and am looking for a book to get me up to speed >quickly. I'm an experienced programmer and very proficient with Ruby, >so Python is coming easily to me and I don't need a gentle >introduction -- I just need a quick way to get familiar wi

Re: Book Recommendations

2004-12-03 Thread Manuzhai
Nathan Weston wrote: I'm new to Python and am looking for a book to get me up to speed quickly. I'm an experienced programmer and very proficient with Ruby, so Python is coming easily to me and I don't need a gentle introduction -- I just need a quick way to get familiar with common Python idioms a

Re: How did you learn Python?

2004-12-03 Thread Manuzhai
I've not read all of it, and it overlaps a fair bit with Learning Python, but the free Dive Into Python reads well and is often cited as a good intro for those with programming experience. . It is also available as a dead-tree product from APress. I found Dive Into P

RE: type cmp add

2004-12-03 Thread Robert Brewer
Zora Honey wrote: > I've just discovered operator overloading via defining a > class's special > methods and I think it's swell, or would be if I could figure out two > things: > > In order say, add things, I need to do some type checking. For a+b to > work, both must be instances of the same cla

Python compared with Xen (for XML)

2004-12-03 Thread Will Stuyvesant
Here is a comment on the paper "Programming with Circles, Triangles and Rectangles" by Erik Meijer, Wolfram Schulte and Gavin Bierman. Google will find it quickly if you try. In the paper they introduce Xen, an extension to C# for better XML support. They show how Lifting, Filtering and Apply-to

Re: pythonwin broke

2004-12-03 Thread David Bolen
Trent Mick <[EMAIL PROTECTED]> writes: > It is also possible that there is some little installer bug or detail > on your environment that is causing the problem. You could try > ActivePython. I regularly install and uninstall ActivePython 2.3 and > 2.4 installers and both installs are still workin

Graphical box /interactive programme

2004-12-03 Thread cm012b5105
Hello i want to put an interactive text programme in to a graphical box this is a small section of my text programme s = raw_input ("Hello whats your name? ") if s=='melvyn': print "your my boss's Dad the one they call in indian language DEEP THOUGHT LITTLE HORSE" if s=='carol': p

Re: How is Python designed?

2004-12-03 Thread Limin Fu
Thanks a lot for the explanations. So CPython used more or less the standard technique to implement the interpreter. Are there any other interpretation techniques? I guess many. But I'm quite new in this field and I couldn't find good references on internet about this. If there is anybody has suc

Re: assymetry between a == b and a.__eq__(b)

2004-12-03 Thread Mel Wilson
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: >I believe what Peter Otten was pointing out is that calling __eq__ is >not the same as using ==, presumably because the code for == checks the >types of the two objects and returns False if they're different before >the __eq

Book Recommendations

2004-12-03 Thread Nathan Weston
I'm new to Python and am looking for a book to get me up to speed quickly. I'm an experienced programmer and very proficient with Ruby, so Python is coming easily to me and I don't need a gentle introduction -- I just need a quick way to get familiar with common Python idioms and important librarie

ANN: Python-2.4 available at Python-Hosting.com

2004-12-03 Thread Remi Delon
Hello everyone, I'm happy to announce that Python-2.4 is already available on all of our servers. People using Python CGI or Python-2.4-compatible application servers will be able to use all the new features of Python-2.4 for their website. We've only installed a few third-party modules for it s

cx_Freeze 3.0.1

2004-12-03 Thread Anthony Tuininga
What is cx_Freeze? cx_Freeze is a set of utilities for freezing Python scripts into executables using many of the techniques found in Thomas Heller's py2exe, Gordon McMillan's Installer and the Freeze utility that ships with Python itself. Where do I get it? http://starship.python.net/crew/atuining

MMA - Musical MIDI Accompaniment, Beta 0.12

2004-12-03 Thread Bob van der Poel
I'm pleased to announce the release of my program mma - Musical MIDI Accompaniment version: Beta 0.12 MMA is a accompaniment generator -- it creates midi tracks for a soloist to perform over from a user supplied file containing chords and MMA directives. MMA is very versatile and generates

mxCGIPython - unofficial update for Python 2.4

2004-12-03 Thread Oleg Broytmann
Hello! I patched mxCGIPython for Python 2.4: http://phd.pp.ru/Software/Python/misc/mxCGI/mxCGIPython.patch The patch adds 3 modules to Modules/Setup - zipimport, _symtable and _csv; it also adds CGIPython/pyversion.c to be used instead of python, becuase Makefile.cgi needs to know what version

Re: PyQT Licensing and plugins/scripting

2004-12-03 Thread Jarek Zgoda
Fabio wrote: I'm about to write an application, and I'd like to use PyQt, but before choosing this toolkit I would like to clarify some particular licensing issues; if some user has already touched these, I would like to hear from his experiences. This app should be cross-platform, so, given qt lic

type cmp add

2004-12-03 Thread Zora Honey
I've just discovered operator overloading via defining a class's special methods and I think it's swell, or would be if I could figure out two things: In order say, add things, I need to do some type checking. For a+b to work, both must be instances of the same class. I can check to see if they ar

GUI Frames and classmethod

2004-12-03 Thread Zak Arntson
I'm currently implementing a game GUI, where there are three components to the screen: A battle, a command button area and a city view area. Each of these are rectangular, and handle interactions in different ways. For example, on the battle "frame" you can select units, right-click to deliver con

Re: How did you learn Python?

2004-12-03 Thread Mark Jackson
[EMAIL PROTECTED] (John Machin) writes: > "Jeffrey Maitland" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL > PROTECTED]>... > > Well I would suggest the Python in a Nutshell and the Python Cookbook both > > by O'Reilly as references. They are great for a desktop reference and I > > check t

Re: How did you learn Python?

2004-12-03 Thread John Machin
"Jeffrey Maitland" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Well I would suggest the Python in a Nutshell and the Python Cookbook both > by O'Reilly as references. They are great for a desktop reference and I > check them first before I google/search else where for an

Zope side-by-side with Python 2.4

2004-12-03 Thread Robert
If I have Python 2.4 installed and I want to install the latest stable Zope, will Zope have problems or does Zope looks to its own setup and not my install of Python 2.4? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 and "Python Regrets"

2004-12-03 Thread Dieter Maurer
Tim Peters <[EMAIL PROTECTED]> writes on Wed, 1 Dec 2004 13:38:49 -0500: > ... > > Are serious Python programmers already taking care to avoid > > using Python features that may disappear in Python 3000? > > No, although some naturally avoid dubious features without being > threatened . Are there

Re: Replace string except inside quotes?

2004-12-03 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > The code > > for text in open("file.txt","r"): > print text.replace("foo","bar")[:-1] > > replaces 'foo' with 'bar' in a file, but how do I avoid changing text > inside single or double quotes? For making changes to Python code, I

Re: Newbie alert !

2004-12-03 Thread Jean Montambeault
Jean Montambeault wrote: I am not only learning Python but programming itself ; reading your posts makes me believe that nobody is that much of a beginner here. Is there a newgroup or list for my type somewhere I can't find it ? To illustrate my case this script : # function to draw rings for a

Re: Need help on program!!!

2004-12-03 Thread Dan Perl
"Max M" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hopefully his teacher doesn't know about Google, or he can be expelled > from school for using it. "Hopefully" for whom? For us, who may have to work with him someday or use a product that he developed? Most of us here hav

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> But, in fact, he says the files are always big endian. So, code like > the following should address his problem. Note I use type 'h' as an > example so I can easily read samples. I'm sorry, I confused that he asked for machine endianess. Then of course you are right. -- Regards, Diez B. Rog

HTTP response code

2004-12-03 Thread Jonas Galvez
Hi list, here's a question about urllib. Is it possible to simply retrieve the HTTP responde code for a given URL? I don't want to download the body of the HTTP message. I simply want to check the response code, like, if it is 200, 301 etc. Something like: if urllib.urlopen(the_url).response_co

Re: Need help on program!!!

2004-12-03 Thread Grant Edwards
On 2004-12-03, Max M <[EMAIL PROTECTED]> wrote: >> That was also my impression. Even the description of the >> problem looks like it's just copied from the assignment, so >> probably didn't even take the time to restate the problem in >> his own words. [...] > Hopefully his teacher doesn't know

Re: How did you learn Python?

2004-12-03 Thread Rocco Moretti
Shawn Milo wrote: > How did you learn Python? > I was just wondering what the best books were for learning Python. If you're open to options besides ink-on-tree, this is how I did it: I read the official tutorial, trying stuff out in the interactive interpreter when I didn't get something/had ques

Re: Python 3000 and "Python Regrets"

2004-12-03 Thread TZOTZIOY
On Wed, 01 Dec 2004 15:44:03 -0500, rumours say that Steve Holden <[EMAIL PROTECTED]> might have written: >Brad Tilley wrote: >> How about 'import classic' > >... or > >from __past__ import __mistakes__ I'll drink to that! >looking-forwards-to-christmas-ly y'rs - steve In the PSU HQ everyday

Re: Need help on program!!!

2004-12-03 Thread Max M
Dan Perl wrote: That was also my impression. Even the description of the problem looks like it's just copied from the assignment, so probably didn't even take the time to restate the problem in his own words. But we're speculating. Either way, this is not a normal request: "I need a program t

PyQT Licensing and plugins/scripting

2004-12-03 Thread Fabio
Hi all, I'm about to write an application, and I'd like to use PyQt, but before choosing this toolkit I would like to clarify some particular licensing issues; if some user has already touched these, I would like to hear from his experiences. This app should be cross-platform, so, given qt licensi

Re: finding byte order

2004-12-03 Thread Scott David Daniels
biner wrote: > I am using a program that has to read binary data from files coming > from different machines. The file are always written with big endian. Diez B. Roggisch wrote: [Scott David Daniels wrote] How about sys.byteorder? This doesn't help, as he wants to read files from varying endian

Re: pythonwin broke

2004-12-03 Thread Trent Mick
Jean Brouwers wrote: PPS) It looks like Python 2.4 and Python 2.3 can not co-exist (in different folders under Program Files) but we did not investigate that any further. That's not true. I have every version of Python back to 2.0 installed and all running fine on my system. Obviously you can only

Re: Curses programming, threads?

2004-12-03 Thread Carl Banks
Bartlomiej Rymarski <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hello, > > I'm writing this little program, and I've came across a function > that I need to call. Since the execution of the function takes a > real long time I want to put a timer, or an animated 'loading'

Re: Need help on program!!!

2004-12-03 Thread Dan Perl
That was also my impression. Even the description of the problem looks like it's just copied from the assignment, so probably didn't even take the time to restate the problem in his own words. But we're speculating. Either way, this is not a normal request: "I need a program to do this, plz h

Re: question on regular expressions

2004-12-03 Thread Darren Dale
Michael Fuhr wrote: > Darren Dale <[EMAIL PROTECTED]> writes: > >> I'm stuck. I'm trying to make this: >> >> file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf,file://C >> %5Cfolderx%5Cfoldery%5Cmydoc2.pdf >> >> (no linebreaks) look like this: >> >> ./mydoc1.pdf,./mydoc2.pdf >> >> my regular expression a

Re: finding byte order

2004-12-03 Thread Jp Calderone
On Fri, 03 Dec 2004 19:19:48 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> I would like to have a test to tell me if the current machine is ^^^ > > using big or small endian, this way I could use the array module in > > the

Re: question on regular expressions

2004-12-03 Thread Michael Fuhr
Darren Dale <[EMAIL PROTECTED]> writes: > I'm stuck. I'm trying to make this: > > file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf,file://C > %5Cfolderx%5Cfoldery%5Cmydoc2.pdf > > (no linebreaks) look like this: > > ./mydoc1.pdf,./mydoc2.pdf > > my regular expression abilities are dismal. This works fo

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> I would like to have a test to tell me if the current machine is > using big or small endian, this way I could use the array module in > the first case and the *slower* struct module on the second. I looked > but did not find. Is there a python function to know that? There is no such test, as

Re: Need help on program!!!

2004-12-03 Thread Miklós P
"Darth Haggis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I need help writing a program > > You are to write a python program to accomplish the following: > ... > > > Haggis > Seems very much like homework to me... ;) And that's something you are supposed to do on your own

RE: Need help on program!!!

2004-12-03 Thread Batista, Facundo
Title: RE: Need help on program!!! [Darth Haggis] #- I need help writing a program #- #- You are to write a python program to accomplish the following: Actually, your homework is *your* homework. Regards, .   Facundo -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> How about sys.byteorder? This doesn't help, as he wants to read files from varying endianess - what the _current_ endianess is doesn't matter here. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Need help on program!!!

2004-12-03 Thread Darth Haggis
I need help writing a program You are to write a python program to accomplish the following: a.. Play a dice game of Craps using a random number generator to simulate the roll of the dice, the code for the rolling of the dice should take place in a user written module named rolldice. b.

RE: question on regular expressions

2004-12-03 Thread Robert Brewer
Darren Dale wrote: > I'm stuck. I'm trying to make this: > > file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf,file://C > %5Cfolderx%5Cfoldery%5Cmydoc2.pdf > > (no linebreaks) look like this: > > ./mydoc1.pdf,./mydoc2.pdf Regular expressions are much easier to write when you only have to worry about s

Re: Few things

2004-12-03 Thread Scott David Daniels
Josiah Carlson wrote: An option if you want to get all of the base representations available is a prefix notation that is similar to what already exists. I'm not advocating it (because I also think its crap), but the following fixes the problems with your postfix notation, and is explicit about ba

Re: question on regular expressions

2004-12-03 Thread Sean Ross
"Darren Dale" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm stuck. I'm trying to make this: > > file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf,file://C > %5Cfolderx%5Cfoldery%5Cmydoc2.pdf > > (no linebreaks) look like this: > > ./mydoc1.pdf,./mydoc2.pdf > > my regular expression abi

Re: How did you learn Python?

2004-12-03 Thread Harry George
"Shawn Milo" <[EMAIL PROTECTED]> writes: > I was just wondering what the best books were for learning Python. > > Which books are good for getting started, and which should be saved for > later, or or not useful except as a reference for the learned? > > I have a decent programming background in

Re: Newbie alert !

2004-12-03 Thread Lonnie Princehouse
> bou_asia=Button(fen1, text='Asia',\ >command=rings(size=41, offsetX=50,offsetY=22, > coul='yellow')) You're calling the rings function when you create the button. What you really want is for "command" to be a callable object that the button will invoke when it's clicked, e.

  1   2   3   >