ANN: Bokeh 0.5.1 released
On behalf of the Bokeh team, I am very happy to announce the release of Bokeh version 0.5.1! (http://continuum.io/blog/bokeh-0. http://continuum.io/blog/bokeh-0.55.1) Bokeh is a Python library for visualizing large and realtime datasets on the web. This release includes many bug fixes and improvements over our last recent 0.5 release: * Hover activated by default * Boxplot in bokeh.charts * Better messages when you forget to start the bokeh-server * Fixed some packaging bugs * Fixed NBviewer rendering * Fixed some Unicodeencodeerror See the CHANGELOG for full details. In upcoming releases, you should expect to see dynamic, data-driven layouts (including ggplot-style auto-faceting), as well as R language bindings, more statistical plot types in bokeh.charts, and cloud hosting for Bokeh apps. Don't forget to check out the full documentation, interactive gallery, and tutorial at http://bokeh.pydata.org as well as the new Bokeh IPython notebook nbviewer index (including all the tutorials) at: http://nbviewer.ipython.org/github/ContinuumIO/bokeh -notebooks/blob/master/index.ipynb If you are using Anaconda, you can install with conda: conda install bokeh Alternatively, you can install with pip: pip install bokeh BokehJS is also available by CDN for use in standalone javascript applications: http://cdn.pydata.org/bokeh-0.5.1.min.js http://cdn.pydata.org/bokeh-0.5.min.js http://cdn.pydata.org/bokeh-0.5.1.min.css http://cdn.pydata.org/bokeh-0.5.min.css Issues, enhancement requests, and pull requests can be made on the Bokeh Github page: https://github.com/continuumio/bokeh Questions can be directed to the Bokeh mailing list: bo...@continuum.io If you have interest in helping to develop Bokeh, please get involved! Damián. -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
PyTexas 2014 Conference
Pythonistas, PyTexas 2014 http://pytexas.org/ is well on its way. This year it will be be located at the Texas AM University Memorial Student Center https://www.pytexas.org/2014/about/venue/ and will take place Friday October 3rd through Sunday October 5th. Friday will be a tutorial day. Saturday and Sunday will be talks. Registration for the conference is already open! http://www.eventbrite.com/e/pytexas-2014-registration-11825772203 This event is a great opportunity to meet with other Python folks, learn about what’s happening in the Python community, and spread the word about exciting projects using Python. We are currently looking for speakers and tutorials in all disciplines. Know about GIS, Scientific Computing, Math, Web, Standard Library, or have an itch to present your personal projects? We want you! We have more details on the PyTexas Site so stop on by and submit a talk today https://www.pytexas.org/2014/call-for-proposals/. Does your company use Python? Do they love Python as much we do? Sponsor! Sponsorship is a great way for your company to reach out to the Python community and let the world know how they use Python. Recruiting? No worries! We have sponsorships where you can set up a booth and speak with developers at the conference. Check out our sponsorship prospectus for more details https://www.pytexas.org/2014/sponsors/. During the conference we will provide breakfast, snacks, and lunch all three days. We have plenty of power so bring your laptop, hack away, and enjoy the conference. We look forward to seeing the community in a few months and stay tuned for any announcements on the PyTexas Site http://pytexas.org/ or PyTexas Twitter https://twitter.com/pytexas. Thanks for your time! PyTexas 2014 Organizers -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: My sys.excepthook dies painfully
On Wed, Jul 23, 2014 at 6:30 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 23 Jul 2014 13:02:51 -0700, Jason Swails wrote: I'm not sure how the mylogger variable is getting set to None in your my_error_handler callback, but I don't see how that can possibly be happening with the provided code... Dammit, it's a Heisenbug... now it's gone away for me too. http://c2.com/cgi/wiki?HeisenBug However, I think I have a glimmer of an idea for how the global variable might be set to None. When the Python interpreter shuts down, it sets global variables to None in some arbitrary order. If the excepthook function isn't called until after the shutdown process begins, then depending on the phase of the moon, it's possible that ``mylogger`` may have been set to None by the time it is called. Looking at your code, it would seem like the shutdown process would happen when you call the original excepthook function (although Python quits whether or not that excepthook is called). How frequently do you observe this Heisenbug? The ones I've encountered were fairly reproducible, although those were more often caused by uninitialized variables or overwriting arrays -- not race conditions like this would seem to be (although unless it's threaded, how do we get a race condition?). Looking at the logging source code, threading is used, although it appears at a cursory glance to be more of a case of handling threaded applications rather than actually using threads to do any kind of work. A possible idea is to throw in a time.sleep(1) call after the call to mylogger.exception to see if that delays interpreter shutdown long enough for mylogger.exception to resolve. Of course if you can't reproduce the bug often enough, it'll be hard to tell if you've fixed it. The most unreliable Heisenbug I've ever fixed still happened ~1/3 of the time, so it was pretty obvious when I fixed it... All the best, Jason -- https://mail.python.org/mailman/listinfo/python-list
Re: Question about asyncio doc example
On 7/24/2014 1:15 AM, Saimadhav Heblikar wrote: On 24 July 2014 05:54, Terry Reedy tjre...@udel.edu wrote: On 7/23/2014 6:43 AM, Saimadhav Heblikar wrote: Hi, The example in question is https://docs.python.org/3/library/asyncio-task.html#example-hello-world-coroutine. I'd like to learn the purpose of the statement yield from asyncio.sleep(2) in that example. In particular, I'd like to know if asyncio.sleep() is used as a substitute for slow/time consuming operation, i.e. in real code, whether there will be a real time consuming statement in place of asyncio.sleep(). The context is while True: print('Hello') yield from asyncio.sleep(3) sleep is both itself, to shown to schedule something at intervals in a non-blocking fashion, as well as a placefiller. The blocking equivalent would use 'time' instead of 'yield from asyncio'. The following shows the non-blocking feature a bit better. import asyncio @asyncio.coroutine def hello(): while True: print('Hello') yield from asyncio.sleep(3) @asyncio.coroutine def goodbye(): while True: print('Goodbye') yield from asyncio.sleep(5.01) @asyncio.coroutine def world(): while True: print('World') yield from asyncio.sleep(2.02) loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait([hello(), goodbye(), world()])) Getting the same time behavior in a while...sleep loop requires reproducing some of the calculation and queue manipulation included in the event loop. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list That clears it up for me. For situations where I dont really know how long a function is going to take(say waiting for user input or a network operation), I am better off using callbacks than yield from asyncio.sleep(). Is my understanding correct? The question is not formulated very well. In asyncio parlance, 'using callbacks' contrasts with 'using co-routines'. It is a coding-style contrast. Tkinter only has the callback style. On the other hand, waiting (via sleep, without blocking other tasks) for a definite time interval contrasts with waiting (without blocking other tasks) until an event happens. This is an operational contrast. Tkinter has both possibilities, using call_after versus event-handler registration. I believe asyncio can do either type of waiting with either coding style. 18.5.3. Tasks and coroutines, seems to be devoid of event wait examples. However, there is a 'yield from' network example in 18.5.5 Streams using socket functions wrapped with coroutines. These should definitely be used instead of sleep. In fact, for cross-platform network code meant to run on *nix and Windows, they are better than the unix oriented select and poll functions. I believe asyncio does not do key events, even though that is a form of unpredictable input. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
one to many (passing variables)
My coding is slowly (*) progress at the moment. Looking at my more or less horrible efforts so far one (well that's understatement) questions pops up. How do you pass data from one function to many? I have functions A B and C. If data generated in A is useable in both B and C how do I ensure this data is passed as needed? Or is it a symptom of bad code? (* it's too hot (30 C + all week, and also this: https://imagizer.imageshack.us/v2/415x311q90/673/a9d1a5.jpg) -- Regards, Martin S -- https://mail.python.org/mailman/listinfo/python-list
Re: one to many (passing variables)
On Thu, Jul 24, 2014 at 4:36 PM, Martin S shieldf...@gmail.com wrote: How do you pass data from one function to many? I have functions A B and C. If data generated in A is useable in both B and C how do I ensure this data is passed as needed? Or is it a symptom of bad code? This is a little vague. Is there one function which calls A and then calls B and C? What's the relationship between them? Is it logical for A to itself call B and C? Are they all methods off one object? Top-level functions in a module? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Question about asyncio doc example
Terry Reedy tjre...@udel.edu: 18.5.3. Tasks and coroutines, seems to be devoid of event wait examples. However, there is a 'yield from' network example in 18.5.5 Streams using socket functions wrapped with coroutines. These should definitely be used instead of sleep. In fact, for cross-platform network code meant to run on *nix and Windows, they are better than the unix oriented select and poll functions. Asyncio has full support for the callback style as well. What I don't know is how well the two styles mix. Say, you have a module that produces callbacks and another one that is based on coroutines. The coroutines can easily emit callbacks but can callbacks call yield from? Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: one to many (passing variables)
Function A collects data and then calls function B with some, but also has data that should be passed to function C. But ofc if nested functions are allowed then that might solve the issue. I don't think I've seen nested functions mentioned in a tutorial I've been looking at. /martin s On 24 Jul 2014, Chris Angelico ros...@gmail.com wrote: On Thu, Jul 24, 2014 at 4:36 PM, Martin S shieldf...@gmail.com wrote: How do you pass data from one function to many? I have functions A B and C. If data generated in A is useable in both B and C how do I ensure this data is passed as needed? Or is it a symptom of bad code? This is a little vague. Is there one function which calls A and then calls B and C? What's the relationship between them? Is it logical for A to itself call B and C? Are they all methods off one object? Top-level functions in a module? ChrisA -- Sent with K-@ Mail - the evolution of emailing.-- https://mail.python.org/mailman/listinfo/python-list
Re: one to many (passing variables)
On Thu, Jul 24, 2014 at 5:27 PM, Martin S shieldf...@gmail.com wrote: Function A collects data and then calls function B with some, but also has data that should be passed to function C. But ofc if nested functions are allowed then that might solve the issue. I don't think I've seen nested functions mentioned in a tutorial I've been looking at. Nested functions shouldn't be necessary. Just start writing code, then figure out what needs to go where. As long as you give a name to everything you need to keep track of, you'll find that pretty much everything 'just works'. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: one to many (passing variables)
On Thu, 24 Jul 2014 09:27:10 +0200, Martin S wrote: Function A collects data and then calls function B with some, but also has data that should be passed to function C. It might help if you give a bit more information. How does it collect data, how does it decide which bits of information should be passed to B and which to C, and what happens with the results returned from B and C? But something like this should give you an idea: def funca(values): data_for_b = [] data_for_c = [] for value in values: if 0 value = 100: data_for_b.append(value) elif 100 value = 200: data_for_c.append(value) # otherwise just discard it result_from_b = funcb(data_for_b) result_from_a = funcc(data_for_c) return max(result_from_b, result_from_a) def funcb(values): return 5*sum(values) def funcc(values): return 2*sum(values) - 200 print(funca([2, 5, 107, 99, 1999, 2345, 84, 156, 23])) If you run that code, it should print 1065. If this is not what you mean, I'm afraid you're going to have to explain what exactly you do mean, because I have no other ideas :-) -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: one to many (passing variables)
Martin S shieldf...@gmail.com writes: I have functions A B and C. If data generated in A is useable in both B and C how do I ensure this data is passed as needed? Or is it a symptom of bad code? This is very vague; an accurate answer is “it depends”. You seem to be asking about how to design your data structures and APIs. This is less a Python-specific question and more a matter of experience and judgement. Here is an article on good API design; the principles apply to Python URL:http://blog.isnotworking.com/2007/05/api-design-guidelines.html. You know your API and its requirements better than we; see whether that sheds any light on improvements to make. It sounds like you are needing to decide how to arrange the data structures. You need to find natural divisions and groupings, such that you can refer to groupings of properties that make sense and that are not too unwieldy. -- \ “Religious faith is the one species of human ignorance that | `\ will not admit of even the *possibility* of correction.” —Sam | _o__) Harris, _The End of Faith_, 2004 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: My sys.excepthook dies painfully
On Thu, 24 Jul 2014 11:50:47 +1000, Chris Angelico wrote: On Thu, Jul 24, 2014 at 11:30 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: However, I think I have a glimmer of an idea for how the global variable might be set to None. When the Python interpreter shuts down, it sets global variables to None in some arbitrary order. If the excepthook function isn't called until after the shutdown process begins, then depending on the phase of the moon, it's possible that ``mylogger`` may have been set to None by the time it is called. In other words, the problem changed when you added the NameError trigger at the bottom of the script? Not quite. The problem changed when I reduced the code from the real code (about a dozen modules) down to the short sample I've given. Except that's not quite either -- even with the original code, I wasn't originally getting the double traceback either. I've just stuck some print statements inside the exception handler, and just before the foo: print 'sys, mylogger', sys, mylogger foo They have their expected values just before foo, but inside the excepthook function they are both None. Would it be possible to snapshot all critical globals with a closure, to force them to be held? Something like: Probably. Or even as default argument parameters. But I'd like to know if that's actually fixing it or just perturbing the system enough that the bug won't show up until next time the moon is full. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: usenet reader software
Sturla Molden sturla.mol...@gmail.com wrote: Monte Milanuk memila...@gmail.com wrote: Aaaannnd here we have a good example of why it would be really nice to be able to filter/score based on the message *body*, not just the headers. 8( Actually, here we have the reason why Usenet died. ... and the alternatives have the ability to filter/score based on the message body do they? :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list
Re: My sys.excepthook dies painfully
On Thu, Jul 24, 2014 at 8:12 PM, Steven D'Aprano st...@pearwood.info wrote: Would it be possible to snapshot all critical globals with a closure, to force them to be held? Something like: Probably. Or even as default argument parameters. But I'd like to know if that's actually fixing it or just perturbing the system enough that the bug won't show up until next time the moon is full. If the problem is that there's a circular reference (function to module, module to function) and stuff's getting cleaned up in arbitrary order, the snapshotting should cure it, as it's a one-way reference. But since I can't recreate the exact symptoms you're seeing, it's hard for me to be sure... ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Distributing python applications as a zip file
On Wednesday, July 23, 2014 4:43:11 AM UTC-4, Leo jay wrote: But if you use windows and you happen to use multiprocessing, please be aware of this bug I encountered several years ago. https://mail.python.org/pipermail/python-dev/2011-December/115071.html It looks like this was fixed for 3.2. Was the fix ever backported to 2.7? -- Thanks, Alan Isaac -- https://mail.python.org/mailman/listinfo/python-list
What is the simplest method to get a vector result?
Hi, I have read a lot about Python, but it still has a problem now on a simple exercise. For example, I want to generate a sine curve. First, I get a time sequence: index=range(100) I import math module, try to calculate sine with math.sin(index*math.pi/2) but it fails. It is possible to use a for loop, but I don't know how to save each result to an array. I have gone through several tutorial, but they are all about using print right away. I want to get an array, or a series, then plot it with import matplotlib.pyplot as plt I have installed plot module and it works already. I am a little hurry for an project interview and would like to ask here besides I continue search on tutorial. Thanks, -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
You can use `list(math.sin(x * math.pi / 2) for x in index)` or use `numpy`, which supports array math. -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
2014-07-24 14:53 GMT+02:00 fl rxjw...@gmail.com: Hi, I have read a lot about Python, but it still has a problem now on a simple exercise. For example, I want to generate a sine curve. First, I get a time sequence: index=range(100) I import math module, try to calculate sine with math.sin(index*math.pi/2) but it fails. It is possible to use a for loop, but I don't know how to save each result to an array. I have gone through several tutorial, but they are all about using print right away. I want to get an array, or a series, then plot it with import matplotlib.pyplot as plt I have installed plot module and it works already. I am a little hurry for an project interview and would like to ask here besides I continue search on tutorial. Thanks, -- Hi, depending on your actual needs, you may also try a specialised library like mpmath, which also supports plotting (and uses matplotlib internally): http://mpmath.org/ Using the sensible defaults, the plotting of a function can be as simple as: mpmath.plot(mpmath.sin) As for your original question, you can use a library designed for working with this data: http://www.numpy.org/ numpy.arange(100) * numpy.pi hth, vbr -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
On Thu, 24 Jul 2014 05:53:12 -0700, fl wrote: Hi, I have read a lot about Python, but it still has a problem now on a simple exercise. For example, I want to generate a sine curve. First, I get a time sequence: index=range(100) I import math module, try to calculate sine with math.sin(index*math.pi/2) but it fails. It is possible to use a for loop, but I don't know how to save each result to an array. That is a fundamental, basic part of programming in Python. If you don't learn the basics, you will never be a good programmer. Have you done any Python tutorials? It's not enough to read them, you must actually do the work. This might get you started: results = [] # Start with an empty list. for value in range(100): results.append(math.sin(value)) but that probably will not give you the results you are hoping for, as sin expects the angles to be given in radians. Perhaps you mean to scale the angles over a full circle? tau = 2*math.pi # number of radians in a full circle angles = [] values = [] for i in range(100): angle = i*tau/100.0 angles.append(angle) values.append(math.sin(angle)) Alternatively, here's a slightly shorter way: angles = [i*tau/100.0 for i in range(100)] values = [math.sin(angle) for angle in angles] -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
fl rxjw...@gmail.com: I have read a lot about Python, but it still has a problem now on a simple exercise. For example, I want to generate a sine curve. Here you go: #!/usr/bin/env python3 import math for x in range(0, 361, 15): print(int((math.sin(x / 180 * math.pi) + 1) * 30 + 0.5) * + *) Marko -- https://mail.python.org/mailman/listinfo/python-list
Exploring Python for next desktop GUI Project
I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) 2. Python 2 or 3? Which will serve me better in the future? Thanks in advance. Noble -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
1. PyQt (or PySide) 2. Python 2 will be legacy soon. Use Python 3 for new project. wxPython is also good option but doesn't support Python 3 for now. I don't know when wxPhenix (next wxPython supporting Python 3) will be released. On Fri, Jul 25, 2014 at 12:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) 2. Python 2 or 3? Which will serve me better in the future? Thanks in advance. Noble -- https://mail.python.org/mailman/listinfo/python-list -- INADA Naoki songofaca...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 10:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) The Python standard library includes the tkinter package, which is an interface to Tcl/Tk. The 'ttk' module provides themed/themable widgets that have the platform-native look by default. I've successfully used tkinter for a few projects, and have kept most of my sanity :). One of the biggest benefits to tkinter is that, since it is included with Python, so you don't have to distribute a separate GUI toolkit. 2. Python 2 or 3? Which will serve me better in the future? Python 3 is the future of Python, but Python 2(.7) is still alive and kicking. I would suggest sticking to Python 3 if at all possible, but revert back to 2.7 (no farther! :) if you have dependencies that you can't escape that rely on Python 2. If you're just learning Python, learn with Python 3 before you start with Python 2, even if you'll wind up using Python 2. Python 3 is easier to learn in the first place, and it's easier to learn the transition from 3-2 than 2-3. Hope this helps, -- Zach -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Fri, Jul 25, 2014 at 1:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) 2. Python 2 or 3? Which will serve me better in the future? Thanks in advance. The first one is certainly possible. Pick any of the well-known toolkits (Tkinter, wxwidgets, GTK, etc), and see how it feels. All of them are portable across the three platforms you name, so see which one is most comfortable for you to code in and produces the best results. Definitely Python 3. If you don't have anything specifically holding you to Python 2, take Python 3 and get all the latest features. Most importantly, you'll never run into troubles with Unicode. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thursday, July 24, 2014 10:57:22 AM UTC-5, Noble Bell wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) 2. Python 2 or 3? Which will serve me better in the future? Thanks in advance. Noble I was leaning toward Python 3 and Tkinter. I suppose the best way to do the GUI with Tkinter is to just roll-up my sleeves and do it via code rather than with the aid of a GUI editor. Thanks to all of you for your replies. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 2014-07-24, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thu, Jul 24, 2014 at 10:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) The Python standard library includes the tkinter package, which is an interface to Tcl/Tk. That's not always true for Linux systems. AFAIK, all Linux installs include Python (of some version or other), but they don't always include tcl/tk and tkinter. It's usually easy enough to add them, but but they're not really part of the standard library if they have to be separately intsalled. -- Grant Edwards grant.b.edwardsYow! Uh-oh!! I'm having at TOO MUCH FUN!! gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Fri, Jul 25, 2014 at 2:29 AM, Noble Bell nobleb...@gmail.com wrote: I was leaning toward Python 3 and Tkinter. I suppose the best way to do the GUI with Tkinter is to just roll-up my sleeves and do it via code rather than with the aid of a GUI editor. Yep. In fact, I recommend that for all GUI toolkits; instead of thinking about your layout in terms of positions of widgets on a window, think about it in terms of what your toolkit provides you with - usually that'll be some kind of tree structure of layout objects, like vertical and horizontal boxes. And if you plan your layout that way, you may as well just write it directly as code. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Question about asyncio doc example
On Jul 24, 2014 1:26 AM, Marko Rauhamaa ma...@pacujo.net wrote: Terry Reedy tjre...@udel.edu: 18.5.3. Tasks and coroutines, seems to be devoid of event wait examples. However, there is a 'yield from' network example in 18.5.5 Streams using socket functions wrapped with coroutines. These should definitely be used instead of sleep. In fact, for cross-platform network code meant to run on *nix and Windows, they are better than the unix oriented select and poll functions. Asyncio has full support for the callback style as well. What I don't know is how well the two styles mix. Say, you have a module that produces callbacks and another one that is based on coroutines. The coroutines can easily emit callbacks but can callbacks call yield from? Callbacks can easily schedule coroutines, but they can't wait on them, because that would require suspending their execution, dropping back to the event loop, and resuming later -- in other words, the callback would need to be a coroutine also. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Jul 24, 2014 6:28 PM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thu, Jul 24, 2014 at 10:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) The Python standard library includes the tkinter package, which is an interface to Tcl/Tk. The 'ttk' module provides themed/themable widgets that have the platform-native look by default. I've successfully used tkinter for a few projects, and have kept most of my sanity :). One of the biggest benefits to tkinter is that, since it is included with Python, so you don't have to distribute a separate GUI toolkit. Tk is neither sane nor native-feeling, especially on Linux, where it looks like something from two decades ago. On other platforms, it also is not 100% native. I personally recommend PyQt4/PySide. wxPython is also worth checking out. And it might be better to stay with Python 2, there are still things that don't work with Py3k that you might find crucial. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ Sent from my SGS3. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Fri, Jul 25, 2014 at 3:04 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: I personally recommend PyQt4/PySide. wxPython is also worth checking out. And it might be better to stay with Python 2, there are still things that don't work with Py3k that you might find crucial. Can you be more specific? Python 3 should be the default for new projects unless there's a good reason for going Py2. Chrisa -- https://mail.python.org/mailman/listinfo/python-list
Re: Question about asyncio doc example
Ian Kelly ian.g.ke...@gmail.com: Callbacks can easily schedule coroutines, but they can't wait on them, because that would require suspending their execution, dropping back to the event loop, and resuming later -- in other words, the callback would need to be a coroutine also. I guess the key is, can a callback release a lock or semaphore, notify a condition variable, or put an item into a queue that a coroutine is waiting on? Quite possibly. Didn't try it. In that case, callbacks mix just fine with coroutines. Marko -- https://mail.python.org/mailman/listinfo/python-list
How can I import unnecessary_math?
Hi, I want to write some test code. Some on-line tutorials have such codes: from unnecessary_math import multiply When it runs, it has errors: from unnecessary_math import multiply Traceback (most recent call last): File interactive input, line 1, in module ImportError: No module named unnecessary_math I have not found anywhere to download it. What explanation about the module: from unnecessary_math import multiply Thanks, from nose import with_setup # optional from unnecessary_math import multiply def setup_module(module): print () # this is to get a newline after the dots print (setup_module before anything in this file) def teardown_module(module): print (teardown_module after everything in this file) def my_setup_function(): print (my_setup_function) def my_teardown_function(): print (my_teardown_function) -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Fri, Jul 25, 2014 at 3:33 AM, fl rxjw...@gmail.com wrote: Hi, I want to write some test code. Some on-line tutorials have such codes: from unnecessary_math import multiply Which tutorials? That's where you'll find the answer to your question. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Thu, Jul 24, 2014 at 11:33 AM, fl rxjw...@gmail.com wrote: Hi, I want to write some test code. Some on-line tutorials have such codes: from unnecessary_math import multiply When it runs, it has errors: from unnecessary_math import multiply Traceback (most recent call last): File interactive input, line 1, in module ImportError: No module named unnecessary_math I have not found anywhere to download it. What explanation about the module: from unnecessary_math import multiply A little bit of searching turns up this: https://github.com/okken/markdown.py/blob/master/simple_example/unnecessary_math.py It appears to be used as a simple example library for a doctesting demo. -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Thursday, July 24, 2014 1:37:49 PM UTC-4, Chris Angelico wrote: On Fri, Jul 25, 2014 at 3:33 AM, fl r...@gmail.com wrote: Hi, I want to write some test code. Some on-line tutorials have such codes: from unnecessary_math import multiply Which tutorials? That's where you'll find the answer to your question. ChrisA Thanks. The source of that snippet is from this link: http://pythontesting.net/framework/nose/nose-introduction/ I do not find any idea on that module yet. -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Thursday, July 24, 2014 1:48:02 PM UTC-4, fl wrote: On Thursday, July 24, 2014 1:37:49 PM UTC-4, Chris Angelico wrote: On Fri, Jul 25, 2014 at 3:33 AM, fl rx...@gmail.com wrote: Thanks. The source of that snippet is from this link: http://pythontesting.net/framework/nose/nose-introduction/ I do not find any idea on that module yet. It is also a question about the symbol '@' on that link. I don't find an explanation about '@' yet. Could you tell me? Thanks, @with_setup(my_setup_function, my_teardown_function) def test_numbers_3_4(): print 'test_numbers_3_4 actual test code' assert multiply(3,4) == 12 @with_setup(my_setup_function, my_teardown_function) def test_strings_a_3(): print 'test_strings_a_3 actual test code' assert multiply('a',3) == 'aaa' -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Fri, Jul 25, 2014 at 3:54 AM, fl rxjw...@gmail.com wrote: It is also a question about the symbol '@' on that link. I don't find an explanation about '@' yet. Could you tell me? Thanks, @with_setup(my_setup_function, my_teardown_function) def test_numbers_3_4(): print 'test_numbers_3_4 actual test code' assert multiply(3,4) == 12 That's a function decorator. You can look them up on the web now that you know what they're called. :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 24/07/2014 17:18, Chris Angelico wrote: On Fri, Jul 25, 2014 at 1:57 AM, Noble Bell nobleb...@gmail.com wrote: I am exploring the idea of creating my next desktop GUI project in Python and would like a little advice from you folks about a couple of requirements. My requirements will be: 1. Needs to be portable across platforms with native LAF (Windows,Linux,OSX) 2. Python 2 or 3? Which will serve me better in the future? Thanks in advance. The first one is certainly possible. Pick any of the well-known toolkits (Tkinter, wxwidgets, GTK, etc), and see how it feels. All of them are portable across the three platforms you name, so see which one is most comfortable for you to code in and produces the best results. s/wxwidgets/wxpython/ unless you fancy wrapping it yourself :) Definitely Python 3. If you don't have anything specifically holding you to Python 2, take Python 3 and get all the latest features. Most importantly, you'll never run into troubles with Unicode. Definitely definitely Python 3. It's The Comfy Chair who anybody having the audacity to disagreee on this!!! ChrisA -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Fri, Jul 25, 2014 at 4:04 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 24/07/2014 17:18, Chris Angelico wrote: The first one is certainly possible. Pick any of the well-known toolkits (Tkinter, wxwidgets, GTK, etc), and see how it feels. All of them are portable across the three platforms you name, so see which one is most comfortable for you to code in and produces the best results. s/wxwidgets/wxpython/ unless you fancy wrapping it yourself :) Yeah that. And pygtk rather than GTK. Or I could have gone the other way and said Tk instead of Tkinter. One way or another, I ought to have been more consistent. Anyway. Pick a good toolkit, get to know it, and use it. Personally, I like GTK, but that's partly because its bindings come with Pike, and I did GUI work with Pike before I did with Python; the same advantage, for someone starting with Python, goes to Tk. But the main thing is, it's easy to be cross-platform - take whatever feels good to you. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On 7/24/2014 1:58 PM, Chris Angelico wrote: On Fri, Jul 25, 2014 at 3:54 AM, fl rxjw...@gmail.com wrote: It is also a question about the symbol '@' on that link. I don't find an explanation about '@' yet. Could you tell me? The Python docs have an index. I STRONGLY recommend that everyone learn to use it. The index starts with a Symbols page. https://docs.python.org/3/genindex-Symbols.html The page may not be complete yet (I plan to recheck sometime), but it has an entry for '@'. If you do not want to search the page for '@', your browser find function (typically control-F) should find it for you. That entry takes you to https://docs.python.org/3/reference/compound_stmts.html#index-20 @with_setup(my_setup_function, my_teardown_function) def test_numbers_3_4(): print 'test_numbers_3_4 actual test code' assert multiply(3,4) == 12 That's a function decorator. You can look them up on the web now that you know what they're called. :) The Symbol index page was added to make knowing names unnecessary. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 11:37 AM, Grant Edwards invalid@invalid.invalid wrote: On 2014-07-24, Zachary Ware zachary.ware+pyl...@gmail.com wrote: The Python standard library includes the tkinter package, which is an interface to Tcl/Tk. That's not always true for Linux systems. AFAIK, all Linux installs include Python (of some version or other), but they don't always include tcl/tk and tkinter. It's usually easy enough to add them, but but they're not really part of the standard library if they have to be separately intsalled. There are several parts of the standard library that have external dependencies (bz2, lzma, sqlite3, ssl, and tkinter, just off the top of my head), which distributors may not decide to include. That doesn't mean they're not part of the standard library, but they are optional parts. Anyway, it may still be easier to declare a dependency on tkinter than to distribute another toolkit with your app, it depends entirely on the specific circumstances. -- Zach -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Thursday, July 24, 2014 1:58:45 PM UTC-4, Chris Angelico wrote: On Fri, Jul 25, 2014 at 3:54 AM, fl rxj...@gmail.com wrote: @with_setup(my_setup_function, my_teardown_function) def test_numbers_3_4(): print 'test_numbers_3_4 actual test code' assert multiply(3,4) == 12 That's a function decorator. You can look them up on the web now that you know what they're called. :) ChrisA Thanks, I find the source of unnecessary_math at http://pythontesting.net/framework/doctest/doctest-introduction/ -- https://mail.python.org/mailman/listinfo/python-list
Re: How can I import unnecessary_math?
On Fri, Jul 25, 2014 at 4:17 AM, Terry Reedy tjre...@udel.edu wrote: That's a function decorator. You can look them up on the web now that you know what they're called. :) The Symbol index page was added to make knowing names unnecessary. And I clock this up on my learn something every day list. Was not aware of that. Not surprised to know that it exists (it's certainly far from unheard-of), but I wasn't specifically aware of it. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Using pyVmomi
On 07/23/2014 01:14 PM, Joseph L. Casale wrote: I am doing some scripting with pyVmomi under 2.6.8 so the code may run directly on a vmware esxi server. As the code is long running, it surpasses the authentication timeout. For anyone familiar with this code and/or this style of programming, does anyone have a recommendation for an elegant authentication retry scheme for objects passed to code that will intermittently access the properties invoking calls. I'd prefer to not litter try/except blocks around the usage of the objects if possible. You could: - have a single point of entry that can check and, if necessary, revalidate - create a helper that checks and, if necessary, revalidate, which is then called where ever needed - create a decorator that does the above for each function that needs it -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 12:04 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: Tk is neither sane How so? Like any other facet of programming, using Tk(inter) has it's frustrations, but for the most part it has always worked as expected for me. Granted, I haven't done anything terribly fancy. nor native-feeling, especially on Linux, where it looks like something from two decades ago. The problem there is that on Linux, native could mean GTK, QT, or something else entirely. Also, just to make sure, you are talking about ttk rather than plain tk, right? On other platforms, it also is not 100% native. On Windows, at least, ttk comes very very close to it. I personally recommend PyQt4/PySide. wxPython is also worth checking out. I have used neither of those, but I have seen many people report happiness with them. For anyone with experience with those toolkits in other languages, those would be the obvious choices. And it might be better to stay with Python 2, there are still things that don't work with Py3k that you might find crucial. I strongly disagree with this: there's no reason to stick with Python 2 until you have a dependency that you can't get rid of that absolutely requires Python 2.x. The fact that there are still things that don't work with Py3k is irrelevant if you don't use them. And if you find that, halfway through building your app, you find that you need to add a dependency that requires Python 2, just backport your project. In the majority of cases, it is very easy to port from Python 3 to either the subset of Python that runs fine in both 2 and 3, or straight to 2. It may just be a matter of going from: import tkinter as tk from tkinter import ttk to: try: import tkinter as tk from tkinter import ttk except ImportError: import Tkinter as tk import ttk It's not necessarily as easy to go from native Python 2 to 2and3 or 3 due to some incorrect assumptions that Python 2 will let you make, but even that can be mitigated by writing your Python 2 code with Python 3 in the back of your mind. -- Zach -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Fri, Jul 25, 2014 at 4:33 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On other platforms, it also is not 100% native. On Windows, at least, ttk comes very very close to it. What exactly does that mean? The Windows default UI changed significantly from W2K - XP - Win8, and each time, it's possible to revert to the old styling; does ttk follow the rest of the OS in that? And if so, does it achieve that by restricting you to a vicious subset of functionality that can actually be implemented natively, or does it try to reimplement as appropriate? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 8:33 PM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thu, Jul 24, 2014 at 12:04 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: Tk is neither sane How so? Like any other facet of programming, using Tk(inter) has it's frustrations, but for the most part it has always worked as expected for me. Granted, I haven't done anything terribly fancy. Pretty much everyone in the world hates Tcl and Tk. Ask your favorite search engine for some results. i’ve tried to write a Tkinter thing once. I don’t have a copy anymore (consciously deleted), but I vaguely remember some issues with widgets that do not work. I also remember that the list of widgets is quite small and not enough for many projects. nor native-feeling, especially on Linux, where it looks like something from two decades ago. The problem there is that on Linux, native could mean GTK, QT, or something else entirely. The best way to handle this is just choose one of the two (wxwidgets chose GTK 2, for example) and be considered native enough by most, as people don’t really mind mixing them (as there are no good Qt web browsers, and VLC uses Qt and not GTK) Also, just to make sure, you are talking about ttk rather than plain tk, right? ttk on Linux doesn’t change a thing. It still uses the ugly, ancient, motif-esque style: https://www.google.com/search?q=tk+linuxtbm=isch (also, off by 10 years, motif is actually from the 1980s.) On Thu, Jul 24, 2014 at 8:51 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Jul 25, 2014 at 4:33 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On other platforms, it also is not 100% native. On Windows, at least, ttk comes very very close to it. What exactly does that mean? The Windows default UI changed significantly from W2K - XP - Win8, and each time, it's possible to revert to the old styling; does ttk follow the rest of the OS in that? There is one more catch, custom themes can be installed after you patch some files (which can be done in 5 minutes by anyone with sufficient googling and reading comprehension skills). AFAIK, Qt follows the system style properly, and it looks quite native on every Windows OS. No idea about ttk though. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 1:51 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Jul 25, 2014 at 4:33 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Windows, at least, ttk comes very very close to [a 100% native look]. What exactly does that mean? The Windows default UI changed significantly from W2K - XP - Win8, and each time, it's possible to revert to the old styling; does ttk follow the rest of the OS in that? And if so, does it achieve that by restricting you to a vicious subset of functionality that can actually be implemented natively, or does it try to reimplement as appropriate? It appears that ttk follows the rest of the OS just fine (just tested on Win7, switching back and forth to the classic Windows theme), and as yet I've not run into any restrictions because of it. -- Zach -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 7/24/2014 11:15 AM, Chris Angelico wrote: On Fri, Jul 25, 2014 at 4:04 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 24/07/2014 17:18, Chris Angelico wrote: The first one is certainly possible. Pick any of the well-known toolkits (Tkinter, wxwidgets, GTK, etc), and see how it feels. All of them are portable across the three platforms you name, so see which one is most comfortable for you to code in and produces the best results. s/wxwidgets/wxpython/ unless you fancy wrapping it yourself :) Yeah that. And pygtk rather than GTK. Or I could have gone the other way and said Tk instead of Tkinter. One way or another, I ought to have been more consistent. Anyway. Pick a good toolkit, get to know it, and use it. Personally, I like GTK, but that's partly because its bindings come with Pike, and I did GUI work with Pike before I did with Python; the same advantage, for someone starting with Python, goes to Tk. But the main thing is, it's easy to be cross-platform - take whatever feels good to you. ChrisA Not knowing any of these GUI platforms (although I've read some about Tk), I have some questions. * Which of them use UTF-8 as their native Unicode interface? * Which makes it easiest to discover and adjust font metrics such as kerning? * Which makes it easiest to obtain bounding rectangles of a piece of text? * Which makes it easiest to use a set of fonts such as Times (for Latin) and others for Cyrillic, Chinese, and Korean? Or which supplies a font configuration that can just be used for any language? Glenn -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 1:02 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: AFAIK, Qt follows the system style properly, and it looks quite native on every Windows OS. No idea about ttk though. My understanding is that Qt merely emulates the native LAF, although it does a good job of it. wxPython on the other hand actually uses native widgets wherever possible. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, Jul 24, 2014 at 2:02 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: Pretty much everyone in the world hates Tcl and Tk. Ask your favorite search engine for some results. Whee, I'm an alien! ;) I'm not saying Tk is the best thing since sliced bread, I just don't see what so many people seem to hate about it. i’ve tried to write a Tkinter thing once. I don’t have a copy anymore (consciously deleted), but I vaguely remember some issues with widgets that do not work. I also remember that the list of widgets is quite small and not enough for many projects. I have had no issues with widgets not working. I will admit that the widget set is fairly small, though. You can get more from Tix (which is also distributed with tkinter), but I haven't had any need for that yet. The best way to handle this is just choose one of the two (wxwidgets chose GTK 2, for example) and be considered native enough by most, as people don’t really mind mixing them (as there are no good Qt web browsers, and VLC uses Qt and not GTK) That's fair, and I agree that Tk should probably provide close to GTK and close to QT themes for ttk[1]. As I understand it, though, ttk gives almost complete control over the look of individual widgets, so if you really don't like how your widget looks, change it! ttk on Linux doesn’t change a thing. It still uses the ugly, ancient, motif-esque style: https://www.google.com/search?q=tk+linuxtbm=isch (also, off by 10 years, motif is actually from the 1980s.) Motif is indeed ugly, but your search for 'tk linux' doesn't tell me anything about 'ttk linux'. I would be interested in the results of the script below on Linux, which I may or may not be able to try for myself later (but can't right now). -- Zach [1] Such themes might already exist, I haven't checked. If anyone wants to see what themes are available and how they look, try this (2/3 compatible, also attached in case Gmail messes it up): import sys try: import tkinter as tk from tkinter import ttk except ImportError: import Tkinter as tk import ttk class App(object): def __init__(self, root): self.root = root self.root.title('Theme tester') self.info_label = ttk.Label(self.root, text=Python {}.{} with Tcl/Tk {} on {}.format( sys.version_info[0], sys.version_info[1], self.root.tk.eval('info patchlevel'), sys.platform)) self.info_label.pack() self.theme_idx = 0 self.change_btn = ttk.Button(self.root, text='Change theme', command=self.change_theme ) self.change_btn.pack() self.rb_var = tk.StringVar(self.root) self.radiobtn = ttk.Radiobutton(self.root, text='Radio button option 1', variable=self.rb_var, value='1') self.radiobtn.pack() self.radiobtn2 = ttk.Radiobutton(self.root, text='Radio button option 2', variable=self.rb_var, value='2') self.radiobtn2.pack() self.checkbtn = ttk.Checkbutton(self.root, text='Checkbutton') self.checkbtn.pack() self.entry = ttk.Entry(self.root) self.entry.insert(0, 'Entry') self.entry.pack() self.style = ttk.Style(self.root) self.available_themes = self.style.theme_names() self.theme_label = ttk.Label(self.root, text='Platform default') self.theme_label.pack() def change_theme(self): try: theme = self.available_themes[self.theme_idx] except IndexError: theme = self.available_themes[0] self.theme_idx = 0 self.style.theme_use(theme) self.theme_label.configure(text=theme) self.theme_idx += 1 root = tk.Tk() app = App(root) root.mainloop() import sys try: import tkinter as tk from tkinter import ttk except ImportError: import Tkinter as tk import ttk class App: def __init__(self, root): self.root = root self.root.title('Theme tester') self.info_label = ttk.Label(self.root, text=Python {}.{} with Tcl/Tk {} on {}.format( sys.version_info[0], sys.version_info[1], self.root.tk.eval('info patchlevel'), sys.platform)) self.info_label.pack() self.theme_idx = 0 self.change_btn = ttk.Button(self.root, text='Change theme', command=self.change_theme ) self.change_btn.pack() self.rb_var = tk.StringVar(self.root) self.radiobtn = ttk.Radiobutton(self.root,
Re: Exploring Python for next desktop GUI Project
On Thursday, July 24, 2014 2:32:04 PM UTC-5, Ian wrote: On Thu, Jul 24, 2014 at 1:02 PM, Chris Kwpolska Warrick kwpol...@gmail.com wrote: AFAIK, Qt follows the system style properly, and it looks quite native on every Windows OS. No idea about ttk though. My understanding is that Qt merely emulates the native LAF, although it does a good job of it. wxPython on the other hand actually uses native widgets wherever possible. If I were to us wxPython then I would be limited to Python 2.x at present. If I were to use PyQt I would have to pay, as I understand the licenses, for it to use in commercial programs and/or programs that I ask for donations. If I am not mistaken PyQT is available for Python 3. I am not familiar with PySide much other than I have heard, though, it is not being updated anymore. Coming from development experience in Java I know how notorious and ugly GUI programming can be at times. Doing development work at my day job in java/.net I just wanted to use something at home to tinker around with and do some hobby programming and perhaps sell something or such if I develop something useful. Python has struck my fancy. -- https://mail.python.org/mailman/listinfo/python-list
How to place several import .... lines in one .py file?
Hi, I have seen several kinds of module import examples, but most of the programs are small and less content. They only have one or two module import. I'll use the following modules in a small project. I would like to know whether it is appropriate to put all of them at the file header, like this: import pandas as pd import numpy as np import sci import matplotlib.pyplot as plt from pandas import DataFrame Because some modules are used only at the beginning or the end, does it recommend to separate to place the import lines just before the associated function lines. import pandas as pd . .. ... import numpy as np . ... . import sci .. . ... import matplotlib.pyplot as plt from pandas import DataFrame Or, it recommends to have separate files for each main functionality, such as input, process and output (plot etc.)? Thanks, -- https://mail.python.org/mailman/listinfo/python-list
Re: How to place several import .... lines in one .py file?
On Thu, Jul 24, 2014 at 2:25 PM, fl rxjw...@gmail.com wrote: Hi, I have seen several kinds of module import examples, but most of the programs are small and less content. They only have one or two module import. I'll use the following modules in a small project. I would like to know whether it is appropriate to put all of them at the file header, like this: http://legacy.python.org/dev/peps/pep-0008/#imports -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On Thu, 24 Jul 2014 13:10:03 -0700 (PDT) Noble Bell nobleb...@gmail.com wrote: If I were to us wxPython then I would be limited to Python 2.x at present. If I were to use PyQt I would have to pay, as I understand the licenses, for it to use in commercial programs and/or programs that I ask for donations. If I am not mistaken PyQT is available for Python 3. I am not familiar with PySide much other than I have heard, though, it is not being updated anymore. I specifically switched from using wxPython to PySide when I decided that I didn't want to keep building up more and more of my codebase on Python 2.x., and didn't feel like wxPython Phoenix was ready for prime time. To the best of my knowledge, PySide is still under active development, including as the day job for Robin Dunn, the lead developer of wxPython. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 2014-07-24, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thu, Jul 24, 2014 at 12:04 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: Tk is neither sane How so? Like any other facet of programming, using Tk(inter) has it's frustrations, but for the most part it has always worked as expected for me. Granted, I haven't done anything terribly fancy. nor native-feeling, especially on Linux, where it looks like something from two decades ago. The problem there is that on Linux, native could mean GTK, QT, or something else entirely. Also, just to make sure, you are talking about ttk rather than plain tk, right? On other platforms, it also is not 100% native. On Windows, at least, ttk comes very very close to it. One of the Tk apps I maintain gets distributed to Windows users as well as Linux users. On my Win7 machine, it looks/acts like a native (at least as much as a Linux user can tell). None of the hardcore windows guys who use it have ever mentioned that it looks or acts oddly. On Linux, it looks like crap and acts a little goofy -- sort of vaguely old-school-Motif with non-standard keybindings. -- Grant Edwards grant.b.edwardsYow! BARRY ... That was at the most HEART-WARMING gmail.comrendition of I DID IT MY WAY I've ever heard!! -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 07/24/2014 01:11 PM, Glenn Linderman wrote: Not knowing any of these GUI platforms (although I've read some about Tk), I have some questions. * Which of them use UTF-8 as their native Unicode interface? * Which makes it easiest to discover and adjust font metrics such as kerning? * Which makes it easiest to obtain bounding rectangles of a piece of text? * Which makes it easiest to use a set of fonts such as Times (for Latin) and others for Cyrillic, Chinese, and Korean? Or which supplies a font configuration that can just be used for any language? Given these new requirements, I think Qt with either PyQt or PySide is really your only choice. See the official Qt docs (C++, but same API and will give you an idea of what's possible): http://qt-project.org/doc/ . Qt is probably the best documented of any GUI framework. On Windows and Mac it uses the native widget drawing dlls so things appear native. Making them feel native will require some attention on your part, though. For example dialog ttgbutton order, though I think there are convenience functions for doing that. Qt is fully unicode throughout. Don't worry about what encoding is used behind the scenes generally. You can encode to UTF-8 when writing bytes out, and decode from UTF-8 when reading bytes in. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 2014-07-24, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: On Thu, Jul 24, 2014 at 8:33 PM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thu, Jul 24, 2014 at 12:04 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: Tk is neither sane How so? Like any other facet of programming, using Tk(inter) has it's frustrations, but for the most part it has always worked as expected for me. Granted, I haven't done anything terribly fancy. Pretty much everyone in the world hates Tcl and Tk. Ask your favorite search engine for some results. Tcl and Tk are both absolutely brilliant for doing trivial things. Once the complexity starts to increase beyond hello world, click here to exit, Tcl falls over almost immediately and starts flopping around like a fish on a dock. Tk hangs in there quite a bit longer and is pretty useful as long as you've just got one main window and a few dialog boxes. IMO, it looks/acts native enough on Windows (at least for the widgets I've used). On Linux, it looks/acts non-native (not GTK or Qt), but Linux users don't have an immediate brain sieze-up when confronted with a slightly different UI, and they seem to be able to use Tk apps just fine. -- Grant Edwards grant.b.edwardsYow! Well, I'm INVISIBLE at AGAIN ... I might as well gmail.compay a visit to the LADIES ROOM ... -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 07/24/2014 12:51 PM, Chris Angelico wrote: On Fri, Jul 25, 2014 at 4:33 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On other platforms, it also is not 100% native. On Windows, at least, ttk comes very very close to it. What exactly does that mean? The Windows default UI changed significantly from W2K - XP - Win8, and each time, it's possible to revert to the old styling; does ttk follow the rest of the OS in that? And if so, does it achieve that by restricting you to a vicious subset of functionality that can actually be implemented natively, or does it try to reimplement as appropriate? ttk, like Qt, uses the MS theming dll to do the widget drawing (buttons, check boxes, etc). So everything looks native. As for actually being native, well, that means less and less every passing year. Windows applications use a plethora of GUI toolkits these days. In the old days everyone used what Win32 provided. Then MS started doing their own widgets in MS Office because the native ones are a subset of desired functionality modern apps demands. That opened the flood gates. So now many programs draw and control their own widgets. It has led to a certain amount of inconsistency, perhaps worse than we have in Linux. And some apps don't even bother with trying to look native anymore, like a lot of antivirus, antimalware, and system optimization programs (such as Advanced System Care). -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 07/24/2014 01:32 PM, Ian Kelly wrote: On Thu, Jul 24, 2014 at 1:02 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: AFAIK, Qt follows the system style properly, and it looks quite native on every Windows OS. No idea about ttk though. My understanding is that Qt merely emulates the native LAF, although it does a good job of it. wxPython on the other hand actually uses native widgets wherever possible. As I said previously in this thread, honestly this doesn't matter anymore. Even MS doesn't use native widgets in their own software. Any widget set worth its salt will draw using the theming dll so things look consistent, but whether or not an app feels right depends on the programmer. Use the correct button order for the platform, the right keyboard shortcuts, the right default button in dialog box behavior, etc, and you'll do quite well. OS X is a bit of a special case, but Qt can be made to fit fairly well on OS X. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 07/24/2014 10:46 AM, Chris Angelico wrote: On Fri, Jul 25, 2014 at 2:29 AM, Noble Bell nobleb...@gmail.com wrote: I was leaning toward Python 3 and Tkinter. I suppose the best way to do the GUI with Tkinter is to just roll-up my sleeves and do it via code rather than with the aid of a GUI editor. Yep. In fact, I recommend that for all GUI toolkits; instead of thinking about your layout in terms of positions of widgets on a window, think about it in terms of what your toolkit provides you with - usually that'll be some kind of tree structure of layout objects, like vertical and horizontal boxes. And if you plan your layout that way, you may as well just write it directly as code. As an exercise, yes this is valuable, but not necessary as a matter of course. But I rarely code guis anymore. I use Qt Designer for Qt apps, and Glade-3 for GTK and then load the resulting XML into my app at runtime. The GUI designers expose the full layout management capabilities of the toolkit. In GTK terms that's generally hboxes or vboxes with expansion flags. In Qt it's the same but with springs to consume space to make things grow and shrink appropriately. -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
Herion, Ketamine,Actavis promethazine codeine 16oz and 32oz available Ketamine Oxycontine Hydrocodone xanax and medicated marijuana US- free shipping and other related products for sell at competitive prices.We do world wide shipping to any clear address.Delivery is 100% safe due to our discreetness and experience.Try our quality and experience then have a story to tell another day. Email Address:stuffstorehouse2014 (AT) gmail.com CONTACT NUMBER: (407)-4852249 * Pleas text me only -- https://mail.python.org/mailman/listinfo/python-list
RE: Using pyVmomi
You could: - have a single point of entry that can check and, if necessary, revalidate - create a helper that checks and, if necessary, revalidate, which is then called where ever needed - create a decorator that does the above for each function that needs it Hi Ethan, Turns out the module in Pypi lacks what the latest release shipped with ESXi and obviously what github has. There is apparently a restartable strategy that I am working with now. I thought of a decorator implementing the retry idiom but as these are simply objects not functions that doesn't apply. I'd have to go options 1 or 2. Hopefully the restartable strategy suffices. Thanks, jlc -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
Chris Angelico wrote: The Windows default UI changed significantly from W2K - XP - Win8, and each time, it's possible to revert to the old styling; Well, sort of. I find that using the classic theme with Win7 is a less-than-satisfying experience, because it still lays things out the same way as the Win7 theme, resulting in big ugly gaps and a generally haphazard appearance. I quickly gave up on it and learned to like the new look. :-( -- Greg -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 7/24/2014 3:11 PM, Glenn Linderman wrote: Not knowing any of these GUI platforms (although I've read some about Tk), I have some questions. * Which of them use UTF-8 as their native Unicode interface? tk uses UCS-2 internally for the BMP subset. It does not display astral chars. tkinter iterfaces via with Python strings. * Which makes it easiest to discover and adjust font metrics such as kerning? I believe tk can use whatever fonts are on the system. Idle gives me a choice of more than I want to look at. Tk does kerning with proportional fonts, but I believe info and control is not user acccessible. The main available metrics are max ascender and descender sizes, for interline spacing. * Which makes it easiest to obtain bounding rectangles of a piece of text? The Text.bbox(index) returns the bounding rectangle for a character. Those can be combined as desired. * Which makes it easiest to use a set of fonts such as Times (for Latin) and others for Cyrillic, Chinese, and Korean? Or which supplies a font configuration that can just be used for any language? 'any language' requires a nearly complete unicode font. One can tag character sequences, and configure properties, including color and font, that override the widget defaults. This is how Idle colorizes Python code by syntax category. One could just as easily tag by language or by alphabet. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Exploring Python for next desktop GUI Project
On 7/24/2014 1:04 PM, Chris “Kwpolska” Warrick wrote: And it might be better to stay with Python 2, there are still things that don't work with Py3k that you might find crucial. It is true that there are 3rd-party modules that do not work with 3.x, including a few that one might want to use is a new project. It is also true that there are language features in 3.4 that do not work with 2.x, or 3.2- or 3.3, including some that one might want to use in a new project. For instance, Unicode works much better in 3.3 than in any version before. That is *only* available in 3.3+. And it is true that there are 'feature' still in 2.7 that do not work in 3.x. But these are mostly nuisances that we are better of without. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
On Thursday, July 24, 2014 10:25:52 AM UTC-4, Marko Rauhamaa wrote: #!/usr/bin/env python3 import math for x in range(0, 361, 15): print(int((math.sin(x / 180 * math.pi) + 1) * 30 + 0.5) * + *) Marko I like your method, but I get a column of '*'. Maybe you have other intentions of your code. I am puzzled about the last part of your code and want to learn from it ( * + * ). * * * * * * * * * * * * * * * * * * * * * * * * * -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
On Thu, Jul 24, 2014 at 7:29 PM, fl rxjw...@gmail.com wrote: On Thursday, July 24, 2014 10:25:52 AM UTC-4, Marko Rauhamaa wrote: #!/usr/bin/env python3 import math for x in range(0, 361, 15): print(int((math.sin(x / 180 * math.pi) + 1) * 30 + 0.5) * + *) Marko I like your method, but I get a column of '*'. Maybe you have other intentions of your code. I am puzzled about the last part of your code and want to learn from it ( * + * ). You probably ran it with Python 2. That code was written for Python 3 and assumes that division of two ints will return a float. You can also fix it by adding the line from __future__ import division at the top of the file. -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
fl rxjw...@gmail.com Wrote in message: I am puzzled about the last part of your code and want to learn from it ( * + * ). 6 * + x will produce a string of 6 blanks followed by an x. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
Re: What is the simplest method to get a vector result?
On Thu, 24 Jul 2014 22:44:51 -0400, Dave Angel wrote: fl rxjw...@gmail.com Wrote in message: I am puzzled about the last part of your code and want to learn from it ( * + * ). 6 * + x will produce a string of 6 blanks followed by an x. Dave is correct, but if you want to format text to a certain width, it is better to have Python count how many spaces you need: py 'spam'.rjust(20) 'spam' py 'spam'.ljust(20) 'spam' py 'spam'.center(20) 'spam' In recent versions, you can even specify the fill character: py 'spam'.center(20, '.') 'spam' -- Steven -- https://mail.python.org/mailman/listinfo/python-list
ANN: bcolz 0.7.0, columnar, chunked and compressed datasets at your fingertips
== Announcing bcolz 0.7.0 == What's new == In this release, support for Python 3 has been added, Pandas and HDF5/PyTables conversion, support for different compressors via latest release of Blosc, and a new `iterblocks()` iterator. Also, intensive benchmarking has lead to an important tuning of buffer sizes parameters so that compression and evaluation goes faster than ever. Together, bcolz and the Blosc compressor, are finally fullfilling the promise of accelerating memory I/O, at least for some real scenarios: http://nbviewer.ipython.org/github/Blosc/movielens-bench/blob/master/querying-ep14.ipynb#Plots ``bcolz`` is a renaming of the ``carray`` project. The new goals for the project are to create simple, yet flexible compressed containers, that can live either on-disk or in-memory, and with some high-performance iterators (like `iter()`, `where()`) for querying them. For more detailed info, see the release notes in: https://github.com/Blosc/bcolz/wiki/Release-Notes What it is == bcolz provides columnar and compressed data containers. Column storage allows for efficiently querying tables with a large number of columns. It also allows for cheap addition and removal of column. In addition, bcolz objects are compressed by default for reducing memory/disk I/O needs. The compression process is carried out internally by Blosc, a high-performance compressor that is optimized for binary data. bcolz can use numexpr internally so as to accelerate many vector and query operations (although it can use pure NumPy for doing so too). numexpr optimizes the memory usage and use several cores for doing the computations, so it is blazing fast. Moreover, the carray/ctable containers can be disk-based, and it is possible to use them for seamlessly performing out-of-memory computations. bcolz has minimal dependencies (NumPy), comes with an exhaustive test suite and fully supports both 32-bit and 64-bit platforms. Also, it is typically tested on both UNIX and Windows operating systems. Installing == bcolz is in the PyPI repository, so installing it is easy: $ pip install -U bcolz Resources = Visit the main bcolz site repository at: http://github.com/Blosc/bcolz Manual: http://bcolz.blosc.org Home of Blosc compressor: http://blosc.org User's mail list: bc...@googlegroups.com http://groups.google.com/group/bcolz License is the new BSD: https://github.com/Blosc/bcolz/blob/master/LICENSES/BCOLZ.txt **Enjoy data!** -- Francesc Alted -- https://mail.python.org/mailman/listinfo/python-list
Re: Question about Pass-by-object-reference?
On 23/07/2014 10:27 AM, Terry Reedy wrote: When you call a function, Python binds function parameter names to argument objects in the function's local namespace, the same as in name assignments. Given def f(a, b): pass a call f(1, 'x') starts by executing a, b = 1, 'x' in the local namespace. Nothing is being 'passed'. The Dude: Look, nothing is passed, here, man. The Big Lebowski: Nothing is passed? The god damn argument has crashed into the parameter! ...sorry, it's been a long week. -- https://mail.python.org/mailman/listinfo/python-list
[issue22055] Incomplete sentence in asyncio BaseEventLoop doc
Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com: -- assignee: docs@python components: Documentation, asyncio files: asyncio-eventloop-doc-incomplete-sent.diff keywords: patch nosy: docs@python, gvanrossum, haypo, sahutd, yselivanov priority: normal severity: normal status: open title: Incomplete sentence in asyncio BaseEventLoop doc versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36060/asyncio-eventloop-doc-incomplete-sent.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22055 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded
Terry J. Reedy added the comment: I will try test the problem and fix on Windows within a day. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21580 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22052] Comparison operators called in reverse order for subclasses with no override.
Mark Dickinson added the comment: the subclass provides doesn't actually imply anything about overriding, I think. Yes, that was the thrust of one of the SO answers. Unfortunately, that explanation doesn't work for arithmetic operators, though: there an explicit override is necessary. Here's another example, partly to get away from the extra complication of __eq__ being its own inverse. After: class A(object): def __lt__(self, other): return True def __gt__(self, other): return False def __add__(self, other): return 1729 def __radd__(self, other): return 42 class B(A): pass we get: A() + B() 1729 A() B() False So the addition is calling the usual __add__ method first (the special exception in the docs doesn't apply: while B *is* a subclass of A, it doesn't *override* A's __radd__ method). But the comparison is (surprisingly) calling the __gt__ method first. So we've got two different rules being followed: one for arithmetic operators, and a different one for comparisons. This isn't a big deal behaviour-wise: I'm certainly not advocating a behaviour change here. But it would be nice to document it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22052 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16733] Solaris ctypes_test failures
Mark Lawrence added the comment: Only one Solaris box was online when I looked and that had passed ctypes tests, but surely this will have been sorted out by now? -- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16733 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18643] add a fallback socketpair() implementation in test.support
STINNER Victor added the comment: I don't remember why I added a specific check on the proto parameter. I tested on Windows: socket.socket(proto=1) raises an OSError(WSAEPROTONOSUPPORT): WSAEPROTONOSUPPORT 10043: Protocol not supported. The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol. Since the error comes directly at socket.socket(), we drop drop the explicit test in socketpair(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions
Dirkjan Ochtman added the comment: I came up with a patch that shifts the compatibility hack we have for the tuple form of exec from run-time (in exec_statement()) to the CST-to-AST transformation (in ast_for_exec_stmt()). It seems to pass the tests (including the ones Robert pasted in here). Please review. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file36061/bug21591.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions
Dirkjan Ochtman added the comment: Oh, one specific question: I'm not sure if I should free the old expr1 (the top-level exec value) before overwriting it with the new one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18643] add a fallback socketpair() implementation in test.support
Charles-François Natali added the comment: By the way, we should reuse socket.socketpair() in asyncio.windows_utils. The Tulip is written for Python 3.3 and shares exactly the same code base, so you should write Something like: if hasattr(socket, 'socketpair'): socketpair = socket.socketpair else: def socketpair(...): ... Please also fix socketpair() in asyncio to add the while/drop unknown connection (well, the function in socket.py and windows_utils.py must be the same). That's a separate issue. Oh, and you forgot to modify the documentation to update Availability. Please add a .. versionchanged:: 3.5 mentionning that the function is now also available on Windows. Did you look at the patch? 363 .. versionchanged:: 3.5 364 Windows support added -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19875] test_getsockaddrarg occasional failure
Mark Lawrence added the comment: Clearly the long term solution is to fix the problems in the cpython code referenced in msg205227, but in the short term is it worth attempting a work around as suggested in msg205131 ? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19875 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22055] Incomplete sentence in asyncio BaseEventLoop doc
New submission from Andrew Svetlov: Fixed in f578e1d717b7 and f578e1d717b7. Thanks. -- nosy: +asvetlov resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22055 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18643] add a fallback socketpair() implementation in test.support
STINNER Victor added the comment: 2014-07-24 10:11 GMT+02:00 Charles-François Natali rep...@bugs.python.org: Please also fix socketpair() in asyncio to add the while/drop unknown connection (well, the function in socket.py and windows_utils.py must be the same). That's a separate issue. Ok. Oh, and you forgot to modify the documentation to update Availability. Please add a .. versionchanged:: 3.5 mentionning that the function is now also available on Windows. Did you look at the patch? 363 .. versionchanged:: 3.5 364 Windows support added Ok, I missed this part. In this case, socketpair-4.diff looks good to me. You can commit your patch in Python 3.5. I will open another issue to synchronize asyncio, maybe fix accept() to check the address and drop the if proto != 0: test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20055] On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py
Roundup Robot added the comment: New changeset 84f26a437893 by Victor Stinner in branch '3.4': Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete sentence. http://hg.python.org/cpython/rev/84f26a437893 New changeset f657b64c67ab by Victor Stinner in branch 'default': (Merge 3.4) Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete http://hg.python.org/cpython/rev/f657b64c67ab -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20055 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22018] Add a new signal.set_wakeup_socket() function
STINNER Victor added the comment: I don't understand this. If you're ok with calling fileno() under Linux, why not under Windows? I propose to add set_wakeup_socket() for all platforms. This function doesn't really call the fileno() method, it gets the socket file descriptor/socket handle from the C structure. I explained why I prefer to use an object rather than a number for set_wakeup_socket(). For example, it makes a clear separation between set_wakeup_fd(int) and set_wakeup_socket(socket). Would you prefer to use the file descriptor/socket handler for set_wakeup_socket()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22018 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19884] Importing readline produces erroneous output
Roundup Robot added the comment: New changeset 0177d8a4e82a by Victor Stinner in branch '2.7': Issue #19884: readline: Disable the meta modifier key if stdout is not a http://hg.python.org/cpython/rev/0177d8a4e82a New changeset 6303266beb80 by Victor Stinner in branch '3.4': Issue #19884: readline: Disable the meta modifier key if stdout is not a http://hg.python.org/cpython/rev/6303266beb80 New changeset f85a968f9e01 by Victor Stinner in branch 'default': (Merge 3.4) Issue #19884: readline: Disable the meta modifier key if stdout is http://hg.python.org/cpython/rev/f85a968f9e01 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19884 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19884] Importing readline produces erroneous output
STINNER Victor added the comment: I commited my patch. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19884 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21813] Enhance doc of os.stat_result
Roundup Robot added the comment: New changeset 833325d45113 by Victor Stinner in branch '3.4': Issue #21813: Enhance documentation of the os.stat_result class. http://hg.python.org/cpython/rev/833325d45113 New changeset 5d70ac83d104 by Victor Stinner in branch 'default': Issue #21813: Enhance documentation of the os.stat_result class. http://hg.python.org/cpython/rev/5d70ac83d104 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21813 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21813] Enhance doc of os.stat_result
STINNER Victor added the comment: Thanks Zachary Ware for your review. I'm not sure that I addressed all your comments, but I'm not interested to spend too much time on the documentation. Please open an issue if your saw other things that can be improved. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21813 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1191964] add non-blocking read and write methods to subprocess.Popen
akira added the comment: STINNER Victor rep...@bugs.python.org writes: I have implemented and would continue to lean towards continuing to hide BrokenPipeError on the additional API endpoints. FYI asyncio.Process.communicate() ignores BrokenPipeError and ConnectionResetError, whereas asyncio.Process.stdin.drain() (coroutine to wait until all bytes are written) raises a BrokenPipeError or ConnectionResetError if the child process exited. I think subprocess has the same design. Do Popen.write_nonblocking() and Popen.read_nonblocking() methods belong to the second category? Should they raise BrokenPipeError? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1191964] add non-blocking read and write methods to subprocess.Popen
STINNER Victor added the comment: Do Popen.write_nonblocking() and Popen.read_nonblocking() methods belong to the second category? Should they raise BrokenPipeError? IMO when you write directly to stdin and read from stdout/stderr of a child process, your code should be written to handle BrokenPipeError. You must decide how to handle them. Otherwise, you have to poll manually the child process using proc.poll() which is less efficient. If you forget to poll the process, your program may enter an unlimited loop which only occur in some cases (bug in the child process which exits before reading the whole stdin input). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13533] Would like Py_Initialize to play friendly with host app
Yukihiro Nakadaira added the comment: This problem easily happen when there is no python installation and there is standalone python application compiled with py2exe or cx_Freeze (e.g. Mercurial). Such application have pythonXX.dll in its directory. But its python library can not be loaded normally. So an application, which loads pythonXX.dll to check if python is available and uses it if possible, is terminated when loading python. Vim uses python as embedding scripting language. Vim loads pythonXX.dll when :python command is used. And this problem is reported occasionally. -- nosy: +ynkdir ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13533 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5718] Problem compiling ffi part of build on AIX 5.3.
David Edelsohn added the comment: ffi_closure_helper_DARWIN should have been declared extern in the assembly file. This has been fixed in more recent versions of libffi and imported into more recent versions of CPython, including 2.7. .extern .ffi_closure_helper_DARWIN Is it worth updating libffi.diff to insert the appropriate fix in 2.6 or not? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5718 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22018] Add a new signal.set_wakeup_socket() function
Antoine Pitrou added the comment: Le 24/07/2014 06:00, STINNER Victor a écrit : STINNER Victor added the comment: I don't understand this. If you're ok with calling fileno() under Linux, why not under Windows? I propose to add set_wakeup_socket() for all platforms. That's not what I'm answering to, though. See option B above. Again, what's wrong with passing the socket as a fileno? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22018 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5718] Problem compiling ffi part of build on AIX 5.3.
Stefan Krah added the comment: Thanks, David. If this is fixed in 2.7 we can close the issue. -- nosy: +skrah resolution: - out of date stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5718 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9770] curses.ascii.isblank() function is broken. It confuses backspace (BS 0x08) with tab (0x09)
akira added the comment: I've made the title more explicit: curses.isblank function doesn't match ctype.h - curses.ascii.isblank() function is broken. It confuses backspace (BS 0x08) with tab (0x09) If a core developer could review the open questions from the previous message msg221008 then I could prepare a proper patch for the issue. -- title: curses.isblank function doesn't match ctype.h - curses.ascii.isblank() function is broken. It confuses backspace (BS 0x08) with tab (0x09) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9770 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21813] Enhance doc of os.stat_result
Zachary Ware added the comment: The only comments you didn't address you were right not to (sorry for the noise about path_fd, I completely missed that it was just a link reference); what you committed looks fine to me. Thanks for your work on this, it looks like a big improvement to me! -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21813 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20055] On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py
Changes by Zachary Ware zachary.w...@gmail.com: -- Removed message: http://bugs.python.org/msg223821 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20055 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22055] Incomplete sentence in asyncio BaseEventLoop doc
Zachary Ware added the comment: Misposted to #20055: New changeset 84f26a437893 by Victor Stinner in branch '3.4': Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete sentence. http://hg.python.org/cpython/rev/84f26a437893 New changeset f657b64c67ab by Victor Stinner in branch 'default': (Merge 3.4) Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete http://hg.python.org/cpython/rev/f657b64c67ab -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22055 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22057] The doc say all globals are copied on eval(), but only __builtins__ is copied
New submission from Alon Mishne: According to the documentation of eval(): If the globals dictionary is present and lacks '__builtins__', the current globals are copied into globals before expression is parsed. However in practice only the __builtins__ items are copied, see: http://hg.python.org/cpython/file/2.7/Python/bltinmodule.c#l655 See http://stackoverflow.com/q/24934908/242762 -- assignee: docs@python components: Documentation messages: 223837 nosy: amishne, docs@python priority: normal severity: normal status: open title: The doc say all globals are copied on eval(), but only __builtins__ is copied versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22057 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com