"norseman" 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:
Correct
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
t
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 eac
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 o
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
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 o
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 th
Rajanikanth Jammalamadaka a écrit :
(top-post corrected - Please, Rajanikanth, learn to trim"e 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
from
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
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 rea
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 usi
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 ove
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 li
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
user0m0
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 g
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
provide
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 w
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 we
>
> 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.__cal
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 weat
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_fi
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
http://cheeseshop.python.org/pypi/MiniMock>.
You don't need to specify what interface the mock object has. Its Mock
obje
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 fun
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.
>
> http:/
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 fil
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 whi
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 it
Le Wednesday 09 July 2008 12:35:10 mk, vous avez écrit :
> vector move_slice(vector& 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 signature shou
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
|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 pl
|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
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 PROTECT
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 PROTECT
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 part
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
fun
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 user
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
prom
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 p
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'
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 hav
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 im
Maric Michaud wrote:
Le Wednesday 09 July 2008 12:35:10 mk, vous avez écrit :
vector move_slice(vector& 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
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, c
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
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 s
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 m
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
appe
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()
>
>
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 ca
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
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
> p
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 proble
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] -- http
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, Lamon
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 bui
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 ca
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 revie
-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, program
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
origin
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
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'
T
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 pro
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
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
> >>> se
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 modu
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 " "+doma
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 windo
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 the
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 t
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 b
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,
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)
'
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 ', '.jo
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 t
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 w
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 irre
samwyse wrote:
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
On Jul 9, 5:04 pm, dp_pearce <[EMAIL PROTECTED]> 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
> coun
On Jul 9, 10:18 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> 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 comman
Phillip B Oldham <[EMAIL PROTECTED]> writes:
> 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
On 9 juil, 18:04, 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 li
Paul & Robert wrote...
> d = ["soep", "reeds", "ook"]
>print ', '.join(d)
> soep, reeds, ook
I occasionally have a need for printing lists of items too, but in the form:
"Butter, Cheese, Nuts and Bolts". The last separator is the word 'and'
instead of the comma. The clearest I could come up with
On 9 juil, 16:38, Phillip B Oldham <[EMAIL PROTECTED]> 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?
This is somewhat subjective... Some would say that Py
"Support Desk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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 v
1 - 100 of 155 matches
Mail list logo