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
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
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
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
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
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
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
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
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.
--
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
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?
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
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
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
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
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
[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
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
Ο/Η 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
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
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
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,
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
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
--
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
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
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
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
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/
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.
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
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'
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
tahks guys
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
[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
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
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 :
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):
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
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
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
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,
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
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
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__':
#!/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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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,
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,
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
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),
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
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,
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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):
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
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
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.
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:
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 - 100 of 210 matches
Mail list logo