what is it
--
A Python package to parse and build CSS Cascading Style Sheets. (Not a
renderer though!)
As there have been quite a few bugfixes and also some minor changes this
is a release candidate and not the final release yet.
main changes
0.9.5rc1 080709
-
Hi all,
lxml 2.1 has been released to PyPI. This is the first official lxml release
that builds and works on Python 2.3, 2.4, 2.5, 2.6 (beta) and 3.0 (beta).
http://codespeak.net/lxml/dev/
http://pypi.python.org/pypi/lxml/2.1
Install with
easy_install lxml==2.1
What is lxml?
In short:
Hello all,
We are proud to announce the release of LDTP 1.2.0. This release features
number of important breakthroughs in LDTP as well as in the field of Test
Automation. This release note covers a brief introduction on LDTP followed
by the list of new features and major bug fixes which makes
Benjamin Goudey [EMAIL PROTECTED] writes:
For example, if my original list is [0,0,1,2,1,0,0] I would like to
produce the lists [1,2,1] (the non zero values) and [2,3,4] (indices
of where the non-zero values used to be). Removing non-zero values
is very easy but determining the indicies is
On Jul 8, 2:48 am, John Machin [EMAIL PROTECTED] wrote:
On Jul 8, 2:51 am, Henning Thornblad [EMAIL PROTECTED]
wrote:
When trying to find an alternative way of solving my problem i found
that running this script:
#!/usr/bin/env python
import re
row=
for a in range(156000):
mk wrote:
Now C++ version took over twice the time to execute in comparison to
Python time!
Am I comparing apples to oranges?
Indeed. Where in Python you're passing references your C++ code produces
copies of the vector. For starters you can change the function signature to
void
Hi list,
i'm running Ubuntu Hardy Desktop and i've installed Tim Golden WMI.
However importing wmi module i have this error:
import wmi
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.5/site-packages/wmi.py, line 141, in module
from win32com.client
On Tue, 08 Jul 2008 15:18:23 -0700, [EMAIL PROTECTED] wrote:
I need to mantain a filesystem where I'll keep only the most recently
used (MRU) files; least recently used ones (LRU) have to be removed to
leave space for newer ones. The filesystem in question is a clustered fs
(glusterfs) which
norseman nor...ghes.net wrote:
8 -
dreaded Yep! I know the feeling. Got lots of those T-Shirts. ;)
I re-read your original post. I got the feeling the eBox is running a
stripped down Linux. Is that so? If it is, then:
Alright, basically I have a list of words in a file and I load each word
from each line into the array. Then basically the question is how do I
check if the input word matches multiple words in the list.
Say someone input test, how could I check if that word matches these list
of words:
test
So, i can't use wmi module on linux?
On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
I think the win32 module is only for windows.
--
http://mail.python.org/mailman/listinfo/python-list
hi!
Try this:
lis=['t','tes','test','testing']
[elem for elem in lis if re.compile(^te).search(elem)]
['tes', 'test', 'testing']
Cheers,
Raj
On Wed, Jul 9, 2008 at 12:13 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
Alright, basically I have a list of words in a file and I load each word
hi Mike,
nice job, I just took a quick look,
Trent Mick wrote:
The Python Cookbook is by far the most popular of the ASPN Cookbooks,
so I wanted to get the Python community's feedback on the new site.
What do you think? What works? What doesn't? I'll try to answer
feedback on python-list
On Jul 9, 2:01 am, Kris Kennaway [EMAIL PROTECTED] wrote:
samwyse wrote:
On Jul 4, 6:43 am, Henning_Thornblad [EMAIL PROTECTED]
wrote:
What can be the cause of the large difference between re.search and
grep?
While doing a simple grep:
grep '[^ =]*/' input (input
I am new in python and I have the following problem:
Suppose I have a list with words of which I want to remove each time
the words in the lines below item1 and above item2:
item1
a
b
item2
c
d
item3
e
f
item4
g
h
item1
i
j
item2
k
l
item3
m
n
item4
o
p
I did not find out how to do this:
Part
On 2008-07-09, |e0 [EMAIL PROTECTED] wrote:
So, i can't use wmi module on linux?
On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
I think the win32 module is only for windows.
Welcome to the world outside MS.
Many python modules don't actually do anything than passing
Rajanikanth Jammalamadaka a écrit :
(top-post corrected - Please, Rajanikanth, learn to trimquote properly,
and by all means avoid top-posting)
On Wed, Jul 9, 2008 at 12:13 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
Alright, basically I have a list of words in a file and I load each word
A.T.Hofkamp wrote:
On 2008-07-09, |e0 [EMAIL PROTECTED] wrote:
So, i can't use wmi module on linux?
On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
I think the win32 module is only for windows.
Welcome to the world outside MS.
Many python modules don't actually do
This could work:
l = [0,0,1,2,1,0,0]
indexes, values = zip(*((index,value) for index,value in enumerate(l) if value
!= 0))
But I guess it would be a little less cryptic (and maybe a lot more efficient)
if there were an unzip function instead of using the zip(*sequence) trick.
I think a more
antar2 wrote:
I am new in python and I have the following problem:
Suppose I have a list with words of which I want to remove each time
the words in the lines below item1 and above item2:
f = re.compile(item\[1\]\:)
g = re.compile(item\[2\]\:)
for i, line in enumerate(list1):
Hello,
I wonder if you don't mind helping me out in this problem. I have been
developing a tool in python that opens some unicode files, reading them and
processing the data. It is working fine. When I started to write a cgi module
that does the same thing for google appengine(actually it is
Hi all,
I want to manipulate sys.path outside of PYTHONPATH (environment) and
sys.path.append() (programmatically).
A bit of background:
We're maintaining a small application that includes a couple of Python
scripts. Over time, a decent amount of code has been forked into
modules, so the
On Wed, 2008-07-09 at 00:00 -0400, Ben Keshet wrote:
oops, my mistake, actually it didn't work...
when I tried:
for x in folders:
print x # print the current folder
filename='Folder/%s/myfile.txt' %x
f=open(filename,'r')
it says: IOError: [Errno 2] No such file or
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
The weather is nice
Item 1
We will go to the seaside
...
Only the
Rajanikanth Jammalamadaka wrote:
Try using a list instead of a vector for the C++ version.
Well, it's even slower:
$ time slice4
real0m4.500s
user0m0.015s
sys 0m0.015s
Time of execution of vector version (using reference to a vector):
$ time slice2
real0m2.420s
user
antar2 wrote:
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
The weather is nice
Item 1
We will go to the
Hello,
i would like use a mock object for testing one class and its methods:
Here my class :
class Foo(Component):
def __init__(self):
self._db = self.env.get_db()
def foomethod(self, arg):
.
But i don't know how to mock the class Component. Note that Component
On Wed, 2008-07-09 at 03:30 -0700, antar2 wrote:
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
The weather
On Wed, 2008-07-09 at 03:30 -0700, antar2 wrote:
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
The weather
My question is: did something about the way the special method names are
implemented change for new-style classes?
class old:
pass
class new(object):
pass
testone = old()
testone.__call__ = lambda : 33
testone()
33
testtwo = new()
testtwo.__call__ = lambda : 33
On 2008-07-09, antar2 [EMAIL PROTECTED] wrote:
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
The weather is
On Jul 9, 2:08 am, Ben Keshet [EMAIL PROTECTED] wrote:
Hi fans,
I want to use a 'for' iteration to manipulate files in a set of folders,
something like:
folders= ['1A28','1A6W','56Y7']
for x in folders:
print x # print the current folder
f = open('my/path/way/x/my_file.txt',
lidiriel [EMAIL PROTECTED] writes:
But i don't know how to mock the class Component. Note that Component
provide the attribut env.
I prefer to use the MiniMock framework
URL:http://cheeseshop.python.org/pypi/MiniMock.
You don't need to specify what interface the mock object has. Its Mock
Hi,
I'm trying to implement an asynchronous scheduler for asyncore to call
functions at a later time without blocking the main loop.
The logic behind it consists in:
- adding the scheduled functions into a heapified list
- calling a scheduler function at every loop which checks the
scheduled
it didn't help. it reads the pathway as is (see errors for both
tries). It looks like it had the write pathway the first time, but
could not find it because it searched in the path/way instead of in the
path\way. thanks for trying.
folders= ['1','2','3']
for x in folders:
print x #
On Jul 8, 10:09 pm, sturlamolden [EMAIL PROTECTED] wrote:
[...]
I use wxFormBuilder with wxPython. Works like a charm. Design the GUI
graphically, export it like a wx XML resource (.xrc). All you nedd to
code in Python is the event handlers and the code to bind/hook the
events.
And if you've gotten this far, why not take the next step:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/476204
and just type tryme (as opposed to tryme.py)
Gerry
--
http://mail.python.org/mailman/listinfo/python-list
Tim Cook a écrit :
On Wed, 2008-07-09 at 00:00 -0400, Ben Keshet wrote:
oops, my mistake, actually it didn't work...
when I tried:
for x in folders:
print x # print the current folder
filename='Folder/%s/myfile.txt' %x
f=open(filename,'r')
it says: IOError: [Errno 2] No such
John Machin wrote:
Hmm, unfortunately it's still orders of magnitude slower than grep in my
own application that involves matching lots of strings and regexps
against large files (I killed it after 400 seconds, compared to 1.5 for
grep), and that's leaving aside the much longer compilation time
-On [20080709 14:08], Kris Kennaway ([EMAIL PROTECTED]) wrote:
It's compiler/build output.
Sounds like the FreeBSD ports build cluster. :)
Kris, have you tried a PGO build of Python with your specific usage? I
cannot guarantee it will significantly speed things up though.
Also, a while ago I
Jeroen Ruigrok van der Werven wrote:
-On [20080709 14:08], Kris Kennaway ([EMAIL PROTECTED]) wrote:
It's compiler/build output.
Sounds like the FreeBSD ports build cluster. :)
Yes indeed!
Kris, have you tried a PGO build of Python with your specific usage? I
cannot guarantee
Le Wednesday 09 July 2008 12:35:10 mk, vous avez écrit :
vectorstring move_slice(vectorstring vec, int start, int stop, int
dest)
I guess the point is to make a vector of referene to string if you don't want
to copy string objects all around but just a word for an address each time.
The
I did not mean to use WMI on linux, but query win machines *from* linux.
Thank you for your clarifications
- Leonardo
On Wed, Jul 9, 2008 at 11:04 AM, A.T.Hofkamp [EMAIL PROTECTED] wrote:
Welcome to the world outside MS.
Many python modules don't actually do anything than passing on calls to
|e0 wrote:
I did not mean to use WMI on linux, but query win machines *from* linux.
Thank you for your clarifications
In principle you ought to be able to use some kind of DCOM bridge
(since WMI access if via COM/DCOM). I've no idea if anyone's attempted
this or even if all the pieces are in
|e0 wrote:
I did not mean to use WMI on linux, but query win machines *from* linux.
What do you mean by query? Using the WMI module? No. It's Windows only.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
2008/7/9 Benjamin Goudey [EMAIL PROTECTED]:
I have a very large list of integers representing data needed for a
histogram that I'm going to plot using pylab. However, most of these
values (85%-95%) are zero and I would like to remove them to reduce
the amount of memory I'm using and save time
On Jul 9, 7:48 am, Rajanikanth Jammalamadaka [EMAIL PROTECTED]
wrote:
Try this:
li=[0,0,1,2,1,0,0]
li
[0, 0, 1, 2, 1, 0, 0] [i for i in range(len(li)) if li[i] != 0]
[2, 3, 4]
Cheers,
Raj
On Tue, Jul 8, 2008 at 10:26 PM, Benjamin Goudey [EMAIL PROTECTED] wrote:
I have a very
On Jul 9, 7:48 am, Rajanikanth Jammalamadaka [EMAIL PROTECTED]
wrote:
Try this:
li=[0,0,1,2,1,0,0]
li
[0, 0, 1, 2, 1, 0, 0] [i for i in range(len(li)) if li[i] != 0]
[2, 3, 4]
Cheers,
Raj
On Tue, Jul 8, 2008 at 10:26 PM, Benjamin Goudey [EMAIL PROTECTED] wrote:
I have a very
Does anybody know of a python module which can do process management
on Windows? The sort of thing that we might usually do with
taskmgr.exe or process explorer?
For example:
* Kill a process by ID
* Find out which process ID is locking an object in the filesystem
* Find out all the IDs of a
Hi,
I'm trying to implement an asynchronous scheduler for asyncore to call
functions at a later time without blocking the main loop.
The logic behind it consists in:
- adding the scheduled functions into a heapified list
- calling a scheduler function at every loop which checks the scheduled
Hi all,
I've been looking around on the web for a way to do this, but so far
have not come across anything for this particular application. I have
found some ways to enable tab completion for program-related commands,
but not for system filepaths. This would be nice to have when
prompting the
Keith Hughitt wrote:
I've been looking around on the web for a way to do this, but so far
have not come across anything for this particular application. I have
found some ways to enable tab completion for program-related commands,
but not for system filepaths. This would be nice to have when
Robert Hancock wrote:
mypackage/
__init__.py
push/
__init__.py
dest.py
feed/
__init__py
subject.py
In subject.py I have
from ..push import dest
There is no such thing as relative
On Jul 9, 12:26 am, Benjamin Goudey [EMAIL PROTECTED] wrote:
I have a very large list of integers representing data needed for a
histogram that I'm going to plot using pylab. However, most of these
values (85%-95%) are zero and I would like to remove them to reduce
the amount of memory I'm
I'm wondering whether anyone can offer suggestions on FOSS projects/
apps which exhibit solid OO principles, clean code, good inline
documentation, and sound design principles?
I'm devoting some time to reviewing other people's code to advance my
skills. Its good to review bad code (of which I
Thomas wrote:
Robert Hancock wrote:
mypackage/
__init__.py
push/
__init__.py
dest.py
feed/
__init__py
subject.py
In subject.py I have
from ..push import dest
There is
Maric Michaud wrote:
Le Wednesday 09 July 2008 12:35:10 mk, vous avez écrit :
vectorstring move_slice(vectorstring vec, int start, int stop, int
dest)
I guess the point is to make a vector of referene to string if you don't want
to copy string objects all around but just a word for an
def ine(you):
yourself = what?
go = list(something), list(anything)
be = something
please = be, yourself
yourself = great
for good in yourself:
if you is good:
good in you
please.add(more, good)
else:
def inition(lacks, clarity):
P.S. Java 1.6 rocks - I wrote equivalent version using ArrayList and it
executed in 0.7s.
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2008-07-09 at 07:38 -0700, Phillip B Oldham wrote:
I'm wondering whether anyone can offer suggestions on FOSS projects/
apps which exhibit solid OO principles, clean code, good inline
documentation, and sound design principles?
I'm devoting some time to reviewing other people's code
On Jul 8, 12:34 pm, Ethan Furman [EMAIL PROTECTED] wrote:
Anybody have an example of when the unary + actually does something?
Besides the below Decimal example. I'm curious under what circumstances
it would be useful for more than just completeness (although
completeness for it's own sake
On Jul 8, 3:01 pm, Rob Wolfe [EMAIL PROTECTED] wrote:
samwyse [EMAIL PROTECTED] writes:
P.S. I tried researching this further by myself, but the logging
module doesn't come with source (apparently it's written in C?) and I
don't have the time to find and download the source to my laptop.
Thanks. Maybe it's a DLL boundary issue? I'll look into this too.
On Jul 5, 11:14 pm, Giuseppe Ottaviano [EMAIL PROTECTED] wrote:
In Python, I retrive an Entity from the EntityList:
elist = EntityList()
elist.append(Entity())
elist.append(Entity())
entity = elist.get_at(0)
Noorhan Abbas wrote:
Hello,
I wonder if you don't mind helping me out in this problem. I have been
developing a tool in python that opens some unicode files, reading
them and processing the data. It is working fine. When I started to
write a cgi module that does the same thing for google
I wonder if it's a DLL boundary problem.
On Jul 5, 11:14 pm, Giuseppe Ottaviano [EMAIL PROTECTED] wrote:
In Python, I retrive an Entity from the EntityList:
elist = EntityList()
elist.append(Entity())
elist.append(Entity())
entity = elist.get_at(0)
entity.foo()
But it crashes
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like to know if I am doing anything
particularly wrong or that
On Jul 9, 2:19 am, |e0 [EMAIL PROTECTED] wrote:
So, i can't use wmi module on linux?
On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris [EMAIL PROTECTED] wrote:
I think the win32 module is only for windows.
WMI is a Windows thing. It stands for Windows Management
Instrumentation. So it's not
dp_pearce wrote:
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like to know if I am doing anything
Hi all,
I'm writing some code that monitors a directory for the appearance of
files from a workflow. When those files appear I write a command file
to a device that tells the device how to process the file. The
appearance of the command file triggers the device to grab the
original file. My
Ethan Furman [EMAIL PROTECTED] wrote:
Anybody have an example of when the unary + actually does something?
I've seen it (jokingly) used to implement a prefix increment
operator. I'm not going to repeat the details in case somebody
decides it's serious code.
--
\S -- [EMAIL PROTECTED] --
On Jul 9, 2:24 am, Rajanikanth Jammalamadaka [EMAIL PROTECTED]
wrote:
hi!
Try this:
lis=['t','tes','test','testing']
[elem for elem in lis if re.compile(^te).search(elem)]
['tes', 'test', 'testing']
Cheers,
Raj
On Wed, Jul 9, 2008 at 12:13 AM, Lamonte Harris [EMAIL PROTECTED]
Could it be a boundary problem? The static data is initialised by the
application. The problem arises when the python module tries to access
it.
On Jul 5, 11:14 pm, Giuseppe Ottaviano [EMAIL PROTECTED] wrote:
In Python, I retrive an Entity from the EntityList:
elist = EntityList()
When make gets to the _ctypes section, I am getting the following in
my output:
building '_ctypes' extension
creating build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/
Modules/_ctypes
creating build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/
Modules/_ctypes/libffi
creating
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like to know if I am doing anything
particularly wrong or that
Phillip B Oldham wrote:
I'm wondering whether anyone can offer suggestions on FOSS projects/
apps which exhibit solid OO principles, clean code, good inline
documentation, and sound design principles?
I'm devoting some time to reviewing other people's code to advance my
skills. Its good to
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
This seems a synchronization problem. A scenario description could clear
things up so we can help:
Program W (The workflow) copies file F to directory B
Program D (the dog) polls directory B to find is there's any new file F
In this scenario,
writeson wrote:
Hi all,
I'm writing some code that monitors a directory for the appearance of
files from a workflow. When those files appear I write a command file
to a device that tells the device how to process the file. The
appearance of the command file triggers the device to grab the
Hello,
I wonder if someone can advise me on how to open unicode utf-8 files without
using the codecs library . I am trying to use the codecs.open() from within
Google Appengine but it is not working.
Thank you very much in advance,
Nora
On Jul 9, 12:04 pm, dp_pearce [EMAIL PROTECTED] wrote:
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like
Tim Cook wrote:
On Wed, 2008-07-09 at 03:30 -0700, antar2 wrote:
I am a starter in python and would like to write a program that reads
lines starting with a line that contains a certain word.
For example the program starts reading the program when a line is
encountered that contains 'item 1'
Also available:
pgm-W copies/creates-fills whatever B/dummy
when done, pgm-W renames B/dummy to B/F
pgm-D only scouts for B/F and does it thing when found
Steve
[EMAIL PROTECTED]
Manuel Vazquez Acosta wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
This seems a synchronization
Dan Stromberg wrote:
On Tue, 08 Jul 2008 15:18:23 -0700, [EMAIL PROTECTED] wrote:
I need to mantain a filesystem where I'll keep only the most recently
used (MRU) files; least recently used ones (LRU) have to be removed to
leave space for newer ones. The filesystem in question is a clustered
On Jul 9, 12:04 pm, dp_pearce [EMAIL PROTECTED] wrote:
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like
In article [EMAIL PROTECTED],
Terry Reedy [EMAIL PROTECTED] wrote:
David C. Ullrich wrote:
In article [EMAIL PROTECTED],
Terry Reedy [EMAIL PROTECTED] wrote:
Is there a reason for the inconsistency? I would
have thought in would check for elements of a
sequence, regardless of what
I'm using some legacy code that has a user-defined exception in it.
The top level program includes this line
from TestRunError import *
It also imports several other modules. These other modules do not
explicitly import TestRunError. TestRunError is raised in various
places throughout the
Diez B. Roggisch wrote:
dp_pearce wrote:
count = 0
dmntString =
for z in range(0, Z):
for y in range(0, Y):
for x in range(0, X):
fraction = domainVa[count]
dmntString +=
dmntString += fraction
Minor point, just construct
sturlamolden wrote:
On 7 Jul, 22:35, [EMAIL PROTECTED] wrote:
Hello,
I have recently become interested in using python for scientific
computing, and came across both sage and enthought. I am curious if
anyone can tell me what the differences are between the two, since
there seems to be a lot of
Noorhan Abbas wrote:
Hello,
I wonder if someone can advise me on how to open unicode utf-8 files
without using the codecs library . I am trying to use the codecs.open()
from within Google Appengine but it is not working.
When posting about something 'not working', post at least a line of
On Jul 8, 4:56 pm, Joseph Barillari [EMAIL PROTECTED] wrote:
My question is: did something about the way the special method names are
implemented change for new-style classes?
Just off the top of my head, I'd guess that it's due to classes
already having a default __call__ method, used when
Hey,
it seems that the socket-module behaves differently on unix / windows when a
timeout is set.
Here an example:
# test.py
import socket
sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print 'trying to connect...'
sock.connect(('127.0.0.1',))
print 'connected!'
# executed on
Guys,
Thanks for your replies, they are helpful. I should have included in
my initial question that I don't have as much control over the program
that writes (pgm-W) as I'd like. Otherwise, the write to a different
filename and then rename solution would work great. There's no way to
tell from
Oops - I didn't see my post so I thought something had gone wrong and
reposted. Apologies for the multiple posts.
On Jul 9, 11:57 am, Stodge [EMAIL PROTECTED] wrote:
Could it be a boundary problem? The static data is initialised by the
application. The problem arises when the python module
Hello every body:
Recently the Google boy's announce their last toy: Google App Engine,
a really great idea. Although the GAE site have documentations and
guides, i think it not covers the some of the best practices when we
really build a web site. I mean layers, design patterns, etc.
In the link
given d:
d = [soep, reeds, ook]
I want it to print like
soep, reeds, ook
I've come up with :
print (%s+, %s*(len(d)-1)) % tuple(d)
but this fails for d = []
any (pythonic) options for this?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 8, 11:01 am, Kris Kennaway [EMAIL PROTECTED] wrote:
samwyse wrote:
You might want to look at Plex.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Plex/
Another advantage of Plex is that it compiles all of the regular
expressions into a single DFA. Once that's done, the input
On Wed, Jul 9, 2008 at 3:23 PM, Robert [EMAIL PROTECTED] wrote:
given d:
d = [soep, reeds, ook]
I want it to print like
soep, reeds, ook
use the join() method of strings, like this:
d = [soep, reeds, ook]
', '.join(d)
'soep, reeds, ook'
d = []
', '.join(d)
''
--
Jerry
--
On Jul 9, 8:23 pm, Robert [EMAIL PROTECTED] wrote:
given d:
d = [soep, reeds, ook]
I want it to print like
soep, reeds, ook
I've come up with :
print (%s+, %s*(len(d)-1)) % tuple(d)
but this fails for d = []
any (pythonic) options for this?
print ', '.join(d)
--
Paul Hankin
--
samwyse wrote:
On Jul 8, 4:56 pm, Joseph Barillari [EMAIL PROTECTED] wrote:
My question is: did something about the way the special method names are
implemented change for new-style classes?
I believe the difference is that for new-style classes, when special
methods are called 'behind
I am trying to assign a variable using an if / else statement like so:
If condition1:
Variable = something
If condition2:
Variable = something else
Do stuff with variable.
But the variable assignment doesn't survive outside the if statement. Is
there any better
Ben Keshet wrote:
it didn't help. it reads the pathway as is (see errors for both
tries). It looks like it had the write pathway the first time, but
could not find it because it searched in the path/way instead of in the
path\way. thanks for trying.
The form of slash ('\' vs '/') is
1 - 100 of 192 matches
Mail list logo