ANN: GraphTerm - A Graphical Terminal Interface
GraphTerm is a browser-based graphical terminal interface, that aims to seamlessly blend the command line and graphical user interfaces. The goal is to be fully backwards compatible with xterm, with additional graphical features being accessed only as needed. (GraphTerm builds upon two earlier browser-based terminal projects, XMLTerm and AjaxTerm.) In addition to the command line, GraphTerm implements file finder or explorer features, and the detached terminal features of GNU Screen. The interface is designed to be touch-friendly, relying upon command re-use to minimize keyboard use. It preserves history for commands entered by typing, clicking, or tapping, and is themable using CSS. GraphTerm acts as a terminal exchange server, allowing multiple users to connect to multiple computers simultaneously and share terminal sessions for collaboration. This is the first public release of GraphTerm. It can be installed from: http://pypi.python.org/pypi/graphterm - Project Page: http://info.mindmeldr.com/code/graphterm - Source: http://github.com/mitotic/graphterm - License: BSD - Version: 0.30 - Screenshots: http://info.mindmeldr.com/code/graphterm/graphterm-screenshots Enjoy, R. Saravanan -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: Is Python a commercial proposition ?
Rodrick Brown, 30.07.2012 02:12: On Jul 29, 2012, at 12:07 PM, lipska the kat wrote: I'm trying to understand where Python fits into the set of commonly available, commercially used languages of the moment. Python is a glue language much like Perl was 10 years ago. Until the GIL is fixed Enough people have commented on this piece of FUD already. I doubt anyone will seriously look at Python as an option for large enterprise standalone application development. I know enough examples to recognise this as nonsense. You mentioned working in financials and even there I know at least one not-so-small bank that's been developing their internal (EAI and business process) code in Python for almost a decade now. And their developers are quite happy with it, certainly happier than many of the Java developers I've met in other banks. Still, you may still get away with the above statement by providing a sufficiently narrow definition of standalone. By my definition, there isn't much standalone code out there. Most code I know interfaces with a couple of external tools, libraries or backends, usually written in languages I don't have to care about because they provide a language independent interface. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
On 7/29/2012 11:33 PM, Steven D'Aprano wrote: On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote: When you are sitting on or in a name, you look to the left or look to the right what would you see that would tell you that you have gone past the end of that name. For example Have you read the docs? It gives full details of the Python syntax. Yes I have. I was hoping for a different perspective because what I'm trying to do is middle out parsing. Top-down when the scanner focus moves from left to right and bottom up when the scanner focus moves from right to left. sounds kind of odd when I describe it that way but both the cursor is on the middle of a name string and I need to look to either end of that name string before can do a conversion to a symbol string, I have to look at both ends in different ways. If you've read the documentation I've provided, would it be a better example to use for describing some of the issues. Here's a very rough draft of a storyboard https://docs.google.com/presentation/d/1fuKyo9AE6i9ZdX2lucwK0v_W5Kx9M3Mezavm40wzCo8/edit the first 13-14 slides are the working content for the storyboard. the rest is mostly memory of things I was thinking about so if it doesn't make sense or seems wrong, don't give me grief. :-) Here's a Python parser using the pyparsing library. It's a bit old (written for Python 2.4) but it shouldn't be hard to update it to new syntax: http://pyparsing.wikispaces.com/file/view/pythonGrammarParser.py thanks for the reference. I'll take a look at it as well. -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
Am 30.07.2012 02:44, schrieb Steven D'Aprano: I wish to extract the bit fields from a Python float, call it x. First I cast the float to 8-bytes: s = struct.pack('=d', x) i = struct.unpack('=q', s)[0] Then I extract the bit fields from the int, e.g. to grab the sign bit: (i 0x8000) 63 Questions: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? The struct docs refer to C's double type, so it depends on that type probably. However, regardless of C's double type, the same docs refer to the IEEE form when packed into a byte array. Is it just the representation you are after or some specific behaviour? 2) If the platform byte-order is reversed, do I need to take any special action? I don't think I do, because even though the float is reversed, so will be the bit mask. Is this correct? Yes, the code is fine. If you have doubts, I have a big-endian system at home (Linux/PowerPC) where I could run tests. 3) Any other problems with the way I am doing this? Python docs refer to IEEE-754, not 784? Typo? Uli -- http://mail.python.org/mailman/listinfo/python-list
Linux shell to python
Dear friends, I just joined the group. I was trying porting from bash shell to python. let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' I tried to use python subprocess and OS.Popen modules. Thanks Regard's Vikas Kumar Choudhary (Yahoo,MSN-Hotmail,Skype) Messenger = vikas.choudhary Please Add Me in Your Messenger List for Better Communication P Please consider the environment before printing this e-mail Do not print this email unless it is absolutely necessary. Save papers, Save tree. Note: This e-mail is confidential and may also be privileged, this is for the intended recipients only. If you are not the intended recipient, please delete the message and notify me immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Notice: All email and instant messages (including attachments) sent to or from This E-mail id , may be retained, monitored and/or reviewed, or authorized law enforcement personnel, without further notice or consent. -- -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On Mon, Jul 30, 2012 at 5:05 PM, Vikas Kumar Choudhary vikas.choudh...@yahoo.co.in wrote: I was trying porting from bash shell to python. let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' Welcome! While it's technically possible to do exactly that in Python (using subprocess as you describe), there's usually a more efficient and cleaner method of achieving the same goal. With a port such as you describe, it's probably best to go right back to the conceptual level and work out what exactly you're trying to do, and then look at implementing that in Python. You'll end up with much cleaner code at the end of it. For an initial guess, I would say that you'll use subprocess to invoke lspci, but then everything else will be done in Python directly. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On Mon, Jul 30, 2012 at 4:07 PM, Stefan Behnel stefan...@behnel.de wrote: Still, you may still get away with the above statement by providing a sufficiently narrow definition of standalone. By my definition, there isn't much standalone code out there. Most code I know interfaces with a couple of external tools, libraries or backends, usually written in languages I don't have to care about because they provide a language independent interface. Agreed, and the flip-side of that is that there aren't many mono-language developers either. Sure, it'd be possible to make a career of nothing but Objective-C, writing apps for Apple to make all the money off, but even then you'll probably benefit from knowing some glue languages. Python's an excellent glue language, but it's also fine for huge applications. Yes, it can't multithread across cores if you use CPython and are CPU-bound. That's actually a pretty specific limitation, and taking out any component of that eliminates the GIL as a serious problem. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On Monday, July 30, 2012 1:44:04 AM UTC+1, Steven D'Aprano wrote: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? Well, IronPython is presumably using .NET Doubles, while Jython will be using Java Doubles---in either case, that's specified to be the IEEE 754 binary64 type. For CPython, and I guess PyPy too, we're using C doubles, which in theory are in whatever format the platform provides, but in practice are always IEEE 754 binary64 again. So you're pretty safe assuming IEEE 754 binary64 format. If you ever meet a current Python running on a system that *doesn't* use IEEE 754 for its C doubles, please let me know---there are a lot of interesting questions that would come up in that case. 2) If the platform byte-order is reversed, do I need to take any special action? I don't think I do, because even though the float is reversed, so will be the bit mask. Is this correct? True; on almost all current platforms, the endianness of int types matches the endianness of float types.But to be safe, why not use 'd' and 'q' in your formats instead of '=d' and '=q'? That way you don't have to worry. 3) Any other problems with the way I am doing this? You might consider whether you want to use 'q' or 'Q' --- i.e. whether you want a signed integer or an unsigned integer to be returned. For grabbing bits, 'Q' seems a bit cleaner, while 'q' has the nice property that you can tell the sign of the original double by looking at the sign of the integer. -- Mark -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
Eric S. Johansson e...@harvee.org writes: When you are sitting on or in a name, you look to the left or look to the right what would you see that would tell you that you have gone past the end of that name. For example a = b + c if you are sitting on a, the boundaries are beginning of line and =, if you are sitting on b, the boundaries are = and +, if you are sitting on c, the boundaries are + and end of line. a call the region between those boundaries the symbol region. Check the lexical definitions. They essentially define, what a symbol region is. In essence, you have names, operators, literals whitespace and comments -- each with quite a simple definition. -- http://mail.python.org/mailman/listinfo/python-list
Re: PyPI question, or, maybe I'm just stupid
Chris Gonnerman ch...@gonnerman.org writes: I've been making some minor updates to the PollyReports module I announced a while back, and I've noticed that when I upload it to PyPI, my changelog (CHANGES.txt) doesn't appear to be integrated into the site at all. Do I have to put the changes into the README, or have I missed something here? It seems that there should be some automatic method whereby PyPI users could easily see what I've changed without downloading it first. CHANGES.txt is not automatically presented. If necessary, you must integrate it into the long description. However, personally, I am not interested in all the details (typically found in CHANGES.txt) but some (often implicit) information is sufficient for me: something like major API change, minor bug fixes. Thus, think carefully what you put on the overview page. I find it very stupid to see several window scrolls of changes for a package but to learn how to install the package, I have to download its source... -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
I appreciate the help because I believe that once this is working, it'll make a significant difference in the ability for disabled programmers to write code again as well as be able to integrate within existing development team and their naming conventions. Did you try to use pygments? http://pygments.org/docs/api/ It already contains a lexer for Python source code. You can create a Lexer (pygments.lexer.Lexer) then call its get_tokens method. Then you can use this to identify statements: http://docs.python.org/reference/simple_stmts.html Fortunately, almost all statements begin with a keyword. There are some exceptions: expression statement assignment statement I would first tokenize the code, then divide it by statement keywords. Finally, you just need to find expression/assignment statements in the remaining sections. (Maybe there is a better way to do it.) -- http://mail.python.org/mailman/listinfo/python-list
Re: newbie: write content in a file (server-side)
Am Sonntag, 29. Juli 2012 17:16:11 UTC+2 schrieb Peter Otten: Thomas Kaufmann wrote: I send from a client file content to my server (as bytes). So far so good. The server receives this content complete. Ok. Then I want to write this content to a new file. It works too. But in the new file are only the first part of the whole content. What's the problem. Here's my server code: while True: bytes = self.request.recv(4096) if bytes: s = bytes.decode(utf8) print(s) li = s.split(~) with open(li[0], 'w') as fp: fp.write(li[1]) - Do you ever want to leave the loop? - You calculate a new filename on every iteration of the while loop -- probably not what you intended to do. - The w argument tells Python to overwrite the file if it exists. You either need to keep the file open (move the with... out of the loop) or open it with a. - You may not receive the complete file name on the first iteration of the while loop. - The bytes buffer can contain incomplete characters, e. g.: data = b\xc3\xa4 data.decode(utf-8) 'ä' data[:1].decode(utf-8) Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data Thanks Peter. It helps;-). -- http://mail.python.org/mailman/listinfo/python-list
Re: newbie: write content in a file (server-side)
Am Sonntag, 29. Juli 2012 16:16:01 UTC+2 schrieb Thomas Kaufmann: Hi, I send from a client file content to my server (as bytes). So far so good. The server receives this content complete. Ok. Then I want to write this content to a new file. It works too. But in the new file are only the first part of the whole content. What's the problem. o-o Thomas Here's my server code: import socketserver class MyTCPServer(socketserver.BaseRequestHandler): def handle(self): s = '' li = [] addr = self.client_address[0] print([{}] Connected! .format(addr)) while True: bytes = self.request.recv(4096) if bytes: s = bytes.decode(utf8) print(s) li = s.split(~) with open(li[0], 'w') as fp: fp.write(li[1]) #... main .. if __name__ == __main__: server = socketserver.ThreadingTCPServer((, 12345), MyTCPServer) server.serve_forever() Thanks a lot. It helps. -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
On 7/30/2012 5:25 AM, Laszlo Nagy wrote: Did you try to use pygments? http://pygments.org/docs/api/ thanks, I'll take a look. I would first tokenize the code, then divide it by statement keywords. Finally, you just need to find expression/assignment statements in the remaining sections. (Maybe there is a better way to do it.) yeah the problem is also little more complicated than simple parsing of Python code. For example, one example (from the white paper) *meat space blowback = Friends and family [well-meaning attempt] *could that be parsed by the tools you mention? I suspect not but this is what I need to generate using speech recognition because it's easily spoken. A more complex example might be something like new base = OS path-base name (old path) or if OS base exists (current path): new base name = OS path base name(current path) What's particularly cute here is that using the translation technique I can actually describe the full object method path with a minimum of speaking overhead. Python is great. :-) But the questions remain, will these tools are stuff like this? -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On 07/30/2012 09:05 AM, Vikas Kumar Choudhary wrote: `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' The rough Python equivalent would be import subprocess [ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim for l in subprocess.check_output(['lspci']).splitlines() if 'Q' in l and isp_str1 in l and isp_str2 in l ] You can also just paste the whole pipeline with the shell=True parameter. That's not recommended though, and it's hard to correctly quote strings. - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On 07/29/12 21:31, Rodrick Brown wrote: Its still not possible to be a pure Python developer and find gainful employment today. I'm not sure where you get your facts, but unless you define pure in a super-narrow way, it's just flat-out wrong. I've been employed doing primarily Python for the past 7+ years. Yes, there's been some SQL involved; yes, I've done code-reviews for somebody else's C# (the nice thing about C-like languages is they all read mostly the same); yes, some of the web apps have required knowing ECMAScript, HTML, XML, CSS, etc. But the day to day is mostly coding in Python. And the several recruiters that have contacted me in the past week or two about additional Python positions seem to think there are pure Python jobs available. Maybe you intended to write not possible to be a poor Python developer and find gainful employment today which could surely be the case, as I've met LOTS of programmers (Python and otherwise) that I'd never consider hiring because of their poor skills/understanding of their tools. -tkc -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
you can use commands.getstatusoutput(command), the shell command special charactor (like $ and so on )should be escaped! 在 2012年7月30日星期一UTC+8下午3时40分04秒,Chris Angelico写道: On Mon, Jul 30, 2012 at 5:05 PM, Vikas Kumar Choudhary vikas.choudh...@yahoo.co.in wrote: I was trying porting from bash shell to python. let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' Welcome! While it's technically possible to do exactly that in Python (using subprocess as you describe), there's usually a more efficient and cleaner method of achieving the same goal. With a port such as you describe, it's probably best to go right back to the conceptual level and work out what exactly you're trying to do, and then look at implementing that in Python. You'll end up with much cleaner code at the end of it. For an initial guess, I would say that you'll use subprocess to invoke lspci, but then everything else will be done in Python directly. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Error
Jürgen A. Erhard j...@jaerhard.com wrote: Peter's right, but instead of a print before the line, put a try/except around it, like try: set1 = set(list1) except TypeError: print list1 raise This way, only the *actual* error triggers any output. With a general print before, you can get a lot of unnecessary output. Grits, J Or even better: try: set1 = set(list1) except TypeError: print list1 import pdb; pdb.set_trace() raise Then the error will print the value of list1 and drop you into the debugger so you can examine what's going on in more detail. -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On Mon, Jul 30, 2012 at 12:35:38PM +0200, Philipp Hagemeister wrote: On 07/30/2012 09:05 AM, Vikas Kumar Choudhary wrote: `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' The rough Python equivalent would be import subprocess [ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim for l in subprocess.check_output(['lspci']).splitlines() if 'Q' in l and isp_str1 in l and isp_str2 in l ] Ouch. A list comprehension spanning more than one line is bad code pretty much every time. But you did qualify it as rough :D Grits, J -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
Vikas Kumar Choudhary wrote: let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' I tried to use python subprocess and OS.Popen modules. subprocess is the way to go. I was trying porting from bash shell to python. Here's an example showing how to translate a shell pipe: http://docs.python.org/library/subprocess.html#replacing-shell-pipeline But even if you can port the shell script literally I recommend a more structured approach: import subprocess import itertools def parse_data(lines): for not_empty, group in itertools.groupby(lines, key=bool): if not_empty: triples = (line.partition(:) for line in group) pairs = ((left, right.strip()) for left, sep, right in triples) yield dict(pairs) if __name__ == __main__: def get(field): return entry.get(field, ).lower() output = subprocess.Popen([lspci, -vmm], stdout=subprocess.PIPE).communicate()[0] for entry in parse_data(output.splitlines()): if nvidia in get(Vendor) and usb in get(Device): print entry[Slot] print entry[Device] print -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On 07/30/2012 01:31 PM, Jürgen A. Erhard wrote: On Mon, Jul 30, 2012 at 12:35:38PM +0200, Philipp Hagemeister wrote: import subprocess [ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim for l in subprocess.check_output(['lspci']).splitlines() if 'Q' in l and isp_str1 in l and isp_str2 in l ] Ouch. A list comprehension spanning more than one line is bad code pretty much every time. I didn't want to introduce a separate function, but as requested, here's the function version: def pciIds(searchWords=['Q', isp_str1, isp_str2]): for l in subprocess.check_output(['lspci']).splitlines(): if all(sw in l for sw in searchWords): yield l.partition(' ')[0] You could also separate the processing, like this: lines = subprocess.check_output(['lspci']).splitlines() lines = [l for l in lines if 'Q' in l and isp_str1 in l and isp_str2 in l] # Or: lines = filter(lambda l: 'Q' in l and isp_str1 in l and isp_str2 in l, lines) [l.partition(' ')[0] for l in lines] # Or: map(lambda l: l.partition(' ')[0], lines) But personally, I have no problem with three-line list comprehensions. Can you elaborate why the list comprehension version is bad code? Or more to the point, how would *you* write it? - Philipp signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python] Re: PyPI question, or, maybe I'm just stupid
On 07/30/2012 04:20 AM, Dieter Maurer wrote: CHANGES.txt is not automatically presented. If necessary, you must integrate it into the long description. However, personally, I am not interested in all the details (typically found in CHANGES.txt) but some (often implicit) information is sufficient for me: something like major API change, minor bug fixes. Thus, think carefully what you put on the overview page. I see your point. I'm just lazy, I guess. I already put a description of what I've changed into git, so why, I muse, must I also edit the overview page separately? I was hoping there was an automatic way that setup.py sdist upload could handle it for me. I find it very stupid to see several window scrolls of changes for a package but to learn how to install the package, I have to download its source... Not sure I get this. The installation procedure for PollyReports is the same as for, what, 99% of Python source packages? sudo python setup.py install What else are you saying I should do? -- Chris. -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python] Re: PyPI question, or, maybe I'm just stupid
On 07/29/2012 11:00 PM, Ben Finney wrote: Your post is showing up as a reply to a thread about IEEE-784 floats, because you created your message as a reply. Consequently, it's rather confusing why you suddenly start talking about PollyReports. If you want to attract attention to an unrelated topic, it's best if you don't reply to an existing thread; instead, start a new thread by composing a new message to the forum. My apologies. I did not consider that headers I can't see might be being sent along. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
In article mailman.2717.1343634778.4697.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Python's an excellent glue language, but it's also fine for huge applications. Yes, it can't multithread across cores if you use CPython and are CPU-bound. That's actually a pretty specific limitation, and taking out any component of that eliminates the GIL as a serious problem. These days, I'm working on a fairly large web application (songza.com). The business/application logic is written entirely in Python (mostly as two django apps). That's what we spend 80% of our developer time writing. As for scale, we're currently running on 80 cores worth of AWS servers for the front end. Another 50 or so cores for the database and other backend functions. Yesterday (Sunday, so a slow day), we served 27 million HTTP requests; we're not facebook-sized, but it's not some little toy application either. Every time we look at performance, we can't hardly measure the time it takes to run the Python code. Overall, we spend (way) more time waiting on network I/O than anything else. Other than I/O, our biggest performance issue is slow database queries, and making more queries than we really need to. The engineering work to improve performance involves restructuring our data representation in the database, caching (at multiple levels), or eliminating marginal features which cost more than they're worth. None of this would be any different if we used C++, except that we'd spend so much time writing and debugging code that we'd have no time left to think about the really important stuff. As far as the GIL is concerned, it's just not an issue for us. We run lots of server processes. Perhaps not as elegant as running fewer multi-threaded processes, but it works just fine, is easy to implement, and we never have to worry about all the horrors of getting memory management right in a multi-threaded C++ application. -- http://mail.python.org/mailman/listinfo/python-list
py2c - an open source Python to C/C++ is looking for developers
I created py2c ( http://code.google.com/p/py2c )- an open source Python to C/C++ translator! py2c is looking for developers! To join create a posting in the py2c-discuss Google Group or email me! Thanks PS:I hope this is the appropiate group for this message. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On 30/07/12 14:06, Roy Smith wrote: In articlemailman.2717.1343634778.4697.python-l...@python.org, Chris Angelicoros...@gmail.com wrote: Python's an excellent glue language, but it's also fine for huge applications. Yes, it can't multithread across cores if you use CPython and are CPU-bound. That's actually a pretty specific limitation, and taking out any component of that eliminates the GIL as a serious problem. These days, I'm working on a fairly large web application (songza.com). The business/application logic is written entirely in Python (mostly as two django apps). That's what we spend 80% of our developer time writing. snip We are very sorry to say that due to licensing constraints we cannot allow access to Songza for listeners located outside of the United States. Arse :-( Lipska -- Lipska the Kat: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On 2012-07-30, Stefan Behnel stefan...@behnel.de wrote: Still, you may still get away with the above statement by providing a sufficiently narrow definition of standalone. By my definition, there isn't much standalone code out there. Most code I know interfaces with a couple of external tools, libraries or backends, usually written in languages I don't have to care about because they provide a language independent interface. It's not really relevent to this discussion, but there is _lots_ of stand-alone code out there. It runs in sub-one-dollar microcontrollers that are programmed in assembly language or in C without external libraries (sometimes not even the libc that's included in the C language definition). Those microcontrollers are everywhere in toys, appliances, and all sorts of other non-computer things. -- Grant Edwards grant.b.edwardsYow! Mr and Mrs PED, can I at borrow 26.7% of the RAYON gmail.comTEXTILE production of the INDONESIAN archipelago? -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? And the question you didn't ask: are there any platforms where a C double isn't IEEE-754? The last ones I worked on that where the FP format wasn't IEEE were the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't think Python runs on the latter, but it might on the former. -- Grant Edwards grant.b.edwardsYow! I was born in a at Hostess Cupcake factory gmail.combefore the sexual revolution! -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
In article jv64v5$g2n$2...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: The last ones I worked on that where the FP format wasn't IEEE were the DEC VAX According to http://en.wikipedia.org/wiki/Vax#History, the last VAX was produced 7 years ago. I'm sure there's still more than a few chugging away in corporate data centers and manufacturing floors, but as an architecture, it's pretty much a dead parrot. IEEE floating point is as near to a universal standard as it gets in the computer world. About the only thing that has it beat for market penetration and longevity are 2's complement integers and 8-bit bytes. -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On 30/07/2012 15:16, Grant Edwards wrote: On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? And the question you didn't ask: are there any platforms where a C double isn't IEEE-754? The last ones I worked on that where the FP format wasn't IEEE were the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't think Python runs on the latter, but it might on the former. Support for Python on VMS has been dropped for v3.3 see http://bugs.python.org/issue11918 -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
yeah the problem is also little more complicated than simple parsing of Python code. For example, one example (from the white paper) *meat space blowback = Friends and family [well-meaning attempt] *could that be parsed by the tools you mention? It is not valid Python code. Pygments is able to tokenize code that is not valid Python code. Because it is not parsing, it is just tokenizing. But if you put a bunch of random tokens into a file, then of course you will never be able to split that into statements. Probably, you will need to process ident/dedent tokens, identify the level of the satement. And then you can tell what file, class, inner class, method you are staying in. Inside one level or code block, you could try to divide the code into statements. Otherwise, I have no idea how a blind person could navigate in a Python source. In fact I have no idea how they use regular programs. So I'm affraid I cannot help too much with this. :-( -- http://mail.python.org/mailman/listinfo/python-list
CfP: 5th International Workshop on Multi-Core Computing Systems (MuCoCoS)
*** Paper submission deadline: September 9, 2012 *** 5th International Workshop on Multi-Core Computing Systems (MuCoCoS) 2012 Focus: Performance Portability and Tuning Salt Lake City, Utah, November 16, 2012 In conjunction with the Supercomputing Conference SC12 http://www.par.univie.ac.at/~pllana/mucocos12/ *** Workshop proceedings are published by the IEEE *** CONTEXT The pervasiveness of homogeneous and heterogeneous multi-core and many-core processors, in a large spectrum of systems from embedded and general-purpose to high-end computing systems, poses major challenges to software industry. In general, there is no guarantee that software developed for a particular architecture will be executable (that is functional) on another architecture. Furthermore, ensuring that the software preserves some aspects of performance behavior (such as temporal or energy efficiency) across different such architectures is an open research issue. Therefore, this workshop focuses on novel solutions for functional and performance portability as well as automatic tuning across different architectures. Following the successful organization of MuCoCoS 2008 (Barcelona, Spain), MuCoCoS 2009 (Fukuoka, Japan), MuCoCoS 2010 (Krakow, Poland), MuCoCoS 2011 (Seoul, Korea), this year MuCoCoS will be organized at Salt Lake City, Utah, November 16, 2012, in conjunction with the Supercomputing Conference SC12. MuCoCoS 2012 focuses on Performance Portability and Tuning. TOPICS OF INTEREST - The topics of the workshop include but are not limited to: :: Performance measurement, modeling, analysis and tuning :: Portable programming models, languages and compilation techniques :: Tunable algorithms and data structures :: Run-time systems and hardware support mechanisms for auto- tuning :: Case studies highlighting performance portability and tuning SUBMISSION GUIDELINES - The papers should be prepared using the IEEE format, and no longer than 10 pages. Submitted papers will be carefully evaluated based on originality, significance to workshop topics, technical soundness, and presentation quality. - Submission of the paper implies that should the paper be accepted, at least one of the authors will register and present the paper at the workshop. Papers will be published as a part of the SC12 digital proceedings. These are IEEE digital library proceedings that will be available online. - Please submit your paper (as PDF) electronically using the online submission system. (https://www.easychair.org/account/signin.cgi?conf=mucocos2012) SPECIAL JOURNAL ISSUE Authors of the best MuCoCoS papers will be invited to submit their extended workshop papers to a special issue of Computing journal (© Springer) that will be developed for this workshop. IMPORTANT DATES - Submission: September 9, 2012 - Notification: October 14, 2012 - Registration: October 17, 2012 - Workshop: November 16, 2012 WORKSHOP CO-CHAIRS - Sabri Pllana, University of Vienna, Austria http://www.par.univie.ac.at/~pllana/ - Jacob Barhen, Oak Ridge National Laboratory, US http://www.ornl.gov/info/awards/cf/cfcitations/cfbios/barhen.shtm -- http://mail.python.org/mailman/listinfo/python-list
Re: py2c - an open source Python to C/C++ is looking for developers
2012/7/30 maniandra...@gmail.com: I created py2c ( http://code.google.com/p/py2c )- an open source Python to C/C++ translator! py2c is looking for developers! To join create a posting in the py2c-discuss Google Group or email me! Thanks PS:I hope this is the appropiate group for this message. -- http://mail.python.org/mailman/listinfo/python-list It looks like a very very hard task, and really useful or for exercise? The first few lines I've seen there are the dangerous * imports and LazyStrin looks like a typo.. from ast import * import functools from c_types import * from lazystring import * #constant data empty = LazyStrin ordertuple = ((Or,),(And -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
On 7/30/2012 10:59 AM, Laszlo Nagy wrote: yeah the problem is also little more complicated than simple parsing of Python code. For example, one example (from the white paper) *meat space blowback = Friends and family [well-meaning attempt] *could that be parsed by the tools you mention? It is not valid Python code. Pygments is able to tokenize code that is not valid Python code. Because it is not parsing, it is just tokenizing. But if you put a bunch of random tokens into a file, then of course you will never be able to split that into statements. If you have been reading the papers, you would understand what I'm doing. I'm trying to take Python code with speech recognition friendly symbols and translate the symbols into a code friendly form. My conjecture is that you can change your perspective on the code and look for the edge that would normally be used to define start of a symbol, you should be able to define the name string. Another possibility is looking at the region which just contains letters numbers and spaces and outside and use that as your definition of a name string. It would probably help to verify that each word is found in a dictionary although that adds extra complexity if you are trying to increase the dictionary at the same time as the translation table. I'm beginning to think for the first generation I should just use regular expressions looking forwards and backwards and try to enumerate the possible cases. Probably, you will need to process ident/dedent tokens, identify the level of the satement. And then you can tell what file, class, inner class, method you are staying in. Inside one level or code block, you could try to divide the code into statements. I was starting in that direction so that is good confirmation Otherwise, I have no idea how a blind person could navigate in a Python source. In fact I have no idea how they use regular programs. So I'm affraid I cannot help too much with this. :-( I'm sorry, I am, and I'm trying to help, hand disabled programmers. There are more disability than blindness and after almost 20 years of encountering this shortsightedness, I do get a little cranky at times. :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On 2012-07-30, Mark Lawrence breamore...@yahoo.co.uk wrote: On 30/07/2012 15:16, Grant Edwards wrote: On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? And the question you didn't ask: are there any platforms where a C double isn't IEEE-754? The last ones I worked on that where the FP format wasn't IEEE were the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't think Python runs on the latter, but it might on the former. Support for Python on VMS has been dropped for v3.3 see http://bugs.python.org/issue11918 I imagine that VAXes running Unix went extinct in the wild long before VAXes running VMS. -- Grant Edwards grant.b.edwardsYow! Did YOU find a at DIGITAL WATCH in YOUR box gmail.comof VELVEETA? -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On Monday, July 30, 2012 3:16:05 PM UTC+1, Grant Edwards wrote: The last ones I worked on that where the FP format wasn't IEEE were the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't think Python runs on the latter, but it might on the former. For current hardware, there's also IBM big iron: the IBM System z10 apparently has hardware support for IBM's hexadecimal floating-point format in addition to IEEE 754 binary *and* decimal floating-point. But IIUC, a typical Linux installation on one of these machines uses the IEEE 754 stuff, not the hexadecimal bits. So unlikely to be an issue for Python. -- Mark -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On Jul 29, 9:01 pm, lipska the kat lip...@yahoo.co.uk wrote: Pythoners Firstly, thanks to those on the tutor list who answered my questions. I'm trying to understand where Python fits into the set of commonly available, commercially used languages of the moment. My most recent experience is with Java. The last project I was involved with included 6775 java source files containing 1,145,785 lines of code. How do I know this? because I managed to cobble together a python script that walks the source tree and counts the lines of code. It ignores block and line comments and whitespace lines so I'm fairly confident it's an accurate total. It doesn't include web interface files (mainly .jsp and HTML) or configuration files (XML, properties files and what have you). In fact it was remarkably easy to do this in python which got me thinking about how I could use the language in a commercial environment. I was first attracted to python by it's apparent 'Object Orientedness' I soon realised however that by looking at it in terms of the language I know best I wasn't comparing like with like. Once I had 'rebooted the bioware' I tried to approach python with an open mind and I have to say it's growing on me. The questions I have are ... How is python used in the real world. What sized projects are people involved with Are applications generally written entirely in python or is it more often used for a subset of functionality. I think when people talk of scripting this area tends to get missed: (Or if someone mentioned it, I missed it :-) ) http://wiki.python.org/moin/AppsWithPythonScripting -- http://mail.python.org/mailman/listinfo/python-list
Re: py2c - an open source Python to C/C++ is looking for developers
On Jul 30, 7:27 am, maniandra...@gmail.com wrote: I created py2c (http://code.google.com/p/py2c)- an open source Python to C/C++ translator! py2c is looking for developers! To join create a posting in the py2c-discuss Google Group or email me! Thanks PS:I hope this is the appropiate group for this message. Out of curiosity. What is the difference between this and Shedskin? Shedskin being a (restricted) python-to-C++ compiler. (http://code.google.com/p/ shedskin/) Is the goal to be able to handle any python code or a subset? Cheers, Adam -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
On Mon, Jul 30, 2012 at 12:44 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I wish to extract the bit fields from a Python float, call it x. First I cast the float to 8-bytes: s = struct.pack('=d', x) i = struct.unpack('=q', s)[0] Then I extract the bit fields from the int, e.g. to grab the sign bit: (i 0x8000) 63 Questions: 1) Are there any known implementations or platforms where Python floats are not C doubles? If so, what are they? Last I heard, DEC Alpha chips did not use IEEE floating point. 2) If the platform byte-order is reversed, do I need to take any special action? I don't think I do, because even though the float is reversed, so will be the bit mask. Is this correct? 3) Any other problems with the way I am doing this? It gives me the heebie jeebies. Why go to all the trouble and incur the lack of portability to esoteric platforms, when you can just use arithmetic expressions? It's fancy, and it'll probably almost always work, but it's probably not so wise. -- http://mail.python.org/mailman/listinfo/python-list
RE: Linux shell to python
You can do this with one subprocess.Popen and some python commands. The alternative is to pipe some subprocess.Popen commands together. Or for the quick way out (but I think you better stick with bash scripting then): http://pypi.python.org/pypi/sarge/ Don't know about it's stability/ubs/etc, never used it. -Original message- From:Vikas Kumar Choudhary vikas.choudh...@yahoo.co.in Sent:Mon 30-07-2012 09:34 Subject:Linux shell to python To:python-list@python.org; Dear friends, I just joined the group. I was trying porting from bash shell to python. let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' I tried to use python subprocess and OS.Popen modules. Thanks Regard's Vikas Kumar Choudhary (Yahoo,MSN-Hotmail,Skype) Messenger = vikas.choudhary Please Add Me in Your Messenger List for Better Communication P Please consider the environment before printing this e-mail Do not print this email unless it is absolutely necessary. Save papers, Save tree. Note: This e-mail is confidential and may also be privileged, this is for the intended recipients only. If you are not the intended recipient, please delete the message and notify me immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Notice: All email and instant messages (including attachments) sent to or from This E-mail id , may be retained, monitored and/or reviewed, or authorized law enforcement personnel, without further notice or consent. -- -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
RE: simplified Python parsing question
Another possibility is to use the ast module of python: http://docs.python.org/library/ast.html The only problem with that module, is that everything you parse must be correct, otherwise it throws an exception, I don't know if that's a problem for your project? -Original message- From:Eric S. Johansson e...@harvee.org Sent:Mon 30-07-2012 12:00 Subject:Re: simplified Python parsing question To:python-list@python.org; On 7/30/2012 5:25 AM, Laszlo Nagy wrote: Did you try to use pygments? http://pygments.org/docs/api/ thanks, I'll take a look. I would first tokenize the code, then divide it by statement keywords. Finally, you just need to find expression/assignment statements in the remaining sections. (Maybe there is a better way to do it.) yeah the problem is also little more complicated than simple parsing of Python code. For example, one example (from the white paper) *meat space blowback = Friends and family [well-meaning attempt] *could that be parsed by the tools you mention? I suspect not but this is what I need to generate using speech recognition because it's easily spoken. A more complex example might be something like new base = OS path-base name (old path) or if OS base exists (current path): new base name = OS path base name(current path) What's particularly cute here is that using the translation technique I can actually describe the full object method path with a minimum of speaking overhead. Python is great. :-) But the questions remain, will these tools are stuff like this? -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On 7/29/2012 5:12 PM Rodrick Brown said... Until the GIL is fixed I doubt anyone will seriously look at Python as an option for large enterprise standalone application development. See openERP -- http://www.openerp.com/ -- they've been actively converting SAP accounts and have recently absorbed a couple SAP resellers. Emile -- http://mail.python.org/mailman/listinfo/python-list
[ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
Pyknon is a simple music library for Python hackers. With Pyknon you can generate Midi files quickly and reason about musical proprieties. It works with Python 2.7 and 3.2. Pyknon is very simple to use, here's a basic example to create 4 notes and save into a MIDI file:: from pyknon.genmidi import Midi from pyknon.music import NoteSeq notes1 = NoteSeq(D4 F#8 A Bb4) midi = Midi(1, tempo=90) midi.seq_notes(notes1, track=0) midi.write(demo.mid) It's available on PyPI and its homepage is http://kroger.github.com/pyknon/ Best regards, Pedro - http://pedrokroger.net http://musicforgeeksandnerds.com -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
Pedro Kroger wrote: Pyknon is a simple music library for Python hackers. Sounds cool. How is 'Pyknon' pronounced? It's available on PyPI and its homepage is http://kroger.github.com/pyknon/ I would suggest you change the theme -- using Firefox 3.6 the page is very difficult to read. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
On Jul 30, 2012, at 3:33 PM, Ethan Furman et...@stoneleaf.us wrote: Pedro Kroger wrote: Pyknon is a simple music library for Python hackers. Sounds cool. How is 'Pyknon' pronounced? I pronounce it similarly as google translate does: http://translate.google.com/#English|English|Pyknon It's a musical Greek term, but since it's a Python package, I think it's acceptable to pronounce the Py part as pie ;-) It's available on PyPI and its homepage is http://kroger.github.com/pyknon/ I would suggest you change the theme -- using Firefox 3.6 the page is very difficult to read. Thanks for the report. Do you mind if I ask why you are using such an old version? (It looks fine with Firefox 14.0.1) Cheers, Pedro - http://pedrokroger.net http://musicforgeeksandnerds.com -- http://mail.python.org/mailman/listinfo/python-list
RE: Is Python a commercial proposition ?
I work in financials and the majority of our apps are developed in C++ and Java yet all the tools that startup, deploy and conduct rigorous unit testing are implemented in Python or Shell scripts that wrap Python scripts. Python definitely has its place in the enterprise however not so much for serious stand alone app development. I'm starting to see Python used along side many statistical and analytical tools like R, SPlus, and Mathlab for back testing and prototype work, in a lot of cases I've seen quants and traders implement models in Python to back test and if successful converted to Java or C++. Maybe this is true in *your* experience but *my* experience is very different. I have seen Python modules become modules that end up rewritten in C for performance reasons but I consider that part of the power of Python and an argument *for* Python. Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
Pedro Kroger wrote: On Jul 30, 2012, at 3:33 PM, Ethan Furman et...@stoneleaf.us mailto:et...@stoneleaf.us wrote: Pedro Kroger wrote: Pyknon is a simple music library for Python hackers. Sounds cool. How is 'Pyknon' pronounced? I pronounce it similarly as google translate does: So the 'k' is pronounced. Okay. I would suggest you change the theme -- using Firefox 3.6 the page is very difficult to read. Thanks for the report. Do you mind if I ask why you are using such an old version? (It looks fine with Firefox 14.0.1) That version works for me -- I don't like upgrading to a new version of bugs if I don't have to. ;) I checked the page on a coworker's machine who does have a recent version, and it is a little better, but it is still very faint (thin grey letters on a white background is hard to read). With version 3 the thin grey letters are also broken, making it even worse. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list
RE: [Python] Re: PyPI question, or, maybe I'm just stupid
However, personally, I am not interested in all the details (typically found in CHANGES.txt) but some (often implicit) information is sufficient for me: something like major API change, minor bug fixes. Thus, think carefully what you put on the overview page. I see your point. I'm just lazy, I guess. I already put a description of what I've changed into git, so why, I muse, must I also edit the overview page separately? I was hoping there was an automatic way that setup.py sdist upload could handle it for me. Even if you could include commit messages I would not recommend it. Commit messages are for developers of _your_ package not users. It is like leaving a memo (cough or message) for future developers. As a user, I want to know that you added a feature AAA. I do *not* want to know that in order to add AAA you also had to modify BBB and create CCC. Maybe you had to revert BBB because it conflicted with DDD and then you refactored some code and added/updated comments. Finally you managed to fix BBB (maybe also modifying DDD?) and so the feature AAA is now available. Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
RE: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
I would suggest you change the theme -- using Firefox 3.6 the page is very difficult to read. Thanks for the report. Do you mind if I ask why you are using such an old version? (It looks fine with Firefox 14.0.1) That version works for me -- I don't like upgrading to a new version of bugs if I don't have to. ;) Why do you prefer to keep your old security holes? Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
Re: Extracting bit fields from an IEEE-784 float
In article jv6ab7$jne$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: I imagine that VAXes running Unix went extinct in the wild long before VAXes running VMS. Of course they did. VMS is all about vendor lock-in. People who continue to run VAXen don't do so because they're wedded to the hardware. They do so because they're wedded to some specific VMS application (and the business processes which depend on it). -- http://mail.python.org/mailman/listinfo/python-list
[ANN] New paper published (Volume 7 of The Python Papers) - High-Speed Data Shredding using Python
Link: http://ojs.pythonpapers.org/index.php/tpp/article/view/243 Abstract In recent years, backup and restore is a common topic in data storage. However, there’s hardly anybody mention about safe data deletion. Common data destruction methodology requires the wipe operation to fill the disk with zeros, then with random data, and then with zeros again. Three passes are normally sufficient for ordinary home users. On the down side, such algorithms will take many hours to delete a 2TB hard disk. Although current Linux utility tools gives most users more than enough security and data protections, we had developed a cross-platform standalone application that could expunge all confidential data stored in flash drive or hard disk. The data shredding software is written in Python, and it could overwrite existing data using user-defined wipe algorithm. This software project also explores the technical approaches to digital data destruction using various methodologies defined in different standards, which includes a selection of military-grade procedures proposed by information security specialists. The application operates with no limitations to the capacity of the storage media connected to the computer system, it can rapidly and securely erase any magnetic mediums, optical disks or solid-state memories found in the computer or embedded system. Not only does the software comply with the IEEE T10/T13 specifications, it also binds to the number of connectivity limited by the SAS/SATA buses. -- http://mail.python.org/mailman/listinfo/python-list
[ANN] New paper published (Volume 7 of The Python Papers) - Designing and Testing PyZMQ Applications
Link: http://ojs.pythonpapers.org/index.php/tpp/article/view/242 Abstract PyZMQ is a powerful and easy-to-use network layer. While ZeroMQ and PyZMQ are quite well documented and good introductory tutorials exist, no best-practice guide on how to design and especially to test larger or more complex PyZMQ applications could be found. This article shows a possible way to design, document and test real-world applications. The approach presented in this article was used for the development of a distributed simulation framework and proved to work quite well in this scenario. -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
lspci gets all its information from the files in /sys/bus/pci/devices. You can use os.listdir() to list all the files in the folder and then open the files you want to get the data you need. And of course you can write list comprehensions on as many lines as it take to make the code maintainable. Barry On 30 Jul 2012, at 17:55, Paul van der Linden m...@paultjuh.org wrote: You can do this with one subprocess.Popen and some python commands. The alternative is to pipe some subprocess.Popen commands together. Or for the quick way out (but I think you better stick with bash scripting then): http://pypi.python.org/pypi/sarge/ Don't know about it's stability/ubs/etc, never used it. -Original message- From: Vikas Kumar Choudhary vikas.choudh...@yahoo.co.in Sent: Mon 30-07-2012 09:34 Subject: Linux shell to python To: python-list@python.org; Dear friends, I just joined the group. I was trying porting from bash shell to python. let me know if someone has tried to implement (grep and PIPE) shell commands in python `lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7' I tried to use python subprocess and OS.Popen modules. Thanks Regard's Vikas Kumar Choudhary (Yahoo,MSN-Hotmail,Skype) Messenger = vikas.choudhary Please Add Me in Your Messenger List for Better Communication P Please consider the environment before printing this e-mail Do not print this email unless it is absolutely necessary. Save papers, Save tree. Note: This e-mail is confidential and may also be privileged, this is for the intended recipients only. If you are not the intended recipient, please delete the message and notify me immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Notice: All email and instant messages (including attachments) sent to or from This E-mail id , may be retained, monitored and/or reviewed, or authorized law enforcement personnel, without further notice or consent. -- -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott ba...@barrys-emacs.org wrote: lspci gets all its information from the files in /sys/bus/pci/devices. You can use os.listdir() to list all the files in the folder and then open the files you want to get the data you need. Gee, wouldn't it be more portable to parse lspci? I wouldn't put it past the (Linux) kernel devs to move the pseudo-filesystems around again... And of course you can write list comprehensions on as many lines as it take to make the code maintainable. Sigh, and I'm also not keen on multi-line list comprehensions, specifically because I think they tend to make less readable code. It also becomes a mess when you need to insert print statements to get some visibility into what's going on. -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On 7/30/2012 3:56 PM Dan Stromberg said... On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott ba...@barrys-emacs.org And of course you can write list comprehensions on as many lines as it take to make the code maintainable. Sigh, and I'm also not keen on multi-line list comprehensions, specifically because I think they tend to make less readable code. It also becomes a mess when you need to insert print statements to get some visibility into what's going on. I tend to write long one-liners then convert them to loops the first time I need to see what's going on. Premature optimization otherwise. :) Emile -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux shell to python
On Mon, Jul 30, 2012 at 11:14 PM, Emile van Sebille em...@fenx.com wrote: On 7/30/2012 3:56 PM Dan Stromberg said... On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott ba...@barrys-emacs.org And of course you can write list comprehensions on as many lines as it take to make the code maintainable. Sigh, and I'm also not keen on multi-line list comprehensions, specifically because I think they tend to make less readable code. It also becomes a mess when you need to insert print statements to get some visibility into what's going on. I tend to write long one-liners then convert them to loops the first time I need to see what's going on. Premature optimization otherwise. :) Premature optimization of what? -- http://mail.python.org/mailman/listinfo/python-list
Re: py2c - an open source Python to C/C++ is looking for developers
On Jul 31, 2:42 am, MaxTheMouse maxthemo...@googlemail.com wrote: What is the difference between this and Shedskin? Shedskin being a (restricted) python-to-C++ compiler. (http://code.google.com/p/ shedskin/) Is the goal to be able to handle any python code or a subset? There's also Nuitka, which is an unrestricted compiler, I believe: http://nuitka.net/pages/overview.html Is this a completely independent project, or are there plans to leverage off of PyPy's toolchain, for example? -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On Jul 30, 12:31 pm, Rodrick Brown rodrick.br...@gmail.com wrote: Its still not possible to be a pure Python developer and find gainful employment today. I have been working as a pure Python developer for six+ years now (in that the bulk of my coding is done in Python, with some interface behaviour in JS). On average, every two months I'm contacted by a recruiter or an employer wanting me for my Python experience. I've worked for government, education and private industry, and the only time I didn't get paid was my last week working for a start-up. So I'm pretty confident that I'm gainfully employed. -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: visage (interfaces)
On Jul 30, 3:18 pm, jwp james@gmail.com wrote: What's c.l.py's perspective on managing interfaces and implementations? I've been working with Plone for the past year and have become a big fan of interfaces. I must admit I _do_ like zope.interface's adaptation, but your's looks lighter in a way that could be handy for a side project, so I may have some more concrete feedback soon :) BTW I think if you rename the ReStructured Text docs to .rst github will automatically render them. -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: visage (interfaces)
On Monday, July 30, 2012 6:09:10 PM UTC-7, alex23 wrote: a side project, so I may have some more concrete feedback soon :) =) BTW I think if you rename the ReStructured Text docs to .rst github will automatically render them. Did not know that. Gonna go do a lot of git mv's now. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote: If you have been reading the papers, you would understand what I'm doing. That is the second time, at least, that you have made a comment like that. Understand that most people are not going to follow links to find out whether or not they are interested in what you have to say. If you can't give a brief explanation of what you are doing in your email or news post, many people aren't going to read on. Perhaps they intend to but are too busy, or they have email access but web access is restricted, or they've already got 200 tabs open in their browser and don't want any more (I'm not exaggerating, I know people like that). People use email because it is a push technology -- you don't have to go out and look for information, it gets pushed into your inbox. Clicking on links is a pull technology -- you have to make the explicit decision to click the link, open a browser, go out to the Internet and read who knows what. That requires a different frame of mind. Expect to lose some of your audience every time you require them to follow a link. And *especially* so if that it a link to Google Docs, instead of an normal web page. Google Docs is, in my opinion, a nasty piece of rubbish that doesn't run on any of my browsers. As far as I'm concerned, I'd rather download a Word doc, because at least I can open that in OpenOffice or Abiword and read it. Something in Google Docs might as well be locked in a safe as far as I'm concerned. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: visage (interfaces)
On Mon, 30 Jul 2012 18:41:19 -0700, jwp wrote: BTW I think if you rename the ReStructured Text docs to .rst github will automatically render them. Did not know that. Gonna go do a lot of git mv's now. Do *one* and see if github actually does render it. Then do the rest. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
On Mon, 30 Jul 2012 14:09:38 +, Grant Edwards wrote: On 2012-07-30, Stefan Behnel stefan...@behnel.de wrote: Still, you may still get away with the above statement by providing a sufficiently narrow definition of standalone. By my definition, there isn't much standalone code out there. Most code I know interfaces with a couple of external tools, libraries or backends, usually written in languages I don't have to care about because they provide a language independent interface. It's not really relevent to this discussion, but there is _lots_ of stand-alone code out there. It runs in sub-one-dollar microcontrollers that are programmed in assembly language or in C without external libraries (sometimes not even the libc that's included in the C language definition). Those microcontrollers are everywhere in toys, appliances, and all sorts of other non-computer things. And at that level, you aren't going to write your app in Python anyway, and not because of the GIL. (These microcontrollers are unlikely to have multiple cores -- why the hell does your microwave oven need two cores?) It seems to me that those who claim that the GIL is a serious barrier to Python's use in the enterprise are mostly cargo-cult programmers, parroting what they've heard from other cargo-cultists. It really is astonishing the amount of misinformation and outright wrong-headed ignorance that counts as accepted wisdom in the enterprise. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: simplified Python parsing question
On 7/30/2012 9:54 PM, Steven D'Aprano wrote: On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote: If you have been reading the papers, you would understand what I'm doing. That is the second time, at least, that you have made a comment like that. Actually, it's probably more like the forth hundred time. :-) I apologize, I was wrong and I would back up and start over again if I could Understand that most people are not going to follow links to find out whether or not they are interested in what you have to say. If you can't give a brief explanation of what you are doing in your email or news post, many people aren't going to read on. Perhaps they intend to but are too busy, or they have email access but web access is restricted, or they've already got 200 tabs open in their browser and don't want any more (I'm not exaggerating, I know people like that). accept criticism. I'm still working on an elevator pitch for this concept. I've been living with the technology and all its variations for about 10 years and it's not easy to explain to someone who is not disabled. People with working hands don't understand how isolating and, sometimes humiliating software can be. advocates like myself sometimes get a little tired of saying the same thing over and over and over again and people who are disabled just don't care. So you find yourself using shorthand because you going to be ignored anyway People use email because it is a push technology -- you don't have to go out and look for information, it gets pushed into your inbox. Clicking on links is a pull technology -- you have to make the explicit decision to click the link, open a browser, go out to the Internet and read who knows what. That requires a different frame of mind. Expect to lose some of your audience every time you require them to follow a link. Okay, this implies the need to really work on more of an elevator/summary speech. Thank you for your input. I appreciate it And *especially* so if that it a link to Google Docs, instead of an normal web page. Google Docs is, in my opinion, a nasty piece of rubbish that doesn't run on any of my browsers. As far as I'm concerned, I'd rather download a Word doc, because at least I can open that in OpenOffice or Abiword and read it. Something in Google Docs might as well be locked in a safe as far as I'm concerned. the ability for multiple people to work on the same document at the same time is really important. Can't do that with Word or Libre office. revision tracking in traditional word processors are unpleasant to work with especially if your hands are broken. It would please me greatly if you would be willing to try an experiment. live my life for a while. Sit in a chair and tell somebody what to type and where to move the mouse without moving your hands. keep your hands gripping the arms or the sides of the chair. The rule is you can't touch the keyboard you can't touch the mice, you can't point at the screen. I suspect you would have a hard time surviving half a day with these limitations. no embarrassment in that, most people wouldn't make it as far as a half a day. I've had to live with it since 1994. Not trying to brag, just pointing out the facts. I'm going to try again from a different angle in a different thread. I will take your advice to heart and I would appreciate some feedback on how well I do satisfying the issues you have described -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.
On Mon, 30 Jul 2012 19:32:47 +, Prasad, Ramit wrote: I would suggest you change the theme -- using Firefox 3.6 the page is very difficult to read. Thanks for the report. Do you mind if I ask why you are using such an old version? (It looks fine with Firefox 14.0.1) Firefox 3.6 is not such an old version. It is the currently supported version in RHEL and Centos, and under the rebranded name Iceweasel, Debian Squeeze. That version works for me -- I don't like upgrading to a new version of bugs if I don't have to. ;) Why do you prefer to keep your old security holes? I don't. But in my experience, the risk of security breaches is *much* less than the chance that the new version will break functionality, introduce bugs, have a worse user interface, and generally be a step backwards rather than forward. Security fixes are orthogonal to new features and UI changes. Any software which forces you to take unwanted new features and accept UI degradation in order to get security fixes is doing the wrong thing, and almost certainly adding new security holes as fast as they remove them. When it comes to browsers, I would rather rely on dedicated security features like NoScript that has a stable UI and continual functional improvements, than to get on the Firefox upgrade treadmill. When I upgrade my OS, I'll get a new major release of Firefox. With luck, all the kinks will be ironed out by then. Until then, Firefox 3.6 is stable and works. Besides, it is amazing what a better browsing experience you get by disabling 99% of all Flash and 95% of all Javascript. Python is one of the few cases where I can implicitly trust that each upgrade is an actual *upgrade*, not a downgrade with a higher version number like KDE 3 - KDE 4, or a sidegrade, like Firefox. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] New paper published (Volume 7 of The Python Papers) - High-Speed Data Shredding using Python
On 31/07/12 07:36, mauricel...@acm.org wrote: Link: http://ojs.pythonpapers.org/index.php/tpp/article/view/243 Abstract In recent years, backup and restore is a common topic in data storage. However, there’s hardly anybody mention about safe data deletion. Common data destruction methodology requires the wipe operation to fill the disk with zeros, then with random data, and then with zeros again. Three passes are normally sufficient for ordinary home users. On the down side, such algorithms will take many hours to delete a 2TB hard disk. Although current Linux utility tools gives most users more than enough security and data protections, we had developed a cross-platform standalone application that could expunge all confidential data stored in flash drive or hard disk. The data shredding software is written in Python, and it could overwrite existing data using user-defined wipe algorithm. This software project also explores the technical approaches to digital data destruction using various methodologies defined in different standards, which includes a selection of military-grade procedures proposed by information security specialists. The application operates with no limitations to the capacity of the storage media connected to the computer system, it can rapidly and securely erase any magnetic mediums, optical disks or solid-state memories found in the computer or embedded system. Not only does the software comply with the IEEE T10/T13 specifications, it also binds to the number of connectivity limited by the SAS/SATA buses. The paper is very interesting. Funny though I found it very hard to find a name of the application developed -- I presume it is the successor of CBL Data Shredder -- or if it is foss or proprietary package? Does the application have a project page? -- Cheers Simon Simon Cropper - Open Content Creator Free and Open Source Software Workflow Guides Introduction http://www.fossworkflowguides.com GIS Packages http://www.fossworkflowguides.com/gis bash / Pythonhttp://www.fossworkflowguides.com/scripting -- http://mail.python.org/mailman/listinfo/python-list
toggle name, With explanations
the wonderful responses I received from people like Lazlo, Paul, and Stephen has given me some ideas about a different approach. First, here's explanation of what I'm doing I'm developing a method which will enable hand disabled developers such as myself to create and manipulate symbols identical to those created by non-disabled developers. the input mechanism will be speech recognition maximizing the use of ordinary continuous English dictation and a minimal set of commands to activate this method. Subsequent work will produce a speech user interface for navigation code and tools such as debuggers bypassing the interference and constraints created by GUIs. The core concept is any string of a natural language words can be transformed into a symbol by storing the matchup between the natural language word string and the symbol string in a database. in other words, a dictionary which has paired keys and one key can return the other. in my original request I was thinking about parsing the environment and looking for the transition between code and symbol or natural language word string but unfortunately, that technique breaks because the characters around the region of interest may not be complete or correct code. So I thought about trying to look at the other way. If you find a string of characters that you don't look like a symbol or look like a string of natural in words, when the characters stop looking like that, then that defines the limits of the region of interest. example: s.pack(side=Tkinter.R^IGHT, fill=Tkinter.Y) the carrot marks the current position. If I was to say this point, toggle word, I would first look to the left and the right and look forward the character string stopped looking like a symbol or a natural language word string.in this example, I would find the string RIGHT. If I didn't find anything, I would look one more character to the left and see if there was a . present, do the same search again this time solely to the left and I would have the string TKinter.RIGHT. The database would have the in tree and replace it with TK interpreter right so I could edit the string with speech recognition. s.pack(side=TK interpreter^ right, fill=Tkinter.Y) Then using the same basic technique as I described above, I looked left and right for a series of symbols, in this case they are actually words, until I reach something that is not a symbol. The end result is used a key for the database which would return Tkinter.RIGHT It looks like if I'm correct, this is a much simpler way of doing what I wanted to do (extract symbols and natural language word strings). 1) can you see any holes in this logic? 2) what would you recommend for regular expressions. The reason I ask is that if you have spaces in the string, you only want want alphanumeric sequences, if you have alphanumeric plus symbol special characters, you don't want spaces. I'm not sure how strict that precondition should be. I'm going to need to think about it more. Opinions would be welcome. I think this works for almost any language too which is really important in the disabled programmer community. I appreciate your patience. Sometimes the overhead of communicating using speech recognition with tools don't work well with speech recognition such as Thunderbird makes the whole process of writing almost more difficult than it's worth. Working on tools like this is incremental progress I need to make in order to be able to bring speech recognition-based accessibility to the Python world. --- eric -- http://mail.python.org/mailman/listinfo/python-list
OT: accessibility (was Re: simplified Python parsing question)
On 07/30/12 21:11, Eric S. Johansson wrote: the ability for multiple people to work on the same document at the same time is really important. Can't do that with Word or Libre office. revision tracking in traditional word processors are unpleasant to work with especially if your hands are broken. If you're developing, I might recommend using text-based storage and actual revision-control software. Hosting HTML (or Restructured Text, or plain-text, or LaTeX) documents on a shared repository such as GitHub or Bitbucket provides nicely for accessible documentation as well as much more powerful revision control. It would please me greatly if you would be willing to try an experiment. live my life for a while. Sit in a chair and tell somebody what to type and where to move the mouse without moving your hands. keep your hands gripping the arms or the sides of the chair. The rule is you can't touch the keyboard you can't touch the mice, you can't point at the screen. I suspect you would have a hard time surviving half a day with these limitations. no embarrassment in that, most people wouldn't make it as far as a half a day. I've tried a similar experiment and am curious on your input device. Eye-tracking/dwell-clicking? A sip/puff joystick? Of the various input methods I tried, I found that Dasher[1] was the most intuitive, had a fairly high input rate and accuracy (both initially, and in terms of correcting mistakes I'd made). It also had the ability to generate dictionaries/vocabularies that made more appropriate/weighted suggestions which might help in certain contexts (e.g. pre-load a Python grammar allowing for choosing full atoms in a given context). -tkc [1] http://en.wikipedia.org/wiki/Dasher http://www.inference.phy.cam.ac.uk/dasher/ -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: visage (interfaces)
On Monday, July 30, 2012 7:09:03 PM UTC-7, Steven D'Aprano wrote: Do *one* and see if github actually does render it. Then do the rest. Did it for one project. It does render it. =) Naturally, sphinx autodoc links don't work. =( Come-on github, use dat fundin' -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: And at that level, you aren't going to write your app in Python anyway, and not because of the GIL. (These microcontrollers are unlikely to have multiple cores -- why the hell does your microwave oven need two cores?) http://greenarrays.com ;-) It seems to me that those who claim that the GIL is a serious barrier to Python's use in the enterprise are mostly cargo-cult programmers, I would say, it puts a crimp into Python's versatility but there are still lots of areas where it's not a serious issue. A real compiler (PyPy) will help Python performance far more than multi-core currently can. -- http://mail.python.org/mailman/listinfo/python-list
Re: py2c - an open source Python to C/C++ is looking for developers
alex23, 31.07.2012 02:16: On Jul 31, 2:42 am, MaxTheMouse wrote: What is the difference between this and Shedskin? Shedskin being a (restricted) python-to-C++ compiler. (http://code.google.com/p/ shedskin/) Is the goal to be able to handle any python code or a subset? There's also Nuitka, which is an unrestricted compiler, I believe: http://nuitka.net/pages/overview.html Not to forget Cython, which is the only Python-to-C compiler that is in widespread use. Is this a completely independent project, or are there plans to leverage off of PyPy's toolchain, for example? From a look at the source code, it seems hard to bring it together with anything. It looks very monolithic. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python a commercial proposition ?
Paul Rubin, 31.07.2012 06:45: A real compiler (PyPy) will help Python performance far more than multi-core currently can. That's too general a statement to be meaningful. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python] Re: PyPI question, or, maybe I'm just stupid
Chris Gonnerman ch...@gonnerman.org writes: On 07/30/2012 04:20 AM, Dieter Maurer wrote: ... I find it very stupid to see several window scrolls of changes for a package but to learn how to install the package, I have to download its source... Not sure I get this. The installation procedure for PollyReports is the same as for, what, 99% of Python source packages? sudo python setup.py install What else are you saying I should do? This remark was not targeted at PollyReports but (in general) at packages with non-trivial installation procedures which nevertheless state on the overview page for installation read the separate installation instructions (in the source distribution). As a side note: playing well with python package managers (easy_install, pip, zc.buildout, ...) could make it even simpler than sudo python setup.py install. -- http://mail.python.org/mailman/listinfo/python-list
[issue15494] Move test/support.py into a test.support subpackage
Martin v. Löwis added the comment: -1. test.support is not at all too large for a single module; there is no point in refactoring it. Without a specific patch to review which proposes some specific change, I'm rejecting this change request. -- nosy: +loewis resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)
Catherine Devlin added the comment: Needed to update the patch slightly for Python 3; now that filter() returns an iterator, ``do_help``'s call to names = self.get_names() followed by names.sort() was throwing an error, so I changed get_names to return a list. -- nosy: +Catherine.Devlin Added file: http://bugs.python.org/file26593/python-cmd-better-filtering-py3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13214 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15489] Correct __sizeof__ support for BytesIO
Serhiy Storchaka added the comment: Antoine, it looks like you committed the wrong patch for 3.3. Patches for 3.2 and 3.3 are different, otherwise I would have provided a one patch. -basesize = support.calcobjsize('P2PP2PP') +basesize = support.calcobjsize('P2nN2Pn') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)
Catherine Devlin added the comment: Change to test_cmd.py to test for help displaying the name of the registered subcommand (as well as a simple test for the basic operation of the registered sub-CLI). -- Added file: http://bugs.python.org/file26594/test_cmd.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13214 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15496] harden directory removal for tests on Windows
Tim Golden added the comment: This is a (near) duplicate of issue7443, I think. -- nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15498] Eliminate the use of deprecated OS X APIs in getpath.c
New submission from Ned Deily: getpath.c uses three OS X APIs that have been producing deprecation warnings since at least OS X 10.5: NSModuleForSymbol, NSLookupAndBindSymbol, and NSLibraryNameForModule. We should figure out how to live without them. -- assignee: ronaldoussoren components: Macintosh messages: 166863 nosy: ned.deily, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Eliminate the use of deprecated OS X APIs in getpath.c versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15498 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Nick Coghlan added the comment: Martin, this change has been specifically requested by me to better organise all the support code that ISN'T in test.support. That file is already huge, and I'm not going to make it even bigger with all the test infrastructure needed for generating packaging heirarchies and zip files and invoking Python subprocesses in various ways. However, that support code *does* need to be made more discoverable (so we stop reinventing these wheels badly). A package with the current support.py as its __init__.py is the obvious solution. -- resolution: rejected - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15490] Correct __sizeof__ support for StringIO
Serhiy Storchaka added the comment: For the PyAccu, AFAICT, objects cannot leak out of it (except for gc.getobjects in debug mode). Not only in debug mode. import io, gc s=io.StringIO() s.write('12345') 5 s.write('qwerty') 6 for o in gc.get_objects(): ... if '123 in repr(o) and len(repr(o)) 1000: ... print(type(o), repr(o)) ... class 'list' ['12345', 'qwerty'] class 'list' ['o', 'gc', 'get_objects', 'repr', 'o', '123, 1000, 'len', 'repr', 'o', 'print', 'type', 'o', 'repr', 'o'] class 'tuple' ('123, 1000, None) Someone can summarize sys.getsizeof() for all managed by GC objects and therefore count internal objects twice. I think the standard library should provide a method for recursive calculation of memory (in some sense, perhaps using different strategies), but that should wait up to 3.4. __sizeof__ should count non-object memory that is not available for GC. As I understand it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15495] enable type truncation warnings for gcc builds
Mark Dickinson added the comment: How many extra warnings do you get by adding these flags (e.g., just by doing 'export CFLAGS= ...' before building)? It might be useful to see a sampling of those warnings. The addition of these flags should be conditional on gcc's version being = 4.3: gcc 4.2 apparently has a different meaning for -Wconversion (to do with implicit conversions when passing function arguments), and generates crazy numbers of warnings on my OS X 10.6 machine (which comes with gcc 4.2). Why '-Wno-sign-conversion'? Is fixing all the places that have implicit sign conversions a reasonable goal, or are there just too many of those? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15495 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15267] tempfile.TemporaryFile and httplib incompatibility
Atsuo Ishimoto added the comment: patch contains fix and test for 2.7. With this patch, AttibuteError is captured as Tim sujested. -- keywords: +patch nosy: +ishimoto Added file: http://bugs.python.org/file26595/issue15267.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15267 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15490] Correct __sizeof__ support for StringIO
Martin v. Löwis added the comment: For the PyAccu, AFAICT, objects cannot leak out of it (except for gc.getobjects in debug mode). Not only in debug mode. I see. I meant sys.getobjects, which is in debug mode only, but I now see that gc.get_objects will get the list (but not the strings) of the Accu. That still leaves readnl and writenl. I think the standard library should provide a method for recursive calculation of memory (in some sense, perhaps using different strategies), but that should wait up to 3.4. Actually, this is (and should be) a separate project: http://guppy-pe.sourceforge.net/ __sizeof__ should count non-object memory that is not available for GC. As I understand it. I think you misunderstand slightly; the GC relevance is only a side effect. __sizeof__ should only account for memory that isn't separately accessible. The notion of separately accessible is somewhat weak, since it may depend on the container. Non-PyObject blocks clearly need to be accounted for. PyObject blocks normally don't need to be accounted for, as they are typically accessible separately, by the following means: - gc.get_objects (for GC objects) - gc.get_referents (for contained non-GC objects) There are also irregular ways to get objects: - in debug mode only: sys.getobjects - customer access functions or attributes For memory accounting, it would really be best if the latter two categories wouldn't exist, i.e. if all non-GC objects were still visible through tp_traverse. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14018] OS X installer does not detect bad symlinks created by Xcode 3.2.6
Roundup Robot added the comment: New changeset f96579debefa by Ned Deily in branch 'default': Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs. http://hg.python.org/cpython/rev/f96579debefa -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14018 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15470] Stuck/hang when reading ssl object
Seamus McKenna added the comment: Thankyou for update. Script was not using 100% cpu. I will add SMTP timeout and increase debuglevel() within the function should this reoccur. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15470 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Martin v. Löwis added the comment: So who is going to provide a patch for it, and when? I don't think the tracker is the right place to keep list of things that someone wants to do some day. There isn't an issue Python should have a JIT, either. Tracker issues should be actionable at the time the issue is submitted, unless there is a clear criterion on which to defer the issue. If the objective is to just put the module into an __init__.py, it takes just a few minutes, no? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Nick Coghlan added the comment: As noted in the original post, this is a change which will be made once the 3.3 release is out the door. It's origin lies in the fact that one of the new pkgutil tests currently lives in test_runpy because test_runpy has much better infrastructure for that kind of thing. While figuring out where to put some shared infrastructure for the runpy, pkgutil, import and importlib tests, I came to the conclusion that having support.py, script_helper.py and whatever we decide to call the new module all living in the main test directory makes the support modules unnecessarily hard to find, and merging them all into a single massive support.py module doesn't make sense either. Chris has been working on the patches. We were going to try to get this refactoring done before the release, but enough other things have ended up coming up that Antoine and I decided it was better to wait. -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15403] Refactor package creation support code into a common location
Changes by Nick Coghlan ncogh...@gmail.com: -- dependencies: +Move test/support.py into a test.support subpackage ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15403 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15376] Refactor the test_runpy walk_package support code into a common location
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15376 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15376] Refactor the test_runpy walk_package support code into a common location
Changes by Nick Coghlan ncogh...@gmail.com: -- dependencies: +Add temp_dir() and change_cwd() to test.support ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15376 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Nick Coghlan added the comment: I've just gone through and made sure all the related issues are correctly assigned to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14018] OS X installer does not detect bad symlinks created by Xcode 3.2.6
Roundup Robot added the comment: New changeset 7232d544c811 by Ned Deily in branch '2.7': Issue #14018: Update the OS X IDLE Tcl/Tk warning check to include http://hg.python.org/cpython/rev/7232d544c811 New changeset 17ddc0c34d9d by Ned Deily in branch '3.2': Issue #14018: Update the OS X IDLE Tcl/Tk warning check to include http://hg.python.org/cpython/rev/17ddc0c34d9d New changeset 28cb0bcaa22e by Ned Deily in branch 'default': Issue #14018: merge http://hg.python.org/cpython/rev/28cb0bcaa22e -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14018 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15494] Move test/support.py into a test.support subpackage
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15494 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15486] Standardised mechanism for stripping importlib frames from tracebacks
Nick Coghlan added the comment: OK, after a bit of experimentation, it appears both 3.2 and 3.3 eventually get annoyed if you mess about too much with __pycache__. 1. They're both fine if __pycache__ is entirely unwritable (they just silently skip caching the bytecode) 2. 3.2 throws EOFError if you replace the cache entry with an empty file, 3.3 silently rewrites it with a valid cached version 3. 3.2 throws EOFError if you replace the cache entry with a directory, 3.3 throws a more accurate IsADirectory error That means my chosen test case is a valid one, and I can just update the offending call in importlib._bootrap to use the new frame stripping hook as I originally planned. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15486 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15463] test_faulthandler can fail if install path is too long
Roundup Robot added the comment: New changeset ff7fc6a91212 by Victor Stinner in branch 'default': Issue #15463: the faulthandler module truncates strings to 500 characters, http://hg.python.org/cpython/rev/ff7fc6a91212 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15463 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14966] Fully document subprocess.CalledProcessError
Changes by Anton Barkovsky swarmer...@gmail.com: -- nosy: +anton.barkovsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14966 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15499] Sleep is hardcoded in webbrowser.UnixBrowser
New submission from Anton Barkovsky: webbrowser.UnixBrowser._invoke will sleep for at least 1 second after launching browser process and then probably 4 more seconds. These numbers are hardcoded and can't be modified which is especially problematic for testing. I think this code should be replaced with Popen.wait with timeout. A patch is attached. -- components: Library (Lib) files: webbrowser_sleep.patch keywords: patch messages: 166877 nosy: anton.barkovsky priority: normal severity: normal status: open title: Sleep is hardcoded in webbrowser.UnixBrowser type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file26596/webbrowser_sleep.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15499 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com