Sebastjan Trepca wrote:
> Hey,
>
> can someone please explain this behavior:
>
> The code:
>
> def test1(value=1):
> def inner():
> print value
> inner()
>
>
> def test2(value=2):
> def inner():
> value = value
> inner()
>
> test1()
> test2()
>
> [EMAIL PROTEC
Taygun Kekec wrote:
> Code :
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> import os
>
> if os.name == 'nt':
> OS_Selection = 0
> elif os.name == 'posix':
> OS_Selection = 1
> else :
> OS_Selection = 1
>
> del_cmd_os = ( "del","rm")
> filelist = ("ddd.txt","eee.txt","fff.txt")
>
>
John Salerno wrote:
> Bruno Desthuilliers wrote:
>> John Salerno a écrit :
>>> I just installed Pylons onto my hosting server so I could try out
>>> templating with Mako, but it seems a little more complicated than that.
>>
>> Err... Actually, it's certainly a little less complicated than that.
>>
dingo_1980 wrote:
> I wanted to know if scipy.sparse support or will support the following
> functions which are available in scipy.linalg or scipy or numpy:
>
> Inverse
> Cholesky
> SVD
> multiply
> power
> append
> eig
> concatenate
>
> Thanks...
You should probably ask on a SciPy mailing list
Steve Potter wrote:
> I'm working on a project to create a central administration interface
> for several websites located on different physical servers.
>
> You can think of the websites as a blog type application. My
> administration application will be used to create new blog posts with
> assoc
Steve Potter wrote:
> On Jul 6, 8:19 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
>> Steve Potter wrote:
>>> I'm working on a project to create a central administration interface
>>> for several websites located on different physical servers.
>>&g
mcl wrote:
> Why can I not the change the value of a variable in another class,
> when I have passed it via a parameter list.
>
> I am sure I am being stupid, but I thought passed objects were Read/
> Write
In Python, there are names which are bound to objects. Doing "foo = bar"
and then "foo = s
mcl wrote:
> On 7 Jul, 13:09, Jeff <[EMAIL PROTECTED]> wrote:
>> When you call c3.createJoe(c1.fred), you are passing a copy of the
>> value stored in c1.fred to your function. Python passes function
>> parameters by value. The function will not destructively modify its
>> arguments; you must exp
[EMAIL PROTECTED] wrote:
> Hi,
>
> I am looking fo svn library(module) which is used in the svn-
> mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody
> know where can I find it(download url)? This is information which I
> received from python error:
>
> from svn import core as s
Jerry Hill wrote:
> On Mon, Jul 7, 2008 at 7:30 AM, mcl <[EMAIL PROTECTED]> wrote:
>> I did not think you had to make the distinction between 'byvar' and
>> 'byref' as in Basic.
>
> Python does not use "call by value" or "call by reference" semantics.
> Instead, python's model is "call by object".
skeept wrote:
> On Jul 9, 7:32 pm, [EMAIL PROTECTED] wrote:
>> I am trying to redirect stderr of a process to a temporary file and
>> then read back the contents of the file, all in the same python
>> script. As a simple exercise, I launched /bin/ls but this doesn't
>> work:
>>
>> #!/usr/bin/python
sanket wrote:
> Hello All,
>
> I have created an API which fetches some data from the database.
> I am using simplejson to encode it and return it back.
>
> Now the problem is that, this API is being called for millions of
> times in a sequence.
> I ran a profiler and saw that most of the time is
[EMAIL PROTECTED] wrote:
> Does python install fairly easily for a non-root user?
>
> I have an ssh login account onto a Linux system that currently
> provides Python 2.4.3 and I'd really like to use some of the
> improvements in Python 2.5.x.
>
> So, if I download the Python-2.5.2.tgz file is it
David Pratt wrote:
> Hi. I am trying to replace a system call with a subprocess call. I have
> tried subprocess.Popen and subprocess.call with but have not been
> successful. The command line would be:
>
> svnadmin dump /my/repository > svndump.db
>
> This is what I am using currently:
>
> os.
Matt Nordhoff wrote:
> David Pratt wrote:
>> Hi. I am trying to replace a system call with a subprocess call. I have
>> tried subprocess.Popen and subprocess.call with but have not been
>> successful. The command line would be:
>>
>> svnadmin dump /my/repository
David Pratt wrote:
> Hi David and Matt. I appreciate your help which has got me moving
> forward again so many thanks for your reply. I have been using
> subprocess.Popen a fair bit but this was the first time I had to use
> subprocess to capture large file output. The trouble I wa
BonusOnus wrote:
> How do I pass a dictionary to a function as an argument?
>
>
> # Say I have a function foo...
> def foo (arg=[]):
> x = arg['name']
> y = arg['len']
>
> s = len (x)
>
> t = s + y
>
> return (s, t)
I assume you actually indented the body of the function?
> # The dictionary:
Gabriel Rossetti wrote:
> Hello everyone,
>
> we are writing an application that needs some cleanup to be done if the
> application is quit, normally (normal termination) or by a signal like
> SIGINT or SIGTERM. I know that the __del__ method exists, but unless I'm
> mistaken there is no guaran
Matt Nordhoff wrote:
> Gabriel Rossetti wrote:
>> Hello everyone,
>>
>> we are writing an application that needs some cleanup to be done if the
>> application is quit, normally (normal termination) or by a signal like
>> SIGINT or SIGTERM. I know that the __de
[EMAIL PROTECTED] wrote:
> By convention, I've read, your module begins with its import
> statements. Is this always sensible?
>
> I put imports that are needed for testing in the test code at the end
> of the module. If only a bit of the module has a visual interface, why
> pollute the global nam
Hi All.
I'm trying to write a script that will send me an email message when my IP
address changes on a specific NIC. On Linux, the script works. On FreeBSD, it
fails with:
Traceback (most recent call last):
File "./pyifcheck.py", line 22, in
if get_ip_address('xl0') == IPADDY:
File "./pyifch
Hey All.
I'm learning some python with the seemingly simple task of updating a firewall
config file with the new IP address when my dhcpd server hands one out. Yeah,
I know it's dangerous to edit such a file "in place" but this is just an
exercise at this point. I would not mind using file han
John Salerno wrote:
>> replaces the elements in the slice by assigned elements.
>
>
> I don't understand the second part of that sentence. I'm assuming "it"
> refers to the list being assigned, "replaces the elements" is
> self-evident, but what does "by assigned elements" refer to? It seems
> wh
Wow, this message turned out to be *LONG*. And it also took a long time
to write. But I had fun with it, so ok. :-)
Michael Torrie wrote:
> Recently a post that mentioned a recipe that extended subprocess to
> allow killable processes caused me to do some thinking. Some of my
> larger bash script
[EMAIL PROTECTED] wrote:
> Hi everybody,
>
> I'm using the win32 console and have the following short program
> excerpt
>
> # media is a binary string (mysql escaped zipped file)
>
>>> print media
> xワユロ[ヨ...
> (works)
>
>>> print unicode(media)
> UnicodeDecodeError: 'ascii' codec can't decode
jmDesktop wrote:
> Hi, I wanted to buy a book on Python, but am concerned that some of
> them are too old. One I had come to after much research was Core
> Python by Wesley Chun. I looked at many others, but actually saw this
> one in the store and liked it. However, it is from 2006. I know
> t
Arnaud Delobelle wrote:
> More simply, use the rsplit() method of strings:
>
path = r'C:\myimages\imageone.jpg'
path.rsplit('.', 1)
> ['C:\\myimages\\imageone', 'jpg']
>
>
path = r"C:\blahblah.blah\images.20.jpg"
path.rsplit('.', 1)
> ['C:\\blahblah.blah\\images.20', 'jpg']
>
Mike Driscoll wrote:
> On May 6, 8:44 am, jmDesktop <[EMAIL PROTECTED]> wrote:
>> Studying OOP and noticed that Python does not have Interfaces. Is
>> that correct? Is my schooling for nought on these OOP concepts if I
>> use Python. Am I losing something if I don't use the "typical" oop
>> cons
On Tue, 06 May 2008 20:02:21 +0100, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
[EMAIL PROTECTED] (Ville M. Vainio) writes:
[EMAIL PROTECTED] (Ville M. Vainio) writes:
I don't think BSD/MIT like license really annoys anyone. Think python
here ;-)
Python's non-GPL license certainly is a
Gandalf wrote:
> my server is my computer and all i did way to install python on it.
But what web server program are you using? Apache? IIS? Lighttpd?
--
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> You
> can't get out of the code block with pressing the Enter key; you have
> to press Ctrl+Z (if you're in Linux) in order to get out of that code
> block, which then throws you back to the Linux command line, but
> before that it prints this line
>
> [1]+ Stopped
John Salerno wrote:
> I know it's popular and very handy, but I'm curious if there are purists
> out there who think that using something like:
>
> for x in range(10):
> #do something 10 times
>
> is unPythonic. The reason I ask is because the structure of the for loop
> seems to be for itera
brad wrote:
> Recently had a need to us a multimap container in C++. I now need to
> write equivalent Python code. How does Python handle this?
>
> k['1'] = 'Tom'
> k['1'] = 'Bob'
> k['1'] = 'Joe'
> ...
>
> Same key, but different values. No overwrites either They all must
> be inserted into
dieter wrote:
> Hi,
>
> Overview
> ===
>
> I'm doing some simple file manipulation work and the process gets
> "Killed" everytime I run it. No traceback, no segfault... just the
> word "Killed" in the bash shell and the process ends. The first few
> batch runs would only succeed with one or t
Asterix wrote:
> how could I test that those 2 strings are the same:
>
> 'séd' (repr is 's\\xc3\\xa9d')
>
> u'séd' (repr is u's\\xe9d')
You may also want to look at unicodedata.normalize(). For example, é can
be represented multiple ways:
>>> import unicodedata
>>> unicodedata.normalize('NFC',
Barak, Ron wrote:
> Hi Fellow Pythonians,
>
> I stated getting the following when starting Python (2.5.2 on Windows XP):
>
> C:\Documents and Settings\RBARAK>python -v
> # installing zipimport hook
> import zipimport # builtin
> # installed zipimport hook
> # D:\Python25\lib\site.pyc matches D:
Emile van Sebille wrote:
> flit wrote:
>> Hello All,
>>
>> I will appreciate the help from the more skillfull pythonistas..
>>
>> I have a small app that generates a sequence like
>>
>> 00341
>> 01741
>> 03254
>
> Consider using a dict with sorted tuple keys, eg
>
> d = {}
>
> for seq in ['00341
Beema Shafreen wrote:
> hi all,
>
> I have a script using functions , I have a problem in returning the
> result. My script returns only one line , i donot know where the looping
> is giving problem, Can any one suggest, why this is happening and let me
> know how to return all the lines
>
> def
Gabriel Genellina wrote:
> En Thu, 11 Sep 2008 10:59:10 -0300, Matt Nordhoff
> <[EMAIL PROTECTED]> escribió:
>
>>>result = "%s\t%s\t%s" %(id,gene_symbol,ptms)
>>
>> This is very trivial, but you could change the above line to:
>>
&g
[EMAIL PROTECTED] wrote:
> Ben Keshet:
>> ...wrong. I thought I should omit the comma and didn't put it. I guess
>> that stating the obvious should be the first attempt with beginners like
>> me. Thanks for thinking about it (it's running perfect now).
>
> In CLisp, Scheme etc, lists such comma
Steven D'Aprano wrote:
> On Thu, 11 Sep 2008 17:27:33 +0200, Sjoerd Mullender wrote:
>
>> When mail messages bounce, the MTA (Message Transfer Agent--the program
>> that handles mail) *should* send the bounce message to whatever is in
>> the Sender header, and only if that header does not exist, s
Grant Edwards wrote:
> On 2008-09-12, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
>
>> I think you misunderstand. He's referring to the Sender
>> header, not the From header. The messages the listbot sends
>> out have a Sender header of
>> "[EMAIL PR
Chris Rebert wrote:
> On Wed, Sep 24, 2008 at 2:02 PM, David Di Biase <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I have a rather large list structure with tuples contained in them (it's
>> part of a specification I received) looks like so:
>> [(x1,y1,r1,d1),(x2,y2,r2,d2)...]
>>
>> The list can range f
[EMAIL PROTECTED] wrote:
> On Sep 24, 9:44 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
>> On Wed, Sep 24, 2008 at 8:30 PM, <[EMAIL PROTECTED]> wrote:
>>> I want to take a long alpha-numeric string with \n and white-space and
>>> place ALL elements of the string (even individual parts of a long
>
[EMAIL PROTECTED] wrote:
> I took over spam filter management for the python.org mailing lists a couple
> months ago and made a few changes to the way the spam filter is trained.
> Things seem to be at a reasonable level as far as I can tell (I see a few
> spams leak through each day), though I was
4: Can I avoid the dummy counter i in the for loop and do something
> like:
> yz=[y[:-1].x-y[1:].x]
yz = [e.x for e in y]
yz.reverse()
--
| Matt Hammond
| R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK.
| http://kamaelia.sf.net/
| http://www.bbc.co.uk/rd/
--
http://
On Wed, 08 Mar 2006 11:29:29 -, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 08 Mar 2006 11:00:09 +, Matt Hammond wrote:
>
>>> 4: Can I avoid the dummy counter i in the for loop and do something
>>> like:
>>> yz=[y[:-1].x-y[1:].
', 'color': 'blue'}
>
> print """\
> Section %(secnum)s
> Elements of type %(type)s should be coloured %(color)s
> """ % results
Don't forget that you may need to escape the application's data for
inclusion in HTML:
the answer with shorter, more readable code. A one-liner!
Is there a 'canned' routine to do it in numpy?
btw, I am not advocating that one should not understand the concepts
behind a 'canned' routine. If you do not understand this concept you
should take 's advice and dive into a linear algebra book.
It's not very difficult, and it is essential that a scientific
programmer understand it.
-Matt
--
http://mail.python.org/mailman/listinfo/python-list
Matt Crema wrote:
> Robert Kern wrote:
>
>> nikie wrote:
>>
>>> I still don't get it...
>>> My data looks like this:
>>> x = [0,1,2,3]
>>> y = [1,3,5,7]
>>> The expected output would be something like (2, 1), as y[i] = x[i]*2
7;polyval'. Then:
"help polyval"
and this problem would have been solved in under 5 minutes.
To sum up a wordy post, "What do experienced users find is the most
efficient way to navigate the numpy docs? (assuming one has already
read the FAQs and tutorials)"
Thanks.
-Matt
--
http://mail.python.org/mailman/listinfo/python-list
.txt")
>>> stream = codecs.getreader('utf-8')(f)
>>> c = stream.read(1)
The 'stream' works on unicode characters so 'c' is a unicode instance,
i.e. a whole textual character.
- Matt
--
__
/ \__ Matt Goodall, Pollenation Internet
[EMAIL PROTECTED] wrote:
> Hi All,
> I'm trying to write a news retrieval client in python.
> I'm going to get the news from google's news service.
> However, when I run the following code, google gives me a 403 error.
Knowing google, they're blocking the user agent supplied by urllib2.
--
http:/
the module
object referred to by the name "one". Since there is only one instance
of a given module*, the change is indeed reflected everywhere the "one"
module is accessed.
The problem is that argFunc does not modify (or replace) one.myList, as
MRAB said.
* Unless you do something strange like reload() or editing sys.modules
or having module available under different names...or something.
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
f
def switch(self, option):
getattr(self, 'do_' + str(option), self.default)()
d = MyCommandDispatcher()
d.switch('a')
d.switch(5)
This isn't _much_ more coding than using the dictionary method, and is pretty
readable. This is also a common pattern in python.
Mat
', with the
>> '*'s removed.
>>
>> So in the case above n would be ['nbh', 'jkjsdfjasd']
>
> [s[1:-1] for s in l if (s[0] == s[-1] == '*')]
s[0] and s[-1] raise an IndexError if l contains an empty string.
Better something like:
>>> [s[1:-1] for s in l if (s[:1] == s[-1:] == '*')]
Or just the slightly more verbose startswith/endswith version.
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
name "_builtins_" is not
defined, as it says. You were probably looking for "__builtins__", with
2 underscores on each end, not just 1.
BTW, "__builtins__" is a CPython implementation detail. If you want to
play with built-in objects, you should import the __builtin__
Rick wrote:
> Is there any way to get the current time from time.gov using urllib2 or
> something similar?
>
> Does anyone have any examples of doing this?
>
> Thanks!
> Rick King
> Southfield MI
Why isn't your local system's clock accurate enough?
--
Matt N
Matt Nordhoff wrote:
> Rick wrote:
>> Is there any way to get the current time from time.gov using urllib2 or
>> something similar?
>>
>> Does anyone have any examples of doing this?
>>
>> Thanks!
>> Rick King
>> Southfield MI
>
> Why i
here were, this is not one of those situations.
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone tell me why this test fails?
http://pastebin.com/f20039b17
This is a minimal example of a much more complex thing I'm trying to
do. I'm trying to hijack a function and inspect the args passed to it
by another function.
The reason the 'Tester' object has no attribute 'arg1' is because
sys, getopt
>
> try:
> opts, args = getopt.getopt(sys.argv, "h:", ["help"])
> except getopt.GetoptError:
> print "error"
> sys.exit(2)
>
> If no args are passed when the script is run there is no exception
> raised.
Once I get everything to work under 2.6, I am using it
> forever or until new releases no longer break working
> code, whichever comes first.
Hey, good luck with that forever plan.
--Matt
--
http://mail.python.org/mailman/listinfo/python-list
You can try flushing, or reopening with no buffering
sys.stdout.flush()
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
On Sun, Sep 27, 2009 at 2:20 AM, Dave Angel wrote:
> kj wrote:
>>
>> Is there any way to specify unbuffered I/O from *within* the code
>> (rather than via the command-line
Yes the needless use of classes further supports that theory.
On Sun, Sep 27, 2009 at 4:31 PM, John Nagle wrote:
> dads wrote:
>>
>> Sorry forgot to mention I'm using python 2.6
>
> This looks like a homework assignment.
>
> John Nagle
> --
> http://mail.python.or
My apologies in advance if this has been addressed before. Google does
not presently seem to return search results for this group from more
than a couple of months ago.
I have some long-running Python processes that slowly increase in
resident memory size, and whose resident size goes down only wh
agmentation.
Thank you for the explanation. Since my real application uses many
small objects, it makes sense that memory cannot be reclaimed in the
absence of compaction.
Matt
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 12, 8:21 pm, Peng Yu wrote:
> Hi,
>
> I'm wondering if there is a document for 2.x indicating what will be
> gone in 3.x. For example, I heard that __cmp__ be not available in
> Python 3. But I don't see it
> inhttp://docs.python.org/reference/datamodel.html.
>
> Regards,
> Peng
'Dive int
Andre Engels wrote:
[snip]
> However, I think that the better Python way would be to use a generator:
>
> def infinite_numbergenerator():
> n = 0
> while True:
> yield n
> n += 1
>
> for i in infinite_numbergenerator():
> ...
That's what itertools.count() is for.
Matt Nordhoff wrote:
> Andre Engels wrote:
> [snip]
>
>> However, I think that the better Python way would be to use a generator:
>>
>> def infinite_numbergenerator():
>> n = 0
>> while True:
>> yield n
>>
st fine to me. There is a difference between a
python string literal written inside of a python script and a string read from a
file. When reading from a file (or the registry) what you see is what you get.
There is no need to do so much work.
Matt McCredie
--
http://mail.python.org/mailman/listinfo/python-list
':
statement = raw_input("Complete the function f(x)=")
exec "f = lambda x:"+statement in {}
print f(2)
print f(4)
print f(6)
Matt McCredie
--
http://mail.python.org/mailman/listinfo/python-list
Rhodri James wildebst.demon.co.uk> writes:
>
> On Fri, 23 Oct 2009 17:39:40 +0100, Matt McCredie gmail.com>
> wrote:
>
> > joao abrantes gmail.com> writes:
> >
> >>
> >> Hey. I want to make a program like this:print "Complete the fu
Gertjan Klein wrote:
> Alf P. Steinbach wrote:
>
>> So with 'w+' the only way to get garbage is if 'read' reads beyond the end
>> of
>> file, or 'open' doesn't conform to the documentation.
>
> It does read beyond the end of file. This is perhaps the way the
> underlying C library works, but it
code.
You might also look at the __import__ funciton, which can import by python path.
You might also look at the imp module.
Matt
--
http://mail.python.org/mailman/listinfo/python-list
prevent the empty tk window from popping up? Here's the code:
import tkFileDialog
answer = tkFileDialog.askdirectory()
if answer is not '':
#do stuff
Thanks!
Matt
--
http://mail.python.org/mailman/listinfo/python-list
-6300 or by electronic mail immediately.
Thank you.
-Original Message-
From: python-list-bounces+mmitchell=transparent@python.org
[mailto:python-list-bounces+mmitchell=transparent@python.org] On
Behalf Of Matt Mitchell
Sent: Friday, November 13, 2009 9:33 AM
To: python-list
Subject: Re: tkFileDialog question
Matt,
There is also a nice thing you need to know about Python if you
already do not know. That is the fact that all empty collections bool
to False. This makes Truth testing easier.
>>> bool([])
False
>>> bool('')
False
>>> bool(
---
The information contained in this electronic message and any attached
document(s) is intended only for the personal and confidential use of the
designated recipients named above. This message may be confidential. If the
reader of this message is not the i
You mean like: http://nostarch.com/ghpython.htm
From: python-list-bounces+mmitchell=transparent@python.org
[mailto:python-list-bounces+mmitchell=transparent@python.org] On
Behalf Of Elf Scripter
Sent: Friday, November 20, 2009 3:31 PM
To: python-list@python.org
Subject: Gray Hat Python
non-Linux users, but there it is. Too bad, because
> inotify is pretty cool.
>
> Jason
Some other operating systems have similar facilities, e.g. FSEvents on OS X.
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
me, value in izip(frames, stretch(values, frames_per_value)):
frame.func(value)
Matt
--
http://mail.python.org/mailman/listinfo/python-list
provided may only consist of the following
Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
and None.
"""
node = parse(text, mode='eval').body
if not isinstance(node, List):
raise ValueError('malformed string')
def _convert(node):
if isinstance(node, Str):
return node.s
raise ValueError('malformed string')
return list(map(_convert, node.elts))
Matt McCredie
--
http://mail.python.org/mailman/listinfo/python-list
responding (in windows cmd).
>
> I'm not sure what is wrong so if anyone as any ideas I would gladly
> send you the netcdf file to try. Thanks.
If the file is really of NetCDF3 format, scipy.io.netcdf should work.
Replace
netCDF4.Dataset(filename,'r',format='NETCDF3_CLASSIC')
with
scipy.io.netcdf.netcdf_open(filename,'r')
--Matt Newville
--
http://mail.python.org/mailman/listinfo/python-list
Tobiah wrote:
> Now that I use python, this is the amount of time
> per day that I spend adding forgotten semicolons while
> debugging other languages.
You can fix that by not using other languages. :>
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
quot;Not the right capitalization."
# do the rest of the stuff I need to do.
This works, but to me it seems like there has to be a better way of
doing it. Any feedback or suggestions would be appreciated.
Thanks,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
I think you need to use the /p switch to pass signtool.exe a password
when using the /f switch.
Check out
http://msdn.microsoft.com/en-us/library/8s9b9yaz%28VS.80%29.aspx for
more info.
---
The information contained in this electronic message and any attached
d
hough I have no
idea what it does, etc.) but keep having the problem.
Am I just using multiprocessing wrong? Is this a bug? Any advice?
Thanks,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
On 3/2/2010 3:59 PM, Matt Chaput wrote:
> I'm trying to use a simple pattern where a supervisor object starts a
> bunch of worker processes, instantiating them with two queues (a job
> queue for tasks to complete and an results queue for the results). The
> supervisor puts al
ormation
back while they run, they just write to a temporary file which the
supervisor can read, which avoids the issue. But if anyone can tell me
what I was doing wrong for future reference, I'd greatly appreciate it.
Thanks,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
x27;t particularly expensive, it would look nicer
to just use self.i and do "self.i == 0" in __call__.
Not that it matters, but this is probably faster than your version, too,
since it saves a method call.
By the way, IIRC Python only looks up double-underscore methods on the
class, not the instance. That's why you had to indirect through self.F.
--
Matt Nordhoff
--
http://mail.python.org/mailman/listinfo/python-list
3) get listing
4) match the file pattern i want to the listing
5) check if file already exists
6) download file if matched and doesn't exist
Can anyone offer any advice whether this already done somewhere?
thanks
matt
--
http://mail.python.org/mailman/listinfo/python-list
en match it via regular pattern.
Not sure if this is the best/most elegant way. But it should work.
thanks
matt
On 12/23/2010 1:46 AM, Octavian Rasnita wrote:
> Can this lib also work with ftps?
>
> Thanks.
>
> Octavian
>
> - Original Message -
> From: "Anurag
ode)
thanks
matt
--
http://mail.python.org/mailman/listinfo/python-list
numpy.
Andrea:
you are right about the value 100. It should have been 0.5.
The original code has a different vector which is tested against 100. I
tried to simply reproduce the functionality with a random vector.
Thus the confusion.
Again, thanks for the input.
matt
On 1/25/2011 2:36 PM, Andrea
Are there any editors/IDEs with good support for line-coloring from Python test
coverage results? (I normally use Eclipse + PyDev but PyDev's current coverage
support isn't much better than nothing.)
Thanks,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
ut if the command line is
"nosetests", it's a one way ticket to an infinite explosion of processes.
Any thoughts?
Thanks,
Matt
--
http://mail.python.org/mailman/listinfo/python-list
The test runner in PyDev works properly.
Maybe multiprocessing is starting new Windows processes by copying the
command line of the current process, but if the command line is
"nosetests", it's a one way ticket to an infinite explosion of processes.
Any thoughts?
Thanks,
Ma
On 18/02/2011 2:54 AM, Terry Reedy wrote:
On 2/17/2011 6:31 PM, Matt Chaput wrote:
Does anyone know the "right" way to write a unit test for code that uses
multiprocessing on Windows?
I would start with Lib/test/test_multiprocessing.
Good idea, but on the one hand it doesn
On 17/02/2011 8:22 PM, phi...@semanchuk.com wrote:
Hi Matt,
I assume you're aware of this documentation, especially the item
entitled "Safe importing of main module"?
http://docs.python.org/release/2.6.6/library/multiprocessing.html#windows
Yes, but the thing is my code isn
601 - 700 of 747 matches
Mail list logo