ANN: Einführung in die Programmierung mit Python parts 5 and 6 (2 German ShowMeDo videos)

2007-02-08 Thread Ian Ozsvald
Summary: Lucas Holland and Marius Meinert continue their introductory German Python series, in this instalment they have released their 5th and 6th videos. German video descriptions: Operatoren und Datentypen In dieser Episode geht es um Operatoren und Datentypen, die eine Grundlage für die

Re: 'IF' Syntax For Alternative Conditions

2007-02-08 Thread Duncan Booth
Gabriel Genellina [EMAIL PROTECTED] wrote: Note that most (if not all) Python keywords are lowercase. All keywords are lower case. and del from not while aselif globalorwith assertelse ifpass yield break

Referencing vars, methods and classes by name

2007-02-08 Thread Sagari
Greetings, Sorry for a newbiw question: what is a most elegant and/or effective way to reference vars, methods and classes by their names in Python? To illustrate, PHP code: $a = ''b'; $$a = $something; // assign to $b $$a($p1); // call function b($p1) $obj-$a(); // call method b() of the

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Sagari
Quite forgot to add the obvious example (in PHP): $a = 'b'; $obj = new $a(); // instantiating class b() -- http://mail.python.org/mailman/listinfo/python-list

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Paul Rubin
Sagari [EMAIL PROTECTED] writes: $a = ''b'; $$a = $something; // assign to $b $$a($p1); // call function b($p1) $obj-$a(); // call method b() of the instance $obj What is the Python way of performing the same indirections? We would not do that. We don't (usually) use the interpreter

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Paul Rubin
Sagari [EMAIL PROTECTED] writes: $a = 'b'; $obj = new $a(); // instantiating class b() Classes are first class objects in python: class b: . # define class b We could assign the class object to a variable a = b and make an instance: obj = a()# same as obj = b() Continuing

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Gabriel Genellina
En Thu, 08 Feb 2007 05:29:23 -0300, Paul Rubin http://phr.cx@NOSPAM.invalid escribió: Sagari [EMAIL PROTECTED] writes: $a = ''b'; $obj-$a(); // call method b() of the instance $obj What is the Python way of performing the same indirections? For your last example we could say

Re: Overloading the tilde operator?

2007-02-08 Thread gatti
On Feb 8, 7:02 am, Dave Benjamin [EMAIL PROTECTED] wrote: Neil Cerutti wrote: There's been only one (or two?) languages in history that attempted to provide programmers with the ability to implement new infix operators, including defining precedence level and associativity (I can't think

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Paul Rubin
Gabriel Genellina [EMAIL PROTECTED] writes: obj.getattr(a)() but even that is a bit ugly, depending. Surely you meant to say getattr(obj, a)() Yeah, darn. Counterintuitive. I keep making that error in my own code too. Maybe I should put in an RFE. --

Re: idea for testing tools

2007-02-08 Thread Jens Theisen
Bruno Desthuilliers [EMAIL PROTECTED] writes: http://codespeak.net/py/current/doc/test.html#assert-with-the-assert-statement Ok, I didn't come across this before. I didn't work for me though, even the simple case #!/usr/bin/python a = 1 b = 2 def test_some(): assert a == b

iso 8601, quality criteria

2007-02-08 Thread Imbaud Pierre
for each library/module or even application, a note in [0:10] in front of every quality criterium. criteria?: completeness robustness how well tested? simplicity documentation maintenance team responsiveness usage: how many developpers picked it up and still use it?

Re: Calling J from Python

2007-02-08 Thread Robin Becker
Tina I wrote: .. It's also a village in Norway: http://en.wikipedia.org/wiki/Hell,_Norway In German it's bright -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: iso 8601, quality criteria

2007-02-08 Thread Imbaud Pierre
Imbaud Pierre a écrit : cutnpaste error in this posting, here is the complete message: Context: I am writing an application that accesses XMP-coded files. Some fields contain dates, and comply to iso 8601. I installed the iso8601 python module (http://cheeseshop.python.org/pypi/iso8601), it

Re: uml and python

2007-02-08 Thread Anastasios Hatzis
Ralf Schönian wrote: azrael schrieb: hy guys i've been googling and got several posts, but nothing that is a satisfaction in my eyes. can someone tell me a nice uml diagram tool with python export (if possible nice gui), or at least nice uml tool gpl or freeware (widows) prefered thanks

Re: Object type check

2007-02-08 Thread king kikapu
def modify(list_of_x): for x in list_of_x: try: x.change_in_place # don't call the method, just check it exists XX...what exactly is going on here ? I mean, what is actually happens if you omit the parenethesis as you just did ? I understand that it does not call

Re: Object type check

2007-02-08 Thread Michele Simionato
On Feb 8, 12:00 pm, king kikapu [EMAIL PROTECTED] wrote: def modify(list_of_x): for x in list_of_x: try: x.change_in_place # don't call the method, just check it exists XX...what exactly is going on here ? I mean, what is actually happens if you omit the

Re: 'IF' Syntax For Alternative Conditions

2007-02-08 Thread James Stroud
[EMAIL PROTECTED] wrote: All my python books and references I find on the web have simplistic examples of the IF conditional. A few also provide examples of multiple conditions that are ANDed; e.g., if cond1: if cond2: do_something. However, I cannot

Getting file line numbers from Nodes in a DOM?

2007-02-08 Thread Beej
I have a DOM parsed with xml.dom.mindom.parse()...for a particular Node, is there an easy way to get the line (and maybe even column) numbers that the element appeared in the original file? Thanks, -Beej -- http://mail.python.org/mailman/listinfo/python-list

Re: Object type check

2007-02-08 Thread king kikapu
Ο/Η Michele Simionato έγραψε: See http://users.rcn.com/python/download/Descriptor.htm for more than you ever wanted to know about attribute access in Python. Michele Simionato Great stuff Michele, thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python design project

2007-02-08 Thread solrick51
Hi Josh, Thank you for replying my message, sorry for the late reply, i was ill for two days.. I thought about the things you said, and think that it would be interesting, if fonts hit eachother the fonts would be merging. stuck together. so in a kind of way you create 'a new font' . I think the

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread skip
greg When I want to do this, usually I define the parts as ordinary, greg separate classes, and then define the main class as inheriting greg from all of them. Agreed. Maybe it's just my feeble brain, but I find this the most compelling (and easy to understand) use for multiple

Re: Calling J from Python

2007-02-08 Thread [EMAIL PROTECTED]
I may have mistook the source code licence for the use licence.. I will look into a little further to see what it can do.. Looks like you are not allowed to redistribute k for profit. Some day I will look up letters a random in the search engine to see what I come up with. On Feb 6, 2:05 am,

Best Free and Open Source Python IDE

2007-02-08 Thread Srikanth
Yes, All I need is a good IDE, I can't find something like Eclipse (JDT). Eclipse has a Python IDE plug-in but it's not that great. Please recommend. Thanks, Srikanth -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Free and Open Source Python IDE

2007-02-08 Thread Maël Benjamin Mettler
Srikanth schrieb: Yes, All I need is a good IDE, I can't find something like Eclipse (JDT). Eclipse has a Python IDE plug-in but it's not that great. Please recommend. Thanks, Srikanth http://www.serpia.org/spe http://www.die-offenbachs.de/detlev/eric.html --

Re: Best Free and Open Source Python IDE

2007-02-08 Thread [EMAIL PROTECTED]
On 8 fév, 13:03, Srikanth [EMAIL PROTECTED] wrote: Yes, All I need is a good IDE, I can't find something like Eclipse (JDT). Eclipse has a Python IDE plug-in but it's not that great. Please recommend. emacs +python-mode +ecb -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
On Feb 8, 1:04 pm, [EMAIL PROTECTED] wrote: greg When I want to do this, usually I define the parts as ordinary, greg separate classes, and then define the main class as inheriting greg from all of them. Agreed. Maybe it's just my feeble brain, but I find this the most

Re: Best Free and Open Source Python IDE

2007-02-08 Thread [EMAIL PROTECTED]
Srikanth wrote: All I need is a good IDE, I can't find something like Eclipse (JDT). Eclipse has a Python IDE plug-in but it's not that great. Please recommend. My favourite at the mo is Komodo Edit - free (though not OSS). On the OSS side, SPE is very good too - more of an IDE than Komodo

postgres backup script and popen2

2007-02-08 Thread flupke
Hi, i made a backup script to backup my postgres database. Problem is that it prompts for a password. It thought i could solve this by using popen2. I tested popen2 with dir (i'm on windows 2000, python 2.4.3) and it works. However when i try popen2 and my pg_dump command, it prompts for a

distutils: different names in src and dist/build

2007-02-08 Thread Anastasios Hatzis
Hi, is it possible to have different names between the original package name and that which will be installed? Example: setup.py src/ sdk/ __init__.py startme.py This usually creates a distribution file like sdk-0.6.2.tar.gz, which may create site-packages/ sdk/

Re: postgres backup script and popen2

2007-02-08 Thread Maël Benjamin Mettler
Use pexpect: http://pexpect.sourceforge.net/ flupke schrieb: Hi, i made a backup script to backup my postgres database. Problem is that it prompts for a password. It thought i could solve this by using popen2. I tested popen2 with dir (i'm on windows 2000, python 2.4.3) and it works.

Simple Interpolation in Numpy?

2007-02-08 Thread LAPI, VINCENT J, ATTLABS
Hi, Please bear with me as I am new to Python and have not done any programming in about 20 years. I am attempting to do a simple interpolation of a line's intermediate points given the x,y coordinates of the line's two endpoints within an Active State Python script that I am working with. Is

Re: Group Membership in Active Directory Query

2007-02-08 Thread Kooch54
On Feb 7, 7:52 pm, alex23 [EMAIL PROTECTED] wrote: On Feb 8, 4:27 am, [EMAIL PROTECTED] wrote: First and foremost thanks for the feedback. Although I don't appreciate the slight dig at me. dummy = ldap_obj.simple_bind.. I _really_ don't think Uwe was intending any slight, 'dummy'

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread W. Watson
Robert Kern wrote: W. Watson wrote: Robert Kern wrote: W. Watson wrote: For some reason Python 2.2.4 cannot find the Numeric module. It's been suggested that I should re-install the Numeric file. How do that? Also the PIL. The three install files are: python-2.4.4.msi

Re: uml and python

2007-02-08 Thread azrael
tahks guys -- http://mail.python.org/mailman/listinfo/python-list

Re: help on packet format for tcp/ip programming

2007-02-08 Thread rattan
On Feb 8, 3:40 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: struct module pack and unpack will only work for fixed size buffer : pack('1024sIL', buffer, count. offset) but the buffer size can vary from one packet to the next :-( Oh

Re: 'IF' Syntax For Alternative Conditions

2007-02-08 Thread rshepard
On 2007-02-08, Paul Rubin http wrote: [EMAIL PROTECTED] writes: if cond1: if cond2: do_something. You can write: if cond1 and cond2: do_something if cond1 OR if cond2: do_something. if cond1 or cond2: do_something I've tried

python linux distro

2007-02-08 Thread azrael
Hy guys last night i was lying in my bed and thinking about something. is there any linux distro that is primary oriented to python. you know what i mean. no need for php, java, or something like this. pure python and containig all the funky modules like scipy, numpy, boaconstructor (wx of

Re: help on packet format for tcp/ip programming

2007-02-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On Feb 8, 3:40 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: struct module pack and unpack will only work for fixed size buffer : pack('1024sIL', buffer, count. offset) but the buffer size can vary from one

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread skip
Michele That is a common design, but I don't like it, since it becomes Michele very easy to get classes with dozens of methods inherited from Michele everywhere, a modern incarnation of the spaghetti-code Michele concept. I find it much better to use composition, i.e. to

Re: help on packet format for tcp/ip programming

2007-02-08 Thread Jean-Paul Calderone
On Thu, 08 Feb 2007 15:56:30 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Feb 8, 3:40 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: struct module pack and unpack will only work for fixed size buffer :

Linux-Signal VS QT

2007-02-08 Thread Marco
Can I use LinuX signal as a tool for commuction with a QT(PyQt4) programme? The follow code didNOT work... from PyQt4 import QtCore,QtGui import signal import sys import os try: import psyco psyco.full() except: pass class Main(QtGui.QWidget): def __init__(self):

Re: python linux distro

2007-02-08 Thread dimitri pater
Hi, the world doesn't need another Linux distro, there are too many already... ( 100) I believe it's a better idea to spend your time contributing to an existing distro (e.g. http://www.ubuntu.com/developers/bounties) doing Python related stuff. Besides that, all distros I know of (4) already

Re: help on packet format for tcp/ip programming

2007-02-08 Thread Diez B. Roggisch
Grant had the right idea, I think, but he failed to actually include a byte length in his format. :) So there's nothing to peek at. If the packing is done like this, instead.. struct.pack('!IIL', len(buffer), count, offset) + buffer Then it is a simple matter to unpack it once the

Re: Linux-Signal VS QT

2007-02-08 Thread Phil Thompson
On Thursday 08 February 2007 3:08 pm, Marco wrote: Can I use LinuX signal as a tool for commuction with a QT(PyQt4) programme? The follow code didNOT work... from PyQt4 import QtCore,QtGui import signal import sys import os try: import psyco psyco.full() except: pass

Re: python linux distro

2007-02-08 Thread Thomas Guettler
azrael wrote: Hy guys last night i was lying in my bed and thinking about something. is there any linux distro that is primary oriented to python. you know what i mean. no need for php, java, or something like this. pure python and containig all the funky modules like scipy, numpy,

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
On Feb 8, 4:05 pm, [EMAIL PROTECTED] wrote: Composition is great when you know how largish classes are going to be composed ahead of time and/or already have the pieces available in the form of other classes you want to reuse. I use this fragment-by-multiple- inheritance (I hesitate to call

Fwd: Python new user question - file writeline error

2007-02-08 Thread Shawn Milo
To the list: I have come up with something that's working fine. However, I'm fairly new to Python, so I'd really appreciate any suggestions on how this can be made more Pythonic. Thanks, Shawn Okay, here's what I have come up with: #! /usr/bin/python import sys import re month

Re: Getting a class name from within main

2007-02-08 Thread Chris Lambacher
On Wed, Feb 07, 2007 at 01:02:39AM -0800, [EMAIL PROTECTED] wrote: Hi, Lets say I have the following class - class MyClass: def __init__(self): print (__name__.split(.))[-1] I would spell this: print self.__class__.__name__ if __name__ == '__main__':

Re: idea for testing tools

2007-02-08 Thread Eduardo \EdCrypt\ O. Padoan
#!/usr/bin/python a = 1 b = 2 def test_some(): assert a == b didn't reveal the values for a and b, though some more complex cases showed something. def test_some(): print 'a:', a, 'b:', b assert a == b

PyQt install problem

2007-02-08 Thread Ron Monroig
hi Bruce, I was trying to interpret the code you wrote for xroot.sh. I saw it on pg 115 in Sitepoint's Run Your Own Web Server Using Linux Apache Could you possibly consider commenting on what each line of code is doing? It works; the warning message goes away. I just don't

Re: python linux distro

2007-02-08 Thread Shawn Milo
On 2/8/07, dimitri pater [EMAIL PROTECTED] wrote: Hi, the world doesn't need another Linux distro, there are too many already... ( 100) I believe it's a better idea to spend your time contributing to an existing distro (e.g. http://www.ubuntu.com/developers/bounties) doing Python related

Re: distutils: different names in src and dist/build

2007-02-08 Thread Anastasios Hatzis
Anastasios Hatzis wrote: Hi, is it possible to have different names between the original package name and that which will be installed? Example: setup.py src/ sdk/ __init__.py startme.py This usually creates a distribution file like sdk-0.6.2.tar.gz, which

Re: Running Application Within Emacs

2007-02-08 Thread [EMAIL PROTECTED]
You can call scripts from the interpreter with execfile('script.py'). If you use ipython there is a %run command that executes a script. Enjoy! Bernhard On Feb 7, 3:26 pm, [EMAIL PROTECTED] wrote: My editor is emacs in linux, and I have the python mode enabled. The two menus -- IM-Python

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread Robert Kern
W. Watson wrote: I did a search in the python24 folder for sys.exec* (in c:\python24), but came up with nothing. [nothing in a search of c:--sys.exec*] I have two python folders, c:\python24 and c:\python25. The contents of both folders look fairly similar and each have a python.exe. I do

Re: Simple Interpolation in Numpy?

2007-02-08 Thread Steve Holden
LAPI, VINCENT J, ATTLABS wrote: Hi, Please bear with me as I am new to Python and have not done any programming in about 20 years. I am attempting to do a simple interpolation of a line's intermediate points given the x,y coordinates of the line's two endpoints within an Active State

SQLObject 0.8.0b3

2007-02-08 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.0b3 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

Re: postgres backup script and popen2

2007-02-08 Thread Gabriel Genellina
On 8 feb, 10:27, Maël Benjamin Mettler [EMAIL PROTECTED] wrote: flupke schrieb: i made a backup script to backup my postgres database. Problem is that it prompts for a password. It thought i could solve this by using popen2. Use pexpect:http://pexpect.sourceforge.net/ pexpect could

Re: postgres backup script and popen2

2007-02-08 Thread Jean-Paul Calderone
On 8 Feb 2007 08:23:49 -0800, Gabriel Genellina [EMAIL PROTECTED] wrote: On 8 feb, 10:27, Maël Benjamin Mettler [EMAIL PROTECTED] wrote: flupke schrieb: i made a backup script to backup my postgres database. Problem is that it prompts for a password. It thought i could solve this by using

Strings in Python

2007-02-08 Thread Johny
Playing a little more with strings, I found out that string.find function provides the position of the first occurance of the substring in the string. Is there a way how to find out all substring's position ? To explain more, let's suppose mystring='12341' import string string.find(mystring

Re: Referencing vars, methods and classes by name

2007-02-08 Thread Gabriel Genellina
On 8 feb, 05:51, Paul Rubin http://[EMAIL PROTECTED] wrote: Gabriel Genellina [EMAIL PROTECTED] writes: obj.getattr(a)() but even that is a bit ugly, depending. Surely you meant to say getattr(obj, a)() Yeah, darn. Counterintuitive. I keep making that error in my own code too.

Re: Strings in Python

2007-02-08 Thread Gary Herron
Johny wrote: Playing a little more with strings, I found out that string.find function provides the position of the first occurance of the substring in the string. Is there a way how to find out all substring's position ? To explain more, let's suppose mystring='12341' import string

Re: Strings in Python

2007-02-08 Thread Shawn Milo
On 8 Feb 2007 08:28:25 -0800, Johny [EMAIL PROTECTED] wrote: Playing a little more with strings, I found out that string.find function provides the position of the first occurance of the substring in the string. Is there a way how to find out all substring's position ? To explain more, let's

Re: idea for testing tools

2007-02-08 Thread Paul Rubin
Jens Theisen [EMAIL PROTECTED] writes: def test_some(): assert a == b didn't reveal the values for a and b, though some more complex cases showed something. I usually use assert a == b, (a,b) -- http://mail.python.org/mailman/listinfo/python-list

Re: Strings in Python

2007-02-08 Thread Shawn Milo
On 2/8/07, Gary Herron [EMAIL PROTECTED] wrote: Johny wrote: Playing a little more with strings, I found out that string.find function provides the position of the first occurance of the substring in the string. Is there a way how to find out all substring's position ? To explain more,

Re: python linux distro

2007-02-08 Thread Steve Holden
azrael wrote: Hy guys last night i was lying in my bed and thinking about something. is there any linux distro that is primary oriented to python. you know what i mean. no need for php, java, or something like this. pure python and containig all the funky modules like scipy, numpy,

Re: help on packet format for tcp/ip programming

2007-02-08 Thread Grant Edwards
On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Feb 8, 3:40 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-02-08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: struct module pack and unpack will only work for fixed size buffer : pack('1024sIL', buffer, count. offset) but the

Re: help on packet format for tcp/ip programming

2007-02-08 Thread Grant Edwards
On 2007-02-08, Diez B. Roggisch [EMAIL PROTECTED] wrote: struct module pack and unpack will only work for fixed size buffer : pack('1024sIL', buffer, count. offset) but the buffer size can vary from one packet to the next :-( Oh for Pete's sake... struct.pack('%dsIL' % len(buffer),

Re: C parsing fun

2007-02-08 Thread Roberto Bonvallet
Károly Kiripolszky [EMAIL PROTECTED] wrote: I've found a brute-force solution. In the preprocessing phase I simply strip out the comments (things inside comments won't appear in the result) and replace curly brackets with these symbols: #::OPEN::# and #::CLOSE::#. This fails when the code

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Gabriel Genellina
On 8 feb, 12:41, Shawn Milo [EMAIL PROTECTED] wrote: I have come up with something that's working fine. However, I'm fairly new to Python, so I'd really appreciate any suggestions on how this can be made more Pythonic. A few comments: You don't need the formatDatePart function; delete it,

Re: Does the world need another v0.1 python compiler?

2007-02-08 Thread sturlamolden
On Feb 8, 8:03 am, Kay Schluehr [EMAIL PROTECTED] wrote: This code generation for an arbitrary backend sounds more like an appropriate task for PyPy. I think Grant's or anyone elses compiler could be a viable tool for augmenting the CPython interpreter in particular in the presence of

Re: C parsing fun

2007-02-08 Thread Károly Kiripolszky
Yes, of course. But you can still fine-tune the code for the sources you want to parse. The C++ header files I needed to analyze contained no such strings. I believe there are very few real-life .h files out there containing those. In fact I chose #::OPEN::# and #::CLOSE::# because they're more

Re: postgres backup script and popen2

2007-02-08 Thread Gabriel Genellina
On 8 feb, 13:29, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On 8 Feb 2007 08:23:49 -0800, Gabriel Genellina [EMAIL PROTECTED] wrote: On 8 feb, 10:27, Maël Benjamin Mettler [EMAIL PROTECTED] wrote: flupke schrieb: i made a backup script to backup my postgres database. Problem is that it

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Shawn Milo
On 8 Feb 2007 09:05:51 -0800, Gabriel Genellina [EMAIL PROTECTED] wrote: On 8 feb, 12:41, Shawn Milo [EMAIL PROTECTED] wrote: I have come up with something that's working fine. However, I'm fairly new to Python, so I'd really appreciate any suggestions on how this can be made more

Re: postgres backup script and popen2

2007-02-08 Thread Jean-Paul Calderone
On 8 Feb 2007 09:18:26 -0800, Gabriel Genellina [EMAIL PROTECTED] wrote: On 8 feb, 13:29, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On 8 Feb 2007 08:23:49 -0800, Gabriel Genellina [EMAIL PROTECTED] wrote: On 8 feb, 10:27, Maël Benjamin Mettler [EMAIL PROTECTED] wrote: flupke schrieb: i

Re: python linux distro

2007-02-08 Thread azrael
thanks guys when i wrote this, i thought that out there is some crazy guy like me. i was hoping for more support but after these arguments, there is nothing more then to say:you are right. the world doesnt need another distro. but if one day I mange to do it, hope you will be glade that i post

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread W. Watson
Robert Kern wrote: W. Watson wrote: I did a search in the python24 folder for sys.exec* (in c:\python24), but came up with nothing. [nothing in a search of c:--sys.exec*] I have two python folders, c:\python24 and c:\python25. The contents of both folders look fairly similar and each

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread J. Clifford Dyer
Martin v. Löwis wrote: I'm happy to announce partial 1.0; a module to implement partial classes in Python. It is available from http://cheeseshop.python.org/pypi/partial/1.0 A partial class is a fragment of a class definition; partial classes allow to spread the definition of a class

Re: idea for testing tools

2007-02-08 Thread Eduardo \EdCrypt\ O. Padoan
That's hardly desirable. If one is writing a test library that goes as far as reparsing the assert statements, I can't see the point of requiring the user to clutter his test suite with such spurious print statements. After all, that's one of the main points of test suites in the first place

begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
Hi, Is there a way to retrieve a web page and before it is entirely downloaded, begin to test if a specific string is present and if yes stop the download ? I believe that urllib.openurl(url) will retrieve the whole page before the program goes to the next statement. I suppose I would be able to

Re: Simple SVN/CVS-like library in Python?

2007-02-08 Thread Andrea Gavana
Andrea Gavana wrote: Hi All, in our office we work with quite complex input files for a reservoir simulator. Those files have thousands of keywords, switches, sub-keywords and whatever. Every time a modification is requested, we modify the input file and re-run the simulator.

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: Is there a way to retrieve a web page and before it is entirely downloaded, begin to test if a specific string is present and if yes stop the download ? I believe that urllib.openurl(url) will retrieve the whole page before the program goes to the next statement. Use

Re: Calling J from Python

2007-02-08 Thread Gosi
On Feb 8, 12:00 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I may have mistook the source code licence for the use licence.. I will look into a little further to see what it can do.. Looks like you are not allowed to redistribute k for profit. Some day I will look up letters a random in

Re: Convert from unicode chars to HTML entities

2007-02-08 Thread Roberto Bonvallet
Steven D'Aprano [EMAIL PROTECTED] wrote: I have a string containing Latin-1 characters: s = u© and many more... I want to convert it to HTML entities: result = copy; and many more... [...[ Is there a batteries included solution that doesn't involve reinventing the wheel? recode is

Re: Does the world need another v0.1 python compiler?

2007-02-08 Thread bearophileHUGS
sturlamolden: IMHO, with the presence of static types in Py3K, we should have a static compiler that can be invoked dynamically, just like Common Lisp. Something like def foo(...): bar = static_compile(foo, optimize=2) bar(...) JIT compilers are hyped, static compilers perform much

Re: Simple SVN/CVS-like library in Python?

2007-02-08 Thread Martin Wiechert
On Wednesday 07 February 2007 21:29, Andrea Gavana wrote: Hi All, in our office we work with quite complex input files for a reservoir simulator. Those files have thousands of keywords, switches, sub-keywords and whatever. Every time a modification is requested, we modify the input file

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Jussi Salmela
Shawn Milo kirjoitti: To the list: I have come up with something that's working fine. However, I'm fairly new to Python, so I'd really appreciate any suggestions on how this can be made more Pythonic. Thanks, Shawn Okay, here's what I have come up with: What follows may

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Shawn Milo
On 2/8/07, Jussi Salmela [EMAIL PROTECTED] wrote: Shawn Milo kirjoitti: To the list: I have come up with something that's working fine. However, I'm fairly new to Python, so I'd really appreciate any suggestions on how this can be made more Pythonic. Thanks, Shawn

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 6:54 pm, Leif K-Brooks [EMAIL PROTECTED] wrote: k0mp wrote: Is there a way to retrieve a web page and before it is entirely downloaded, begin to test if a specific string is present and if yes stop the download ? I believe that urllib.openurl(url) will retrieve the whole page

Functions, parameters

2007-02-08 Thread Boris Ozegovic
Hi, I'am still learning Python and while reading Django tutorial couldn't understand this part: class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') # Django provides a rich database lookup API that's entirely

Re: Strings in Python

2007-02-08 Thread attn . steven . kuo
On Feb 8, 8:28 am, Johny [EMAIL PROTECTED] wrote: Playing a little more with strings, I found out that string.find function provides the position of the first occurance of the substring in the string. Is there a way how to find out all substring's position ? To explain more, let's suppose

Re: Functions, parameters

2007-02-08 Thread Bruno Desthuilliers
Boris Ozegovic a écrit : Hi, I'am still learning Python and while reading Django tutorial couldn't understand this part: class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') # Django provides a rich database

Re: Functions, parameters

2007-02-08 Thread Matimus
Poll.objects.filter(question__startswith='What') That is an example of a keyword argument. You can read about it in the Python Tutorial: http://docs.python.org/tut/node6.html#SECTION00672 -Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Functions, parameters

2007-02-08 Thread Paul Rubin
Boris Ozegovic [EMAIL PROTECTED] writes: Poll.objects.filter(question__startswith='What') This 'question__startswith' is the problem. What is the common idiom for this type od arguments, so I can Google it? You can refer to function args in Python by name, e.g. define a function def

Re: Functions, parameters

2007-02-08 Thread Boris Ozegovic
Bruno Desthuilliers wrote: Why don't you just read the source code ? Django is free software, you know !-) Yes, I know. :) What about something like: def filter(self, **kw): for argname, value in kw.items(): fieldname, op = argname.split('__', 1) Yes, this is what confused

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: It seems to take more time when I use read(size) than just read. I think in both case urllib.openurl retrieve the whole page. Google's home page is very small, so it's not really a great test of that. Here's a test downloading the first 512 bytes of an Ubuntu ISO (beware of wrap):

Re: Functions, parameters

2007-02-08 Thread Paul Rubin
Boris Ozegovic [EMAIL PROTECTED] writes: def filter(self, **kw): for argname, value in kw.items(): fieldname, op = argname.split('__', 1) Yes, this is what confused me in the first place: how to separate arguments. If you call split, and split returns list of String, then you

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Björn Steinbrink
On Thu, 08 Feb 2007 10:20:56 -0800, k0mp wrote: On Feb 8, 6:54 pm, Leif K-Brooks [EMAIL PROTECTED] wrote: k0mp wrote: Is there a way to retrieve a web page and before it is entirely downloaded, begin to test if a specific string is present and if yes stop the download ? I believe that

Re: Does the world need another v0.1 python compiler?

2007-02-08 Thread sturlamolden
On Feb 8, 7:02 pm, [EMAIL PROTECTED] wrote: At the moment I think this approach can't improve much the speed of Python programs compared to what Psyco is already able to do. Pyrex generates code that competes with hand-written C. It is as close to statically typed Python as it gets.

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Thomas Heller
Ziga Seilnacht schrieb: Thomas Heller wrote: Do you have a pointer to that post? I think that he was refering to this post: http://mail.python.org/pipermail/python-list/2006-December/416241.html If you are interested in various implementations there is also this:

default mutable arguments

2007-02-08 Thread Gigs_
I read that this is not the same: if arg is None: arg = [] arg = arg or [] def functionF(argString=abc, argList = None): if argList is None: argList = [] # this ... def functionF(argString=abc, argList=None): argList = argList or [] # and this

  1   2   3   >