Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
on defects and flaws in the standards are likely to show up in very obscure ways; ones due to programmer error tend to be much simpler. If you want to contact me by Email, and can describe technically what you are doing and (most importantly) what you are assuming, I may be able to give some hints. But no promises. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
;t live in one. Until you have identified the cause, you can't tell if threading has anything to do with the failure - given what we know, it seems likely, but what Aahz says is how to tackle the problem WHATEVER the cause. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to document Python code...

2007-01-24 Thread Nick Vatamaniuc
Epydoc is the way to go. You can even choose between various formating standards (including javadoc ) and customize the output using CSS. On Jan 22, 7:51 pm, "Stuart D. Gathman" <[EMAIL PROTECTED]> wrote: > On Mon, 22 Jan 2007 17:35:18 -0500, Stuart D. Gathman wrote: > > The HTML generated by py

Re: The reliability of python threads

2007-01-25 Thread Nick Maclaren
o the square of the activity, sometimes a higher power. Virtually nothing involved does any routine logging, or even has options to log relevant events. The first means that the strategy of restarting doesn't help. All three mean that current logs are almost never any use. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-25 Thread Nick Maclaren
^^ |> before its likely to go down doesn't take too long, compared to your |> exploration of the problem, and, of course, you have to be able to |> afford the glitch in availability. Consider the marked phrase in the context of a Poisson pr

Re: The reliability of python threads

2007-01-25 Thread Nick Maclaren
is fine but "it can't |> theoretically be fixed" is no solution. I suggest that you do invest in a little learning and look up Poisson processes. |> Keep your eye on the goal and your more likely to score! And, if you have your eye on the wrong goal, you would generally be b

Re: The reliability of python threads

2007-01-26 Thread Nick Maclaren
mprove the reliability. Well, it could also be one where failure becomes LESS likely the longer the server stays up (i.e. the "settling down" problem). No problem is as hard to find as one where you are firmly convinced that it is somewhere other than where it is. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Two mappings inverse to each other: f, g = biject()

2007-02-06 Thread Nick Vatamaniuc
-- >>> S=('a','b','d') >>> L=('alpha,'beta','delta') >>> f={} >>> for i in range(3): : f[S[i]]=L[i] : f[L[i]]=S[i] >>> f {'a': 'alpha',

Re: Repr or Str ?

2007-02-06 Thread Nick Vatamaniuc
On Feb 6, 5:47 am, "Johny" <[EMAIL PROTECTED]> wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences > Thanks > LL When you want to provide a representation of an object from which you can create another object if you had to. Use 'str

Re: Can Parallel Python run on a muti-CPU server ?

2007-02-07 Thread Nick Vatamaniuc
>From the www.parallelpython.com , the 'Features' section: Features: *Parallel execution of python code on SMP and clusters --- PP uses processes, and thus it will take advantage of multiple cores for a CPU bound task. -

Question involving a Python app...

2007-12-04 Thread Nick Watton
hi not a direct answer to your question, but fixes the issue. full details of a work-around at this link: http://www.sephiroth.it/phpBB/showthread.php?t=9244 cheers Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ and functions that don't exist

2006-05-25 Thread Nick Smallbone
Erik Johnson wrote: > Maybe I just don't know the right special function, but what I am wanting to > do is write something akin to a __getattr__ function so that when you try to > call an object method that doesn't exist, it get's intercepted *along with > it's argument*, in the same manner as __ge

Re: Threading the Python interpreter

2008-02-18 Thread Nick Stinemates
mb > here. Am I correct in my assumption this is OK or just lucky so far? > FYI -- That's not multi threading that's multiprocessing. You're safe. -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list

Re: name of client module

2008-02-18 Thread Nick Stinemates
at module. Is there any way to have a hook > invoked on subsequent imports, and for that hook (as in Q1) to determine > the name of the client module? > Why would you ever want to do this? I don't really understand why you wouldn't want to do the following: import foo fo

Re: Python ASP Error

2008-02-18 Thread Nick Stinemates
unning IIS/whatever webserver you're running read access to C:\\WINDOWS\\TEMP\\gen_py\\2.5\\__init__.py -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- http://mail.python.org/mailman/listinfo/python-list

Re: name of client module

2008-02-18 Thread Nick Stinemates
; % module a.setImported(self) i = Importer() i.__import__("Imported") Imported.py #!/usr/bin/python def setImported(importer): print "I've been imported by %s" %importer -- ====== Nick St

Re: name of client module

2008-02-18 Thread Nick Stinemates
Jeff Schwab wrote: > Nick Stinemates wrote: > >>> I'm not saying I don't want to do that. I'm saying that, in addition to >>> what you've written, I want foo to know it's being imported, and by whom. >>> > > Please

Re: Question on importing and function defs

2008-03-02 Thread Nick Miller
this is a local function issue. Meaning that even when you write the new a() function in the main source file, b() doesn't know it exists because it's relying on it's own "local" a() in the module. I'm also new to using Python so I that's all I can think would be the problem. Nick -- http://mail.python.org/mailman/listinfo/python-list

Problems installing Python Imaging Library

2008-03-09 Thread Nick Day
uild" and don't understand how I would change the compiling options to add the "- fPIC" flag. I'm quite a newbie when it comes to Linux/Python so any help you could give me would be great. Thanks, Nick -- http://mail.python.org/mailman/listinfo/python-list

Comparing two book chapters (text files)

2009-02-04 Thread Nick Matzke
ws, are not really usable. Any help is much appreciated!! Cheers, Nick -- Nicholas J. Matzke Ph.D. student, Graduate Student Researcher Huelsenbeck Lab Center for Theoretical Evolutionary Genomics 4151 VLSB (Valley Life Sciences Building)

Re: Comparing two book chapters (text files)

2009-02-04 Thread Nick Matzke
Chris Rebert wrote: On Wed, Feb 4, 2009 at 5:20 PM, Nick Matzke wrote: Hi all, So I have an interesting challenge. I want to compare two book chapters, which I have in plain text format, and find out (a) percentage similarity and (b) what has changed. Some features make this problem

global name 'sqrt' is not defined

2009-02-05 Thread Nick Matzke
=== Any ideas? If I do something like "import math" in the subfunction, then the error changes to "global name 'math' is not defined". Thanks! Nick -- Nicholas J. Matzke Ph.D. student, Graduate Student

Re: global name 'sqrt' is not defined

2009-02-05 Thread Nick Matzke
Scott David Daniels wrote: M.-A. Lemburg wrote: On 2009-02-05 10:08, Nick Matzke wrote: ..., I can run this in the ipython shell just fine: a = ["12", "15", "16", "38.2"] dim = int(sqrt(size(a))) ...But if I move these commands to a function in anothe

Re: global name 'sqrt' is not defined

2009-02-05 Thread Nick Matzke
o it.) Thanks! Nick Diez B. Roggisch wrote: Nick Matzke schrieb: Scott David Daniels wrote: M.-A. Lemburg wrote: On 2009-02-05 10:08, Nick Matzke wrote: ..., I can run this in the ipython shell just fine: a = ["12", "15", "16", "38.2"] dim = int(sqrt(s

hist without plotting

2009-02-15 Thread Nick Matzke
Hi, Is there a way to run the numpy hist function or something similar and get the outputs (bins, bar heights) without actually producing the plot on the screen? (R has a plot = false option, something like this is what I'm looking for...) Cheers!

Re: hist without plotting

2009-02-15 Thread Nick Matzke
Nevermind, I was running the pylab hist; the numpy.histogram function generates the bar counts etc. without plotting the histogram. Cheers! Nick Nick Matzke wrote: Hi, Is there a way to run the numpy hist function or something similar and get the outputs (bins, bar heights) without actually

pythonic array subsetting

2009-02-16 Thread Nick Matzke
s the rownames list at every other entry, I need to pull out a 500x500 array holding every other row & column in the parent array. I have to do this hundreds of times, so speed would be useful. Cheers! Nick -- Nicholas J. Matzke Ph.D

Re: pythonic array subsetting

2009-02-17 Thread Nick Matzke
Looks like "compress" is the right numpy function, but it took forever for me to find it... x = array([[1,2,3], [4,5,6], [7,8,9]], dtype=float) compress([1,2], x, axis=1) result: array([[ 1., 2.], [ 4., 5.], [ 7., 8.]]) Gary Herron wrote: Nick Matzke wrote: Hi

Re: Redirecting warnings.showwarning to logging

2008-11-23 Thread Nick Coghlan
Tres Seaver wrote: > Nick Coghlan wrote: >> Antoine Pitrou wrote: >>> Brett Cannon python.org> writes: >>>> It is specifically there to be overridden (and as an aside, it was a >>>> pain to support in the C port of warnings), so it really isn't

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Nick Coghlan
oat_class) You could make a PEP if you really wanted to, but it's going to be rejected. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-28 Thread Nick Mellor
one or two: def get_highest_bit_num(i): while i>0: highestbit, i = i, i & (i-1) return highestbit >>> highestbit(1<<31) 2147483648L >>> highestbit(1<<4) 16 >>> highestbit(3<<4) 32 Note that it returns the value of the highest bit, no

Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Hi all, I'm pretty sure I'm following all the Python rules: I've put "self" before "forename" to make sure it's treated as a data attribute (instance variable.) And from within a class, I'm told, you need to prefix the var with self too. RandomName is a class that I've tested (and which still work

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Thanks Chris and John, all workin now. Sorry about proclamation of innocence-- fruitless morning and 3 hours sleep :-) Nick On Mar 3, 12:03 pm, Chris Rebert wrote: > On Mon, Mar 2, 2009 at 4:56 PM, Nick Mellor > > > > wrote: > > Hi all, > > > I'm pretty sure

Async serial communication/threads sharing data

2009-03-21 Thread Nick Timkovich
I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with messages 4-10 bytes long or so. Most of the nuts and bolts problems I've been able to solve, and have learned a little about the threading library to avoid blocking

Re: Async serial communication/threads sharing data

2009-03-22 Thread Nick Timkovich
On Mar 21, 9:19 pm, Jean-Paul Calderone wrote: > On Sat, 21 Mar 2009 13:52:21 -0700 (PDT), Nick Timkovich > wrote: > >I've been working on a program that will talk to an embedded device > >over the serial port, using some basic binary communications with > >messages

Getting the type of an AST Node

2009-03-27 Thread Nick Edds
Is there an easy way to figure out what the type of an AST Node is? If I have a node n, doing type(n) doesn't help because it gives me , but what I really want is If, or And, or whatever node type the node actually is. I could always just look at n.__repr__(), because the repr for each node type is

Re: Getting the type of an AST Node

2009-03-28 Thread Nick Edds
Ahh sorry. This was in Python 2.5. On Sat, Mar 28, 2009 at 1:20 AM, Terry Reedy wrote: > Nick Edds wrote: > >> Is there an easy way to figure out what the type of an AST Node is? >> > > Specify version. > > ? If I > >> have a node n, doing type(n) doesn

RE: is there a way to collect twitts with python?

2009-04-03 Thread Nick Stinemates
> Thank you, thank you, thank you > everyone around me seems to love that thing (twitter), and I still can't > work out why (apart from hacks such as using it as a hosted queue for > cross-server comms, or receiving cheap sms to your app) > Tim Wintle You mean you don't want to read every d

RE: Generators/iterators, Pythonicity, and primes

2009-04-05 Thread Nick Stinemates
I thought it was beautiful. Reminded me of lisp and I haven't seen that done in Python before. -Original Message- From: python-list-bounces+nick=stinemates@python.org [mailto:python-list-bounces+nick=stinemates@python.org] On Behalf Of Kay Schluehr Sent: Sunday, April 05, 2

RE: Testing dynamic languages

2009-04-05 Thread Nick Stinemates
Plenty. Try github.com for starters. -Original Message- From: python-list-bounces+nick=stinemates@python.org [mailto:python-list-bounces+nick=stinemates@python.org] On Behalf Of barisa Sent: Sunday, April 05, 2009 10:22 AM To: python-list@python.org Subject: Re: Testing dynamic

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-22 Thread Nick Coghlan
ecoding and environment variable encoding/decoding? (the PEP currently only states that the encoding switch will be done for the file system encoding - it is silent regarding the other two system interfaces). Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane

debugging in IPython

2009-04-24 Thread Nick Matzke
. This is doable but extremely tedious when the crash occurred 5 functions deep, or at some unknown point within a for loop. Any help much appreciated! Cheers! Nick -- Nicholas J. Matzke Ph.D. student, Graduate Student Researcher Huels

urllib.FancyURLopener.redirect_internal behavior

2009-06-03 Thread Nick Nobody
ass FancyURLopener and define my own version of redirect_internal that has the "void = fp.read()" line commented out. What I'd like to know is what's the point of doing the read() and not using the result? Is this a bug in urllib? Or am I simply doing something wrong? Thanks, nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I need "self" and "other"?

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kurda Yon wrote: > Hi, > > I found one example which defines the addition of two vectors as a > method of a class. It looks like that: > > class Vector: > def __add__(self, other): > data = [] > for j in range(len(self.data)): > data.

Re: C++ or Python

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kurda Yon wrote: > I would like to know what are advantages of Python in comparison with C > ++? In which cases and why Python can be a better tool than C++? > > Thank you! I'm a relative novice, so I couldn't tell you about deeply hidden features or

Re: Pygame, how to show window without loop? no loop=popupand close...

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 defn noob wrote: > Im using PyGame to draw images of graphs and trees. Howver right now i > am looping using: > > while 1: > for event in pygame.event.get(): > if event.type == pygame.QUIT: sys.exit() > > screen.fill(screencolor) > >

Pygame and Tkinter

2008-06-28 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm doing a project with Pygame, a Snake game, and I've just taken a look at Tkinter and I really like how easy it is to build a GUI with it. The thing is that I don't know how I would use Tkinter and Pygame in conjunction. They seem to have some overl

Re: Do I need "self" and "other"?

2008-06-28 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Pearson wrote: > On Fri, 27 Jun 2008 20:19:00 -0400, Nick Dumas <[EMAIL PROTECTED]> wrote: > [snip] >> Example: >> >> class Foo(): >> self.x = 5 > > > Have you tried what you're pos

Re: windows installers and license agreement

2008-06-29 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Darren Dale wrote: > Is it possible to create a windows installer using distutils that > includes a > prompt for the user to agree to the terms of the license? > > Thanks, > Darren Yeah. In your setup.py script, have it pop up a console window with th

Re: "in"consistency?

2008-07-07 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [1,2] in [1,2,3] checks to see if the list [1,2] is an item in [1,2,3]. Because the list [1,2,3] only contains the integers 1,2,3, the code returns a False. Try "[1,2] in [[1,2],[2,3]]" David C. Ullrich wrote: > Luckily I tried it before saying no, th

Re: Smal question

2008-07-10 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This is easy. Simply create a .py file containing all the methods you want to share. Put this file in the same directory as the rest of your project files. In each of your project files that requires one of the methods, simply "import ". Python support

Re: Newbie Threading Question

2008-07-13 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not an expert on Python threading, so don't take my word as low, however, I believe that there's no need for a list of systems which support it because the Python virtual machine handles it. Thus, any system which supports Python (or at least Pytho

Re: Suggestion: Python global scope

2008-07-15 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The function of the global keyword is to 'push' local variables to the global scope. If you want to 'import' a variable into a local scope, pass the variable to your function/method as an argument. Anonymous Bastard wrote: > I've been tossing this ide

Re: Regular expression help

2008-07-18 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I think you're over-complicating this. I'm assuming that you're going to do a line graph of some sorta, and each new line of the file contains a new set of data. The problem you mentioned with your regex returning a match object rather than a string i

Re: a question that can accelerate learning python?

2008-07-20 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simple. dir(object) [EMAIL PROTECTED] wrote: > I am new to python .But interest in it . > I think if python could provide a method that show every method of an > object or an module.it will be great! We can save a lot of time to > find the document >

Re: import dll instead of pyd

2008-07-24 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is this DLL in the same directory as your script? If not, is it part of your pythonpath? If neither are true, then you won't be able to import it, regardless of whether it's a good file or not. jrh wrote: > Hello, > > From previous posts and document

Re: proposal, change self. to .

2008-08-03 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It's also worth noting that you can use a different name for the object that represents your class. If you did def __init__(foo):pass, then you would be able to access the class's objects with foo.objectname. Using self is simply the recommended standa

Re: py3k s***s

2008-04-18 Thread Nick Stinemates
rhaps been drinking but i have been p**d all week since i > began look into this:-( > -- > http://mail.python.org/mailman/listinfo/python-list Yo, no one here is a child so don't litter your title and text with hard to read bullshit. -- Nick Stinemates ([EMAIL PROTECTED]) http://n

Re: Brand New!

2008-04-18 Thread Nick Stinemates
t how long will it take me to learn the basics of > the language? > -Thanks 4 all ur help! Agent E 10 > -- > http://mail.python.org/mailman/listinfo/python-list Windows or Unix/Linux? I find python is easier to learn in Linux environments, since it assumes some familiarty with the shell. -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Brand New!

2008-04-18 Thread Nick Stinemates
if it works for you, go ahead. > For other resources, see the beginners section in the Python wiki: > http://wiki.python.org/moin/BeginnersGuide I agree and disagree! As long as the student understands how the different parts play together, and the Web medium is what gets him interested

Re: Brand New!

2008-04-18 Thread Nick Stinemates
here. I have immensely enjoyed it so far, and will continue to tinker > well into the future. > > --Paul > I think that's wonderful! I think problem solving language independent. As long as you can break down what you need to do and conceptualize. You must have learned to do with wi

Re: program to Ping ip addresses

2008-04-18 Thread Nick Stinemates
ot;+str(b)+" is online.\n") > elif z==1: > print("Either "+str(sec)+"."+str(b)+" is offline, or ping > request has been blocked.") > zx.write("Either "+str(sec)+"."+str(b)+" is offline, or ping > request has been blocked.\n") > > intb = intb + 1 > b=str(intb) > > else: > > print("Wrong choice. Retard.") > I love that you call the users of your app retards :) That rocks! ping runs forever. tracert doesnt. try: > ping -w 5 -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: How to have unittest tests to be executed in the order they appear?

2008-04-18 Thread Nick Stinemates
ngle test that > way if you wanted to. > Agreed! -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting subprocess.call() output into a string?

2008-04-18 Thread Nick Stinemates
_close(self): os.kill(self.__process.pid,9) def _listen(self): """ get from stdout """ return "".join(self.__stdout.readlines()) def _listen2(self): """ My attempt at trying d

Re: python beginer

2008-04-18 Thread Nick Stinemates
ve a nice day > -- > http://mail.python.org/mailman/listinfo/python-list Start with learning how to type. -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: insert python script in current script

2008-04-18 Thread Nick Stinemates
ttp://mail.python.org/mailman/listinfo/python-list Could it also be that he would like to have a base class? Cause that's what It sounds like to me! class Base: def __init__(self): self.address = "address" self.status = 1 //use numbers instead of strings :) class Person(Base): def __init__(self): Base.__init__(self) # now you have the self.address, self.status -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: how turbo geras code works

2008-04-18 Thread Nick Stinemates
On Wed, Apr 16, 2008 at 01:35:29AM -0700, reetesh nigam wrote: > hi. > actually i have developed one small project but now i want to > develope a project with the help of html.. > please help me out > -- > http://mail.python.org/mailman/listinfo/python-list OK. Done -- Nick

Re: Calling Python code from inside php

2008-04-23 Thread Nick Stinemates
How do I go about this?? > > > Cheers > Vijay > -- > http://mail.python.org/mailman/listinfo/python-list Why not just write it all in Python? -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Python code from inside php

2008-04-24 Thread Nick Stinemates
wasting a lot of time)? I don't understand how the 2 are mutually exclusive? You can have PHP and Python bindings installed on the same Apache server, unless I'm mistaken? -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove multiple inheritance in Python 3000

2008-04-24 Thread Nick Stinemates
tance. > > I also published this request at http://bugs.python.org/issue2667 > -- > http://mail.python.org/mailman/listinfo/python-list You make strong, compelling arguments -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: MESSAGE RESPONSE

2008-04-25 Thread Nick Stinemates
about the internet. > ZING! -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Python code from inside php

2008-04-25 Thread Nick Stinemates
On Fri, Apr 25, 2008 at 03:29:49PM +0200, Diez B. Roggisch wrote: > Nick Stinemates schrieb: >>> While I certainly prefer to use Python wherever I can, that does not mean >>> that there aren't cases where legacy systems or other constraints make >>> this impos

Re: multiple pattern regular expression

2008-04-25 Thread Nick Stinemates
following regex import re str = """a=b c=d e=f string=The sum of 2+2=4""".split("\n") p = re.compile("([^=]*)=(.*)") for lines in str: key,value=p.findall(lines)[0] print key, value -- Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple pattern regular expression

2008-04-25 Thread Nick Stinemates
On Fri, Apr 25, 2008 at 08:40:55PM -0400, Carsten Haese wrote: > Nick Stinemates wrote: >> On Fri, Apr 25, 2008 at 09:50:56AM -0400, [EMAIL PROTECTED] wrote: >>> How about this? >>> >>> for line in file: >>> # ignore lines without = assignment

Re: how many nested for can we utilize?

2008-08-17 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A good quote I read (I can't remember who it was from, though) is "If you need more than three levels of indentation, then something is seriously wrong with your code." Possibly Guido himself? Anyway. If you've got 100 levels of for, you're probably ma

Re: Total No. of "Records" in a File?

2008-08-23 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Err...you want to know what is in a file before you open it? This could be done if you keep some external database documenting changes made to the file. But unless I misunderstand what you're saying, then it's not possible to know the contents of a fil

Re: About IDLE?

2006-03-09 Thread Nick Smallbone
Sybren Stuvel wrote: > Dr. Pastor enlightened us with: > > When I select Run Module in the Edit window, I got only > > two >>> after the RESTART line. > > I expected to see the output of several commands! > > You never gave it any commands that print output. > > I suggest reading the Python tutoria

Re: About IDLE?

2006-03-09 Thread Nick Smallbone
Dr. Pastor wrote: > Any reply? > ahem. three replies, when i counted: http://groups.google.com/group/comp.lang.python/browse_frm/thread/ab0c8455251e616c/ -- http://mail.python.org/mailman/listinfo/python-list

Re: sizeof(struct timeval)

2006-03-14 Thread Nick Kew
ourself up for a Y2K-family bug. Except it'll be a real one, not a storm-inna-teacup. My python isn't up to sizeof issues either, so I can't help you there. Either figure it out, or do it in C. -- Nick Kew -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API: A beginner's problem

2006-03-19 Thread Nick Smallbone
Duncan Booth wrote: > Heikki Salo wrote: > > > > > And closer look tells that the code should not even compile. Is the > > code cut & pasted directly? Line "list[i] = item;" tries to assign a > > pointer to an int-array, which should not compile. There are other > > similar oddities. > > ... such a

Re: High-performance Python websites

2009-11-26 Thread Nick Mellor
On Nov 27, 3:26 am, Bruno Desthuilliers wrote: > Nick Mellor a écrit : > > > Hi all, > > > I'm contemplating setting up a Python-powered website for the tourist > > industry, which will involve a web service, a good deal of XML > > processing, and a Django-p

strange geometry problem

2009-12-23 Thread Nick Buchholz
n.lgcDialog.activate() if resp == 'OK': self.lgcNominal = Pin.lgcDialog.get() self.entries[5].setentry(self.lgcNominal) self.valDisps[4].setentry( self.lgcNominal ) else: return "break" Any ideas on what's going on? an

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-03 Thread Nick Keighley
On 3 Oct, 00:33, Xah Lee wrote: > Haskell has a new logo. A fantastic one. Beautiful. For creator, > context, detail, see bottom of: > > • A Lambda Logo Tour >  http://xahlee.org/UnixResource_dir/lambda_logo.html I'm amazed he thinks anyone would donate 3 USD to that site -- http://mail.python

windows side-by-side configuration woes on windows HPC

2009-10-08 Thread Nick Touran
ster and I don't think the admin is going to install that on all of them. So is there any way to set an environmental variable or something to get these packages to know where to find the proper msvcr90.dll, akin to setting LD_LIBRARY_PATH in Linux? Is there another solution? Thanks in

Re: windows side-by-side configuration woes on windows HPC

2009-10-12 Thread Nick Touran
It is indeed a pain. I would really like a work-around. Matplotlib is supposed to be immune to this nowadays but it's not. Nor are some other third-party modules. Did they break with the new release? (2.6.3?) -nick On Thu, Oct 8, 2009 at 1:12 PM, M.-A. Lemburg wrote: > Nick Tour

Re: windows side-by-side configuration woes on windows HPC

2009-10-14 Thread Nick Touran
endency checking via depends.exe. Yay. -nick On Mon, Oct 12, 2009 at 2:41 PM, M.-A. Lemburg wrote: > Nick Touran wrote: > > It is indeed a pain. I would really like a work-around. Matplotlib is > > supposed to be immune to this nowadays but it's not. Nor are some other > > th

Re: windows side-by-side configuration woes on windows HPC

2009-10-16 Thread Nick Touran
compile the module myself and strip the manifest, or apply the manifest-stripping patch and then just compile the module, and the msvcr71.dll step would be unnecessary. (Well, in an IDEAL world I'd not have all these problems because I'd be running on MySQL, OpenMPI, and a Linux HPC ;) -nic

Re: list comprehension problem

2009-10-29 Thread Nick Stinemates
> Some objects are singletons, ie there's only ever one of them. The most > common singleton is None. In virtually every other case you should be > using "==" and "!=". Please correct me if I am wrong, but I believe you meant to say some objects are immutable, in which case you would be correct.

Re: database handling

2009-11-07 Thread Nick Touran
The mysqldb module works well for me. It's available on sourceforge. Find some examples in the documentation here: http://mysql-python.sourceforge.net/MySQLdb.html#some-mysql-examples -Nick On Sat, Nov 7, 2009 at 11:24 AM, asit wrote: > I need some tutorial about python-mysql conn

Re: Vim breaks after Python upgrade

2009-11-17 Thread Nick Stinemates
At least with Gentoo, there's a command to recompile all of the plugins you have installed when upgrading python versions. Your issue is probably related to that. I don't think VIM uses hardcoded locations for scripts at the core. If you have any specific questions about the errors you're receivi

Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-17 Thread Nick Stinemates
>From _winreg.c: "Disables registry reflection for 32-bit processes running on a 64-bit OperatingSystem. Will generally raise NotImplemented if executed on a 32-bit Operating System. If the key is not on the reflection list, the function succeeds but has noeffect. Disabling reflection for a key

Re: Accessing a Web server --- how?

2009-11-18 Thread Nick Stinemates
This is what the History and Compare URL translates to: http://service.nordea.com/nordea-openpages/six.action?target=/nordea.public/bond/nordeabond.page&magic=(cc+(detail+(tsid+310746)+(view+hist)))& Some questions.. Do you have an idea on what the tsid is? It looks like it's a unique identifier

Re: A Good Mailer

2009-11-18 Thread Nick Stinemates
uot;em...@myhost.com"] session.sendmail(email_from, email_to, header+messages) HTH, Nick Stinemates > TIA, > Victor > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

High-performance Python websites

2009-11-25 Thread Nick Mellor
o find out more about how existing high-volume Python sites have managed their workload. Can anyone give me examples of high-volume Python-powered websites, if possible with some idea of their architecture? Many thanks, Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: High-performance Python websites

2009-11-25 Thread Nick Mellor
ld.com and others on the Django home page (http://www.djangoproject.com/) They seem to do a great job of loading large, complex pages using Django (stacked on Python, stacked on bytecode, stacked on C.) Shows it can be done. Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: [python-committers] [RELEASED] Python 3.2 beta 2

2010-12-21 Thread Nick Coghlan
to improve Sequence ABC conformance and to make range objects more list-like) Cheers, Nick. -- Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia -- http://mail.python.org/mailman/listinfo/python-list

Re: cipher encoding

2011-01-12 Thread Nick Stinemates
Try print s[::-1] Nick On Wednesday, January 12, 2011, Cathy James wrote: > Dear all, > > I hope someone out there can help me. > >  The output string of my code is close to what i need, but i need it > 1)printed on one line and > > 2) reversed > > > #

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Nick Stinemates
You make it very hard for me to take what you say seriously. I lurk on this list and I have created a filter where emails from you go in to Spam. Good luck. Nick On Tue, Jan 18, 2011 at 5:23 PM, rantingrick wrote: > On Jan 18, 2:37 pm, Adam Skutt wrote: > > On Jan 18, 2:11 pm, ra

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Nick Stinemates
norance is > defined as the lack of knowledge. Bill has presented just that. > No, he's refuting your point that newbies are somehow paralyzed and cannot make a decision about which toolkit they would like to use. > > PS: You never cease to amaze me MRAB. > I am also amazed. Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Nick Stinemates
ocs > > I disagree. All of the ducks should be in a row* **before* making a decision like this as it shows commitment from the community to making it happen. Nothing happens because we wish it to. Nick -- http://mail.python.org/mailman/listinfo/python-list

<    5   6   7   8   9   10   11   12   13   14   >