Re: a gift function and a question

2013-09-09 Thread Mohsen Pahlevanzadeh
I completed my two functions, i say may be poeple can use them: ##33 def integerToPersian(number): listedPersian = ['۰','۱','۲','۳','۴','۵','۶','۷','۸','۹'] listedEnglish = ['0','1','2','3','4','5','6','7','8','9'] returnList = list()

Re: python REST API access fails after adding date to URL

2013-09-09 Thread dieter
mahsan9...@gmail.com writes: > So the REST API calls work great with out the URL appended to the URL.However > as soon as I do add the URL, because I want to retrieve the data on a daily > basis, the calls fail and the server will return a 401 and say signature > invalid. Apparently, you do so

Language design

2013-09-09 Thread Steven D'Aprano
Some time ago, Tom Christiansen wrote about the "Seven Deadly Sins of Perl": http://www.perl.com/doc/FMTEYEWTK/versus/perl.html What design mistakes, traps or gotchas do you think Python has? Gotchas are not necessarily a bad thing, there may be good reasons for it, but they're surprising. T

Re: Building tkinter on Windows

2013-09-09 Thread Westley Martínez
On Monday, September 9, 2013 12:43:16 AM UTC-7, Terry Reedy wrote: > Some combination of the README instructions, external.bat, and the > > project files are not correct. There may be an issue on the tracker. I > > believe I copied tcl85g.dll and tk85g.dll into .../py3x/pcbuild from > > .../t

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 11:05:44 -0600, Michael Torrie wrote: > On 09/09/2013 08:28 AM, wxjmfa...@gmail.com wrote: >> Comment: Such differences never happen with utf. > > But with utf, slicing strings is O(n) (well that's a simplification as > someone showed an algorithm that is log n), whereas a fix

Re: Monitor key presses in Python?

2013-09-09 Thread Michael Torrie
On 09/09/2013 11:39 AM, eamonn...@gmail.com wrote: > Is there a way to detect if the user presses a key in Python that > works on most OS's? I've only seen 1 method, and that only works in > Python 2.6 and less. If you get the key, can you store it in a > variable? > > Also, is there a way to cre

Re: Weighted choices

2013-09-09 Thread Jason Friedman
>> I coach a flag football team of 11-year-olds. A stated goal of the >> league is that every player should get nearly equal playing time and >> that winning is of secondary importance. That said, some players just >> can't throw the ball at all, and having a quarterback who cannot throw >> is no

Re: Monitor key presses in Python?

2013-09-09 Thread Nobody
On Mon, 09 Sep 2013 10:39:43 -0700, eamonnrea wrote: > Is there a way to detect if the user presses a key in Python that works on > most OS's? I've only seen 1 method, and that only works in Python 2.6 and > less. There's no "generic" solution to this. At a minimum, there's getting "key presses"

Re: Can I trust downloading Python?

2013-09-09 Thread Nobody
On Sun, 08 Sep 2013 03:37:15 +, Dave Angel wrote: > You can run a 32bit Python on 64bit OS, but not the oter way > around. And most people just match the bitness of Python against the > bitness of the OS. AFAICT, most people run 32-bit Python on any version of Windows. [And this isn't limit

RE: sqlite issue in 2.7.5

2013-09-09 Thread Joseph L. Casale
> This pragma speeds up most processes 10-20 times (yes 10-20): > pragma synchronous=OFF > > See the SQLITE documentation for an explanation. > I've found no problems with this setting. Aside from database integrity and consistency? :) I have that one set to OFF as my case mandates data processing

Re: Can I trust downloading Python?

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 12:19:11 +, Fattburger wrote: > On Sun, 08 Sep 2013 03:37:15 +, Dave Angel wrote: > >> 1) what OS are you running? Actually, we can be pretty sure you're >> running Windows, since any other common operating system would have >> already included Python. > > Plus I don

Re: sqlite issue in 2.7.5

2013-09-09 Thread mbg1708
On Tuesday, September 3, 2013 8:22:42 AM UTC-4, Alister wrote: > On Mon, 02 Sep 2013 22:13:27 +, Joseph L. Casale wrote: > > > > > I have been battling an issue hopefully someone here has insight with. > > > > > > I have a database with a few tables I perform a query against with some >

Re: a gift function and a question

2013-09-09 Thread random832
On Mon, Sep 9, 2013, at 16:10, Mohsen Pahlevanzadeh wrote: > My question is , do you have reverse of this function? persianToInteger? The int constructor is able to handle different forms of decimal numerals directly: >>> int('\u06f3\u06f4\u06f5\u06f5') 3455 -- https://mail.python.org/mailman/li

Re: Monitor key presses in Python?

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 10:39:43 -0700, eamonnrea wrote: > Is there a way to detect if the user presses a key in Python that works > on most OS's? I've only seen 1 method, and that only works in Python 2.6 > and less. http://code.activestate.com/recipes/577977 I have just tried the above under Linux

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread Terry Reedy
On 9/9/2013 12:38 PM, Ned Batchelder wrote: jmf, thanks for your reply. You've calmed my fears that there is something wrong with the Flexible String Representation. None of the examples you show demonstrate any behavior contrary to the Unicode spec. The goals of the new unicode implementati

a gift function and a question

2013-09-09 Thread Mohsen Pahlevanzadeh
Dear all, I have a gift for mailing list: def integerToPersian(number): listedPersian = ['۰','۱','۲','۳','۴','۵','۶','۷','۸','۹'] listedEnglish = ['0','1','2','3','4','5','6','7','8','9'] returnList = list() listedTmpString = list(str(numb

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Victor Stinner
2013/9/9 Antoine Pitrou : > Le Mon, 9 Sep 2013 14:30:50 +0200, > Victor Stinner a écrit : >> 2013/9/9 Larry Hastings : >> > Python 3.4 includes a range of improvements of the 3.x series, >> > including hundreds of small improvements and bug fixes. Major new >> > features and changes in the 3.4 re

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread random832
On Mon, Sep 9, 2013, at 15:03, Ian Kelly wrote: > Do you mean that it breaks when overwriting Python string object buffers, > or when overwriting arbitrary C strings either received from C code or > created with create_unicode_buffer? > > If the former, I think that is to be expected since ctypes

Re: Monitor key presses in Python?

2013-09-09 Thread John Gordon
In <57051d11-abd9-4621-9618-1574cd375...@googlegroups.com> eamonn...@gmail.com writes: > Is there a way to detect if the user presses a key in Python that works on > most OS's? That depends on what you're really asking; your question is somewhat vague. Are you asking for a function that waits f

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread random832
On Fri, Sep 6, 2013, at 13:04, Chris Angelico wrote: > On Sat, Sep 7, 2013 at 2:59 AM, wrote: > > Incidentally, how does all this interact with ctypes unicode_buffers, > > which slice as strings and must be UTF-16 on windows? This was fine > > pre-FSR when unicode objects were UTF-16, but I'm not

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread Ian Kelly
On Sep 9, 2013 12:36 PM, wrote: > > On Fri, Sep 6, 2013, at 13:04, Chris Angelico wrote: > > On Sat, Sep 7, 2013 at 2:59 AM, wrote: > > > Incidentally, how does all this interact with ctypes unicode_buffers, > > > which slice as strings and must be UTF-16 on windows? This was fine > > > pre-FSR

Re: Monitor key presses in Python?

2013-09-09 Thread Dave Angel
On 9/9/2013 13:39, eamonn...@gmail.com wrote: > Is there a way to detect if the user presses a key in Python that works on > most OS's? I've only seen 1 method, and that only works in Python 2.6 and > less. If you get the key, can you store it in a variable? > > Also, is there a way to create a

Monitor key presses in Python?

2013-09-09 Thread eamonnrea
Is there a way to detect if the user presses a key in Python that works on most OS's? I've only seen 1 method, and that only works in Python 2.6 and less. If you get the key, can you store it in a variable? Also, is there a way to create a callback in Python? -- https://mail.python.org/mailman

Re: Can I trust downloading Python?

2013-09-09 Thread William Ray Wing
On Sep 9, 2013, at 12:23 PM, Michael Torrie wrote: > On 09/09/2013 05:02 AM, Anthony Papillion wrote: >> But (and this is stepping into *really* paranoid territory here. But >> maybe not beyond the realm of possibility) it would not be so hard to >> compromise compilers at the chip level. If the

Re: Can I trust downloading Python?

2013-09-09 Thread Michael Torrie
On 09/09/2013 10:40 AM, William Ray Wing wrote: > I think that is pretty far fetched. It requires recognition that a > compiler is being compiled. I'd be REALLY surprised if there were a > unique sequence of hardware instructions that was common across every > possible compiler (current and futur

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread Ned Batchelder
On 9/9/13 10:28 AM, wxjmfa...@gmail.com wrote: Le vendredi 6 septembre 2013 17:46:14 UTC+2, Piet van Oostrum a écrit : wxjmfa...@gmail.com writes: The Flexible String Representation has conceptually to face the same problem. It splits "unicode" in chunks and it has to solve two problems at t

python REST API access fails after adding date to URL

2013-09-09 Thread mahsan9861
Hi, So the REST API calls work great with out the URL appended to the URL.However as soon as I do add the URL, because I want to retrieve the data on a daily basis, the calls fail and the server will return a 401 and say signature invalid.The code is below: import oauth2 as oauth import time

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread Michael Torrie
On 09/09/2013 08:28 AM, wxjmfa...@gmail.com wrote: > Comment: Such differences never happen with utf. But with utf, slicing strings is O(n) (well that's a simplification as someone showed an algorithm that is log n), whereas a fixed-width encoding (Latin-1, UCS-2, UCS-4) is O(1). Do you understan

Re: Can I trust downloading Python?

2013-09-09 Thread Michael Torrie
On 09/09/2013 05:02 AM, Anthony Papillion wrote: > But (and this is stepping into *really* paranoid territory here. But > maybe not beyond the realm of possibility) it would not be so hard to > compromise compilers at the chip level. If the NSA were to strike an > agreement with, say, Intel so that

Re: anyone trying out the alpha?

2013-09-09 Thread Terry Reedy
On 9/9/2013 8:22 AM, Fattburger wrote: I just read that Python 3.4.0a is out in alpha. Any of you going to try it out? 3.4.0whatever is essentially 3.3.2 with additional bug fixes that will also appear in 3.3.3 plus a few additional bugfixes that were not backported plus new features. The onl

Re: Chardet, file, ... and the Flexible String Representation

2013-09-09 Thread wxjmfauth
Le vendredi 6 septembre 2013 17:46:14 UTC+2, Piet van Oostrum a écrit : > wxjmfa...@gmail.com writes: > > > > > The Flexible String Representation has conceptually to > > > face the same problem. It splits "unicode" in chunks and > > > it has to solve two problems at the same time, the coding

Re: [RELEASED] Python 3.4.0a2

2013-09-09 Thread Larry Hastings
On 09/09/2013 09:30 PM, Antoine Pitrou wrote: Le Mon, 9 Sep 2013 08:16:06 -0400, Brett Cannon a écrit : Those last two PEPs are still in draft form and not accepted nor have any committed code yet. Unless Larry enthusiastically sneaked them into the release. Whoops. Nope, I'm not that enthu

Re: [RELEASED] Python 3.4.0a2

2013-09-09 Thread ishish
Am 09.09.2013 13:02, schrieb Larry Hastings: To download Python 3.4.0a2 visit: http://www.python.org/download/releases/3.4.0/ [quote] Python 3.4.0 alpha 2 was released on September 10th, 2013... [/quote] Import from __future__ ?? ;-) -- https://mail.python.org/mailman/listinfo/python-lis

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Antoine Pitrou
Le Mon, 9 Sep 2013 14:30:50 +0200, Victor Stinner a écrit : > 2013/9/9 Larry Hastings : > > Python 3.4 includes a range of improvements of the 3.x series, > > including hundreds of small improvements and bug fixes. Major new > > features and changes in the 3.4 release series so far include: > > >

Re: [RELEASED] Python 3.4.0a2

2013-09-09 Thread Antoine Pitrou
Le Mon, 9 Sep 2013 08:16:06 -0400, Brett Cannon a écrit : > On Mon, Sep 9, 2013 at 8:02 AM, Larry Hastings > wrote: > > > > > On behalf of the Python development team, I'm chuffed to announce > > the second alpha release of Python 3.4. > > > > This is a preview release, and its use is not recomm

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Victor Stinner
2013/9/9 Larry Hastings : > Python 3.4 includes a range of improvements of the 3.x series, including > hundreds of small improvements and bug fixes. Major new features and > changes in the 3.4 release series so far include: > > * PEP 446, changing file descriptors to not be inherited by default >

anyone trying out the alpha?

2013-09-09 Thread Fattburger
I just read that Python 3.4.0a is out in alpha. Any of you going to try it out? I don't have any bright ideas for testing it, myself. -- https://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.4.0a2

2013-09-09 Thread Larry Hastings
On behalf of the Python development team, I'm chuffed to announce the second alpha release of Python 3.4. This is a preview release, and its use is not recommended for production settings. Python 3.4 includes a range of improvements of the 3.x series, including hundreds of small improvements an

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Brett Cannon
On Mon, Sep 9, 2013 at 8:02 AM, Larry Hastings wrote: > > On behalf of the Python development team, I'm chuffed to announce the > second alpha release of Python 3.4. > > This is a preview release, and its use is not recommended for > production settings. > > Python 3.4 includes a range of improve

Re: Can I trust downloading Python?

2013-09-09 Thread Fattburger
On Sun, 08 Sep 2013 03:37:15 +, Dave Angel wrote: > 1) what OS are you running? Actually, we can be pretty sure you're > running Windows, since any other common operating system would have > already included Python. Plus I don't often run into Linux users who worry about viruses, unless the

Re: Logical error in filling QTableWidget and filling all of nodes

2013-09-09 Thread MRAB
On 09/09/2013 06:15, Mohsen Pahlevanzadeh wrote: Dear All, I have the following code (PyQt): / searchFrameObject.tableWidget.setRowCount(rowCounter) searchFrameObject.tableWidget.setColumnCount(5) for row in range(rowCounter): for column in range(5): for result in

Re: Can I trust downloading Python?

2013-09-09 Thread Anthony Papillion
On 09/09/2013 04:41 AM, Steven D'Aprano wrote: > On Mon, 09 Sep 2013 02:39:09 +1000, Chris Angelico wrote: > >> On Mon, Sep 9, 2013 at 2:08 AM, Charles Hottel >> wrote: >>> I think this article is relevant althought the code examples are not >>> Python but C: >>> >>> http://cm.bell-labs.com/who/k

Re: Weighted choices

2013-09-09 Thread Antoon Pardon
Op 09-09-13 11:11, Steven D'Aprano schreef: > On Mon, 09 Sep 2013 09:12:05 +0200, Antoon Pardon wrote: > >> Op 09-09-13 02:21, Dennis Lee Bieber schreef: >>> On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon >>> declaimed the following: >>> Op 08-09-13 04:12, Jason Friedman schreef: > ch

Re: Can I trust downloading Python?

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 02:39:09 +1000, Chris Angelico wrote: > On Mon, Sep 9, 2013 at 2:08 AM, Charles Hottel > wrote: >> I think this article is relevant althought the code examples are not >> Python but C: >> >> http://cm.bell-labs.com/who/ken/trust.html > > That is quite true, and yet not truly

Re: Weighted choices

2013-09-09 Thread Peter Otten
Jason Friedman wrote: [You may have sent this in private mail by accident, so I take the freedom to bring this back to the mailing list] > I'm realizing with your question which was roughly: Do picks from a pool influence probability of subsequent picks, i. e. weather the pool is finite or in

Re: Weighted choices

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 09:12:05 +0200, Antoon Pardon wrote: > Op 09-09-13 02:21, Dennis Lee Bieber schreef: >> On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon >> declaimed the following: >> >>> Op 08-09-13 04:12, Jason Friedman schreef: choices = dict() choices["apple"] = 10 choice

Re: Building tkinter on Windows

2013-09-09 Thread Terry Reedy
On 9/9/2013 1:14 AM, Westley Martínez wrote: Hello. Can anyone tell me how to build tkinter on Windows? I've downloaded the source, ran Tools/buildbot/external.bat to build the external dependencies. I copied tcl85g.dll and tk85g.dll to PCBuild. I built the Visual Studio solution. Everyth

Re: Weighted choices

2013-09-09 Thread Antoon Pardon
Op 09-09-13 02:21, Dennis Lee Bieber schreef: > On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon > declaimed the following: > >> Op 08-09-13 04:12, Jason Friedman schreef: >>> choices = dict() >>> choices["apple"] = 10 >>> choices["pear"] = 20 >>> choices["banana"] = 15 >>> choices["orange"] = 2