Re: How to add a current string into an already existing list

2013-11-05 Thread Larry Hudson
On 11/05/2013 02:07 AM, Antoon Pardon wrote: And now you have depraved Nikos of the opportunity to really learn something. ... I know you meant "deprived", but "depraved Nikos" sounds like a good description to me. ;-) -=- Larry -=- -- https://mail.python.org/mai

Re: To whoever hacked into my Database

2013-11-08 Thread Larry Hudson
ot be surprised if he doesn't report it as income. Pure speculation, of course. -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing PIL without internet access

2015-02-26 Thread Larry Martell
On Thu, Feb 26, 2015 at 11:57 AM, MRAB wrote: > On 2015-02-26 15:23, Larry Martell wrote: >> >> I have a host that has no access to the internet and I need to install >> PIL on it. I have an identical host that is on the internet and I have >> installed it there (with

[RELEASED] Python 3.5.0a2 is now available

2015-03-09 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm thrilled to announce the availability of Python 3.5.0a2. Python 3.5.0a2 is the second alpha release of Python 3.5, which will be the next major release of Python. Python 3.5 is still under heavy development

regex help

2015-03-13 Thread Larry Martell
I need to remove all trailing zeros to the right of the decimal point, but leave one zero if it's whole number. For example, if I have this: 14S,5.,4.5686274500,3.7272727272727271,3.3947368421052630,5.7307692307692308,5.7547169811320753,4.9423076923076925,5.7884615384615383,5.1

Re: regex help

2015-03-13 Thread Larry Martell
On Fri, Mar 13, 2015 at 1:29 PM, MRAB wrote: > On 2015-03-13 16:05, Larry Martell wrote: >> >> I need to remove all trailing zeros to the right of the decimal point, >> but leave one zero if it's whole number. For example, if

Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
I have an app that works with 2.6, but in 2.7 it is failing. I traced it down to an issue with decimal.Decimal being passed a value of 0.0. It 2.6 this is fine, but in 2.7 it throws an exception: TypeError: Cannot convert float to Decimal. First convert the float to a string This is easy enough

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
On Wed, Mar 25, 2015 at 8:26 AM, Grant Edwards wrote: > On 2015-03-25, Larry Martell wrote: >> I have an app that works with 2.6, but in 2.7 it is failing. I traced >> it down to an issue with decimal.Decimal being passed a value of 0.0. >> It 2.6 this is fine, but in 2.7 i

Re: Python 2.7 issue with decimal value 0.0

2015-03-25 Thread Larry Martell
On Wed, Mar 25, 2015 at 10:44 AM, Ian Kelly wrote: > On Wed, Mar 25, 2015 at 8:36 AM, Larry Martell > wrote: >> On Wed, Mar 25, 2015 at 8:26 AM, Grant Edwards >> wrote: >>> On 2015-03-25, Larry Martell wrote: >>>> I have an app that works with 2.6, but

Re: Sudoku solver

2015-03-27 Thread Larry Hudson
expressing-hate -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Supply condition in function call

2015-03-27 Thread Larry Hudson
ies directly without going through the clipboard. I use this all the time, VERY handy. It's been standard in Unix/Linux since forever... :-) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.5.0a3 is now available

2015-03-30 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm thrilled to announce the availability of Python 3.5.0a3. Python 3.5.0a3 is the third alpha release of Python 3.5, which will be the next major release of Python. Python 3.5 is still under heavy development,

Re: Help with ElementTree

2015-04-09 Thread Larry Martell
On Thu, Apr 9, 2015 at 2:39 PM, Peter Otten <__pete...@web.de> wrote: > Larry Martell wrote: > >> I have an XML file that looks like this (this is just the pertinent >> part, the file is huge): >> >> >> >> >> >>

Re: Help with ElementTree

2015-04-09 Thread Larry Martell
On Thu, Apr 9, 2015 at 2:42 PM, Ben Finney wrote: > Larry Martell writes: > >> I have an XML file that looks like this (this is just the pertinent >> part, the file is huge): > > It's also not a very helpful schema. Elements called “Node”, where the > actual ty

Help with ElementTree

2015-04-09 Thread Larry Martell
with this? Thanks! -larry -- https://mail.python.org/mailman/listinfo/python-list

Re: EuroPython 2015: Django Girls Workshop

2015-04-17 Thread Larry Martell
On Fri, Apr 17, 2015 at 4:31 PM, Marko Rauhamaa wrote: > beliav...@aol.com: > >> If your target audience is women, I think you should have termed it >> the Django Womens Workshop rather than the Django Girls Workshop. >> Referring to adults as children can be seen as condescending. > > You got it

Re: New to Python - block grouping (spaces)

2015-04-17 Thread Larry Hudson
he defining and creating something new. But otherwise, take it or leave it. Naturally you are permitted to have your own opinions, whether passionate or otherwise, but it's not worth arguing about. -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.5.0a4 is now available

2015-04-20 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm thrilled to announce the availability of Python 3.5.0a4. Python 3.5.0a4 is the fourth and alpha release of Python 3.5, which will be the next major release of Python. Python 3.5 is still under development, a

Re: Enterprise Python

2015-04-25 Thread Larry Martell
On Fri, Apr 24, 2015 at 10:27 PM, Terry Reedy wrote: > Someone, (Mark, I believe), posted this link to a podcast from a few weeks > ago: > http://www.talkpythontome.com/episodes/show/4/enterprise-python-and-large-scale-projects > > A large part of that is based on this Dec 2014 post: > https://www

Re: seek operation in python

2015-04-30 Thread Larry Hudson
anduser(message_filename), 'r').readlines()[index].rstrip() Very minor nit unrelated to the file closing question: This would be a good place to give index a default value... def get_indexed_message(message_filename, index=0): ... -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: seek operation in python

2015-04-30 Thread Larry Hudson
On 04/30/2015 01:50 PM, Cecil Westerhof wrote: Op Thursday 30 Apr 2015 21:38 CEST schreef Larry Hudson: On 04/30/2015 01:06 AM, Cecil Westerhof wrote: [snip] I wrote a module where I have: def get_indexed_message(message_filename, index): """ Get index message from a file, w

Re: Immediate Hire: Sr. Java Software Engineer - Oklahoma - GC, US Citizens Onlt

2015-05-11 Thread Larry Martell
I am only interested in work that I can do remotely from home. If you have any opportunities like that, please contact me. On Mon, May 11, 2015 at 11:12 AM, nagaraju thoudoju wrote: > Hi, > > Hope you are doing well, > > Please find the requirement below and let me know you interest on this > po

[RELEASED] Python 3.5.0b1 is now available

2015-05-24 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm pleased to announce the availability of Python 3.5.0b1. Python 3.5 has now entered "feature freeze". By default new features may no longer be added to Python 3.5. (However, there are a handful of features tha

[RELEASED] Python 3.5.0b2 is now available

2015-05-31 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0b2. Python 3.5.0b1 had a major regression (see http://bugs.python.org/issue24285 for more information) and as such was not suitable for testing Python 3.5.

Re: Regular Expression

2015-06-04 Thread Larry Martell
On Thu, Jun 4, 2015 at 9:36 AM, Palpandi wrote: > > Hi All, > > This is the case. To split "string2" from "string1_string2" I am using > re.split('_', "string1_string2", 1)[1]. > > It is working fine for string "string1_string2" and output as "string2". But > actually the problem is that if a sti

Re: So what's happening here?

2015-06-05 Thread Larry Martell
On Fri, Jun 5, 2015 at 8:46 AM, Paul Appleby wrote: > I saw somewhere on the net that you can copy a list with slicing. So > what's happening when I try it with a numpy array? > a = numpy.array([1,2,3]) b = a[:] a is b > False b[1] = 9 a > array([1, 9, 3]) is is identity

Re: Is it a newsgroup or a list?

2015-06-07 Thread Larry Martell
On Sun, Jun 7, 2015 at 11:49 AM, Gene Heskett wrote: > You mentioned GoogleGroups, now go warsh yur mouth out with some of > Grandma's Lye soap. This list is 500% easier to read when they are > filtered out. I still see the responses but they are at least formatted > for readability. Gene is ver

Re: Parser needed.

2015-06-11 Thread Larry Martell
On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick wrote: > but you aren't asking questions. You are having a conversation with > yourself on a public q/a list. Its unpleasant Well, he did mention masterbation in another post. -- https://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.5.0b3 is now available

2015-07-05 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0b3. Python 3.5 has now entered "feature freeze". By default new features may no longer be added to Python 3.5. This is a preview release, and its use is

[RELEASED] Python 3.5.0b4 is now available

2015-07-26 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm delighted to announce the availability of Python 3.5.0b4. Python 3.5.0b4 is scheduled to be the last beta release; the next release will be Python 3.5.0rc1, or Release Candidate 1. Python 3.5 has now entered "featu

Re: Gmail eats Python

2015-07-29 Thread Larry Martell
On Wed, Jul 29, 2015 at 10:51 AM, wrote: > On Sun, Jul 26, 2015, at 07:48, Marko Rauhamaa wrote: >> At first, there was only the machine language. Assembly languages >> introduced "mnemonics" for the weaklings who couldn't remember the >> opcodes by heart. > > To be fair, x86 is also a particular

Re: Python Developer- Houston, TX

2015-08-10 Thread Larry Martell
Can this be done remotely or only on-site? On Mon, Aug 10, 2015 at 3:24 PM, wrote: > Hi, > Hope you are doing well !!! > My name is Siva and I'm a recruiter at TheAppliedthought , a global staffing > and IT consulting company. > Please find the below job description which may suits any of your

[RELEASED] Python 3.5.0rc1 is now available

2015-08-10 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0rc1, also known as Python 3.5.0 Release Candidate 1. Python 3.5 has now entered "feature freeze". By default new features may no longer be added to Python

Re: Sorry folks, minor hiccup for Python 3.5.0rc1

2015-08-10 Thread Larry Hastings
On 08/10/2015 05:55 PM, Larry Hastings wrote: I yanked the tarballs off the release page as soon as I suspected something. I'm rebuilding the tarballs and the docs now. If you grabbed the tarball as soon as it appeared, it's slightly out of date, please re-grab. p.s. I s

Sorry folks, minor hiccup for Python 3.5.0rc1

2015-08-10 Thread Larry Hastings
I built the source tarballs with a slightly-out-of-date tree. We slipped the release by a day to get two fixes in, but the tree I built from didn't have those two fixes. I yanked the tarballs off the release page as soon as I suspected something. I'm rebuilding the tarballs and the docs n

[RELEASED] Python 3.5.0rc2 is now available

2015-08-25 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0rc2, also known as Python 3.5.0 Release Candidate 2. Python 3.5 has now entered "feature freeze". By default new features may no longer be added to Python

sending push notifications

2015-09-03 Thread Larry Martell
I'm looking for people's experiences with the different ways to send push notifications to mobile devices. I have an app that will be running on Amazon, so I can use their SNS API or I can do it myself. >From googling there appear to be a few different packages but PyAPNs and python-gcm seem to be

Re: sending push notifications

2015-09-03 Thread Larry Martell
On Thu, Sep 3, 2015 at 8:54 AM, Laura Creighton wrote: > In a message of Thu, 03 Sep 2015 08:30:35 -0400, Larry Martell writes: >>I'm looking for people's experiences with the different ways to send >>push notifications to mobile devices. I have an app that will be >

mocking request and still getting certain ones locally

2015-09-07 Thread Larry Martell
I use the getsentry/responses package (https://github.com/getsentry/responses) for mocking the requests library for unit testing. It works great but now I have a situation where I need to talk to a local server but have my remote requests mocked out. With getsentry/responses I cannot do that - all

[RELEASED] Python 3.5.0rc3 is now available

2015-09-07 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0rc3, also known as Python 3.5.0 Release Candidate 3. The next release of Python 3.5 will be Python 3.5.0 final. There should be few (or no) changes to Pyt

Re: passing double quotes in subprocess

2015-09-08 Thread Larry Martell
On Tue, Sep 8, 2015 at 7:03 AM, loial wrote: > I need to execute an external shell script via subprocess on Linux. > > One of the parameters needs to be passed inside double quotes > > But the double quotes do not appear to be passed to the script > > I am using : > > myscript = '/home/john/myscri

Getting response over logging socket

2015-09-09 Thread Larry Martell
I have an app that uses the logging package with a SocketHandler to send messages. Now I've been asked to change it so that it can receive a response for each log message sent. It appears there is no way to do this with logging package. Is that true? Can I not receive data over a socket used in a l

[RELEASED] Python 3.5.0rc4 is now available!

2015-09-09 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm surprised to announce the availability of Python 3.5.0rc4, also known as Python 3.5.0 Release Candidate 4. Python 3.5.0 Release Candidate 3 was only released about a day ago. However: during testing, a major

[RELEASED] Python 3.5.0 is now available

2015-09-13 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm proud to announce the availability of Python 3.5.0. Python 3.5.0 is the newest version of the Python language, and it contains many exciting new features and optimizations. You can read all about what's new

Catching exceptions from logging socket handler

2015-09-18 Thread Larry Martell
I have a socket logging handler and I want to be able to catch exceptions from it. Specifically, I want to know if the remote side has gone away so I can close the socket and reopen it when the remote side come back. What happens now is that I get Broken pipe and BAD_WRITE_RETRY exceptions, but it

sort help

2015-09-22 Thread Larry Martell
I currently have 3 lists of lists and I sort them based on a common field into a single list like this: def GetObjKey(a): return a[2] sorted(a + b + c, key=GetObjKey) Which works just fine. But now, I need to have just the first list (a) also sub sorted by another fi

Re: sort help

2015-09-23 Thread Larry Martell
On Tue, Sep 22, 2015 at 6:55 PM, Chris Angelico wrote: > On Wed, Sep 23, 2015 at 8:42 AM, Larry Martell > wrote: >> I currently have 3 lists of lists and I sort them based on a common >> field into a single list like this: >> >> def GetObjKey

Re: Oracle connect

2015-09-30 Thread Larry Martell
On Wed, Sep 30, 2015 at 11:25 AM, wrote: > Hi > New to Python and just downloaded 3.5 > Trying to connect to Oracle but failing - eg > > import cx_oracle > connstr = 'userid/password@@99.999.9.99:PORT/SID' > connection = cx_oracle.connect(connstr) > cursor = connection.cursor() > cursor.execute("

threading bug in strptime

2015-10-05 Thread Larry Martell
We have been trying to figure out an intermittent problem where a thread would fail with this: AttributeError: 'module' object has no attribute '_strptime' Even though we were importing datetime. After much banging our heads against the wall, we found this: http://code-trick.com/python-bug-attri

List comprehension with if-else

2015-10-28 Thread Larry Martell
I'm trying to do a list comprehension with an if and that requires an else, but in the else case I do not want anything added to the list. For example, if I do this: white_list = [l.control_hub.serial_number if l.wblist == wblist_enum['WHITE'] else None for l in wblist] I end up with None in my

Re: List comprehension with if-else

2015-10-28 Thread Larry Martell
On Wed, Oct 28, 2015 at 12:36 PM, Zachary Ware wrote: > On Wed, Oct 28, 2015 at 11:25 AM, Larry Martell > wrote: >> I'm trying to do a list comprehension with an if and that requires an >> else, but in the else case I do not want anything added to the list. >>

Re: Regular expressions

2015-11-06 Thread Larry Martell
On Fri, Nov 6, 2015 at 3:36 PM, Christian Gollwitzer wrote: > Am 06.11.15 um 20:52 schrieb ru...@yahoo.com: >> >> I have always thought lexing >> and parsing solutions for Python were a weak spot in the Python eco- >> system and I was about to write that I would love to see a PEG parser >> for pyt

[RELEASED] Python 3.5.1rc1 is now available

2015-11-22 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm pleased to announce the availability of Python 3.5.1rc1. Python 3.5.1 will be the first update for Python 3.5. Python 3.5 is the newest version of the Python language, and it contains many exciting new featur

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Larry Hudson
cters are stripped. Example: >>> s = 'some text \n' >>> print('"{}"'.format(s.rstrip())) # No parameter, strip all whitespace "some text" >>> print('"{}"'.format(s.rstrip('\n'))) # Parameter

Re: First time I looked at Python was(...)

2014-06-10 Thread Larry Martell
On Tue, Jun 10, 2014 at 4:51 PM, Mark Lawrence wrote: > On 10/06/2014 21:41, leo kirotawa wrote: >> >> Gzz, >> >> Guys I'm from Brazil too, and I'm ashamed for this troll. And sorry by >> his terrible taste in music. >> Wondering now about moderation , have we one? >> > > No, otherwise the residen

Re: Adding thread module support to Ubuntu 3 for Python3

2014-06-23 Thread Larry Hudson
: I gave up on Ubuntu when they switched to Unity -- I find that very awkward to use. Just personal opinion, of course, and I know there are others who like it -- that's fine with me as well. (But I switched to Mint.) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get Timezone from latitude/longitude ?

2014-06-25 Thread Larry Martell
On Wed, Jun 25, 2014 at 8:53 AM, wrote: > Hi, > > I'm looking for a python-library which can help me to get Timezone and > Timezone-offset(UTC) from latitude/longitude. > > I'm not able to find an easy way to do it. > > Thanks in advance. It took me 30 seconds on google to find this: https://g

Re: Why is it different from the example on the tutorial?

2014-07-06 Thread Larry Hudson
ar superior and more comfortable to use, and it gets away from Big-Brotherish Microsoft. I do use it occasionally, but I think the last time I ran it was at least two months ago.) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Blocked thread

2014-07-17 Thread Larry Martell
I have a python cx_Oracle script that does a delete from a table. Usually this takes well under 1 second. But sometimes it takes 1 to 2 minutes. I wanted to monitor that delete and if it's taking too long I want to see what is blocking it. I run the delete sql in a thread and I do this: while sel

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 1:32 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 2:26 AM, Larry Martell > wrote: >> I have a python cx_Oracle script that does a delete from a table. >> Usually this takes well under 1 second. But sometimes it takes 1 to 2 >> minutes.

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 1:46 PM, Skip Montanaro wrote: > > On Thu, Jul 17, 2014 at 12:32 PM, Chris Angelico wrote: >> >> I don't know Oracle specifically, but if it's anything like >> PostgreSQL, you'll probably do better with a completely separate >> connection to the server > > > Agreed. We use

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:01 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell > wrote: >> I can have as many connections to the db server as I want, that's not >> the issue. The issue is that my main thread seems to be blocked in the >> jo

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:04 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 4:00 AM, Larry Martell > wrote: >> I did ask my DBA - he said "Blocking is a normal part of database >> operations. It's only a problem when it's a deadlock, in which case >>

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:09 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 4:03 AM, Larry Martell > wrote: >> On Thu, Jul 17, 2014 at 2:01 PM, Chris Angelico wrote: >>> On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell >>> wrote: >>>> I can have

Re: Python 3 is killing Python

2014-07-18 Thread Larry Martell
On Fri, Jul 18, 2014 at 8:19 AM, Grant Edwards wrote: > But, I do know that a > decent, civilized person just doesn't make insulting comments like > that about somebody else's work even if it is true (which I very much > doubt). Now, _that's_ funny. This is the internet. If you can't stand the he

Re: Wikibooks example doesn't work

2014-08-06 Thread Larry Hudson
My response here may sound harsh but I don't mean it to be, so please don't take it that way. Python is a great language to learn -- keep it up, you'll get it!:-) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie needing some help

2014-08-08 Thread Larry Martell
On Fri, Aug 8, 2014 at 3:07 PM, Matt Smith wrote: > I am trying to write a program that will loop through a text file and delete > rows in a mysql database. > > It seemingly runs but I don't see anything getting deleted in the db. > Is there anything apparent that I am missing? > > This is the cod

Re: how to get the ordinal number in list

2014-08-08 Thread Larry Martell
On Sat, Aug 9, 2014 at 1:22 PM, luofeiyu wrote: x=["x1","x3","x7","x5"] y="x3" > > how can i get the ordinal number by some codes? > > for id ,value in enumerate(x): > if y==value : print(id) > > Is more simple way to do that? print x.index(y) -- https://mail.python.org/mailman/li

Re: Python in financial services

2014-08-12 Thread Larry Martell
On Tue, Aug 12, 2014 at 3:33 AM, Rustom Mody wrote: > Ive been asked to formulate a python course for financial services folk. > > If I actually knew about the subject, I'd have fatter pockets! > Anyway heres some thoughts. What I am missing out? > > [Apart from basic python -- contents typically

Re: newbee

2014-08-13 Thread Larry Hudson
u might check it out. (Current Amazon price -- $25.81) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Why can not initialize the class?

2014-08-22 Thread Larry Martell
On Fri, Aug 22, 2014 at 10:26 AM, luofeiyu wrote: > System:win7+python34. > > class Contact(object): > def __init__(self, first_name=None, last_name=None, > display_name=None, email=None): > self.first_name = first_name > self.last_name = la

Re: Why can not initialize the class?

2014-08-22 Thread Larry Martell
On Fri, Aug 22, 2014 at 10:58 AM, luofeiyu wrote: class Contact(object): > ... def __init__(self, first_name=None, last_name=None, > ... display_name=None, email="haha@haha"): > ... self.first_name = first_name > ... self.last_name = last_name > ...

Re: Working with decimals

2014-08-24 Thread Larry Hudson
l/index.html It does appear that you're using Py3, but in case you're using Py2, change the '3' in that URL to '2'. (Print formatting is in section 7) -=- Larry -=- PS. Oops, my bad... I just double checked my suggestions, which left-justified the values, b

Re: Working with decimals

2014-08-24 Thread Larry Hudson
7;-' instead of the default space filler) [-] [---] [] <-- showing field widths -12 $123.45--- $15.00- Notice, the first field is right-justified by default. (And that is not negative 12, the '-' is my pretend filler) Helpful? -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: This formating is really tricky

2014-08-26 Thread Larry Hudson
post) > pb2=random.choice([1-53]) > > I included my shortcut for pb2. It doesn't work? Is there a short to > prevent from listing each number? Of course it doesn't work! That list has only one element, the integer -52. Now go through a tutorial to find out what to d

Re: This could be an interesting error

2014-08-31 Thread Larry Hudson
7;m still not highly accurate and fairly frequently make typos, it's still much better than hunt-and-peck typing.) I definitely suggest it is well worth learning. -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

hashlib suddenly broken

2014-09-18 Thread Larry Martell
I am on a mac running 10.8.5, python 2.7 Suddenly, many of my scripts started failing with: ValueError: unsupported hash type sha1 Googling this showed that it's an issue with hashlib with a common cause being a file called hashlib.py that gets in the way of the interpreter finding the standard

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 10:47 AM, John Gordon wrote: > In Larry Martell > writes: > >> Googling this showed that it's an issue with hashlib with a common >> cause being a file called hashlib.py that gets in the way of the >> interpreter finding the standard

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 11:18 AM, Chris Angelico wrote: > On Fri, Sep 19, 2014 at 3:07 AM, Steven D'Aprano > wrote: >> but I expect that's probably not where the problem lies. My *wild guess* is >> that your system updated SSL, and removed some underlying SHA-1 library >> needed by hashlib. SHA-1

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 11:07 AM, Steven D'Aprano wrote: > Larry Martell wrote: > >> I am on a mac running 10.8.5, python 2.7 >> >> Suddenly, many of my scripts started failing with: >> >> ValueError: unsupported hash type sha1 > [...] >> This ju

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 1:22 PM, Larry Martell wrote: > On Thu, Sep 18, 2014 at 11:07 AM, Steven D'Aprano > wrote: >> Larry Martell wrote: >> >>> I am on a mac running 10.8.5, python 2.7 >>> >>> Suddenly, many of my scripts started failing wi

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 2:21 PM, John Gordon wrote: > In Larry Martell > writes: > >> It's failing on the 'import _sha' in hashlib.py: > >> 66 def __get_builtin_constructor(name): >> 67try: >> 68 if name in (&#x

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 2:44 PM, Ned Deily wrote: > In article > , > Larry Martell wrote: >> On Thu, Sep 18, 2014 at 1:22 PM, Larry Martell >> wrote: >> > On Thu, Sep 18, 2014 at 11:07 AM, Steven D'Aprano >> > wrote: >> >> Larry Martel

Re: hashlib suddenly broken

2014-09-18 Thread Larry Martell
On Thu, Sep 18, 2014 at 2:49 PM, Christian Heimes wrote: > On 18.09.2014 21:23, Larry Martell wrote: >> On Thu, Sep 18, 2014 at 11:18 AM, Chris Angelico wrote: >>> On Fri, Sep 19, 2014 at 3:07 AM, Steven D'Aprano >>> wrote: >>>> but I expect that

Re: hashlib suddenly broken

2014-09-19 Thread Larry Martell
On Thu, Sep 18, 2014 at 11:00 PM, Steven D'Aprano wrote: > Ned Deily wrote: > >> In article >> , >> Larry Martell wrote: >>> Do you think I should install this update? Perhaps that would restore >>> whatever is missing. >> >> Yes. You

Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Larry Martell
On Mon, Sep 22, 2014 at 8:23 AM, Chris Angelico wrote: > So, comments would definitely help. In some cases, would help a lot. This is me: http://xkcd.com/1421/ -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 3.4.2rc1 is now available

2014-09-22 Thread Larry Hastings
On behalf of the Python development community and the Python 3.4 release team, I'm chuffed to announce the availability of Python 3.4.2rc1. Python 3.4.2 has many bugfixes and other small improvements over 3.4.1. One new feature for Mac OS X users: the OS X installers are now distributed as

Re: [python-committers] [RELEASE] Python 3.4.2rc1 is now available

2014-09-22 Thread Larry Hastings
/issue21431 We'll get it right for 3.4.2 final. I don't think we need to respin 3.4.2rc1 / add a 3.4.2rc2 for this. On 09/22/2014 06:02 PM, Terry Reedy wrote: On 9/22/2014 10:15 AM, Larry Hastings wrote: You can download it here: https://www.python.org/download/rele

Best way to deal with different data types in a list comprehension

2014-09-23 Thread Larry Martell
I have some code that I inherited: ' '.join([self.get_abbrev()] + [str(f['value') for f in self.filters if f.has_key('value')]).strip() This broke today when it encountered some non-ascii data. I changed the str(f['value']) line to f['value'].encode('utf-8'),

Re: Best way to deal with different data types in a list comprehension

2014-09-23 Thread Larry Martell
On Tue, Sep 23, 2014 at 6:05 PM, Rock Neurotiko wrote: > 2014-09-24 0:01 GMT+02:00 Larry Martell : >> >> I have some code that I inherited: >> >> ' '.join([self.get_abbrev()] + >>[str(f['value') >> for f i

Re: Storage Cost Calculation

2014-09-27 Thread Larry Martell
On Sat, Sep 27, 2014 at 7:18 AM, Chris Angelico wrote: > On Sat, Sep 27, 2014 at 9:14 PM, Skip Montanaro > wrote: > > On Sep 27, 2014 1:06 AM, "Chris Angelico" wrote: > >> > > > >> We are not going to do your homework for you. > > > > Perhaps it was a take home test... What then? :-) > > Then w

Re: Storage Cost Calculation

2014-09-27 Thread Larry Martell
On Sat, Sep 27, 2014 at 7:18 AM, Chris Angelico wrote: > On Sat, Sep 27, 2014 at 9:14 PM, Skip Montanaro > wrote: > > On Sep 27, 2014 1:06 AM, "Chris Angelico" wrote: > >> > > > >> We are not going to do your homework for you. > > > > Perhaps it was a take home test... What then? :-) > > Then w

Re: Returning a List

2014-10-03 Thread Larry Hudson
ing as a program, you have to specifically print the return values (or save them in a variable to access them later). Change your calling line to: print(front_x(['bbb', 'ccc', 'axx', 'xzz', 'xaa'])) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Issue in printing top 20 dictionary items by dictionary value

2014-10-04 Thread Larry Hudson
w] on the lhs of the assignment does not exist, so a new entry is created in the ts dictionary with the given w as the key, and the value is initialized with the 1 from the get()+1. Make sense? -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 3.4.2 is now available

2014-10-08 Thread Larry Hastings
On behalf of the Python development community and the Python 3.4 release team, I'm pleased to announce the availability of Python 3.4.2. Python 3.4.2 has many bugfixes and other small improvements over 3.4.1. One new feature for Mac OS X users: the OS X installers are now distributed as sig

Re: Code Review for Paper, Rock, Scissors

2014-10-15 Thread Larry Hudson
ps')# Computer selects human = get_rps() # Human selects if human == 'q': break print('You have {}, I have {}. '.format( things[human], things[computer]), end='') scr, res = get_result(human, computer) scores[scr] += 1# Count win/loss/draw print(res) # And show results # Show final scores print('\nTotal scores:') print('\tYou won {} games'.format(scores[WIN])) print('\tComputer won {} games'.format(scores[LOSE])) print('\tThere were {} tie games'.format(scores[DRAW])) print('\nThanks for playing with me. Bye now.') # End of code -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Building lists

2014-10-21 Thread Larry Hudson
description is too vague to effectively do that. Good luck. -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Building lists

2014-10-21 Thread Larry Hudson
ague. But good luck! -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Test None for an object that does not implement ==

2011-12-25 Thread Larry Hudson
7;s simply: (a==None) and (c==None) Most of the replies you're getting here seem unnecessarily complicated. Thanks, gz -=- Larry -=- -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-23 Thread Larry Hudson
has to be done with a less convenient extended if/elif/.../else structure. Peter -=- Larry -=- -- http://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8   9   10   11   12   >