[issue16991] Add OrderedDict written in C

2015-05-29 Thread Wes Turner
Wes Turner added the comment: * Would this make it easy/faster to also have a DefaultOrderedDict (which can/could also be accomplished with .get(attr, []) and .setdefault ? On May 29, 2015 2:39 PM, Eric Snow rep...@bugs.python.org wrote: Eric Snow added the comment: Planning on committing

[issue16991] Add OrderedDict written in C

2014-12-17 Thread Wes Turner
Wes Turner added the comment: * Macros could be useful. * Would this make it easy/faster to also have a DefaultOrderedDict (which can/could also be accomplished with .get(attr, []) and .setdefault(attr, [])? * There may be some value in looking at https://pypi.python.org/pypi/cyordereddict

[issue20019] platform.py line _sys_version function

2013-12-19 Thread Wes
Wes added the comment: I'll submit this to Continuum Analytics so they know it's their issue. On Thu, Dec 19, 2013 at 3:06 AM, Marc-Andre Lemburg rep...@bugs.python.orgwrote: Marc-Andre Lemburg added the comment: Closing, since there's nothing much we can do about the problem

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
New submission from Wes: Marc-Andre, I'm on a Macbook pro OSX Mountain Lion I've been automating virtual environment builds locally and remotely, but it seems that when my pip install -r requirements.txt tries to run and download.py in pip/ runs it invokes platform.py. I'm getting a user

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
Wes added the comment: Marc Thanks for getting back to me so quickly on this. I'm running an apple version of python from the looks of it. I was running an Anaconda version at the time I posted this script, but I just reset my $PATH variable to use the mac factory python and still got

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
Wes added the comment: Marc, Here was the initial output: platform.__file__ '/Users/wesmadrigal/anaconda/lib/python2.7/platform.pyc' import sys sys.version '2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Nov 11 2013, 10:49:09) \n[GCC 4.0.1 (Apple Inc. build 5493)]' Here is what I had when I

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
Wes added the comment: I just commented out the _sys_version_parser regular expression in anaconda/lib/python2.7/platform.py on line 1363 and replaced it with the _sys_version_parser from /usr/lib/python2.7/platform.py and everything worked fine. On Wed, Dec 18, 2013 at 5:53 PM, Ned Deily rep

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
Wes added the comment: The shitty part is, you pretty much need anaconda to run iPython notebook on a mac. On Wed, Dec 18, 2013 at 6:08 PM, Wes Madrigal wesley7...@gmail.com wrote: I just commented out the _sys_version_parser regular expression in anaconda/lib/python2.7/platform.py on line

[issue20019] platform.py line _sys_version function

2013-12-18 Thread Wes
Wes added the comment: Marc, Thanks for your help. What I did was just copied the _sys_version_parser from the standard python platform.py into the anaconda version of platform.py and it fixed the issue. So it looks like Anaconda made a change to your regular expression. Thanks for getting

[issue16692] Support TLS 1.1 and TLS 1.2

2013-08-04 Thread Wes Turner
Wes Turner added the comment: http://docs.python.org/3.4/whatsnew/3.4.html#ssl re: Backporting to Python 2.7: maybe something like: backports.ssl (like backports.ssl_match_hostname) https://pypi.python.org/pypi/backports/ -- nosy: +westurner

[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner
New submission from Wes Turner: random.shuffle [1][2] could be faster. ``xrange(10,1,-1)`` is faster than ``reversed(xrange(1,10))``. [1] http://hg.python.org/cpython/file/v3.3.2/Lib/random.py#l254 [2] http://hg.python.org/cpython/file/v2.7.5/Lib/random.py#l276 -- components: Library

[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner
Wes Turner added the comment: Added patch to random.shuffle for trunk -- Added file: http://bugs.python.org/file30985/random-shuffle_trunk.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18511

[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner
Wes Turner added the comment: Added patch to random.shuffle for v2.7.5 -- keywords: +patch Added file: http://bugs.python.org/file30984/random-shuffle_v2.7.5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18511

[issue4493] urllib2 doesn't always supply / where URI path component is empty

2010-11-22 Thread Wes Chow
Wes Chow wes.c...@gmail.com added the comment: This same bug also exists in HTTPClient, and my patch addresses that. Addressing it in HTTPClient has a side effect of taking care of it for urllib2 as well (and all future libraries that use HTTPClient). Even if the urllib2 patch is preferable

[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-11-20 Thread Wes Chow
Wes Chow wes.c...@gmail.com added the comment: Here's a patch for 3.2 which fixes this problem I believe. There does exist a test case that should have produced an error, except that the last path segment in RFC3986_BASE is only one character long. Had it been more than one character long

[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-11-20 Thread Wes Chow
Wes Chow wes.c...@gmail.com added the comment: New patch (urlparse-9721-3.2.patch) against 3.2 which fixes the erroneous test. -- Added file: http://bugs.python.org/file19706/urlparse-9721-3.2.patch ___ Python tracker rep...@bugs.python.org http

[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-11-20 Thread Wes Chow
Wes Chow wes.c...@gmail.com added the comment: Patch against 2.7 (urlparse-9721-2.7.patch). -- Added file: http://bugs.python.org/file19707/urlparse-9721-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9721

[issue4493] urllib2 doesn't always supply / where URI path component is empty

2010-11-20 Thread Wes Chow
Wes Chow wes.c...@gmail.com added the comment: Attached is a patch against 3.2 that replaces empty paths with '/' in HTTPConnection. I do not totally understand the ; syntax in URIs, and so this implementation may break that, as it splits urls and unsplits them if needed. The Python docs seem

[issue10144] Buffering bug after calling curses function

2010-10-18 Thread Wes McKinney
New submission from Wes McKinney wesmck...@gmail.com: We tracked a bug originating in IPython to the Python interpreter itself, seems to be present in 2.6.x and 2.7.x but not 3.1.x. This is on Ubuntu Linux 10.04, does not seem to occur in OS X 10.6. Reference: http://article.gmane.org

Structure accessible by attribute name or index

2010-03-17 Thread Wes Santee
an answer. Cheers, -Wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Structure accessible by attribute name or index

2010-03-17 Thread Wes Santee
On Mar 17, 11:14 am, Christian Heimes li...@cheimes.de wrote: Wes Santee wrote: I am very new to Python, and trying to figure out how to create an object that has values that are accessible either by attribute name, or by index.  For example, the way os.stat() returns a stat_result

Re: Structure accessible by attribute name or index

2010-03-17 Thread Wes Santee
On Mar 17, 11:34 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: Wes Santee a écrit : I am very new to Python, and trying to figure out how to create an object that has values that are accessible either by attribute name, or by index.  For example, the way

Re: WANTED: Regular expressions for breaking TeX/LaTeX document into tokens

2010-02-24 Thread Wes James
help: http://plastex.sourceforge.net/plastex/sect0025.html -wes -- http://mail.python.org/mailman/listinfo/python-list

Re: python dowload

2010-02-23 Thread Wes James
snip NEW QUESTION if y'all are still reading: Is there an integer increment operation in Python? I tried using i++ but had to revert to 'i = i + 1' i+=1 snip -- http://mail.python.org/mailman/listinfo/python-list

Re: string to list when the contents is a list

2010-02-18 Thread Wes James
On Thu, Feb 18, 2010 at 8:18 AM, Tim Chase python.l...@tim.thechases.com wrote: Wes James wrote: snip Just to add to the list of solutions I've seen, letting the built-in csv module do the heavy lifting:   s = ['a','b']   import csv   no_brackets = s[1:-1] # s.strip(' \t[]')   c

Re: string to list when the contents is a list

2010-02-18 Thread Wes James
On Thu, Feb 18, 2010 at 12:32 PM, Wes James compte...@gmail.com wrote: On Thu, Feb 18, 2010 at 8:18 AM, Tim Chase python.l...@tim.thechases.com wrote: Wes James wrote: snip Just to add to the list of solutions I've seen, letting the built-in csv module do the heavy lifting:   s = ['a','b

string to list when the contents is a list

2010-02-17 Thread Wes James
(',') returns [ 'a' , 'b' ] when I want it to return ['a','b']. How can I do this? thx, -wes -- http://mail.python.org/mailman/listinfo/python-list

error trying to join #python on irc.freenode.net

2010-02-17 Thread Wes James
When I try to join #python on irc.freenode.net it keeps saying: You need to identify with network services to join the room #python on irc.freenode.net. Server Details: Cannot join channel (+r) - you need to be identified with services What does this mean? thx, -wes -- http://mail.python.org

Re: error trying to join #python on irc.freenode.net

2010-02-17 Thread Wes James
On Wed, Feb 17, 2010 at 4:53 PM, Wes James compte...@gmail.com wrote: When I try to join #python on irc.freenode.net it keeps saying: You need to identify with network services to join the room #python on irc.freenode.net. Server Details: Cannot join channel (+r) - you need to be identified

Re: socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-16 Thread Wes McKinney
On Sep 16, 3:53 pm, Irmen de Jong irmen.nos...@xs4all.nl wrote: Tim Roberts wrote: Wes McKinney wesmck...@gmail.com wrote: I noticed the flag socket.MSG_WAITALL seems to have crept its way into Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about intermediate releases

socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-15 Thread Wes McKinney
in the socket module. Does anyone know more about this? Thanks, Wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python Web Framework ?

2009-04-21 Thread Wes James
On Tue, Apr 21, 2009 at 12:46 PM, SKYLAB zky...@gmail.com wrote: Greetings.. First , my english is not good . I heard that was written in python ( Youtube Programming Language : PYTHON :S ) Correct ? That's not correct ? Then youtube is PHP application ? That's correct ; Which python web

python twitter

2009-04-15 Thread Wes James
Anyone know if there is a twit for python? I did http://twitter.com/python, but nope on that I was looking for twit py announcements, etc... thx, -wj -- http://mail.python.org/mailman/listinfo/python-list

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels scott.dani...@acm.org wrote: Atul. wrote: snip In your case, '\r' is a return (a single character), not two characters long. I think its sad that 'C:\Thesis' doesn't cause an error because there is no such character as '\T', but I am

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:32 PM, Wes James compte...@gmail.com wrote: On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels scott.dani...@acm.org wrote: Atul. wrote: snip In your case, '\r' is a return (a single character), not two characters long. I think its sad that 'C:\Thesis' doesn't

Re: Upgrade Python on a Mac

2009-03-02 Thread Wes James
On Mon, Mar 2, 2009 at 2:53 PM, Rey Bango reyba...@gmail.com wrote: Hi, I'd like to upgrade the installed version of Python that came standard on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot in it, I just wanted to get a better understanding of the process. I'd recommend

how to conditionally add a dict in-line

2009-02-23 Thread Wes James
I have this line: navs.append(A(' '+str(i+1)+' ',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query or ''}))) How do I do something like this: vars={'_page':i, if request.vars._query not None then insert this key/value pair ('_query':request.vars._query) else

Re: how to conditionally add a dict in-line

2009-02-23 Thread Wes James
On Mon, Feb 23, 2009 at 9:35 PM, Wes James compte...@gmail.com wrote: I have this line: navs.append(A(' '+str(i+1)+' ',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query or ''}))) How do I do something like this: vars={'_page':i, if request.vars._query

Re: how to conditionally add a dict in-line

2009-02-23 Thread Wes James
Steven. Thx (see my question below...) On Mon, Feb 23, 2009 at 9:47 PM, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Mon, 23 Feb 2009 21:35:38 -0700, Wes James wrote: I have this line: navs.append(A(' '+str(i+1)+' ',_href=self.action(args=request.args,vars= {'_page':i

parsing text from a file

2009-01-29 Thread Wes James
If I read a windows registry file with a line like this: {C15039B5-C47C-47BD-A698-A462F4148F52}=v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted Multicast|Edge=FALSE| with this code:

Re: Python Genetic Algorithm

2008-01-28 Thread wes
Max, def GeneticNextGen(self): numsets = len(self.WtSets) numwts= len(self.WtSets[0].Lis) self.WtSets.sort(CompByCurrentFitness) index_lis = [] K = 100.0 N= float(numwts) #if RISE(slope) is too high, concentration

Re: problem with global var

2008-01-03 Thread wes
Bruno Ferreira wrote: Hi, I wrote a very simple python program to generate a sorted list of lines from a squid access log file. Here is a simplified version: ## 1 logfile = open (squid_access.log, r) 2 topsquid = [[0, 0, 0, 0, 0, 0, 0]] 3 4 def

Re: MySQLdb syntax issues - HELP

2007-12-16 Thread wes
) \ % (CharAccount, CharName, CharGender, CharJob, CharLevel, Strength,\ Dexterity, Inteligence, Charm, Luck) print sql=,sql cursor.execute(sql) -then show the error message here wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary help

2007-11-01 Thread wes weston
Steve wrote: I'm currently working on a little database type program is which I'm using a dictionary to store the information. The key is a component a and the definition is a list of parts that make up the component. My problem is I need to list out several components, but not all, and

Re: python under earthlink hosting?

2006-08-01 Thread wes weston
No, but before I signed up with them I asked if it was available and they said yes. wes mbstevens wrote: I keep chatting with the tech support people at Earthlink, asking where the location of the Python interpreter is. They don't seem to know where it is. They don't know if Python

Re: Parsing HTML--looking for info/comparison of HTMLParser vs. htmllib modules.

2006-07-07 Thread wes weston
from HTMLParser import HTMLParser class MyHTMLParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.TokenList = [] def handle_data( self,data): data = data.strip() if data and len(data) 0: self.TokenList.append(data)

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread wes weston
Andrew Robert wrote: Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) self is not known here; only inside the class. var =

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread wes weston
Andrew Robert wrote: wes weston wrote: Andrew Robert wrote: Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) self is not known here; only

Re: Basic coin flipper program - logical error help

2006-02-21 Thread wes weston
flipping once before the start of the loop now. wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Walking through a mysql db

2005-06-04 Thread wes weston
, You just check for a fetchone return of None. list is a list of tuples here. ... cursor.execute( sql ) list = [] while 1: row = cursor.fetchone() if not row: break list.append(row) ... wes -- http://mail.python.org/mailman

Re: Rotating arbitrary sets of elements within a list

2005-04-08 Thread wes weston
. The i'th element is gotten as mod 6 (front+i) where 6 would be the length of the list. wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Rotating arbitrary sets of elements within a list

2005-04-08 Thread wes weston
[EMAIL PROTECTED] wrote: I'm trying to come up with a good algorithm to do the following: Given a list 'A' to be operated on, and a list 'I' of indices into 'A', rotate the i'th elements of 'A' left or right by one position. Here's are some examples: A = [a, b, c, d, e, f] I = [0, 3, 4] rotate(A,

Re: MySQL problem

2005-03-18 Thread wes weston
Dennis Lee Bieber wrote: On Thu, 17 Mar 2005 16:45:57 GMT, wes weston [EMAIL PROTECTED] declaimed the following in comp.lang.python: str = INSERT INTO produkt1 (MyNumber) VALUES(%d) % (MyNumber) cursor.execute(str) Think you meant MyValue for the second item... However... Try neither

Re: MySQL problem

2005-03-17 Thread wes weston
) % (MyNumber) cursor.execute(str) wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple account program

2005-03-17 Thread wes weston
? All transactions are related to an account; have a self.TransActList in Account. You have amount in both Withdrawl and Deposit both derived from Transaction. If Transactions always have an amount, why not put amount in the transactions class? But we don't know. wes -- http://mail.python.org

Re: What's the cost of using hundreds of threads?

2005-03-01 Thread wes weston
solution to this problem :) ). PR, I notice there's a resource module with a getrusage(who) that looks like it would support a test to get what you need. wes -- http://mail.python.org/mailman/listinfo/python-list

Re: String Replace Problem...

2005-02-28 Thread wes weston
/ andrea, If you put in keywords.reverse() after getting keywords, things may work better. Though not a good fix, it illustrates part of the problem. If you replace @PERMX1 you also replace part of @PERMX10. Wouldn't it be better to read the file as lines instead of strings? wes -- http

Re: broke tkinter

2005-02-08 Thread wes weston
, Might you be getting the wrong header file/tk version? http://wiki.tcl.tk/3669 talks about it. wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Where are list methods documented?

2005-02-01 Thread wes weston
list.sort.__doc__ 'L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) - -1, 0, 1' Grant, For a quick, short doc string list: help(list) wes -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you do arrays

2005-02-01 Thread wes weston
) + 1 iMatrix[index] = k The book statement of array(typecode, initializer) does not make sence to me how it henerates ore relaes to the org name for the array. Thank You Tom Thomas, You can do m = [4] m [4] wes -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you do arrays

2005-02-01 Thread wes weston
Is it basic that indexes from 1 vs. 0? 'just about completely forgotten basic. wes Thomas Bunce wrote: Tryed it and this is what I got (I did go to the web sight) tom(h=500)$ /tmp/501/Cleanup\ At\ Startup/ptesting-128981347.87.py.command; exit Input the maximu number of tvalue: 114 Traceback (most

Re: Where can I find sample beginner programs to study?

2005-01-28 Thread wes weston
the pieces you use most often. wes -- http://mail.python.org/mailman/listinfo/python-list

Re: A completely silly question

2004-12-17 Thread wes weston
sence to me... Amir Amir, import tkSimpleDialog ch = tkSimpleDialog.askstring(,ch?) wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on sorting

2004-11-29 Thread wes weston
. You could do: def mycompare(s1,s2): #return -1 to put s1's at front; 1 to put s1's at back; 0 for a tie #if s1== and s2: return 1 lines.sort(mycompare) wes -- http://mail.python.org/mailman/listinfo/python-list