embedded python and threading

2013-07-25 Thread David M. Cotter
in my app i initialize python on the main thread, then immediately call PyEval_SaveThread() because i do no further python stuff on the main thread. then, for each script i want to run, i use boost::threads to create a new thread, then on that thread i "ensure" the GIL, do my stuff, then release

Re: Hello Everyone! A simple questions!

2013-07-25 Thread Thanatos xiao
Thanks I just surprised by three dot 2013/7/26 Florian Baumgartner > As alex23 already indicated you created a recursive data-structure (by > inserting a reference to the list into the second place of the list) and > the interpreter handles this gracefully by showing [...]. > > In case you real

Re: Help

2013-07-25 Thread Terry Reedy
On 7/26/2013 1:06 AM, ty...@familyrobbins.com wrote: I'm a bit new to python and I'm trying to create a simple program which adds words and definitions to a list, and then calls them forward when asked to. Why are you not putting them in a Python dict, which is made for this? Unless you have a

Re: Help

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 6:06 AM, wrote: > I'm a bit new to python and I'm trying to create a simple program which adds > words and definitions to a list, and then calls them forward when asked to. One of the most important tidbits of information is: What version of Python are you using? > prin

Re: Help

2013-07-25 Thread Peter Otten
ty...@familyrobbins.com wrote: > I'm a bit new to python and I'm trying to create a simple program which > adds words and definitions to a list, and then calls them forward when > asked to. > while escape < 1: > > choice = input("Type 'Entry' to add a word to the Dictionary, 'Search' > t

Re: Help

2013-07-25 Thread alex23
On 26/07/2013 3:06 PM, ty...@familyrobbins.com wrote: I'm a bit new to python and I'm trying to create a simple program which adds words and definitions to a list, and then calls them forward when asked to. --- choice =

Help

2013-07-25 Thread tyler
I'm a bit new to python and I'm trying to create a simple program which adds words and definitions to a list, and then calls them forward when asked to. --- choice = 0 words = [] entry = 0 definition = 0 escape = 0 f

Re: How would I do this?

2013-07-25 Thread Ian Kelly
On Thu, Jul 25, 2013 at 9:40 PM, wrote: > Thank you for the quick reply. Unfortunately I'm still a little confused... > How might I implement that into my current code? Where you print spaces indicating an empty space, you need to look up the current square in the board data structure to see wh

Re: How would I do this?

2013-07-25 Thread h4ck3rpr0n3
Thank you for the quick reply. Unfortunately I'm still a little confused... How might I implement that into my current code? def Make_Board(): Col = "+--+" Row = "| |" Col2 = "--+" Row2 = " |" print(" ", Col + Col2 + Col2 + Col2 + Col2 + Col2 + Col2 + Col2) print("1", Ro

Re: How would I do this?

2013-07-25 Thread Ian Kelly
On Thu, Jul 25, 2013 at 9:16 PM, John Doe wrote: > Hey guys, > > I;m working on making a chess program and I hit a wall. I have no idea how to > get the position of the chess pieces. I have the chess board 1-8 and A-H for > black as well as 1-8 and a-h for white. i just have to figure out how to

Re: RE Module Performance

2013-07-25 Thread Ian Kelly
On Thu, Jul 25, 2013 at 8:48 PM, Steven D'Aprano wrote: > UTF-8 uses a flexible representation on a character-by-character basis. > When parsing UTF-8, one needs to look at EVERY character to decide how > many bytes you need to read. In Python 3, the flexible representation is > on a string-by-str

How would I do this?

2013-07-25 Thread John Doe
Hey guys, I;m working on making a chess program and I hit a wall. I have no idea how to get the position of the chess pieces. I have the chess board 1-8 and A-H for black as well as 1-8 and a-h for white. i just have to figure out how to declare those positions for the actual pieces so like the

Re: Hello Everyone! A simple questions!

2013-07-25 Thread Ben Finney
Thanatos xiao writes: > >>> values = [0, 1, 2]>>> values[1] = values>>> values[0, [...], 2] > > why?? Because. :-) Did you have a more specific question? What exactly are you expecting that code to do, and what is the surprise? -- \ “I was the kid next door's imaginary friend.” —Emo

Re: RE Module Performance

2013-07-25 Thread Michael Torrie
On 07/25/2013 11:18 AM, Steven D'Aprano wrote: > JMF has explained that it is impossible, impossible I say!, to write an > editor using a flexible string representation. Since Emacs uses such a > flexible string representation, Emacs is impossible, and therefore Emacs > doesn't exist. Now I'm e

Re: RE Module Performance

2013-07-25 Thread Michael Torrie
On 07/25/2013 01:07 PM, wxjmfa...@gmail.com wrote: > Let start with a simple string \textemdash or \texttendash > sys.getsizeof('–') > 40 sys.getsizeof('a') > 26 That's meaningless. You're comparing the overhead of a string object itself (a one-time cost anyway), not the overhead of st

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 15:45:38 -0500, Ian Kelly wrote: > On Thu, Jul 25, 2013 at 12:18 PM, Steven D'Aprano > wrote: >> On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: >> >>> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano >>> wrote: On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sander

Re: Hello Everyone! A simple questions!

2013-07-25 Thread alex23
On 26/07/2013 12:15 PM, Thanatos xiao wrote: values = [0, 1, 2] values[1] = values values [0, [...], 2] why?? First, it helps if you tell us what you were expecting instead. In your example, you have a list where you have replaced the 2nd element with the list itself. The [...] i

Hello Everyone! A simple questions!

2013-07-25 Thread Thanatos xiao
>>> values = [0, 1, 2]>>> values[1] = values>>> values[0, [...], 2] why?? -- http://mail.python.org/mailman/listinfo/python-list

Re: virtualenv problem

2013-07-25 Thread alex23
On 25/07/2013 11:48 PM, D. Xenakis wrote: I think there is something wrong with the installation because when i run through idle the virtual-env scripts located in "C:\Python33\Scripts" then i get the following.. virtualenv is intended to be a command line tool, so running it through idle is

PyGLet, 2to3...?

2013-07-25 Thread John Ladasky
On Thursday, July 25, 2013 3:26:01 PM UTC-7, John Ladasky wrote: > I'll try again from scratch, and see whether that clears up my problems. Nope, that didn't work. === john@john:~/Desktop/pyglet-1.2alpha1$ sudo python3 setup.py install [sudo] password for joh

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Terry Reedy
Some additional comments. On 7/25/2013 7:00 PM, Terry Reedy wrote: On 7/25/2013 4:58 PM, CTSB01 wrote: 1) I decided to use Python 2.7, and I will be sure to specify this in all future threads. Given that you are not using any libraries, let alone one that does not run on Python 3, I strongly

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Dave Angel
On 07/25/2013 04:58 PM, CTSB01 wrote: Sorry Dave, to answer each part of your response: 1) I decided to use Python 2.7, and I will be sure to specify this in all future threads. 2) It is a list of positive integers. In fact, it is always going to be a list of positive increasing integer

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Terry Reedy
On 7/25/2013 4:58 PM, CTSB01 wrote: 1) I decided to use Python 2.7, and I will be sure to specify this in all future threads. Given that you are not using any libraries, let alone one that does not run on Python 3, I strongly recommend using the latest version (3.3). 2) It is a list of posit

Re: PyGLet on Python 3

2013-07-25 Thread John Ladasky
Hi Devyn. After I didn't get a response concerning PyGLet inside this thread, I started another thread. It's here: https://groups.google.com/forum/#!topic/comp.lang.python/ARtI0GC9RHc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3, GUIs, game APIs, PyGLet, 2to3...?

2013-07-25 Thread John Ladasky
On Thursday, July 25, 2013 1:35:43 AM UTC-7, Kushal Kumaran wrote: > Does your python command mean python2 or python3? The setup.py at > https://code.google.com/p/pyglet/source/browse/setup.py seems to run > 2to3 automatically, but that will only happen if you actually use > python3 to run setup.

how to package embedded python?

2013-07-25 Thread David M. Cotter
what must i include in my app package if i'm embedding python? i tried including *everything* in the "DLLs" directory, but my app still crashes as soon as i attempt to initialize python. this is on a system that does not have python installed, as most of my users won't have it. is it actually

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread CTSB01
On Thursday, July 25, 2013 3:19:27 PM UTC-4, Dave Angel wrote: > On 07/25/2013 12:03 PM, CTSB01 wrote: > > > I have the following code that runs perfectly: > > > > def psi_j(x, j): > > >rtn = [] > > >for n2 in range(0, len(x) * j - 2): > > > n = n2 /

Re: RE Module Performance

2013-07-25 Thread Ian Kelly
On Thu, Jul 25, 2013 at 12:18 PM, Steven D'Aprano wrote: > On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: > >> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano >> wrote: >>> On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: "To conserve memory, Emacs does not hold fixed-le

Re: RE Module Performance

2013-07-25 Thread Ian Kelly
On Wed, Jul 24, 2013 at 9:34 AM, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 12:17 AM, David Hutto wrote: >> I've screwed up plenty of times in python, but can write code like a pro >> when I'm feeling better(on SSI and medicaid). An editor can be built simply, >> but it's preference that mak

RE: RE Module Performance

2013-07-25 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Jul 26, 2013 at 5:07 AM, wrote: > > Let start with a simple string \textemdash or \texttendash > > > sys.getsizeof('-') > > 40 > sys.getsizeof('a') > > 26 > > Most of the cost is in those two apostrophes, look: > > >>> sys.getsizeof('a') > 26 > >>> sys.

PyDev 2.8.0 Released

2013-07-25 Thread Fabio Zadrozny
Hi All, PyDev 2.8.0 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Type Inference now works with docstrings (Sphinx or Epydoc). See: http://pydev.org/manual_adv_type_hints.html * F

Re: [ANN] bbfreeze 1.1.2

2013-07-25 Thread Ralf Schmitt
Fábio Santos writes: > Seems like it has awesome features, but py3k is really important to me. Is > this on your roadmap? Sorry, I don't have a need for python 3 and also don't have a roadmap. -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 5:07 AM, wrote: > Let start with a simple string \textemdash or \texttendash > sys.getsizeof('–') > 40 sys.getsizeof('a') > 26 Most of the cost is in those two apostrophes, look: >>> sys.getsizeof('a') 26 >>> sys.getsizeof(a) 8 Okay, that's slightly unfair (bo

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Dave Angel
On 07/25/2013 12:03 PM, CTSB01 wrote: I have the following code that runs perfectly: def psi_j(x, j): rtn = [] for n2 in range(0, len(x) * j - 2): n = n2 / j r = n2 - n * j rtn.append(j * x[n] + r * (x[n + 1] - x[n]))

Re: RE Module Performance

2013-07-25 Thread wxjmfauth
Le jeudi 25 juillet 2013 12:14:46 UTC+2, Chris Angelico a écrit : > On Thu, Jul 25, 2013 at 7:27 PM, wrote: > > > A coding scheme works with a unique set of characters (the repertoire), > > > and the implementation (the programming) works with a unique set > > > of encoded code points. The cri

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Terry Reedy
On 7/25/2013 12:21 PM, Ethan Furman wrote: On 07/25/2013 09:11 AM, Prasad, Ramit wrote: Hmm, that is a change that makes some sense to me. Does the view get updated when dictionary changes or is a new view needed? I assume the latter. Nope, the former. That is a big advantage that the views

Re: Is it that easy to install Python ?

2013-07-25 Thread Grant Edwards
On 2013-07-25, santiago.d...@caoba.fr wrote: > Hi there, > > I never write any Python program but as a system administrator, I'm > often asked to install python on Debian servers. Are you sure it's not already installed? I haven't seen a Linux distro for a _long_ time that didn't include Python

Problem with PyObjC and NSEvents

2013-07-25 Thread kle
Hello all, I am having a rather specialized problem involving PyObjC and receiving NSEvents, and I'm wondering whether anybody here might have any insight. I'm writing a Python program, using PyObjC, that runs in the background and registers whenever the user clicks the mouse, in any applicati

Re: how: embed + extend to control my running app?

2013-07-25 Thread David M. Cotter
Okay the link problem was solved: i had installed a 64bit python and my app is 32bit. i'm using ActivePython installer from here: http://www.activestate.com/activepython/downloads it seems that now the problem is that this does not install the _d versions of the .lib. :( does anyone know how

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 3:18 AM, Steven D'Aprano wrote: > On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: > >> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano >> wrote: >>> On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: "To conserve memory, Emacs does not hold fixed-len

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: > On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano > wrote: >> On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: >>> "To conserve memory, Emacs does not hold fixed-length 22-bit numbers >>> that are codepoints of text characters wi

Re: Is it that easy to install Python ?

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 2:36 AM, Irmen de Jong wrote: > On 25-7-2013 17:11, santiago.d...@caoba.fr wrote: >> Hi there, >> >> I never write any Python program but as a system administrator, I'm often >> asked to install python on Debian servers. >> >> I just finished downloading, configuring, maki

Re: Is it that easy to install Python ?

2013-07-25 Thread Irmen de Jong
On 25-7-2013 17:11, santiago.d...@caoba.fr wrote: > Hi there, > > I never write any Python program but as a system administrator, I'm often > asked to install python on Debian servers. > > I just finished downloading, configuring, making and installing. > > The binary is now installed in : > /u

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Ethan Furman
On 07/25/2013 09:11 AM, Prasad, Ramit wrote: Terry Reedy wrote: On 7/24/2013 4:34 PM, Prasad, Ramit wrote: I am still not clear on the advantage of views vs. iterators. A1: Views are iterables that can be iterated more than once. Therefore, they can be passed to a function that re-iterates

Re: Understanding other people's code

2013-07-25 Thread Azureaus
On Friday, July 12, 2013 3:22:59 PM UTC+1, Azureaus wrote: > Hi all, > > I've been asked to take over a project from someone else and to extend the > functionality of this. The project is written in Python which I haven't had > any real experience with (although I do really like it) so I've spen

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Peter Otten
Ian Kelly wrote: > On Thu, Jul 25, 2013 at 2:13 AM, Peter Otten <__pete...@web.de> wrote: >> Chris Angelico wrote: >> >>> On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano >>> wrote: - Views support efficient (O(1) in the case of keys) membership testing, which neither iterkeys() nor Pyt

Re: Is it that easy to install Python ?

2013-07-25 Thread Matthew Lefavor
On Thu, Jul 25, 2013 at 11:11 AM, wrote: > Hi there, > > I never write any Python program but as a system administrator, I'm often > asked to install python on Debian servers. > > I just finished downloading, configuring, making and installing. > > The binary is now installed in : > /usr/local/Py

Re: Is it that easy to install Python ?

2013-07-25 Thread Maarten
On Thursday, July 25, 2013 5:11:15 PM UTC+2, santia...@caoba.fr wrote: > Hi there, > > I never write any Python program but as a system administrator, I'm often > asked to install python on Debian servers. > > I just finished downloading, configuring, making and installing. > > The binary is no

RE: Python 3: dict & dict.keys()

2013-07-25 Thread Prasad, Ramit
Terry Reedy wrote: > > On 7/24/2013 4:34 PM, Prasad, Ramit wrote: > > > I am still not clear on the advantage of views vs. iterators. > > A1: Views are iterables that can be iterated more than once. Therefore, > they can be passed to a function that re-iterates its inputs, or to > multiple funct

Creating a Simple User Interface for a Function

2013-07-25 Thread CTSB01
I have the following code that runs perfectly: def psi_j(x, j): rtn = [] for n2 in range(0, len(x) * j - 2): n = n2 / j r = n2 - n * j rtn.append(j * x[n] + r * (x[n + 1] - x[n])) print 'n2 =', n2, ': n =', n, ' r =' , r, '

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Ian Kelly
On Thu, Jul 25, 2013 at 2:13 AM, Peter Otten <__pete...@web.de> wrote: > Chris Angelico wrote: > >> On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano >> wrote: >>> - Views support efficient (O(1) in the case of keys) membership testing, >>> which neither iterkeys() nor Python2 keys() does. >> >> To

Re: How to tick checkboxes with the same name?

2013-07-25 Thread malayrev
вторник, 23 июля 2013 г., 11:25:00 UTC+4 пользователь Peter Otten написал: > malay...@gmail.com wrote: > > > > > I faced a problem: to implement appropriate search program I need to tick > > > few checkboxes which turned out to have the same name (name="a", > > > id="a1","a2","a3","a4"). Set_i

Re: How to tick checkboxes with the same name?

2013-07-25 Thread malayrev
вторник, 23 июля 2013 г., 9:05:14 UTC+4 пользователь Joel Goldstick написал: > On Tue, Jul 23, 2013 at 12:10 AM, wrote: > > > I faced a problem: to implement appropriate search program I need to tick > > few checkboxes which turned out to have the same name (name="a", > > id="a1","a2","a3","a4

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano wrote: > On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: >> "To conserve memory, Emacs does not hold fixed-length 22-bit numbers >> that are codepoints of text characters within buffers and strings. >> Rather, Emacs uses a variable-length

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: > wxjmfa...@gmail.com wrote: > >> Short example. Writing an editor with something like the FSR is simply >> impossible (properly). > > http://www.gnu.org/software/emacs/manual/html_node/elisp/Text- Representations.html#Text-Representation

Is it that easy to install Python ?

2013-07-25 Thread santiago . diez
Hi there, I never write any Python program but as a system administrator, I'm often asked to install python on Debian servers. I just finished downloading, configuring, making and installing. The binary is now installed in : /usr/local/Python-2.7.5/bin/python2.7 (the path is a deliberate admini

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 12:57 AM, Steven D'Aprano wrote: > [ snip lengthy explanation of sets ] > The union operator ought to > be symmetrical, a ∪ b should be identical to b ∪ a, but isn't. Another > leaky abstraction. Right. I agree with all your theory, which is fine and good. If we had a "set

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 20:34:23 +1000, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 7:44 PM, Steven D'Aprano > wrote: >> On Thu, 25 Jul 2013 18:15:22 +1000, Chris Angelico wrote: >>> That's true, but we already have that issue with sets. What's the >>> union of {0} and {0.0}? Python's answer: It

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Ethan Furman
On 07/24/2013 10:48 PM, Steven D'Aprano wrote: On Wed, 24 Jul 2013 08:57:11 -0700, Ethan Furman wrote: My point is that in 2.x .keys() did something different from the dict, while in 3.x it appears to me that they are the same. Then you aren't looking very closely. Actually, I am. That's w

Re: Python3, GUIs, game APIs, PyGLet, 2to3...?

2013-07-25 Thread Kushal Kumaran
John Ladasky writes: > Followup to my own post: I've made progress with PyGLet. I should mention > that I'm using Ubuntu Linux 13.04 64-bit, in case it matters. > > I tried executing "2to3 -w *.py" on just the files in the directory > pyglet-1.2alpha1/pyglet. I then changed back to the pyglet

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Ethan Furman
On 07/24/2013 11:01 PM, alex23 wrote: On 25/07/2013 4:31 AM, Ethan Furman wrote: 2) Hopefully learn something about when a view is useful. I haven't seeen this mentioned - forgive me if it's a repeat - but views are constant references to whichever set they represent. Python 2.7: dd = d

Re: Critic my module

2013-07-25 Thread Schneider
Hi, nice idea. mybe - for security reasons - you should ensure, that the right tool is called and not some tool put the path with the same name. bg, Johannes On Thu 25 Jul 2013 03:24:30 PM CEST, Devyn Collier Johnson wrote: Aloha Python Users! I made a Python3 module that allows users

Re: Critic my module

2013-07-25 Thread Alain Ketterlin
Devyn Collier Johnson writes: >I made a Python3 module that allows users to use certain Linux > shell commands from Python3 more easily than using os.system(), > subprocess.Popen(), or subprocess.getoutput(). This module (once > placed with the other modules) can be used like this Good, but

Re: Critic my module

2013-07-25 Thread Joshua Landau
On 25 July 2013 14:24, Devyn Collier Johnson wrote: > Aloha Python Users! > >I made a Python3 module that allows users to use certain Linux shell > commands from Python3 more easily than using os.system(), > subprocess.Popen(), or subprocess.getoutput(). This module (once placed > with the oth

Re: Python Script Hashplings

2013-07-25 Thread Matthew Lefavor
The answer is "probably not." If you just want to use the latest version of Python 3 you have installed on your system, use: "#!/usr/bin/python3". When you use the specific minor version numbers, they point to that specific minor version. Actually, the preferred shebang line is of the form: "#!/us

Re: Python Script Hashplings

2013-07-25 Thread MRAB
On 25/07/2013 14:42, Devyn Collier Johnson wrote: If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall back to Python3.2? Why don't you try it? I hope Dihedral is listenin

virtualenv problem

2013-07-25 Thread D. Xenakis
Hi there. Im using windows 7 64bit I have installed python 3.3.2 in C:\Python33 and then easy_install , pip, and virtualenv. But i do not know if the virtualenv installation is correct as i cant seem to be able to create any virtual enviroment yet. How can i check if everything is correct? What e

Re: RE Module Performance

2013-07-25 Thread Devyn Collier Johnson
On 07/25/2013 09:36 AM, Jeremy Sanders wrote: wxjmfa...@gmail.com wrote: Short example. Writing an editor with something like the FSR is simply impossible (properly). http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Representations.html#Text-Representations "To conserve memory,

Cross-Platform Python3 Equivalent to notify-send

2013-07-25 Thread Devyn Collier Johnson
Linux systems with the proper software can use the "notify-send" command. Is there a cross-platform Python3 equivalent? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Python Script Hashplings

2013-07-25 Thread Devyn Collier Johnson
If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall back to Python3.2? I hope Dihedral is listening. I would like to see another response from HIM. Mahalo, DCJ -- http://

Re: RE Module Performance

2013-07-25 Thread Jeremy Sanders
wxjmfa...@gmail.com wrote: > Short example. Writing an editor with something like the > FSR is simply impossible (properly). http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Representations.html#Text-Representations "To conserve memory, Emacs does not hold fixed-length 22-bit number

Re: PyGLet on Python 3

2013-07-25 Thread Devyn Collier Johnson
On 07/23/2013 02:24 AM, John Ladasky wrote: On 07/21/2013 08:10 PM, Joseph Clark wrote: John, have you taken a look at pyglet? It's an alternative to pygame and I found it pretty slick once I got the hang of it. There is a development version that's compatible with python 3 and I've never h

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Johannes Bauer
On 25.07.2013 07:48, Steven D'Aprano wrote: > Then you aren't looking very closely. d.keys() returns a set-like view > into the dict, which is great for comparing elements: > > py> d1 = dict.fromkeys([1, 2, 3, 4]) > py> d2 = dict.fromkeys([3, 4, 5, 6]) > py> d1.keys() & d2.keys() # keys that ar

Critic my module

2013-07-25 Thread Devyn Collier Johnson
Aloha Python Users! I made a Python3 module that allows users to use certain Linux shell commands from Python3 more easily than using os.system(), subprocess.Popen(), or subprocess.getoutput(). This module (once placed with the other modules) can be used like this import boash; boash.ls()

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 7:44 PM, Steven D'Aprano wrote: > On Thu, 25 Jul 2013 18:15:22 +1000, Chris Angelico wrote: >> That's true, but we already have that issue with sets. What's the union >> of {0} and {0.0}? Python's answer: It depends on the order of the >> operands. > > That's a side-effect

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 7:27 PM, wrote: > A coding scheme works with a unique set of characters (the repertoire), > and the implementation (the programming) works with a unique set > of encoded code points. The critical step is the path > {unique set of characters} <--> {unique set of encoded cod

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 7:22 PM, Steven D'Aprano wrote: > What I'm trying to say is that it is possible to use UTF-16 internally, > but *not* assume that every code point (character) is represented by a > single 2-byte unit. For example, the len() of a UTF-16 string should not > be calculated by c

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 18:15:22 +1000, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 5:27 PM, Steven D'Aprano > wrote: >> On Thu, 25 Jul 2013 16:02:42 +1000, Chris Angelico wrote: >> >>> On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano >>> wrote: Dicts aren't sets, and don't support set meth

Re: RE Module Performance

2013-07-25 Thread wxjmfauth
Le mercredi 24 juillet 2013 16:47:36 UTC+2, Michael Torrie a écrit : > On 07/24/2013 07:40 AM, wxjmfa...@gmail.com wrote: > > > Sorry, you are not understanding Unicode. What is a Unicode > > > Transformation Format (UTF), what is the goal of a UTF and > > > why it is important for an implementa

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 17:58:10 +1000, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 5:15 PM, Steven D'Aprano > wrote: >> On Thu, 25 Jul 2013 04:15:42 +1000, Chris Angelico wrote: >> >>> If nobody had ever thought of doing a multi-format string >>> representation, I could well imagine the Python c

Re: must be dicts in tuple

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 4:58 PM, Tanaya D wrote: > Hi, > > I am using Python with Bots(EDI translator) > > But i am getting the following error: > MappingFormatError: must be dicts in tuple: get((({'BOTSID': 'HEADER'},),)) The first thing to do is to construct a short piece of code that demonstra

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 5:27 PM, Steven D'Aprano wrote: > On Thu, 25 Jul 2013 16:02:42 +1000, Chris Angelico wrote: > >> On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano >> wrote: >>> Dicts aren't sets, and don't support set methods: >>> >>> py> d1 - d2 >>> Traceback (most recent call last): >>>

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Peter Otten
Chris Angelico wrote: > On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano > wrote: >> - Views support efficient (O(1) in the case of keys) membership testing, >> which neither iterkeys() nor Python2 keys() does. > > To save me the trouble and potential error of digging through the > source code:

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano wrote: > - Views support efficient (O(1) in the case of keys) membership testing, > which neither iterkeys() nor Python2 keys() does. To save me the trouble and potential error of digging through the source code: What's the complexity of membership

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 5:15 PM, Steven D'Aprano wrote: > On Thu, 25 Jul 2013 04:15:42 +1000, Chris Angelico wrote: > >> If nobody had ever thought of doing a multi-format string >> representation, I could well imagine the Python core devs debating >> whether the cost of UTF-32 strings is worth th

Re: RE Module Performance

2013-07-25 Thread Chris Angelico
On Thu, Jul 25, 2013 at 5:02 PM, Steven D'Aprano wrote: > On Thu, 25 Jul 2013 00:34:24 +1000, Chris Angelico wrote: > >> But mainly, I'm just wondering how many people here have any basis from >> which to argue the point he's trying to make. I doubt most of us have >> (a) implemented an editor wid

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 16:02:42 +1000, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano > wrote: >> Dicts aren't sets, and don't support set methods: >> >> py> d1 - d2 >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: unsupported operand type(s) fo

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 04:15:42 +1000, Chris Angelico wrote: > If nobody had ever thought of doing a multi-format string > representation, I could well imagine the Python core devs debating > whether the cost of UTF-32 strings is worth the correctness and > consistency improvements... and most likely

[ANN] New article in The Python Papers Source Codes - COPADS III (Compendium of Distributions II): Cauchy, Cosine, Exponential, Hypergeometric, Logarithmic, Semicircular, Triangular, and Weibull

2013-07-25 Thread mauricel...@acm.org
Hi everyone We have a new article in The Python Papers Source Codes. Title: COPADS III (Compendium of Distributions II): Cauchy, Cosine, Exponential, Hypergeometric, Logarithmic, Semicircular, Triangular, and Weibull Abstract: This manuscript illustrates the implementation and testing of eight

Re: Python 3: dict & dict.keys()

2013-07-25 Thread Steven D'Aprano
On Wed, 24 Jul 2013 11:31:58 -0700, Ethan Furman wrote: > On 07/24/2013 10:23 AM, Stefan Behnel wrote: >> Peter Otten, 24.07.2013 08:23: >>> Ethan Furman wrote: So, my question boils down to: in Python 3 how is dict.keys() different from dict? What are the use cases? >>> >>> To me

Re: RE Module Performance

2013-07-25 Thread Steven D'Aprano
On Thu, 25 Jul 2013 00:34:24 +1000, Chris Angelico wrote: > But mainly, I'm just wondering how many people here have any basis from > which to argue the point he's trying to make. I doubt most of us have > (a) implemented an editor widget, or (b) tested multiple different > internal representation

Re: Python3, GUIs, game APIs, PyGLet, 2to3...?

2013-07-25 Thread John Ladasky
Followup to my own post: I've made progress with PyGLet. I should mention that I'm using Ubuntu Linux 13.04 64-bit, in case it matters. I tried executing "2to3 -w *.py" on just the files in the directory pyglet-1.2alpha1/pyglet. I then changed back to the pyglet-1.2alpha1 directory, and execu

must be dicts in tuple

2013-07-25 Thread Tanaya D
Hi, I am using Python with Bots(EDI translator) But i am getting the following error: MappingFormatError: must be dicts in tuple: get((({'BOTSID': 'HEADER'},),)) Can anyone pls help me with it. Thanks -- http://mail.python.org/mailman/listinfo/python-list