Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.04; 'argument': 0.05; 'output': 0.05; 'subject:ANN': 0.07; 'string': 0.09; 'friday,': 0.09; 'function,': 0.09; 'subject:version': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'sat,': 0.16; 'wrote:': 0.18; 'subject:] ': 0.20; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'chris': 0.29; 'am,': 0.29; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'you?': 0.31; 'anyone': 0.31; 'could': 0.34; 'convert': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'date.': 0.36; 'useful': 0.36; 'january': 0.37; 'so,': 0.37; 'handle': 0.38; 'issue': 0.38; 'skip:p 20': 0.39; 'how': 0.40; 'today,': 0.61; 'email addr:gmail.com': 0.63; 'skip:n 10': 0.64; 'to:addr:gmail.com': 0.65; 'default': 0.69; "today's": 0.70; '2015': 0.84; '2:02': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3pQ2z0bWZtNZ3/PLz0W9robROWJVvDmXZxNByqzqnR4=; b=smJab2sJC6WHCjmEt8AHy7ZyWExeiAE14vGXYRQk4tEmp1RH7MkhGVt3rq1+xRmGXy 0XsodBU3AualYgSrV+vHfgcmCksMzhGXzT4Wu7fyQ9P2Wx8hEUA2wZOOjaFAO7O2bGIq Uef05ny/wXDvWkJdOKwwJUEih4Dtq7zmw9CPVDhs51ubpYl9aA/a9fH4PPTzy3W6Knwo eEe6EN4Ah9Hzlt8V2k8OjLTGD983PehOm6ECESkogLJKs8BPf9sTU7ZyiRSKaRJHUkv3 4SLoIm1rQzerkk202vD3N8WNpbW7B2c45Stx1eJUbmReMZTpWVsVzR/PIWSnqu+3DZSe xuUQ== MIME-Version: 1.0 X-Received: by 10.152.87.142 with SMTP id ay14mr26140058lab.45.1420882348540; Sat, 10 Jan 2015 01:32:28 -0800 (PST) In-Reply-To: References: <4c3dbebe-0184-4ca7-9d7d-30462ae2a578@googlegroups.com> <2f1dd848-e075-4435-93ef-c65af9a5148b@googlegroups.com> Date: Sat, 10 Jan 2015 10:32:28 +0100 Subject: Re: [ANN] EasyGUI_Qt version 0.9 From: Chris Warrick To: =?UTF-8?Q?Andr=C3=A9_Roberge?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420882357 news.xs4all.nl 2914 [2001:888:2000:d::a6]:38320 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83495 On Sat, Jan 10, 2015 at 2:02 AM, Andr=C3=A9 Roberge wrote: > On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@gmail.com wrote: >> One issue is the format returned for the calendar selection. For today, = the string returned is "Fri Jan 9 2015". My script needs to convert the dat= e to a datetime.date, and having the month returned as a string instead of = an integer makes this harder. > > Would today's date be represented as the string "09.01.2015" useful to yo= u? (I found out how to do this.) If so, I could perhaps add an argument li= ke numeric_format =3D True. The correct way to handle this is to use cal.date.toPyDate(), which helpfully returns a datetime.date object =E2=80=94 and make this the defaul= t output of the calendar function, because that=E2=80=99s the only useful out= put for anyone asking for a date. >>> date 'Sat Jan 10 2015' >>> cal.date PyQt4.QtCore.QDate(2015, 1, 10) >>> cal.date.toPyDate() datetime.date(2015, 1, 10) --=20 Chris Warrick PGP: 5EAAEA16