Thanks,
I'm not too keen on the ini layout. But it's good to know it's there.
On Wed, 23 Feb 2005 14:50:27 +1300, Tony Meyer <[EMAIL PROTECTED]> wrote:
> > How are the expert pythoneers dealing with config files?
> [...]
>
> You can just "import ConfigParser", or look at the various alternative
On Wed, 23 Feb 2005 20:15:47 +, Phil Jackson
<[EMAIL PROTECTED]> wrote:
> Tom Willis <[EMAIL PROTECTED]> writes:
>
> > How are the expert pythoneers dealing with config files?
>
> You could use the cPickle module if you don't mind your config files
> bei
On 24 Feb 2005 02:06:24 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote:
> I'm looking for people to work on a couple of projects... online
> bookmarks manager for example
>
> Regards,
>
> Fuzzy
> http://www.voidspace.org.uk/python/index.shtml
>
> --
> http://mail.python.org/mailman/listinfo/pytho
On Thu, 24 Feb 2005 11:15:07 -0800, Scott David Daniels
<[EMAIL PROTECTED]> wrote:
>
> I have started doing the following to watch for exceptions in wxPython.
> I'd like any input about (A) the interface, and (B) the frame before I
> throw it in the recipes book.
>
> import wx, os, sys
>
On Thu, 24 Feb 2005 15:00:46 -0700, Steven Bethard
<[EMAIL PROTECTED]> wrote:
> Tom Willis wrote:
> > Question on decorators in general. Can you parameterize those?
> >
> > If I wanted to something and after the function call for example, I
> > would expe
On Thu, 24 Feb 2005 15:20:30 -0700, Steven Bethard
<[EMAIL PROTECTED]> wrote:
> Tom Willis wrote:
> >>> Question on decorators in general. Can you parameterize those?
> >
> > Wow thanks for the explanation!! Some of it is a bit mind bending to
> > me at the m
On Fri, 25 Feb 2005 15:02:04 -0700, Dave Brueck
<[EMAIL PROTECTED]> wrote:
> Jorgen Grahn wrote:
> > On Tue, 22 Feb 2005 20:38:28 -0500, Tom Willis <[EMAIL PROTECTED]> wrote:
> >
> >>How are the expert pythoneers dealing with config files?
> >
> &
button, 0, 1, 3, 4)
button = gtk.Button(label="Quit", stock=gtk.STOCK_QUIT)
button.connect("clicked", self.delete_event)
table.attach(button, 1, 2, 3, 4)
self.window.show_all()
def main():
gtk.main()
return 0
if __name__ == "__main__":
AddressSearch()
main()
---end---
Cheers,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
I'm trying to get pylint running on windows and the bat file for it
seems a little screwy. I'm hoping someone may have figured this out
already.
rem = """-*-Python-*- script
@echo off
rem DOS section
rem You could set PYTHONPATH or TK environment variables
On Tue, 01 Mar 2005 10:12:29 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
> Tom Willis wrote:
> > I'm trying to get pylint running on windows and the bat file for it
> > seems a little screwy. I'm hoping someone may have figured this out
> > already.
>
10 Mar 2005 06:02:22 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I've been trying to come up with an elegant solution to this problem,
> but can't seem to think of anything better than my solution below.
>
> I have a Python program that needs to be converted into an executa
On Thu, 10 Mar 2005 13:01:28 -0500, Steve Holden <[EMAIL PROTECTED]> wrote:
> Larry Bates wrote:
> > Note: my comments assume Windows distribution.
> >
> > Why do you think you can't you have a config file after you convert
> > your program to an executable? I do it all the time and so do many
>
ConfigParser works on linux I'm pretty sure. I just ran Ipython
imported it and loaded a config file.
I don't remember anything in the docs that said otherwise.
I would prefer an xml style config file myself. But I can get by with
and ini right now. The logging framework seems to me to be the
h
On Fri, 11 Mar 2005 23:32:48 +0100, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hello NG,
>
>I am still quite a newbie with Python (I intensely use wxPython, anyway).
> I would like to know what are, in your opinions, the best/faster databases
> that I could use in Python (and, of course, I
On 15 Mar 2005 23:54:16 -0800, Mike Wimpe <[EMAIL PROTECTED]> wrote:
> Other than being used to wrap Java classes, what other real use is
> there for Jython being that Python has many other GUI toolkits
> available? Also, these toolkits like Tkinter are so much better for
> client usage (and faster
On 18 Mar 2005 07:22:05 -0800, scattered <[EMAIL PROTECTED]> wrote:
>
> Tim Roberts wrote:
> > "Mike Cox" <[EMAIL PROTECTED]> wrote:
> > >
> > >As you may or may not know, Microsoft is discontinuing Visual Basic
> in favor
> > >of VB.NET and that means I need to find a new easy programming
> langu
On Fri, 18 Mar 2005 15:45:10 -0500, Tom Willis <[EMAIL PROTECTED]> wrote:
> On Fri, 18 Mar 2005 20:20:19 +, Steve Horsley <[EMAIL PROTECTED]> wrote:
> > scattered wrote:
> >
> > > You are right that VBA isn't being discontinued yet. My own inter
On Fri, 18 Mar 2005 20:20:19 +, Steve Horsley <[EMAIL PROTECTED]> wrote:
> scattered wrote:
>
> > You are right that VBA isn't being discontinued yet. My own interest in
> > learning python is to find a replacement for Excel VBA. I'm a
> > mathematician who likes to throw quick programs togeth
I used the instructions in the PyGTK FAQ and managed to get it working.
Take a look at:
http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq21.005.htp
Cheers,
Rakis
Viktor wrote:
> Did anybody managed to "pack", a program that uses pygtk with pyexe?
>
> The best result I got was:
ll subsequent builds have
been as simple as running that one python command and copying my custom GTK
directory into the dist directory.
Without being at my desk, that's the best I explanation I can give. If
Monday rolls around and you still don't have it working, send an e-mail to
my work
e(iconShieldImage, (10,10), iconShieldImage)
^^^
transparency as 3rd parameter
TTFN
Tom.
--
http://mail.python.org/mailman/listinfo/python-list
ictionary.
vidiodict =
{'Title':{'description':'','date':'','cast':'','length':'130.99','comments':''}}
that way you could look at vidiodict['Title']['length'] it returns '130.99'.
Tom
--
http://mail.python.org/mailman/listinfo/python-list
7;re cheap and in
my brief experience have been pretty good at responding to support
issues. They gave me a big 'no' to subversion though. (tip: if you use
these guys, be sure to tell them you want the server with the latest
Python goodies *before* you sign up!)
Thanks,
Tom.
--
Esmail Bonakdarian wrote:
Hi,
Is there a way to display how long a Win XP system has been up?
Somewhat analogous to the *nix uptime command.
Thanks,
Esmail
I believe that "uptime" works from the console, but don't have a machine
to check it with...
--
http://mail.python.org/mailman/listinfo/python
for i in InvalidStrings:
self.assertRaises(DB.InvalidConnectString,
DB.DB,",".join(i))
My problem is, this passes one string containing
"'pg','test','localhost','5432','test','test'" rather than each one of those as
variables.
Any help appreciated.
Thanks, Tom
--
http://mail.python.org/mailman/listinfo/python-list
st, a valid syntax would be (except that this
unittest would fail, as this is a "good" connection:
self.assertRaises(DB.InvalidConnectString,
DB.DB,'pg','test','localhost',5432,'test','test')
Thanks, Tom
-Original Message-
From
Great, works a treat. Thanks
-Original Message-
From: Jim Sizelove [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 15, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: Re: Dynamically passing variables to unittest
Tom Haddon wrote:
> Hi Peter,
>
> Yeah, you're r
file to a
managable size for network transfer.
Tom
Viktor wrote:
> I succeeded :)))
>
> And the winner is:
>
>
>
> from distutils.core import setup
> import py2exe
>
> opts = {
> "
e programs for use within only.
Thanks,
Tom
:.
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any
Has anyone used BlackAdder IDE for any project small or big? Whats your opinion?
Thanks,
Tom
:.
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not
oop with an accumulator, this style should be preferred,
> perhaps with us providing a simple helper function to abstract away
> the boilerplate code. At any rate, FOLD must fold.
Couldn't you leave it in for just another month? And during the
remaining month, we'll just call
Hi,
In my attempted learning of python, I've decided to recode an old
anagram solving program I made in C++. The C++ version runs in less
than a second, while the python takes 30 seconds. I'm not willing to
think it's just python being slow, so I was hoping someone could find
a faster way of doing
hit CTRL-D. I expected that 'doSomethingWith(line)' would execute
after every line I input into the program, just like what used to happen
with:
while True:
line = sys.stdin.readline()
if line == '': break
doSomethingWith(line)
What is the difference?
Th
Jeff Epler wrote:
> The iterator for files is a little bit like this generator function:
>
Cool thanks for that, it looks like iter(f.readline, '') is the best
solution for the job.
Tom
--
http://mail.python.org/mailman/listinfo/python-list
Joe Spammer wrote:
bah! I thought maybe they found a huge forest of rosewood trees in Brazil.
Tom (disappointed) Reese
--
http://mail.python.org/mailman/listinfo/python-list
You may also be interested in the biopython project:
http://www.biopython.org/
tom
--
http://mail.python.org/mailman/listinfo/python-list
You only need to call PyEval_InitThreads() for multithreaded C-code. The
Python threads operate on a different principle.
Tom
Ricardo wrote:
> If I embed Python in a C app and the Python code is threaded, but the C
> code isn't, do I need to call PyEval_InitThreads() ? - or do yo
My current Python project involves lots repeatating code blocks,
mainly centred around a binary string of data. It's a genetic
algorithm in which there are lots of strings (the chromosomes) which
get mixed, mutated and compared a lot.
Given Python's great list processing abilities and the relative
Thank you all very much for your responses. It's especially reassuring
to hear about other Python GA's as I have had some scepticism about
Python's speed (or lack of it) being too big a problem for such an
application.
With regard to using numeric, arrays or integer lists -- I didn't
mention that
;20>
ncalls tottime percall cumtime percall
filename:lineno(function)
582926.423 0.005-155.269 -0.027 :0(parse)
...
This is with Python 2.4 on Linux. Is it a bug, or what
does it mean?
Thanks!
Tom
--
http://mail.python.org/mailman/listinfo/python-list
From looking at your example, it looks like you're making the problem FAR
more difficult than it needs to be. The main thing to keep in mind is that
Python threads do not correspond to operating system threads. In an
application using a single OS-level thread, you can use as many Python
threads a
I have two numpy arrays, xx and yy -
(Pdb) xx
array([0.7820524520874, masked, masked, 0.3700476837158,
0.7252384185791, 0.6002384185791, 0.6908474121094,
0.7878760223389, 0.6512288818359, 0.1110143051147,
masked, 0.716205039978, 0.546038
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if dateutil.parser.parse
should be able to handle about any format, but what I get is:
datetimestr = '2012-10-22 11:22:33'
print(dateutil.parser.parse(datetimestr))
result: date
On 02/13/2016 07:13 PM, Gary Herron wrote:
On 02/13/2016 09:58 AM, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if
dateutil.parser.parse should be able to handle about any format, but
what I get is
On 02/13/2016 09:45 PM, Gary Herron wrote:
On 02/13/2016 12:27 PM, Tom P wrote:
On 02/13/2016 07:13 PM, Gary Herron wrote:
On 02/13/2016 09:58 AM, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if
On 02/13/2016 10:01 PM, Mark Lawrence wrote:
On 13/02/2016 17:58, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if dateutil.parser.parse
should be able to handle about any format, but what I get is
On 02/29/2016 01:53 PM, tomwilliamson...@gmail.com wrote:
Thanks. If a word appears more than once how would I bring back both locations?
for i, str in enumerate(l): . . . .
--
https://mail.python.org/mailman/listinfo/python-list
arting Basic--
--Basic Complete--
--Starting With Thread--
Exception ignored in:
Traceback (most recent call last):
File "C:\Python34-32\Lib\threading.py", line 1289, in _shutdown
assert tlock.locked()
AssertionError:
--With Thread Complete--
--output--
The order of the
On 28.04.2014 15:04, mboyd02...@gmail.com wrote:
I have a numpy array consisting of 1s and zeros for representing binary numbers:
e.g.
>>> binary
array([ 1., 0., 1., 0.])
I wish the array to be in the form 1010, so it can be manipulated.
I do not want to use built in binary con
hook
# zipimport: found 65452 names in pyspark.jar
Is this a known limitation or is this perhaps fixed in newer version or is
there a work around?
Note, I'm not subscribed to the mailing list so please copy me in response if
possible.
Thanks,
Tom
--
https://mail.python.org/mailman/listinfo/python-list
On 10.09.2013 11:45, Oscar Benjamin wrote:
On 10 September 2013 01:06, Steven D'Aprano
wrote:
On Mon, 09 Sep 2013 12:19:11 +, Fattburger wrote:
But really, we've learned *nothing* from the viruses of the 1990s.
Remember when we used to talk about how crazy it was to download code
from untr
I can't get conditional breakpoints to work. I have a variable ID and I
want to set a breakpoint which runs until ID==11005.
Here's what happens -
-> import sys
...
(Pdb) b 53, ID==11005
Breakpoint 1 at /home/tom/Desktop/BEST Tmax/MYSTUFF/sqlanalyze3.py:53
(Pdb) b
Num Type
On 06.11.2013 16:14, Tom P wrote:
ok I figured it. ID is a tuple, not a simple variable.
The correct test is ID[0]==11005
I can't get conditional breakpoints to work. I have a variable ID and I
want to set a breakpoint which runs until ID==11005.
Here's what happens -
On 04/21/2015 12:57 PM, pm05...@gmail.com wrote:
Hello everyone,
I am willing to learn Python from scratch.Please he me to learn.Although I hv
knowledge of c and object oriented programming.
Apart from the various tutorials you might want to look at the on-line
courses offered by Coursera a
aa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc'
nc = netCDF4.Dataset(url)
I get the error -
netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__
(netCDF4/_netCDF4.c:9551)()
RuntimeError: NetCDF: file not found
However if I download the same file, it works -
url = '/hom
On 08/13/2015 05:55 PM, Jason Swails wrote:
On Thu, Aug 13, 2015 at 6:32 AM, Tom P mailto:werot...@freent.dd>> wrote:
I'm having a problem trying to access OpenDAP files using netCDF4.
The netCDF4 is installed from the Anaconda package. According to
their changelog,
On 08/14/2015 03:15 PM, Jason Swails wrote:
On Aug 14, 2015, at 3:18 AM, Tom P wrote:
Thanks for the reply but that is not what the documentation says.
http://unidata.github.io/netcdf4-python/#section8
"Remote OPeNDAP-hosted datasets can be accessed for reading over http if a UR
I do have a fresh successful install of Visual Studio 2015 Redistributables
installed.
Then I reinstalled Python 3.5 and still now joy.
What am I missing?
Tom
Tom Barnett
Senior Systems Administrator
Prime, inc.
2740 N. Mayfair
Springfield, MO 65803
Ph. 417.866.0001 Fax 417.521.6863
Hi Sharon,
> Sharon MOrine wrote:
> I am new to programming and the website is confusing and my eyesight
isn't that great.
Welcome to Python!
Announcement mailing lists, like this one, are typically used by python
package maintainers to publicize the availability of new versions of their
softwa
On 10/24/2015 10:05 PM, Poul Riis wrote:
I have N points in 3D, organized in a list. I want to to point out the numbers
of the two that have the smallest distance.
With scipy.spatial.distance.pdist I can make a list of all the distances, and I
can point out the number of the minimum value of th
On 30.09.2014 13:50, Jean-Michel Pichavant wrote:
Hello list,
I'm currently writing a presentation to help my co-workers ramp up on new
features of our tool (written in python (2.7)).
I have some difficulties presenting code in an efficient way (with some basic syntax
highlights). I need to b
nd out the maxlen
str in list, and use its length as the standard size to format the list.
Ok, maybe i ignore something, so please give me some hints.
---
thanks
tom--
http://mail.python.org/mailman/listinfo/python-list
___
发件人: Ian Kelly
收件人: Tom Zhou
抄送: "python-list@python.org"
发送日期: 2011年12月19日, 星期一, 下午 7:35
主题: Re: Columnize in module "cmd"
On Mon, Dec 19, 2011 at 7:53 PM, Tom Zhou wrote:
> Hi~ alls
> recently, i focus on the module "cmd", and find some conf
On Dec 21, 2011, at 2:15 AM, Chris Withers wrote:
> Hi All,
>
> What's the general consensus on supporting Python 2.5 nowadays?
>
> Do people still have to use this in commercial environments or is everyone on
> 2.6+ nowadays?
For those of us living the nightmare of AppEngine *and* working
On 03/18/2013 10:17 PM, Peng Yu wrote:
Hi,
I don't quite understand how -m option is used. And it is difficult to
search for -m in google. Could anybody provide me with an example on
how to use this option? Thanks!
-m module-name
Searches sys.path for the named module and
First, here's a sample test program:
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class MyRequestHandler(BaseHTTPRequestHandler, object):
def do_GET(self):
top_self = super(MyRequestHandler, self) # try to access
MyWebServer instance
self.send_re
On 04/05/2013 02:27 PM, Dylan Evans wrote:
On 05/04/2013 9:09 PM, "Tom P" wrote:
First, here's a sample test program:
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class MyRequestHandler(BaseHTTPRequestHandler, object):
def do_GET(self):
On 04/05/2013 01:54 PM, Dave Angel wrote:
On 04/05/2013 07:02 AM, Tom P wrote:
First, here's a sample test program:
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class MyRequestHandler(BaseHTTPRequestHandler, object):
def do_GET(self):
top_self =
On 04/05/2013 01:54 PM, Dave Angel wrote:
On 04/05/2013 07:02 AM, Tom P wrote:
First, here's a sample test program:
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class MyRequestHandler(BaseHTTPRequestHandler, object):
def do_GET(self):
top_self =
On 04/05/2013 02:27 PM, Dylan Evans wrote:
On 05/04/2013 9:09 PM, "Tom P" wrote:
First, here's a sample test program:
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class MyRequestHandler(BaseHTTPRequestHandler, object):
def do_GET(self):
On 04/05/2013 01:02 PM, Tom P wrote:
ok, after much experimenting it looks like the solution is as follows:
class MyWebServer(object):
def __init__(self):
# self.foo = "foo" delete these from self
# self.bar = "bar"
myServer = HTTPServer
Hi,
a few weeks back I posed a question about passing static data to a
request server, and thanks to some useful suggestions, got it working. I
see yesterday there is a suggestion to use a framework like Tornado
rather than base classes. However I can't figure achieve the same effect
using To
On Sun, 11 Dec 2005, Steven D'Aprano wrote:
On Sat, 10 Dec 2005 16:34:13 +0000, Tom Anderson wrote:
On Sat, 10 Dec 2005, Sybren Stuvel wrote:
Zeljko Vrba enlightened us with:
Find me an editor which has folds like in VIM, regexp search/replace
within two keystrokes (ESC,:), mar
xpressions can hang around as expressions for a while,
or even not be evaluated all in one go. Laziness is really a property of
the implementation, not the the language - in an idealised pure functional
language, i believe that a program can't actually tell whether the
implementation is
which would
suggest that this sort of implementation is common. Indeed, i see no
reason why it wouldn't be - i think the push-a-handler style seen in C/C++
implementations is only necessary because of the platform ABI, which
doesn't usually mandate a standard layout for per-function metadata
eativity, but overindulgence
makes you use perl).
In fact, we can tame the regular expressions quite neatly by writing a
function which generates them:
def regularly_express_patterns(patterns):
pattern_regexps = map(
lambda pattern: "(?:%s)" % re.escape(pattern)
On Mon, 12 Dec 2005, Cameron Laird wrote:
> While there is indeed much to love about Lisp, please be aware
> that meaningful AI work has already been done in Python
Wait - meaningful AI work has been done?
;)
tom
--
limited to concepts that are meta, generic, abstract and philoso
ss power, as LISP does.
> using Python is not programming, it IS a fun!
+1 QOTW.
> I'll be here!!!
Good to hear it - welcome!
tom
--
limited to concepts that are meta, generic, abstract and philosophical --
IEEE SUO WG
--
http://mail.python.org/mailman/listinfo/python-list
comp.protocols.tcp-ip a while ago:
http://groups.google.co.uk/group/comp.protocols.tcp-ip/browse_thread/thread/39f810b43a6008e6/72ca111d67768b83
And didn't get much in the way of answers. Someone did point to this,
though:
http://www.internet2.edu/~shalunov/writing/protocol-design.htm
On Mon, 12 Dec 2005, Bengt Richter wrote:
On Mon, 12 Dec 2005 01:12:26 +, Tom Anderson <[EMAIL PROTECTED]> wrote:
--
ø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤ø
[OT} (just taking liberties with yo
On Mon, 12 Dec 2005, Donn Cave wrote:
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Alex Martelli) wrote:
>
>> Tom Anderson <[EMAIL PROTECTED]> wrote:
>>...
>>
>>
>>> For example, if i wrote code like this (using python syntax)
ct' convention is incorrect, unneccessary,
confusing and silly.
I'm sure this has been argued over many times here, and we still
all have our different ideas, so please just ignore this post!
tom
--
So the moon is approximately 24 toasters from Scunthorpe.
--
http://mail.python.org/mailman/listinfo/python-list
w sham - he's only keeping up the
pretense for the children.
;)
tom
--
So the moon is approximately 24 toasters from Scunthorpe.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 13 Dec 2005, Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Tom Anderson <[EMAIL PROTECTED]> wrote:
>> On Mon, 12 Dec 2005, Cameron Laird wrote:
>>
>>> While there is indeed much to love about Lisp, please be aware
>>> that me
ngs
terminology - just replace 'variable' with 'name'. The expression would be
nonsensical, but it's nonsensical in the variables-objects-and-pointers
terminology too.
> Some languages have variables. Some do not.
Well, there is the lambda calculus, i guess ...
s-bindings
terminology is consistent, correct and clear. It's just that i think that
the variables-objects-pointers terminology is equally so, so i object to
statements like "python is not pass-by-value".
tom
--
The sky above the port was the colour of television, tuned to a dead
channel
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 13 Dec 2005, Xavier Morel wrote:
> Tom Anderson wrote:
>
>> In what sense are the names-bound-to-references-to-objects not
>> variables?
>
> In the sense that a variable has various meta-informations (at least a
> type)
No. In a statically typed language (or
em
# n should be such a 2-tuple
n_namespace = n[0]
n_name = n[1]
n_namespace[n_name] += 1
x = 1
increment((locals(), "x"))
assert x == 2
This is an evil, festering, bletcherous hack, but it is a direct
translation of the use of pass-by-reference in C.
As a bonus, here's a similarly literal python translation of your C
program:
>>> i = 1
>>> ref = "i"
>>> i = 2
>>> assert ref == "i"
tom
--
The sky above the port was the colour of television, tuned to a dead
channel
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 14 Dec 2005, Steven D'Aprano wrote:
> On Tue, 13 Dec 2005 15:28:32 +0000, Tom Anderson wrote:
>
>> On Tue, 13 Dec 2005, Steven D'Aprano wrote:
>>
>>> On Mon, 12 Dec 2005 18:51:36 -0600, Larry Bates wrote:
>>>
>>> [snippidy-doo-dah]
&g
On Tue, 13 Dec 2005, Steve Holden wrote:
> Tom Anderson wrote:
>> On Tue, 13 Dec 2005, Steven D'Aprano wrote:
>>
>>> On Mon, 12 Dec 2005 18:51:36 -0600, Larry Bates wrote:
>>>
>>> [snippidy-doo-dah]
>>>
>>>> I had the same th
On Sat, 17 Dec 2005, Dennis Lee Bieber wrote:
> (Now there is an interesting technical term:
> #define ERROR_ARENA_TRASHED 7)
FreeBSD at one point had an EDOOFUS; Apple kvetched about this being
offensive, so it was changed to EDONTPANIC.
I shitteth thee not.
tom
--
infor
if (x in seen):
... return False
... else:
... seen.add(x)
... return True
...
>>> new_list = filter(unseen, orig_list)
>>> new_list
[3, 1, 2]
Slightly tidier like this, i'd say:
>>> orig_list = [3,1,2,3,1,2,3,1,2,1,2,1,3]
&
this, but this is a bit easier. If you don't want this, delete the elif
block mentioning the @, and the stripped function. A slightly neater
implementation not involving list.pop also then becomes possible.
tom
--
Hit to death in the future head
--
http://mail.python.org/mailman/listinfo/python-list
g of was eval, not source. You are
> correct in saying he'd need to create a file to source.
True. The downside of eval is that it doesn't (well, in bash, anyway)
handle line breaks properly (for some value of 'properly') - it seems to
treat them as linear whitespace, not line ends. I was about to suggest:
source <(my_script.py)
As a way to use source to run the script's output, but that seems not to
work. I think <() might be a bashism anyway.
tom
--
Hit to death in the future head
--
http://mail.python.org/mailman/listinfo/python-list
This may have been discussed before, so I apologize.
Does Java have generators? I am aware of the "Iterator" interface,
but it seems much more restrictive. Python generators are useful
for many more things than simply list enumeration, but the Java
Iterator seems limited.
To
ised_fn(*args):
if args in cache:
return cache[args]
else:
rtn = fn(*args)
cache[args] = rtn
return rtn
return memoised_fn
@memoised
def func(x):
return x +
;license" for more information.
>>> import os
>>> filenames = os.listdir(".")
>>> first = filenames[0]
>>> first in filenames
True
>>> first.upper() in filenames
False
>>> os.path.exists(os.path.join(".", first))
True
&g
ading the Tibetan Book of the Dead.
tom
--
Chance? Or sinister scientific conspiracy?
--
http://mail.python.org/mailman/listinfo/python-list
break
SUITE
except __StopIteration__, exc_info:
somehow_set_sys_exc_info(exc_info)
HANDLER
As it stands, throwing a StopIteration in the suite inside a for loop
doesn't terminate the loop - the exception escapes; by analogy, the
for-except construct shouldn
On Tue, 3 Jan 2006, Scott David Daniels wrote:
> Tom Anderson wrote:
>
>> Java has a java.io.File.getCanonicalPath method that does this, but i can't
>> find an equivalent in python - is there one?
>
> What's wrong with: os.path.normcase(path) ?
It doesn't
301 - 400 of 667 matches
Mail list logo