:
1. posix/other linux sytems (perhaps Macs fit into this anways)
2. Macs
3. Windows
luckily i do have other examples of python 3 programs which
seem to be multiple platform oriented that i can look at and
see what they've done. so i won't be forever lost in the
wilderness
sntshkm...@gmail.com wrote:
>> $ pip install readme_renderer[md]
>
> Thanks a lot for this, I wasn't able to figure it out earlier.
does it work ok now? got the upload to go to pypitest?
ant
--
https://mail.python.org/mailman/listinfo/python-list
>> i just used it earlier today... worked fine for me.
>> is your account there and verified?
>
> Yes, I have an account on TestPyPI and is verified.
try the above...
ant
--
https://mail.python.org/mailman/listinfo/python-list
rsions of
setuptools, wheel and twine
$ pip install --upgrade setuptools
$ pip install --upgrade wheel
$ pip install --upgrade twine
i just used it earlier today... worked fine for me.
is your account there and verified?
ant
--
https://mail.python.org/mailman/listinfo/python-list
ant wrote:
...
> .pypirc
>=
> [distutils]
> index-servers=
> testpypi
>
> [testpypi]
> repository: https://test.pypi.org/legacy/
> username: UserName
> password: Password
>=
>
>
> and my upload command is:
>
>
>=
> #!/bin
cd $NGFP_SRC_HOME
twine upload --repository testpypi dist/*
=
note: it may take a while for what you uploaded to be made
available for download again even if it reflected in your
project page. sometimes it has been as long as a half hour
or more before it comes down. other times it has only been
a few minutes.
hope this helps...
ant
--
https://mail.python.org/mailman/listinfo/python-list
dieter wrote:
...
thank you for your help. :) i finally worked through
the changes needed at last.
my current package in testing PyPI is at:
https://test.pypi.org/project/ngfp/
which uses my code from:
https://salsa.debian.org/ant-guest/gfpoken-in-python
i ended up needing
dieter wrote:
> ant writes:
>> ...
>> in order to get this far below i had to edit each
>> file and put a try: except: around each import
>> statment checking if the module could be found
>> like (as an example):
>>
>> try:
>> import config
e to take
the code and use it however you like:
https://salsa.debian.org/ant-guest/gfpoken-in-python
ant
--
https://mail.python.org/mailman/listinfo/python-list
dieter wrote:
> ant writes:
>> ant wrote:
>> ...
>>> (env) me@ant(26)~/src/test$ ngfp
>>> Traceback (most recent call last):
>>> File "/home/me/src/env/bin/ngfp", line 7, in
>>> from ngfp import main
>>> ImportError:
ant wrote:
> ant wrote:
>
> ...
>
> script was there, but the package was not actually
> installed.
>
> after installing again i get:
>
>=
>
> (env) me@ant(26)~/src/test$ ngfp
> Traceback (most recent call last):
> File "/home/me/src/env/bin
ant wrote:
...
script was there, but the package was not actually
installed.
after installing again i get:
=
(env) me@ant(26)~/src/test$ ngfp
Traceback (most recent call last):
File "/home/me/src/env/bin/ngfp", line 7, in
from ngfp import main
ImportError: cannot i
dieter wrote:
> ant writes:
>> ...
>> yet not quite all the way yet. i run the
>> commands to make the sdist and wheels and upload
>> it using twine to my test account, but when
>> i install it and try to run it the ngfp.py is
>> not found (i'
tra-index-url
https://pypi.org/simple ngfp==0.1.5.post3
thank you and cheers,
ant
--
https://mail.python.org/mailman/listinfo/python-list
On Sep 21, 2:04 pm, Philip Semanchuk wrote:
> On Sep 21, 2010, at 8:29 AM, Ant wrote:
> Don't know about Python 3 on Fedora (I use a Mac), but distrowatch.org
> reports that Fedora has been using Python >= 2.6 since Fedora 11 which was
> released in June of 2009.
Yes
Hi all,
I've just seen this: http://sheddingbikes.com/posts/1285063820.html
Whatever you think of Zed Shaw (author of the Mongrel Ruby server and
relatively recent Python convert), he has a very good point in this. I
run Fedora 12 on my home computers, and find it far too much hassle to
try to ge
I don't know whether this thread is going backwards, forwards or
sideways. But a lot of useful information is creeping out of the
woodwork.
I like the points about backwards compatibility. Presumably that
reason alone is enough to keep Tkinter in the standard library for a
long while.
But the poin
Since I started this thread, I feel a sense of responsibility for it,
in some bizarre way.
Not to prolong its existence, which is clearly a troubling one for
some, but to try to steer it towards some kind of consensus that will
irritate the least number of people. Or better, that will gain some
kin
I rather feel like I'm flogging a dead horse here, but time for
another mile...
First off, I'm not volunteering to lead this effort. I don't think
anyone should
even think about that until and unless the Python Powers That Be
actually
decide that it is worth doing. That is what I meant by 'strong
On Jun 6, 2:22 pm, ant wrote:
> I get the strong feeling that nobody is really happy with the state of
> Python GUIs.
What an interesting set of responses I got!
And - even more interesting - how few of them actually seem to think
there is a problem, let
alone make any attempt to mo
I get the strong feeling that nobody is really happy with the state of
Python GUIs.
Tkinter is not widely liked, but is widely distributed. WxPython and
PyGtk are both
powerful, but quirky in different ways. PyQt is tied to one platform.
And there are
dozens more.
Whether or not we like graphics p
On May 25, 6:35 pm, LittleGrasshopper wrote:
> With so many choices, I was wondering what editor is the one you
> prefer when coding Python, and why. I normally use vi, and just got
I use GVim or vim if on a terminal. There are quite a few plugins and
scripts I find invaluable, but most are not p
On May 20, 6:46 pm, namekuseijin wrote:
> anyway, again, thanks for the laughs.
I'm a Java developer in my day job, and I use Jython for testing out
ideas and prototyping, due to the way Jython makes writing Java so
much easier... Those examples were spot on - things weren't much
simpler before g
On May 14, 3:52 pm, Hyuga wrote:
...
> On the other hand, I just took a peek at the matplotlib example
> gallery, which is very diverse, and it has an example that I think is
> exactly what you're looking
> for:http://matplotlib.sourceforge.net/examples/api/two_scales.html
Superb - spot on. Than
so points can be easily
correlated, but overlayed so that each line has a different scale on
the y-axis. The closest I can get is to have two subplots, one above
the other.
Thanks in advance,
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
not "C:\Python 2.6". I'd
be carefull of changing the default install directory of Python,
particularly if you are "non-techy" as some packages installers may
look for Python in the default location.
--
Ant
--
http://mail.python.org/mailman/listinfo/python-list
a little 1 man company called Zabkat.
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 24, 7:59 am, Sreejith K wrote:
...
> data is the whole file, but 'less' gives only the two lines...
>From this statement (that you are using less), it appears that you are
redirecting sys.stdout to a file or similar - if that is the case, you
may need to flush or close the output file befo
On Jan 15, 6:43 am, "James Mills"
wrote:
...
> That is a good idea :) Windows teaches you nothing!
Not true. Windows teaches you the art of the workaround...
--
http://mail.python.org/mailman/listinfo/python-list
A 0-width positive lookahead is probably what you want here:
>>> s = """
... hdhd http://mysite.com/blah.html";>Test String OK
...
... """
>>> p = r'href="(http://mysite.com/[^"]+)">(.*)(?=)'
>>> m = re.search(p, s)
>>> m.group(1)
'http://mysite.com/blah.html'
>>> m.group(2)
'Test String OK'
The
On Jan 8, 9:06 pm, "Tim Arnold" wrote:
> Is there any lib or recipe(s) for doing something like this via python?
Look into the PyWin32 extension module. It gives access to Windows
internals including the COM interface. You'll need to do some research
into how to automate the GUI you're using from
You could look at something like the following to turn the class
iteslf into a decorator (changed lines *-ed):
> class TaggedWrapper():
>
* def __init__(self, logMixin, stream):
> self.__tag = '%...@%s' % (logMixin.describe(), stream)
> logMixin._debug('Created %s' % self)
>
>
On Jan 5, 9:47 am, "Jack.Chu" wrote:
> Hello guys:
> I created a simple tool to count how I wasted my time day by day
> ;-)http://www.flickr.com/photos/34017...@n07/3169438647/sizes/o/
Looks interesting - did you have some sort of time machine to be
spending that much time in Chrome at the end o
On Nov 29, 8:44 pm, Josh <[EMAIL PROTECTED]> wrote:
> If you were a beginning programmer and willing to make an investment in
> steep learning curve for best returns down the road, which would you pick?
Personally I'd choose Vim for the following reasons:
1) Vim is ubiquitous on Linux/Unix server
On Oct 22, 10:03 am, "wooly booly" <[EMAIL PROTECTED]> wrote:
> I would like to execute a Python script from Windows command line:
>
> Python myscript.py
>
> This works if myscript.py resides in the current folder. My question is:
> Is it possible to execute the command above from another folder?
>
CT, you will have to use Cygwin Python with screen.
Thanks for the info. Shame but - cygwin python for this setup it is
(Though I may hunt for a native windows port of screen rather than the
cygwin one.)
Cheers,
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone
know if this is a known issue with screen/Python, or if there is a
workaround, as I'd prefer to have just a single Python instance
installed rather than having Cygwin python and windows Python both
installed.
Cheers,
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
some respect for majority's rules.
> This is childish.
Do some research before flaming on a subject on which you only have
one side of the story.
--
Ant
--
http://mail.python.org/mailman/listinfo/python-list
will provide a base for extending the list format.
Thanks,
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
;parser.py", line 50, in ?
print comb.parseString(text + text2)
.
. [Stacktrace snipped]
.
raise exc
pyparsing.ParseException: Expected start of line (at char 81), (line:9,
col:1)
Any help appreciated!
Cheers,
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 21, 12:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> http://xkcd.com/413/
>
> :)
Didn't realise you'd posted this when I posted my "Batteries
Included..." post. Amused me as well!
--
http://mail.python.org/mailman/listinfo/python-list
Today's XKCD comic has a nice Python reference!
http://xkcd.com/413/
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 3, 2:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
...
> It's even prettier in 2.5:
>
> any(word in name for word in words)
>
> George
And arguably the most readable yet!
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote:
> What's the neatest and/or most efficient way of testing if one of a
A different approach:
>>> words = ["he", "sh", "bla"]
>>> name = "blah"
>>> True in (word in name for word in words)
True
>>> name = "bling"
>>> True in (word in name for word in wo
On Mar 31, 5:40 pm, Rui Maciel <[EMAIL PROTECTED]> wrote:
...
> So far the decision seems to be a no brainer. Yet, Python 3000 will arrive
> in a few months. As it isn't backwards compatible with today's Python,
> there is the risk that no matter what I learn until then, I will end up
> having to r
he possibility of more Python jobs
out there for us all in the future given the ubiquity of the JVM in
the enterprise and willingness of corporations to accept such
endorsements!
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
In the spirit of "Simple is better than complex." and totally
bypassing the intention of quines (though not necessarily the
definition):
--- probably_not_a_real_quine.py
import sys
for line in open(sys.argv[0]):
print line,
--
;-)
--
Ant
a troll - so many people who would actually be
able to assist you (such as the PIL, pygame and numpy/scipy
communities) may have ignored this thread.
Cheers,
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
are doing. Of course this could also be achieved by
doing pairs.sort() and pairs.reverse() before iterating over the pairs
list.
Cheers,
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
The Jython team got an honourable mention on the Headius blog this
morning. Apparently they have got Django working with the latest
builds of Jython: http://headius.blogspot.com/2008/01/jythons-back-baby.html
So congratulations!
--
Ant.
--
http://mail.python.org/mailman/listinfo/python
On Jan 2, 7:07 pm, Rob Williscroft <[EMAIL PROTECTED]> wrote:
> Ant wrote in news:34a84caa-5387-40a2-a808-
> > 1) Is there a module out there for extracting files from an ISO?
>
> There are command line programs that can do this:
>
> http://cdrecord.berlios.de/old/priv
e out there for extracting files from an ISO?
2) Is there a module out there for extracting icons from a Windows
exe?
Cheers,
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
time insertion anywhere in the list.
>
> It's on the shelf between the jar of phlogiston and the perpetual
> motion machine.
lol!
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
Python on xkcd:
http://xkcd.com/353/
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
, pythonw
runs the script as a background process. I'd imagine that it is the
same for the Mac, and I shouldn't think it has anything to do with
your problem here.
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 30, 9:10 am, SMALLp <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm new in wxPython and before i start doing anything I have one qustion.
>
> Shoul I use some of editors like boa, spe or shoud i use my favorite
> text editor!
>
> i used IDLE on windows and it seamd nice. Now i have linux install
duce() is going away, not just
> from the built-ins but (I believe) from the standard library as well.
I thought that at the last count it was merely being moved out into
functools (or somewhere similar).
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 23, 9:31 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Fri, 23 Nov 2007 00:50:30 -0800, Ant wrote:
> > So my point really is that foldr (perhaps renamed to make_reducer or
> > something) could create idioms that are more readable than using
&g
On Nov 23, 4:09 am, "kyo guan" <[EMAIL PROTECTED]> wrote:
...
> >>> '120.exe'.rstrip('.exe')
Another approach since you seem to be working with filenames is using
the os.path module:
>>> import os.path as path
>>> s = "test.torrent"
>>> t = "test.exe"
>>> u = "test"
>>> path.splitext(s)[0]
'test'
On Nov 22, 7:14 pm, oj <[EMAIL PROTECTED]> wrote:
> On Nov 22, 3:02 pm, Ant <[EMAIL PROTECTED]> wrote:
...
> It's basically just one line to implement:
>
> foldr = lambda f, i: lambda s: reduce(f, s, i)
>
> It's just reduce with currying, I'm not su
maSeparate = foldr(lambda x, y: "%s%s%s" % (x, "," if x else "",
y), "")
commaSeparate(myList)
Of course the lambda function in this case could be a named function,
helping with both readability and reuse, but I think the latter is
conceptually easier to grasp when reading the code.
Discuss.
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
ht that pygame would satisfy the
graphical side of things.
--
Ant
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 6, 9:59 am, Shriphani <[EMAIL PROTECTED]> wrote:
...
> My main intention is to state that each of the variables namely a, b,
> c, ## can take value from 1 to 9.
> How do I go about this ?
It sounds like you are after something like:
for var in (a, b, c, d, e, f):
assert var in [1, 2, 3,
On Nov 1, 1:23 pm, Ant <[EMAIL PROTECTED]> wrote:
> On Nov 1, 11:37 am, Ze'ev <[EMAIL PROTECTED]> wrote:
> ...
>
> > ...> Jython is currently significantly slower than Python.
>
> > ...
> > Not according to this
> > :http://blogs.
parallel processing and mathematical processing that seems
faster in Jython. It's be interesting to see a proper comparison of
how different types of program run.
The VM startup overhead is much slower mind, but then that's only an
issue for very small programs.
Cheers,
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 1, 9:12 am, Anand <[EMAIL PROTECTED]> wrote:
...
> This code works for dictionaries of any nested level.
At least up to the max recursion depth.
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
ional tests etc. Take a
look at
http://antroy.blogspot.com/2007/04/swing-testing-with-jython-and-jemmy.html
for an example of how I have successfully used Jython for Swing
testing. More information can be found on
http://www.jython.org/Project/index.html
Cheers,
--
Ant.
--
http://mail.pyt
On Oct 22, 1:26 pm, Py-Fun <[EMAIL PROTECTED]> wrote:
> I'm stuck trying to write a function that generates a factorial of a
> number using iteration and not recursion. Any simple ideas would be
> appreciated.
The following simple adder functions should give you an idea of how
recursion can be re
a = a+1
elif a < b:
b = b-1
if b > a: a = a-1
# end if
else:
print 'oops!'
# end if
# end def foobar
The help in the script looks pretty good.
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 22, 10:44 am, Paul Brauner <[EMAIL PROTECTED]> wrote:
> Hi, I'm working on a project that outputs several languages including
> (hopefully) python. My problem is that the generic backend architecture
> has not been designed to output correctly indented code, and that would
> be helpful if th
3k a) when frameworks/modules that
they use are available and b) if and when doing so would be
advantageous.
I suspect that many of the projects I have that are solid and are in
no imminent need of development will remain <3k for several years.
Cheers,
--
Ant
--
http://mail.python.org/mai
def get_value():
for i in range(10):
for j in range(10):
print i, j
if j == 6:
return fn(i, j)
I guess to an extent it would depend on the exact situation as to
which of these is more suitable. Are there any other recommended
solutions to this?
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 21, 4:47 am, "W. Watson" <[EMAIL PROTECTED]> wrote:
> How about in the case of MS Win?
Both emacs and vim have GUI versions that run on Windows.
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
oad and reinstall 2.2,
uninstall 2.2 and 2.5 via Add/Remove Programs and then reinstall 2.5
again.
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
t_function pairs in a dictionary, and reuse this whole block of
code for arbitrary keywords with arbitrary rules.
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
g
>From the command prompt:
C:\0>test.py action key=value key=value
action
key=value
key=value
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-list
Python, the Python implementation for
the .Net platform.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 21, 10:47 am, Bjoern Schliessmann wrote:
> Ant wrote:
...
> | print os.path.split(sys.argv[0])[0]
>
> $ cd tmp
> ~/tmp$ ../test.py
> ..
> ~/tmp$
>
> That's rather not what's intended. I'd try os.path.abspath(__file__)
> instead.
Fair point.
On Aug 21, 10:29 am, [EMAIL PROTECTED] wrote:
> On 21 Aug, 11:27, Ant <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Aug 21, 10:10 am, [EMAIL PROTECTED] wrote:
> > ...
>
> > > myLocation = GetMyLocation()
> > > print myLocation
>
> > > >
try something like: os.path.abspath(os.curdir)
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
f Python:
def counter(std_rate, over_rate, limit):
stops = 0
while True:
stops += 1
wage = stops * std_rate + max(0, stops - limit) * (over_rate -
std_rate)
yield stops, wage
truck = counter(0.4, 1.4, 22)
for i in range(30):
print "Stopped %s times, with ac
urllib2 and cookielib in the standard library should do most
of what you want, perhaps with the addition of beautiful soup if you
need to scrape the pages for data: http://www.crummy.com/software/BeautifulSoup/
HTH.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
ments (any compund statements in fact such as for loops etc)
*must* start on a new line (with indentation as necessary):
http://docs.python.org/ref/compound.html
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
lly you would use map to get a new list object. In this case the
new list returned by map is just a list of None's (since append
returns None - a common idiom for functions that operate by side
effect), and so is not used directly.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
nguage designers made the collections API
non-thread safe by default (you have to wrap the standard collections
in a synchronised wrapper to make them thread safe).
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 10, 11:47 am, [EMAIL PROTECTED] wrote:
> On 10 kol, 11:02, Ant <[EMAIL PROTECTED]> wrote:
...
> yes,Python 2.5 is on the path, but how can I remove panda3d from that
> path?
Hit Win - Break to bring up the System Properties dialog (you can also
get here through the Control
gt;
> Diez
import turtle
Its part of the standard Library! I don't know the answer to the OP's
question mind you, I'd played around a little with it a while ago, but
nothing more.
Python: Batteries and Turtles included!
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
rds,
> Vedran
Sounds like your path needs setting up properly. Try typing echo %PATH
% into your console window to find out if Python2.5 is in the path. If
you are using the default setup, then c:\Python25 should be on the
path.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
:
if count == 10:
Or probably even:
if count == 9:
Since the 1 billionth line will have index 9.
Cheers,
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
ikely to be that you are using m.group(1) with your match object
instead of m.group(0) - the former gets the first group (i.e.
everything between the first set of parens - in your case the wmv|3gp
expression), whereas the latter will return the entire match.
Post your actual code, not just the
On Aug 5, 12:31 pm, Campbell Barton <[EMAIL PROTECTED]> wrote:
...
> * ubuntu have some of their install tools in python.
Gentoo Linux's "Portage" package management tool is written in Python.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
her
Comp Sci graduate just after a wage), and secondly that I have
experience in good development practice (the open source projects I
worked on had better infrastructure in place than two of the three
companies I've worked for since!)
--
Ant...
http://antroy.blogspot.com/
--
http://mail.p
ywin32/):
import win32clipboard, win32con, random
text = "Some text to stick on the clipboard"
win32clipboard.OpenClipboard()
win32clipboard.SetClipboardData(win32con.CF_TEXT, text)
win32clipboard.CloseClipboard()
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
n most OOP languages "static
> classes", can you give me a hint ?
Hope the above was what you are looking for.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
n, use the jdbc driver from www.mysql.com,
and you an then use JDBC from within Jython. You'll just need to add
the mysql jdbc jar to your classpath.
HTH.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
newThreadObject)
self.ch=self.ch+1
class CServerThread(threading.Thread):
def __init__(self, network):
self.network = network
def run(self):
while (1):
self.clientSocket, self.clientAddress =
self.network.accept()
...
HTH.
--
Ant...
http:
ed with the class - for conceptual reasons
rather than practical ones, and are rarely used as far as I can tell.
I've certainly never bothered with them.
In the case of your statAdd above, self is never used in the method
body, and so this is a clear indication that a module level fun
On May 16, 3:07 pm, Gerard Flanagan <[EMAIL PROTECTED]> wrote:
...
> import os
>
> def iter_dirs(root, dirs=False):
...
Rather than rolling your own directory walker:
The same iterator using os.walk:
def iter_dirs(root, dirs=False):
for root, directories, files in os.walk(root):
if d
ing list
comprehension.:
1 > v = ['123', '345', '', '0.3']
2 > v = [x if x else '3' for x in v]
3 > v
3 = ['123', '345', '3', '0.3']
Note that this replaces the list, so won't be appropriate for
modifying a list passed in from elsewhere.
--
Ant...
http://antroy.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
On May 15, 9:17 am, Ant <[EMAIL PROTECTED]> wrote:
...
> I can't remember what it is I use - I haven't got access to my server
> at the moment... But look in the cheese shop - I'm fairly sure it was
> from there. I'll post details if I remember. Alternatively
1 - 100 of 302 matches
Mail list logo