Imports again...

2010-04-09 Thread Alex Hall
Hello all, once again: http://www.gateway2somewhere.com/sw/sw.zip The above link is to a project. I am new to using multiple files in Python, and I have a lot of tangled imports where many files in the same folder are importing each other. When I tried to follow the manual to make some files into

Re: lambda with floats

2010-04-09 Thread Bas
On Apr 7, 6:15 am, Patrick Maupin wrote: > I should stop making a habit of responding to myself, BUT.  This isn't > quite an acre in square feet.  I just saw the 43xxx and assumed it > was, and then realized it couldn't be, because it wasn't divisible by > 10.  (I used to measure land with my gran

Re: pass object or use self.object?

2010-04-09 Thread Bruno Desthuilliers
Tim Arnold a écrit : On Apr 8, 4:20 am, Bruno Desthuilliers (snip) There are two points here : the first is that we (that is, at least, you and me) just don't know enough about the OP's project to tell whether something should belong to the document or not. period. The second point is that obje

Re: Imports again...

2010-04-09 Thread Tim Golden
On 08/04/2010 14:16, Alex Hall wrote: The above link is to a project. I am new to using multiple files in Python, and I have a lot of tangled imports where many files in the same folder are importing each other. When I tried to follow the manual to make some files into packages, it did not work.

Re: SIP

2010-04-09 Thread CHEN Guang
PythoidC ( http://pythoidc.sf.net ) provides some examples and templates for writing and importing C modules (.c or .exe) into Python environment, may be of some help. - Original Message - From: "omnia neo" To: Sent: Friday, April 09, 2010 1:51 PM Subject: Re: SIP On Apr 9, 10:42 am

Re: The Regex Story

2010-04-09 Thread Steven D'Aprano
On Fri, 09 Apr 2010 14:48:22 +1000, Lie Ryan wrote: > On 04/09/10 12:32, Dotan Cohen wrote: >>> Regexes do have their uses. It's a case of knowing when they are the >>> best approach and when they aren't. >> >> Agreed. The problems begin when the "when they aren't" is not >> recognised. > > But

Re: The Regex Story

2010-04-09 Thread Alf P. Steinbach
* Steven D'Aprano: For some reason, people seem to have the idea that pattern matching of strings must be a single expression, no matter how complicated the pattern they're trying to match. If we have a complicated task to do in almost any other field, we don't hesitate to write a function to

Re: python as pen and paper substitute

2010-04-09 Thread Giacomo Boffi
Manuel Graune writes: > Giacomo Boffi writes: > >> Manuel Graune writes: >> >>> Hello everyone, >>> >>> I am looking for ways to use a python file as a substitute for simple >>> pen and paper calculations. >> >> search("embedded calc mode") if manuel in emacs_fellows_set or sys.exit(1) > > Well

Re: The Regex Story

2010-04-09 Thread Paul Rubin
Steven D'Aprano writes: > One disadvantage is that you have to learn an entire new language, a > language which is painfully terse and obfuscated, with virtually no > support for debugging. Larry Wall has criticised the Perl regex syntax on > a number of grounds: ... There is a parser combinat

Re: The Regex Story

2010-04-09 Thread Lie Ryan
On 04/09/10 18:59, Steven D'Aprano wrote: > On Fri, 09 Apr 2010 14:48:22 +1000, Lie Ryan wrote: > >> On 04/09/10 12:32, Dotan Cohen wrote: Regexes do have their uses. It's a case of knowing when they are the best approach and when they aren't. >>> >>> Agreed. The problems begin when the

[Python-list] The distutils.sysconfig.set_python_config() function

2010-04-09 Thread Ray Allen
I've been reading the python document "Distributing python modules", and found this function document in sysconfig module: This function is even more special-purpose, and should only be used from Python’s own build procedures. distutils.sysconfig.set_python_build()<#distutils.sysconfig.set_python

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
Tim Chase, 08.04.2010 16:23: Lie Ryan wrote: Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ...

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
Steven D'Aprano, 09.04.2010 10:59: It's as if we decided that every maths problem had to be solved by a single expression, no matter how complex, and invented a painfully terse language unrelated to normal maths syntax for doing so: # Calculate the roots of sin**2(3*x-y): result = me.compile("{^

Re: How to open and read an unknown extension file

2010-04-09 Thread varnikat t
Hey thanks a lot to all of youNow i understood the concept and can use it the right way I have another doubt regarding using radio buttons I am using two radio buttons for user to select either of the two options: Landscape Portrait When i run the program it shows both radio buttons

Re: How to open and read an unknown extension file

2010-04-09 Thread varnikat t
And I am using python and GLADE for GUI On Fri, Apr 9, 2010 at 6:30 PM, varnikat t wrote: > Hey thanks a lot to all of youNow i understood the concept and can use > it the right way > > I have another doubt regarding using radio buttons > > I am using two radio buttons for user to se

Re: Pythonic list reordering

2010-04-09 Thread Joaquin Abian
On Apr 9, 1:58 am, Chris Rebert wrote: > On Thu, Apr 8, 2010 at 4:01 PM, Joaquin Abian wrote: > > On Apr 9, 12:52 am, Ben Racine wrote: > >> I have a list... > > >> ['dir_0_error.dat', 'dir_120_error.dat', 'dir_30_error.dat', > >> 'dir_330_error.dat'] > > >> I want to sort it based upon the num

Re: Preserving logging streams through a daemon.DaemonContext switch (was: daemon.DaemonContext)

2010-04-09 Thread Vinay Sajip
On Apr 9, 12:46 am, Ben Finney wrote: > > I think you just have to pass the file object used by the handler > > (fh.stream) in the files_preserve array. > > Not quite. As the docs specify, you need to pass the *file descriptors* > for the files you want preserved. Okay, but the docstring you quot

Re: Imports again...

2010-04-09 Thread Thomas Guettler
Hi, please post your traceback. I guess you have a recursive import. This can lead to strange exceptions (for example AttributeError) Thomas Alex Hall wrote: > Hello all, once again: > http://www.gateway2somewhere.com/sw/sw.zip > > The above link is to a project. I am new to using multiple fil

Excellent SAS Developer avaliable immediately for your client requriments

2010-04-09 Thread Haritha b
Dear Partners I have Keerthi, SAS Developer available immediately for your client requirements. Has worked for AccessPharmaceuticalsInc, ICON Clinical Research, Amarillo Biosciences. She is in NC right now and is willing to relocate in NC. Please let me know if you have any direct client position

Re: Imports again...

2010-04-09 Thread Gabriel Genellina
On 8 abr, 10:16, Alex Hall wrote: > Hello all, once again:http://www.gateway2somewhere.com/sw/sw.zip > > The above link is to a project. I am new to using multiple files in > Python, and I have a lot of tangled imports where many files in the > same folder are importing each other. When I tried

Re: Imports again...

2010-04-09 Thread Tim Golden
On 09/04/2010 15:19, Gabriel Genellina wrote: In addition to what Tim Golden has said (which appears to be based on another version of this project Just downloaded again, and there's definitely an empty package structure of the kind I described. (Altho' I certainly did have a few other versions

Re: SIP

2010-04-09 Thread Gabriel Genellina
omnia neo gmail.com> writes: > On Apr 9, 10:42 am, omnia neo wrote: > > On Apr 9, 10:30 am, Stefan Behnel wrote: > > > > > omnia neo, 09.04.2010 07:01: > > > > > > import siptest > > > > > > I get following error : > > > > import error : no module named siptest > > > > > Is the directory where y

Re: The Regex Story

2010-04-09 Thread Tim Chase
On 04/09/2010 06:18 AM, Stefan Behnel wrote: Tim Chase, 08.04.2010 16:23: Lie Ryan wrote: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ... t

Python Line Intersection

2010-04-09 Thread Peyman Askari
Hello This is partly Python related, although it might end up being more math related. I am using PyGTK (GUI builder for Python) and I need to find the intersection point for two lines. It is easy to do, even if you only have the four points describing line segments (http://www.maths.abdn.ac.u

Tough sorting problem: or, I'm confusing myself

2010-04-09 Thread david jensen
Hi all, I'm trying to find a good way of doing the following: Each n-tuple in combinations( range( 2 ** m ), n ) has a corresponding value n-tuple (call them "scores" for clarity later). I'm currently storing them in a dictionary, by doing: res={} for i in itertools.combinations( range( 2**

Re: Replacing Periods with Backspaces

2010-04-09 Thread Aahz
In article <8404fac9-06c7-4555-93af-c78f5e01d...@j21g2000yqh.googlegroups.com>, Booter wrote: > >I am trying to replace a series of periods in a sting with backspaces >that way I can easily parse information from a Windows command. the >current statement I have for this is > >capture = re.sub('\

Re: Python Line Intersection

2010-04-09 Thread Emile van Sebille
On 4/9/2010 8:04 AM Peyman Askari said... Hello This is partly Python related, although it might end up being more math related. I am using PyGTK (GUI builder for Python) and I need to find the intersection point for two lines. It is easy to do, even if you only have the four points describin

Re: Python Line Intersection

2010-04-09 Thread Gary Herron
Peyman Askari wrote: Hello This is partly Python related, although it might end up being more math related. I am using PyGTK (GUI builder for Python) and I need to find the intersection point for two lines. It is easy to do, even if you only have the four points describing line segments (h

Re: Python Line Intersection

2010-04-09 Thread Chris Rebert
On Fri, Apr 9, 2010 at 8:04 AM, Peyman Askari wrote: > > Hello > > This is partly Python related, although it might end up being more math > related. > > I am using PyGTK (GUI builder for Python) and I need to find the intersection > point for two lines. It is easy to do, even if you only have t

Re: Generating a rainbow?

2010-04-09 Thread Tobiah
>>You should use different variables for the two loops. > >Actually it is closing the divs that makes it work in FireFox: > Hah. I new that the rainbow wasn't complete and that it didn't work in Opera. I just fizzled on the closing of the divs. I also don't get why it worked at all

Re: Imports again...

2010-04-09 Thread Alex Hall
Okay, what you all say makes sense, and I am going to try the package thing again. The "modes" dir is from my last attempt, as is its "weather" subdir. I think I see what I did wrong, at least I hope I do. I will also remove the init file from the main dir. Yes, "arm" is the main directory of the p

Re: Pythonic list reordering

2010-04-09 Thread Tobiah
> How about a one liner? > > L.sort(key=lambda s: int(s.split('_')[1])) > > (Which is not necessarily elegant, but it is short.) I grant it a measure of elegance as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Imports again...

2010-04-09 Thread Ethan Furman
Tim Golden wrote: On 09/04/2010 15:19, Gabriel Genellina wrote: In addition to what Tim Golden has said (which appears to be based on another version of this project Just downloaded again, and there's definitely an empty package structure of the kind I described. (Altho' I certainly did have

Python question

2010-04-09 Thread Binary
How much space approximately is required to install the following packs on Windows XP? pycairo-1.4.12-2.win32-py2.6.exe python-2.6.1.msi pygobject-2.14.2-2.win32-py2.6.exe pygtk-2.12.1-3.win32-py2.6.exe pywin32-213.win32-py2.6.exe gtk-2.12.9-win32-2.exe Does all this packs requires installation

Re: How to call application in the background with subprocess.call

2010-04-09 Thread John Bokma
Kushal Kumaran writes: > On Thu, Apr 8, 2010 at 7:39 PM, jorma kala wrote: >> Hi, >> >> I'd like to call an external application (firefox) from a python program (a >> PyQT GUI), but I want the external application to run in the background, I >> mean I do not want my python calling program to wai

Re: Python Line Intersection

2010-04-09 Thread Josh English
On Apr 9, 8:36 am, Emile van Sebille wrote: > On 4/9/2010 8:04 AM Peyman Askari said... > > > Hello > > > This is partly Python related, although it might end up being more math > > related. > > > I am using PyGTK (GUI builder for Python) and I need to find the > > intersection point for two lin

Excellent Oracle Apps Technical Consutant avaliable immediately for your client requriments

2010-04-09 Thread Haritha b
Dear Partners I have Raja Rao, Oracle Apps Technical consultant available immediately for your client requirements. Has worked for Tekelec, Hitachi Data Systems etc. He is in NC right now and is willing to relocate. Pl. let me know if you have any direct client positions for him. Location: NC Re

Re: Performance of list vs. set equality operations

2010-04-09 Thread Gabriel Genellina
En Thu, 08 Apr 2010 21:02:23 -0300, Patrick Maupin escribió: On Apr 8, 6:35 pm, "Gabriel Genellina" wrote: The CPython source contains lots of shortcuts like that. Perhaps the checks should be stricter in some cases, but I imagine it's not so easy to fix: lots of code was written in the p

Re: Imports again...

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 11:29:50 -0300, Tim Golden escribió: On 09/04/2010 15:19, Gabriel Genellina wrote: In addition to what Tim Golden has said (which appears to be based on another version of this project Just downloaded again, and there's definitely an empty package structure of the kin

Re: Striving for PEP-8 compliance

2010-04-09 Thread John Nagle
Lawrence D'Oliveiro wrote: In message , Gabriel Genellina wrote: If you only reindent the code (without adding/removing lines) then you can compare the compiled .pyc files (excluding the first 8 bytes that contain a magic number and the source file timestamp). Remember that code objects contai

Re: Python Line Intersection

2010-04-09 Thread John Nagle
Chris Rebert wrote: On Fri, Apr 9, 2010 at 8:04 AM, Peyman Askari wrote: Hello This is partly Python related, although it might end up being more math related. I am using PyGTK (GUI builder for Python) and I need to find the intersection point for two lines. It is easy to do, even if you onl

Re: lambda with floats

2010-04-09 Thread monkeys paw
On 4/9/2010 3:43 AM, Bas wrote: On Apr 7, 6:15 am, Patrick Maupin wrote: I should stop making a habit of responding to myself, BUT. This isn't quite an acre in square feet. I just saw the 43xxx and assumed it was, and then realized it couldn't be, because it wasn't divisible by 10. (I used t

Re: Imports again...

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 13:10:44 -0300, Alex Hall escribió: c:\Python26>python.exe i:\arm\main.pyw Traceback (most recent call last): File "i:\arm\main.pyw", line 3, in import arm, network, weather, dict File "i:\arm\arm.py", line 4, in import config File "i:\arm\config.py", line 4,

Re: Cleanup guarantees?

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 01:13:37 -0300, Alf P. Steinbach escribió: > > import urllib.request # urlopen > import codecs # getreader > import sys # stderr > > def text_stream_from( url, encoding ): > text_reader = codecs.getreader( encoding ) > connection

Re: fcntl, serial ports and serial signals on RS232.

2010-04-09 Thread Max Kotasek
On Apr 8, 11:17 am, Grant Edwards wrote: > On 2010-04-07, Max Kotasek wrote: > > > I'm trying to figure out how to parse the responses fromfcntl.ioctl() > > calls that modify the serial lines in a way that asserts that the line > > is now changed. > > Two comments: > >   1) None of the Linux seri

Re: python as pen and paper substitute

2010-04-09 Thread Michael Torrie
On 04/08/2010 02:54 PM, Manuel Graune wrote: > > Well, the subject does say python and not elisp, but I'm a vim-user > anyways. Did you look at the link to Owen Taylor's reinteract program? I think it's closer to what you want than any other thing mentioned here, with the exception that it's a

Re: Python question

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 14:14:34 -0300, Binary escribió: How much space approximately is required to install the following packs on Windows XP? pycairo-1.4.12-2.win32-py2.6.exe python-2.6.1.msi pygobject-2.14.2-2.win32-py2.6.exe pygtk-2.12.1-3.win32-py2.6.exe pywin32-213.win32-py2.6.exe gtk-2.

Re: lambda with floats

2010-04-09 Thread Patrick Maupin
On Apr 9, 1:22 pm, monkeys paw wrote: > On 4/9/2010 3:43 AM, Bas wrote: > > > On Apr 7, 6:15 am, Patrick Maupin  wrote: > >> I should stop making a habit of responding to myself, BUT.  This isn't > >> quite an acre in square feet.  I just saw the 43xxx and assumed it > >> was, and then realized it

Re: Performance of list vs. set equality operations

2010-04-09 Thread Patrick Maupin
On Apr 9, 1:07 pm, "Gabriel Genellina" wrote: > En Thu, 08 Apr 2010 21:02:23 -0300, Patrick Maupin   > escribió: > > > On Apr 8, 6:35 pm, "Gabriel Genellina" wrote: > > >> The CPython source contains lots of shortcuts like that. Perhaps the   > >> checks should be stricter in some cases, but I i

Re: python grep

2010-04-09 Thread Peter Otten
Mag Gam wrote: > I am in the process of reading a zipped file which is about 6gb. > > I would like to know if there is a command similar to grep in python > because I would like to emulate, -A -B option of GNU grep. > > Lets say I have this, > > 083828.441,AA > 093828.441,AA > 094028.441,AA > 0

Re: lambda with floats

2010-04-09 Thread monkeys paw
On 4/9/2010 2:40 PM, Patrick Maupin wrote: On Apr 9, 1:22 pm, monkeys paw wrote: On 4/9/2010 3:43 AM, Bas wrote: On Apr 7, 6:15 am, Patrick Maupinwrote: I should stop making a habit of responding to myself, BUT. This isn't quite an acre in square feet. I just saw the 43xxx and assumed

Re: Python Line Intersection

2010-04-09 Thread lepy
> See Wikipedia for the usual solution, given points on both lines: > >        http://en.wikipedia.org/wiki/Line-line_intersection # -*- coding: utf-8 -*- import numpy as N def intersect(line1, line2): """\begin{align} P(x,y)= \bigg(&\frac{(x_1 y_2-y_1 x_2)(x_3-x_4)- (x_1-x_2)(x_3 y_4-y_3 x_4)

Re: Pydev 1.5.6 Released (Django Integration)

2010-04-09 Thread Дамјан Георгиевски
> Hi All, > > Pydev 1.5.6 has been released > > Details on Pydev: http://pydev.org > Details on its development: http://pydev.blogspot.com Question, Does it have a feature to evaluate the current edit buffer and continue with an interactive prompt? -- дамјан ((( http://damjan.softver.org.mk

Re: Python Line Intersection

2010-04-09 Thread Chris Rebert
On Fri, Apr 9, 2010 at 11:43 AM, John Nagle wrote: > Chris Rebert wrote: >> On Fri, Apr 9, 2010 at 8:04 AM, Peyman Askari >> wrote: >>> >>> Hello >>> >>> This is partly Python related, although it might end up being more math >>> related. >>> >>> I am using PyGTK (GUI builder for Python) and I ne

off by 1 error?

2010-04-09 Thread david jensen
Hi all, I'm trying to assign a color to various values between some arbitrary maximum and minimum, and i'd like to go from red to blue to green . Currently, I have the following, where i'm passing the minimum and maximum as a 2-tuple: def getcolor( minmax, curr ): rangesize = (minmax[1] -

How to read file during module import?

2010-04-09 Thread Jeremy
I have a module that, when loaded, reads and parses a supporting file. The supporting file contains all the data for the module and the function that reads/parses the file sets up the data structure for the module. How can I locate the file during the import statement. The supporting file is loc

Dvalve! we called the heart of outsourcing world.

2010-04-09 Thread Dvalve.com
Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, tested professionals with technical, marketing and business skills. Dvalve also pr

Dvalve! we called the heart of outsourcing world.

2010-04-09 Thread Dvalve.com
Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, tested professionals with technical, marketing and business skills. Dvalve also pr

Dvalve! we called the heart of outsourcing world.

2010-04-09 Thread Dvalve.com
Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, tested professionals with technical, marketing and business skills. Dvalve also pr

Dvalve! we called the heart of outsourcing world.

2010-04-09 Thread Dvalve.com
Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, tested professionals with technical, marketing and business skills. Dvalve also pr

Dvalve! we called the heart of outsourcing world.

2010-04-09 Thread Dvalve.com
Dvalve.com is an online talent workplace that helps companies hire and manage professionals online to get work done and grow their businesses. Dvalve matches employers with a ready and qualified workforce and rated, tested professionals with technical, marketing and business skills. Dvalve also pro

Re: Pickle problem while loading a class instance.

2010-04-09 Thread gerardob
I tried both things: 1- moved all the code to C:/Python26/lib/site-packages 2- Modified the PYTHONPATH in the windows registry. However, i stil have exactly the same error on the screen. Any other suggestions? Thanks. Peter Otten wrote: > > gerardob wrote: > >> Hello, I am new to python a

Re: How to read file during module import?

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 18:04:59 -0300, Jeremy escribió: How can I locate the file during the import statement. The supporting file is located in the same directory as the module, but when I import I get a No such file or directory error. I could hard code the path to the filename, but that would

Re: Pickle problem while loading a class instance.

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 18:42:23 -0300, gerardob escribió: I tried both things: 1- moved all the code to C:/Python26/lib/site-packages 2- Modified the PYTHONPATH in the windows registry. However, i stil have exactly the same error on the screen. Any other suggestions? Did you follow the advi

Re: How to read file during module import?

2010-04-09 Thread Jeremy
On Apr 9, 4:02 pm, "Gabriel Genellina" wrote: > En Fri, 09 Apr 2010 18:04:59 -0300, Jeremy escribió: > > > How can I locate the file during the import statement.  The supporting > > file is located in the same directory as the module, but when I import > > I get a No such file or directory error.

Re: Pickle problem while loading a class instance.

2010-04-09 Thread Peter Otten
gerardob wrote: > > I tried both things: > > 1- moved all the code to C:/Python26/lib/site-packages > 2- Modified the PYTHONPATH in the windows registry. > > However, i stil have exactly the same error on the screen. > > Any other suggestions? Did you heed my advice and make sure that your sc

Re: Striving for PEP-8 compliance

2010-04-09 Thread Lawrence D'Oliveiro
In message <4bbf6eb8$0$1670$742ec...@news.sonic.net>, John Nagle wrote: > Lawrence D'Oliveiro wrote: > >> In message , >> Gabriel Genellina wrote: >> >>> If you only reindent the code (without adding/removing lines) then you >>> can compare the compiled .pyc files (excluding the first 8 bytes tha

Event: First meeting of Karlsruhe User Group (tentatively named "KaPy"), 2010-04-16, 19:00:00 CEST

2010-04-09 Thread Jürgen Erhard
A new user group is being set up by some interested pythoneers from (around) Karlsruhe. The first meeting will be on Friday, 2010-04-16 (April 16th, 2010) at 19:00 (7pm) in the rooms of Entropia eV (the local affiliate of the CCC). See http://entropia.de/wiki/Anfahrt on how to get there. Or repl

urllib2: post request to textarea

2010-04-09 Thread bfrederi
I'm getting a 500 error when attempting to make a post request with urllib2 to a form with a tag. When I create the post request with all the other post data, I don't get a 500. Just the part of the form that is a . Is this just a coincidence, and my real problem is something else? Thanks, Brando

getopt question

2010-04-09 Thread Raphael Mayoraz
Hello, I have some trouble to make getopt.getopt work and the way I want (and is described in the documentation). Attached is very small script to reproduce my problem. If running: > python testGetOpt.py -a junk1 -b junk2 everything is ok > python testGetOpt.py -c junk1 ok too: I get the 'In

Re: nested threading

2010-04-09 Thread Aahz
In article <4566e767-768f-4399-8a6b-5530ec90b...@a37g2000prd.googlegroups.com>, Omer Ihsan wrote: > >is there anything as "nested threading"that is, call a thread from >within a thread. >in this case how will thread locking take place. > >for example initially there were two functions that we

Re: off by 1 error?

2010-04-09 Thread Terry Reedy
On 4/9/2010 4:10 PM, david jensen wrote: Hi all, I'm trying to assign a color to various values between some arbitrary maximum and minimum, and i'd like to go from red to blue to green . Currently, I have the following, where i'm passing the minimum and maximum as a 2-tuple: def getcolor( minma

getopt question

2010-04-09 Thread Raphael Mayoraz
Ooops, forgot to attach the file in my first e-mail. Now, here it is. Hello, I have some trouble to make getopt.getopt work and the way I want (and is described in the documentation). Attached is very small script to reproduce my proble

Re: getopt question

2010-04-09 Thread Sean DiZazzo
On Apr 9, 4:37 pm, Raphael Mayoraz wrote: > Ooops, forgot to attach the file in my first e-mail. Now, here it is. > > > Hello, > > I have some trouble to make getopt.getopt work and the way I want (and > is described in the documentation). >

Re: Striving for PEP-8 compliance

2010-04-09 Thread Grant Edwards
On 2010-04-09, Lawrence D'Oliveiro wrote: > In message <4bbf6eb8$0$1670$742ec...@news.sonic.net>, John Nagle wrote: > >> Lawrence D'Oliveiro wrote: >> >>> In message , >>> Gabriel Genellina wrote: >>> If you only reindent the code (without adding/removing lines) then you can compare the

Re: Striving for PEP-8 compliance

2010-04-09 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > Anybody who invents another brace-delimited language should be beaten. > You always end up with a big problem trying to make sure the braces > are consistent with the program logic. Would you prefer “begin” and “end” word symbols, then? -- http://mail.python.o

Re: Preserving logging streams through a daemon.DaemonContext switch

2010-04-09 Thread Ben Finney
Vinay Sajip writes: > On Apr 9, 12:46 am, Ben Finney wrote: > > Not quite. As the docs specify, you need to pass the *file > > descriptors* for the files you want preserved. > > Okay, but the docstring you quoted: > > "Elements of the list are file descriptors (as returned by a file > object's `

Re: Striving for PEP-8 compliance

2010-04-09 Thread Grant Edwards
On 2010-04-10, Lawrence D'Oliveiro wrote: > In message , Grant Edwards wrote: > >> Anybody who invents another brace-delimited language should be beaten. >> You always end up with a big problem trying to make sure the braces >> are consistent with the program logic. > Would you prefer ???begin???

Re: Striving for PEP-8 compliance

2010-04-09 Thread Patrick Maupin
On Apr 9, 5:31 pm, Lawrence D'Oliveiro wrote: > >> Anybody who ever creates another indentation-controlled language should > >> be beaten to death with a Guido van Rossum voodoo doll. > > >     No ... > > Yes, because otherwise you wouldn’t have stupid problems like the one which > is preoccupying

Re: raise exception with fake filename and linenumber

2010-04-09 Thread kwatch
On 4月8日, 午後12:52, "Gabriel Genellina" wrote: > > The built-in SyntaxError exception does what you want. Constructor   > parameters are undocumented, but they're as follows: > >     raise SyntaxError("A descriptive error message", (filename, linenum,   > colnum, source_line)) > > colnum is used to

Re: Striving for PEP-8 compliance

2010-04-09 Thread Steven D'Aprano
On Sat, 10 Apr 2010 10:31:58 +1200, Lawrence D'Oliveiro wrote: > In message <4bbf6eb8$0$1670$742ec...@news.sonic.net>, John Nagle wrote: > >> Lawrence D'Oliveiro wrote: >> >>> In message , >>> Gabriel Genellina wrote: >>> If you only reindent the code (without adding/removing lines) then >>

Re: urllib2: post request to textarea

2010-04-09 Thread Tim Roberts
bfrederi wrote: > >I'm getting a 500 error when attempting to make a post request with >urllib2 to a form with a tag. When I create the post >request with all the other post data, I don't get a 500. Just the part >of the form that is a . Is this just a coincidence, and my >real problem is somethi

Re: Performance of list vs. set equality operations

2010-04-09 Thread Raymond Hettinger
> > I don't know if it's a good "fix" anyway.  If you subclass an internal > > type, you can certainly supply your own rich comparison methods, which > > would (IMO) put the CPU computation burden where it belongs if you > > decide to do something goofy like subclass a list and then override > > __

Re: Python Line Intersection

2010-04-09 Thread Mark Tolonen
"Chris Rebert" wrote in message news:y2o50697b2c1004091304u627d99bfj44ad56fa76a3c...@mail.gmail.com... On Fri, Apr 9, 2010 at 11:43 AM, John Nagle wrote: Chris Rebert wrote: On Fri, Apr 9, 2010 at 8:04 AM, Peyman Askari wrote: Hello This is partly Python related, although it might end

Re: Python Line Intersection

2010-04-09 Thread Lie Ryan
On 04/10/10 16:24, Mark Tolonen wrote: > > "Chris Rebert" wrote in message > news:y2o50697b2c1004091304u627d99bfj44ad56fa76a3c...@mail.gmail.com... >> On Fri, Apr 9, 2010 at 11:43 AM, John Nagle wrote: >>> Chris Rebert wrote: On Fri, Apr 9, 2010 at 8:04 AM, Peyman Askari wrote: >