mimedecode.py version 2.3.6
Hello! mimedecode.py WHAT IS IT Mail users, especially in non-English countries, often find that mail messages arrived in different formats, with different content types, in different encodings and charsets. Usually this is good because it allows us to use appropriate format/encoding/whatever. Sometimes, though, some unification is desirable. For example, one may want to put mail messages into an archive, make HTML indices, run search indexer, etc. In such situations converting messages to text in one character set and skipping some binary attachments is much desirable. Here is the solution - mimedecode.py. This is a program to decode MIME messages. The program expects one input file (either on command line or on stdin) which is treated as an RFC822 message, and decodes to stdout or an output file. If the file is not an RFC822 message it is just copied to the output one-to-one. If the file is a simple RFC822 message it is decoded as one part. If it is a MIME message with multiple parts (attachments) all parts are decoded. Decoding can be controlled by command-line options. WHAT'S NEW in version 2.3.6 (2014-02-19) Decode To, Cc, Reply-To and Mail-Followup-To headers by default. Report test progress and success. Add tests for headers and parameters decoding. Add tests for passing (-b) and skipping (-i) message bodies. WHAT'S NEW in version 2.3.4 (2014-02-11) Optimize recursive decoding. Fix a bug - decode message/rfc822 subparts. WHERE TO GET Home page: http://phdru.name/Software/Python/#mimedecode git clone http://git.phdru.name/mimedecode.git git clone git://git.phdru.name/mimedecode.git Requires: Python 2.2.2+, m_lib 2.0+. Recommends: configured mailcap database. Documentation (also included in the package): http://phdru.name/Software/Python/mimedecode.txt AUTHOR Oleg Broytman p...@phdru.name COPYRIGHT Copyright (C) 2001-2014 PhiloSoft Design. LICENSE GPL Oleg. -- Oleg Broytmanhttp://phdru.name/p...@phdru.name Programmers don't die, they just GOSUB without RETURN. -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: Cannot figure out line of code, also not understanding error
On Thu, Feb 20, 2014 at 6:32 PM, ApathyBear nircher...@gmail.com wrote: 1. What does this line of code mean: return(Athlete(temp1.pop(0),temp1.pop(0), temp1) Is it making an Athlete class? if you can give examples to help explain what this is doing that would be helpful. It's supposed to be calling Athlete() with some arguments. However, due to the extra open parenthesis between the keyword return and the rest, it... 2. Why am I getting this error when I try to run the file? PS C:\Users\N\desktop python gg.py File gg.py, line 34 except IOError: ^ SyntaxError: invalid syntax PS C:\Users\N\desktop ... causes this error, which is detected at the point where a keyword comes in that makes no sense inside the return expression. The solution is to delete the first open parenthesis: return Athlete(temp1.pop(0),temp1.pop(0), temp1) Then you have properly matched parens, and it should carry on happily. Tip: Computers report errors where they find them, which isn't always where the error actually is. But with most modern programming languages, the file is read from top to bottom and left to right, so when a problem is reported, its cause is always *before* it in the file. Never after it. You could make a horrible mess of the file after that except and you wouldn't change the error. (Apart from things like text encoding, which are done in a separate pass.) You'll get used to scanning up a line or two from the error to find the real cause. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
Le 20/02/2014 08:32, ApathyBear a écrit : I have two questions that come along with the following code: -- from __future__ import print_function def sanitize(time): if '-' in time: splitter = '-' (mins,secs) = time.split(splitter, 1) return (mins+'.'+secs) elif ':' in time: splitter = ':' (mins,secs) = time.split(splitter, 1) return (mins+'.'+secs) else: return time #start class class Athlete: def __init__(self, a_name, a_dob=None, a_times=[]): self.name = a_name self.dob= a_dob self.times = a_times def top3(self): return(sorted(set([sanitize(t) for t in self.times]))[0:3]) #end class def get_coach_data(filename): try: with open(filename) as f: data = f.readline() temp1 = data.strip().split(',') return(Athlete(temp1.pop(0),temp1.pop(0), temp1) except IOError: print ('File error') return (None) james = get_coach_data('james2.txt') print (james.name + 's fastest times are: + str(james.top3())) -- This is the original text file data I am working with called james2.txt located on my desktop: James Lee,2002-3-14,2-34,3:21,2.34,2.45,3.01,2:01,2:01,3:10,2-22,2-01,2.01,2:16 -- 1. What does this line of code mean: return(Athlete(temp1.pop(0),temp1.pop(0), temp1) Is it making an Athlete class? if you can give examples to help explain what this is doing that would be helpful. 2. Why am I getting this error when I try to run the file? PS C:\Users\N\desktop python gg.py File gg.py, line 34 except IOError: ^ SyntaxError: invalid syntax PS C:\Users\N\desktop What syntax is invalid here? One parenthesis missing here: return(Athlete(temp1.pop(0),temp1.pop(0), temp1)) -- Vincent V.V. Oqapy https://launchpad.net/oqapy . Qarte https://launchpad.net/qarte . PaQager https://launchpad.net/paqager -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
Thanks for pointing out the missing parenthesis, it makes sense now why there was an error. I suppose my question now is (and forgive my ignorance about classes, this is my first time learning them) why is it calling Athlete with some arguments? In order to make a class object, don't you need to create an instance by assigning a class to something? like: x = Athlete(temp1.pop(0),temp1.pop(0),temp1) can a similar line look like this?: temp1.pop(0) = Athlete(temp1.pop(0),temp1) -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
On Thu, Feb 20, 2014 at 7:26 PM, ApathyBear nircher...@gmail.com wrote: Thanks for pointing out the missing parenthesis, it makes sense now why there was an error. I suppose my question now is (and forgive my ignorance about classes, this is my first time learning them) why is it calling Athlete with some arguments? In order to make a class object, don't you need to create an instance by assigning a class to something? like: x = Athlete(temp1.pop(0),temp1.pop(0),temp1) Calling a class will create a new instance of it. [1] What you do with it afterwards is separate. The return statement takes any value and, well, returns it. You can return anything - an Athlete instance, the integer 13423523452, the floating point value NaN, anything at all. can a similar line look like this?: temp1.pop(0) = Athlete(temp1.pop(0),temp1) You can't assign to a function call, so no, you can't do that. I recommend you start with the Python tutorial: http://docs.python.org/3/tutorial/index.html ChrisA [1] The class might choose to do something different (when you call bool with some argument, it'll return a pre-existing True or False), but conceptually, you still get back an instance of that class. -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
On 02/20/2014 12:26 AM, ApathyBear wrote: Thanks for pointing out the missing parenthesis, it makes sense now why there was an error. I suppose my question now is (and forgive my ignorance about classes, this is my first time learning them) why is it calling Athlete with some arguments? In order to make a class object, don't you need to create an instance by assigning a class to something? like: x = Athlete(temp1.pop(0),temp1.pop(0),temp1) can a similar line look like this?: temp1.pop(0) = Athlete(temp1.pop(0),temp1) First some notation: You are not creating a class, but rather in instance of a class. The code class Athlete: ... created the class, and now you are ready to create (many?) instances of that class. A call like Athlete(...) will create an instance of that class with whatever parameters you supply. What you do with that instance after it is created is your choice. Assignment is one possibility, but many other operation are also possible: x = Athlete(...) print( Athlete(...) ) Athlete(...)+Athlete(...) # If addition made any sense and was implemented in the class return Athlete(...) ... Gary Herron -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
On Thursday, February 20, 2014 12:54:54 AM UTC-8, Chris Angelico wrote: Calling a class will create a new instance of it. [1] What you do with it afterwards is separate. Okay. So what you are saying is that return(Athlete(temp1.pop(0),temp1.pop(0), temp1)) IS in fact creating an instance of Athlete. My problem with this is that there really is no declaration of 'self' for this instance. Usually when I do something like this. x = Athlete(Henry, 11-15-90, [1,2,3]) I can refer to things of this instance by executing x.name or whatever other attributes the class defined. If I create an instance with no 'self' how does this make any sense? How would I get an attribute for the our instance above? -- https://mail.python.org/mailman/listinfo/python-list
Commonly-used names in the Python standard library
In working on a proposal that might result in the creation of a new keyword, I needed to ascertain what names were used extensively in existing Python code. Out of random curiosity, I asked my script what names were the most commonly used. The script responded with 21854 names and a total of 297164 references, averaging 13-14 refs per name. A good number of names are referenced just once - set and never referenced. They're there for applications to use. That takes out 6217 names. But I'm more interested in the ones that see a lot of use. By far the most common name is 'self', for obvious reasons; after that, it's a fairly steady drop-off. The most popular names in the standard library are... *drumroll* 45298 - self 3750 - os 3744 - name 3166 - i 3140 - s 2685 - value 2648 - a 2451 - len 2348 - c 2331 - sys 2255 - b 2238 - line 2132 - print 2131 - x Few surprises there. The os and sys modules are used extensively, and short variable names are reused frequently. To the print-detractors: That's two thousand uses in the standard library, more than any other single function bar 'len'! (And by the way, this is ignoring any file with /test/ in the name.) I find the pairing of 'name' and 'value' interesting. There are 40% more names than values in Python, apparently. And on that bombshell, as they say on Top Gear, it's time to end! ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
On Thu, Feb 20, 2014 at 8:22 PM, ApathyBear nircher...@gmail.com wrote: On Thursday, February 20, 2014 12:54:54 AM UTC-8, Chris Angelico wrote: Calling a class will create a new instance of it. [1] What you do with it afterwards is separate. Okay. So what you are saying is that return(Athlete(temp1.pop(0),temp1.pop(0), temp1)) IS in fact creating an instance of Athlete. My problem with this is that there really is no declaration of 'self' for this instance. Usually when I do something like this. x = Athlete(Henry, 11-15-90, [1,2,3]) I can refer to things of this instance by executing x.name or whatever other attributes the class defined. If I create an instance with no 'self' how does this make any sense? How would I get an attribute for the our instance above? Inside a method, including __init__, self refers to the object. Even if you never assign it to anything, that instance exists somewhere, and self can refer to it. It has an identity from the moment it begins to exist - which is before it ever gets the name 'x' pointing to it. You definitely should work through the tutorial I linked you to; it explains Python's object model quite well. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
Thank you Chris. And thank you to everyone else. This has tremendously helped me. This google group is definitely the best place for python questions/discussion. PS: Chris, I will be looking at that tutorial now. -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: In working on a proposal that might result in the creation of a new keyword, I'm looking forward to the day when every application can add its own keywords as is customary in Lisp. I needed to ascertain what names were used extensively in existing Python code One advantage of Perl is that names and keywords are in separate namespaces so introducing new keywords is easy. Should Python have something like: from py35 import * That way, you could choose between: unless x 7: return and: py35.unless x 7: return in case you have already made use of the name unless in your program. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, Feb 20, 2014 at 9:22 PM, Marko Rauhamaa ma...@pacujo.net wrote: from py35 import * That way, you could choose between: unless x 7: return and: py35.unless x 7: return in case you have already made use of the name unless in your program. What about return? Are you allowed to namespace that? And 'from' and 'import' and '*'? In languages with keywords, they're there to signal things to the parser. There are languages that have no keywords at all, like REXX, and their grammars are usually restricted to non-alphabetic tokens (for instance, REXX has and | instead of and and or). Python already has most of its important names in either builtins (which can be shadowed) or actual modules, so it's only actual language keywords that can't be reused; and there aren't all that many of those. But more can be created, and it's worth being careful. In this instance, various proposals included then, when, use, and raises. My script reported the following: 1 instances of the name 'use' 12 instances of the name 'when' and none of either of the others. Granted, the stdlib isn't everything, and isn't even reliably representative, but that supported my gut feeling that keywording 'when' would be likely to trip code up. If you're curious about the full proposal, it's PEP 463, an expression form of the 'except' statement. The latest draft PEP can be found here: https://raw2.github.com/Rosuav/ExceptExpr/master/pep-0463.txt and the official repo (currently out of date, but later on will be the official and maintained version) has it here: http://www.python.org/dev/peps/pep-0463/ ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: On Thu, Feb 20, 2014 at 9:22 PM, Marko Rauhamaa ma...@pacujo.net wrote: py35.unless x 7: return What about return? Are you allowed to namespace that? And 'from' and 'import' and '*'? Old keywords are guaranteed not to clash with programs. Introducing new keywords runs that risk. Hence, C had to introduce the ugly _Bool keyword. If you're curious about the full proposal, it's PEP 463, an expression form of the 'except' statement. The latest draft PEP can be found here: https://raw2.github.com/Rosuav/ExceptExpr/master/pep-0463.txt A coworker pointed out that the gist of the PEP has already been implemented by URL: https://pypi.python.org/pypi/fuckit. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, Feb 20, 2014 at 10:28 PM, Marko Rauhamaa ma...@pacujo.net wrote: A coworker pointed out that the gist of the PEP has already been implemented by URL: https://pypi.python.org/pypi/fuckit. I love how that's categorized Topic :: Software Development :: Quality Assurance. It certainly assures _something_ about quality... ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, Feb 20, 2014 at 10:28 PM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: On Thu, Feb 20, 2014 at 9:22 PM, Marko Rauhamaa ma...@pacujo.net wrote: py35.unless x 7: return What about return? Are you allowed to namespace that? And 'from' and 'import' and '*'? Old keywords are guaranteed not to clash with programs. Introducing new keywords runs that risk. Hence, C had to introduce the ugly _Bool keyword. Okay, so what you're saying is that there are three states: Before Python X.Y, the unless keyword simply doesn't exist. (It can't be coded in as a module, so it can't exist until someone implements the code.) From X.Y, it can be called up by importing it from pyAB and used in its namespace. From A.B onward, it always exists. Python has a facility like this. It doesn't namespace the keywords, but it does let you choose whether to have them or not. In Python 2.5, you could type from __future__ import with_statement to turn 'with' into a keyword. After Python 2.6, it's always a keyword. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: Python has a facility like this. It doesn't namespace the keywords, but it does let you choose whether to have them or not. In Python 2.5, you could type from __future__ import with_statement to turn 'with' into a keyword. After Python 2.6, it's always a keyword. That certainly softens the blow but might still cause unnecessary suffering when maintaining/resurrecting legacy Python code. How about blocking the introduction of new keywords for ever except if you specify: from __py35__ import syntax Eventually, every Python module would likely begin with a statement like that, and it would document the assumption more clearly than __future__. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, Feb 20, 2014 at 11:09 PM, Marko Rauhamaa ma...@pacujo.net wrote: How about blocking the introduction of new keywords for ever except if you specify: from __py35__ import syntax Eventually, every Python module would likely begin with a statement like that, and it would document the assumption more clearly than __future__. It's more self-documenting with the __future__ directive, because it says *what* syntax you're importing from the future. And at some point, the new keywords must just become standard. There's no point polluting every Python script forever with these directives, and no point maintaining two branches of code in the interpreter. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Al madinah international university opening apply for university colleges
MR/ Mrs * Al madinah international university which win dependence Malaysian Ministry of Higher Education Malaysia (MOHE) and also winning the adoption of all academic programs and courses, the university that are approved by the Malaysian funds and private academy, which deals with quality control and efficiency Academy, known for short as [MQA ] to congratulate you on the occasion of the new academic February year - 2014 . Its pleasure to tell you that the university opening apply for university colleges. The following colleges : * Faculty of Islamic Sciences * Faculty of languages * Faculty of Computer and Information Technology. *Faculty of education . * Faculty of Finance and Management. *Language center *Faculty of engineering The university offer : * Bachelor degree * Master degree * PHD degree Both online and on campus learning for more information you can visit http://www.mediu.edu.my/ar/admissions/requirments for more information about Bachelor degree http://www.mediu.edu.my/ar/admissions/undergraduateprograms for more information about master degree http://www.mediu.edu.my/ar/admissions/postgraduateprograms Best Regard Al madinah international university //www.mediu.edu.my/ar/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: On Thu, Feb 20, 2014 at 11:09 PM, Marko Rauhamaa ma...@pacujo.net wrote: from __py35__ import syntax It's more self-documenting with the __future__ directive, because it says *what* syntax you're importing from the future. As a developer, I will probably want to state the Python dialect that was used to write the module. Each dialect comes with hundreds of features. I don't want to list them individually (even if I could). And at some point, the new keywords must just become standard. That's an explicit program of destroying backwards-compatibility: a war on legacy code. That may be the Python way, but it's not a necessary strategy. There's no point polluting every Python script forever with these directives, and no point maintaining two branches of code in the interpreter. Two branches? I would imagine there would be dozens of branches in the interpreter if the latest interpreter were to support all past Python dialects (as it should, IMO). Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, Feb 20, 2014 at 11:46 PM, Marko Rauhamaa ma...@pacujo.net wrote: And at some point, the new keywords must just become standard. That's an explicit program of destroying backwards-compatibility: a war on legacy code. That may be the Python way, but it's not a necessary strategy. There's no point polluting every Python script forever with these directives, and no point maintaining two branches of code in the interpreter. Two branches? I would imagine there would be dozens of branches in the interpreter if the latest interpreter were to support all past Python dialects (as it should, IMO). Indeed. If the interpreter were to include every dialect of old Python, then it would have a lot more than two branches. They would, in fact, increase exponentially with every Python version. Fortunately, there is an alternative. You can specify the version of Python like this: #!/usr/local/bin/python3.4 or any of several other ways. You then choose exactly which versions of Python to have installed, and continue to use them for as long as you wish. There's no reason for the 3.4 interpreter to be able to run code as if it were the 3.1 interpreter, when you can just have the 3.1 interpreter itself right there. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.7 importing pyc files without py files
joi, 20 februarie 2014, 00:25:41 UTC+2, Emile van Sebille a scris: On 2/19/2014 2:03 PM, Mircescu Andrei wrote: If there are only pyc files, the loading time of the application is much more than if I have pyc and py files. It is behind with 2 minutes more than if it had py files You may get some clues by starting python as /path/to/python/python2.7 -vv which will provide the details of attempts to import: [root@vsds4 log]# python2.7 -vv # installing zipimport hook import zipimport # builtin # installed zipimport hook # trying /usr/local/lib/python2.7/site.so # trying /usr/local/lib/python2.7/sitemodule.so # trying /usr/local/lib/python2.7/site.py # /usr/local/lib/python2.7/site.pyc matches /usr/local/lib/python2.7/site.py import site # precompiled from /usr/local/lib/python2.7/site.pyc # trying /usr/local/lib/python2.7/os.so # trying /usr/local/lib/python2.7/osmodule.so # trying /usr/local/lib/python2.7/os.py # /usr/local/lib/python2.7/os.pyc matches /usr/local/lib/python2.7/os.py import os # precompiled from /usr/local/lib/python2.7/os.pyc ... HTH, Emile I cannot start python since i'm embedding it in .net with pythonnet solution. -- https://mail.python.org/mailman/listinfo/python-list
Cross-platform way to get default directory for binary files like console scripts?
Hi! Is there cross-platform way to get default directory for binary files (console scripts for instance) the same way one can use sys.executable to get path to the Python's interpreter in cross-platform way? Context: There's Python script which runs various tools like pip using subprocess and we would like to make sure we run tools that accompany Python's interpreter used to run this script. Please note that the script may be run from within virtualenv which had not been activated - ./venv/bin/python our_script.py Regards, Piotr Dobrogost -- https://mail.python.org/mailman/listinfo/python-list
Error getting REMOTE_USER Environment Variable
I'm running the Abyss Web Server X1 (v 2.9.0.1) on a Windows XP Home (SP3) system and am using Python 3.3 for a scripting language. I'm having a problem getting the environment variable REMOTE_USER. Here's the situation: 1. I have created a user under Abyss. The userid is userxyz.. 2. I have created a directory under htdocs called Test and using the Abyss console I have password protected it. 3. In the Test directory, there is no index.html file but there is an index.py file, so that should get executed when I access the Test directory. 4. If I start up my web browser and point it to localhost/Test, I get challenged for user authentication, as I should. 5. I enter the userid (userxyz) and its password and click the Log in button. Authentication succeeds. So far, so good. 6. The index.py script is launched. It's only function (so far) is to fetch the REMOTE_USER environment variable and echo it back to me. 7. What it echoes back is userxyzuserxyz. In other words, the REMOTE_USER value is repeated. In case you're interested, here is the entire index.py script: import os userid =os.environ[REMOTE_USER] print(Content-type: text/html) print() print(HTMLBODY + userid + /BODY/HTML) That's about as simple as anything could be. The fact that the script is displaying anything at all indicates to me that my Python cgi support is installed correctly and that the script is being executed correctly. By why the REMOTE_USER value is doubled is beyond my understanding. Is this a bug in the os package that comes with Python 3.3? Anybody got a fix for it? By the way, if I try to fetch AUTH_USER, I get the same problem. Thanks in advance. Hobie Audet -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 2/20/14 9:27 AM, Piotr Dobrogost wrote: Hi! Is there cross-platform way to get default directory for binary files (console scripts for instance) the same way one can use sys.executable to get path to the Python's interpreter in cross-platform way? Context: There's Python script which runs various tools like pip using subprocess and we would like to make sure we run tools that accompany Python's interpreter used to run this script. Please note that the script may be run from within virtualenv which had not been activated - ./venv/bin/python our_script.py Regards, Piotr Dobrogost Hi Piotr, we talked about this briefly in #python this morning. I still don't quite understand why you are averse to activating the virtualenv. It is designed to solve precisely this problem: create an environment that uses the natural OS tools (including PATH) to produce a consistent environment that works the way tools expect. If you don't activate the virtualenv, then you can look for your Python executable using sys.executable, and see if the file you want to run is in that same directory. I have no idea under what conditions that is the right or wrong answer, and I don't know what to do if the file you're looking for isn't in that directory. Perhaps the shorter answer is, look in the Python executable directory, then look in the directories on PATH. -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: If the interpreter were to include every dialect of old Python, then it would have a lot more than two branches. They would, in fact, increase exponentially with every Python version. It shouldn't be *that bad*; the linux kernel is grappling with the glut of system calls, but they are managing it reasonably well. I don't see why Python, especially at this mature stage, couldn't adopt a similar stance *going forward*. In fact, not every syntax change requires special backwards-compatibility treatment in the compiler. Constructs that used to be illegal might become legal (say, try-except-finally). They don't require any attention. Even new keywords have a very small impact on the parser; it should be a simple matter of enabling dictionary entries. Fortunately, there is an alternative. You can specify the version of Python like this: #!/usr/local/bin/python3.4 Well, * you won't be finding old Python versions on newer operating system distributions, * even URL: http://www.python.org/downloads/ isn't all that extensive and * the program may import modules that were written in different Python dialects. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 20 February 2014 14:27, Piotr Dobrogost p...@google-groups-2014.dobrogost.net wrote: Is there cross-platform way to get default directory for binary files (console scripts for instance) the same way one can use sys.executable to get path to the Python's interpreter in cross-platform way? Context: There's Python script which runs various tools like pip using subprocess and we would like to make sure we run tools that accompany Python's interpreter used to run this script. Please note that the script may be run from within virtualenv which had not been activated - ./venv/bin/python our_script.py I'm not sure if I understand the question. Are you trying to find where a script would go if it had been installed as a result of 'python setup.py install' or 'pip install ...'? If so there are different places it could go depending not only on the system but also how the packages were installed (e.g. --user). You can find the default location in this roundabout way: In [1]: from distutils.command.install import install In [2]: from distutils.dist import Distribution In [3]: c = install(Distribution()) In [4]: c.finalize_ c.finalize_options c.finalize_otherc.finalize_unix In [4]: c.finalize_options() In [5]: c.insta c.install_base c.install_headersc.install_lib c.install_path_file c.install_platlibc.install_scripts c.install_usersite c.install_data c.install_layout c.install_libbase c.install_platbase c.install_purelibc.install_userbase In [5]: c.install_scripts Out[5]: '/usr/local/bin' Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: Error getting REMOTE_USER Environment Variable
On 2014-02-20 14:53, Hobie Audet wrote: I'm running the Abyss Web Server X1 (v 2.9.0.1) on a Windows XP Home (SP3) system and am using Python 3.3 for a scripting language. I'm having a problem getting the environment variable REMOTE_USER. Here's the situation: 1. I have created a user under Abyss. The userid is userxyz.. 2. I have created a directory under htdocs called Test and using the Abyss console I have password protected it. 3. In the Test directory, there is no index.html file but there is an index.py file, so that should get executed when I access the Test directory. 4. If I start up my web browser and point it to localhost/Test, I get challenged for user authentication, as I should. 5. I enter the userid (userxyz) and its password and click the Log in button. Authentication succeeds. So far, so good. 6. The index.py script is launched. It's only function (so far) is to fetch the REMOTE_USER environment variable and echo it back to me. 7. What it echoes back is userxyzuserxyz. In other words, the REMOTE_USER value is repeated. In case you're interested, here is the entire index.py script: import os userid =os.environ[REMOTE_USER] print(Content-type: text/html) print() print(HTMLBODY + userid + /BODY/HTML) That's about as simple as anything could be. The fact that the script is displaying anything at all indicates to me that my Python cgi support is installed correctly and that the script is being executed correctly. By why the REMOTE_USER value is doubled is beyond my understanding. Is this a bug in the os package that comes with Python 3.3? Anybody got a fix for it? By the way, if I try to fetch AUTH_USER, I get the same problem. Thanks in advance. How many other environment variables are doubled? All of them? Does the problem exist when the Python script is run directly, outside Abyss, or in IDLE, for example? -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On Thursday, February 20, 2014 4:22:53 PM UTC+1, Oscar Benjamin wrote: I'm not sure if I understand the question. Are you trying to find where a script would go if it had been installed as a result of 'python setup.py install' or 'pip install ...'? Yes. If so there are different places it could go depending not only on the system but also how the packages were installed (e.g. --user). Right. You can find the default location in this roundabout way: (...) In [5]: c.install_scripts Out[5]: '/usr/local/bin' I think this is pretty much what I'm after, thanks. I'm wondering if there's some API to get this info as what you showed is really roundabout way to achieve the goal... Regards, Piotr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 2/20/14 10:34 AM, Piotr Dobrogost wrote: On Thursday, February 20, 2014 4:22:53 PM UTC+1, Oscar Benjamin wrote: I'm not sure if I understand the question. Are you trying to find where a script would go if it had been installed as a result of 'python setup.py install' or 'pip install ...'? Yes. If so there are different places it could go depending not only on the system but also how the packages were installed (e.g. --user). Right. You can find the default location in this roundabout way: (...) In [5]: c.install_scripts Out[5]: '/usr/local/bin' I think this is pretty much what I'm after, thanks. I'm wondering if there's some API to get this info as what you showed is really roundabout way to achieve the goal... As roundabout and advanced as that code is, it doesn't give the right answer for me. It returns None. On my Mac, after activating a virtualenv: Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type help, copyright, credits or license for more information. from distutils.command.install import install from distutils.dist import Distribution c = install(Distribution()) c.install_scripts c.install_scripts is None True sys.executable '/usr/local/virtualenvs/studygroup/bin/python' os.listdir(os.path.dirname(sys.executable)) ['activate', 'activate.csh', 'activate.fish', 'activate_this.py', 'easy_install', 'easy_install-2.7', 'pip', 'pip-2.7', 'python', 'python2', 'python2.7'] -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 20 February 2014 15:34, Piotr Dobrogost p...@google-groups-2014.dobrogost.net wrote: On Thursday, February 20, 2014 4:22:53 PM UTC+1, Oscar Benjamin wrote: You can find the default location in this roundabout way: I'm wondering if there's some API to get this info as what you showed is really roundabout way to achieve the goal... There may be something that I don't know of. Distutils is generally pretty clunky though if you're not trying to do one of the exact things it was designed to do. Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Fri, Feb 21, 2014 at 2:14 AM, Marko Rauhamaa ma...@pacujo.net wrote: * you won't be finding old Python versions on newer operating system distributions, * even URL: http://www.python.org/downloads/ isn't all that extensive and * the program may import modules that were written in different Python dialects. You can always build your own Python, if it really matters... but more likely, if you care about old versions, you actually care about *one specific old version* which your program uses. That's why Red Hat still supports Python 2.4 and, I think, 2.3. You can't randomly pick up 2.2 or 1.5, but if you want 2.4, you can keep on using that for as long as this RHEL is supported. As to importing modules written for other versions... that can be a major problem. Often the new keywords come with new functionality. Take string exceptions, for instance. Say you import a module that was written for a version that still supported them - if it raises a string, you can't catch it. There is a limit to how far the compatibility can be taken. Also, what happens if two modules (one of which might be your script) written for different versions both import some third module? Should they get different versions, based on what version tags they use themselves? Compatibility can't be changed that easily. You either run on the new version, or run on the old. Not both. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 20 February 2014 15:42, Ned Batchelder n...@nedbatchelder.com wrote: As roundabout and advanced as that code is, it doesn't give the right answer for me. It returns None. On my Mac, after activating a virtualenv: Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type help, copyright, credits or license for more information. from distutils.command.install import install from distutils.dist import Distribution c = install(Distribution()) You forgot to call c.finalize_options() here which actually sets all of these attributes. c.install_scripts c.install_scripts is None True Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On Thursday, February 20, 2014 4:42:54 PM UTC+1, Ned Batchelder wrote: As roundabout and advanced as that code is, it doesn't give the right answer for me. It returns None. Indeed. I tried on Linux and got None both inside and outside virtualenv :( Regards, Piotr -- https://mail.python.org/mailman/listinfo/python-list
Re: Error getting REMOTE_USER Environment Variable
In mailman.7186.1392908069.18130.python-l...@python.org Hobie Audet hobie.au...@comcast.net writes: 7. What it echoes back is userxyzuserxyz. In other words, the REMOTE_USER value is repeated. What username is recorded in the access_log file? executed correctly. By why the REMOTE_USER value is doubled is beyond my understanding. Is this a bug in the os package that comes with Python 3.3? Anybody got a fix for it? If there is a bug, it's much more likely to be in the webserver code that sets the REMOTE_USER value. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list
The sum of numbers in a line from a file
Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2999-88-7766 A-FN99 100969190 name3000-00-0110AUD5100281976 name4398-72-P/FY7684496978 name5909-37-3689A-FY97941006179 For name1, I want to add together columns 4, 5, 6, and get an average from that, then do the same for the last two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) -- https://mail.python.org/mailman/listinfo/python-list
Re: Cross-platform way to get default directory for binary files like console scripts?
On 2/20/14 10:55 AM, Oscar Benjamin wrote: On 20 February 2014 15:42, Ned Batchelder n...@nedbatchelder.com wrote: As roundabout and advanced as that code is, it doesn't give the right answer for me. It returns None. On my Mac, after activating a virtualenv: Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type help, copyright, credits or license for more information. from distutils.command.install import install from distutils.dist import Distribution c = install(Distribution()) You forgot to call c.finalize_options() here which actually sets all of these attributes. Ah, good! Thanks! -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Chris Angelico ros...@gmail.com: Also, what happens if two modules (one of which might be your script) written for different versions both import some third module? Should they get different versions, based on what version tags they use themselves? Compatibility can't be changed that easily. You either run on the new version, or run on the old. Not both. Shared C libraries face the exact same issue. Java seems pretty good on this front as well. When there is a will, there is a way. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Fri, Feb 21, 2014 at 3:26 AM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: Also, what happens if two modules (one of which might be your script) written for different versions both import some third module? Should they get different versions, based on what version tags they use themselves? Compatibility can't be changed that easily. You either run on the new version, or run on the old. Not both. Shared C libraries face the exact same issue. Java seems pretty good on this front as well. When there is a will, there is a way. Shared C libraries usually do it by linking against a particular version. That's why you often need to keep multiple versions around. Once it's all binary code, there's no more compatibility question - it all runs on the same CPU. With Python code, the module's written to run on a particular interpreter, and that can't just switch around - it's like the weird and wonderful life I enjoyed as 32-bit computing started coming along, and I wanted to call on code that used the other word length... ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Just For Inquiry
Hello, Sir I am Shivang Patel and Master of Computer Engineering Student. In this current we are studying one subject name Principals of management as part of syllabus. As per this subject, we have one assignment(Because of we all student think, this subject is useless for us) - *Talk with Project manager and ask them about Role of Project Manager in Organization * So, I kindly request to you please, give me a very brief info regarding *Role of Project Manager*. Thank u. -- # shivangpatel # http://shivangpatel1.wordpress.com/ # http://mylinuxsys.wordpress.com/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Cannot figure out line of code, also not understanding error
ApathyBear nircher...@gmail.com Wrote in message: On Thursday, February 20, 2014 12:54:54 AM UTC-8, Chris Angelico wrote: Calling a class will create a new instance of it. [1] What you do with it afterwards is separate. Okay. So what you are saying is that return(Athlete(temp1.pop(0),temp1.pop(0), temp1)) IS in fact creating an instance of Athlete. My problem with this is that there really is no declaration of 'self' for this instance. Usually when I do something like this. x = Athlete(Henry, 11-15-90, [1,2,3]) I can refer to things of this instance by executing x.name or whatever other attributes the class defined. If I create an instance with no 'self' how does this make any sense? How would I get an attribute for the our instance above? The code you're describing is inside a function: def get_coach_data(filename): try: with open(filename) as f: data = f.readline() temp1 = data.strip().split(',') return Athlete(temp1.pop(0),temp1.pop(0), temp1) So the caller might be doing something like x = get_coach_data (myfile.txt) The return statement you're asking about returns a new instance of Athlete, which gets assigned to x. Then you may try x.data or equivalent if you like. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
On Feb 20, 2014 11:25 AM, kxjakkk kjaku...@gmail.com wrote: Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2999-88-7766 A-FN99 100969190 name3000-00-0110AUD5100281976 name4398-72-P/FY7684496978 name5909-37-3689A-FY97941006179 For name1, I want to add together columns 4, 5, 6, and get an average from that, then do the same for the last two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) -- Use split() on each line. Do the math https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
In 882091da-a499-477e-8f50-c5bdde7cd...@googlegroups.com kxjakkk kjaku...@gmail.com writes: Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2999-88-7766 A-FN99 100969190 name3000-00-0110AUD5100281976 name4398-72-P/FY7684496978 name5909-37-3689A-FY97941006179 For name1, I want to add together columns 4, 5, 6, and get an average from that, then do the same for the last two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) This should get you started. However, this code does not work for all your imput lines, as 'name3' is missing the third field. You'll have to to modify the code to do something smarter than simple space-delimited data. But as I said, it's a start. # open the file with open('file') as fp: # process each line for line in fp.readlines(): # split the line into a list of fields, delimited by spaces fields = line.split() # grab the name name = fields[0] # convert text values to integers and sum them sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) sum2 = int(fields[7]) + int(fields[8]) # compute the averages average1 = sum1 / 3.0 average2 = sum2 / 2.0 # display output print '%s %f %f' % (name, average1, average2) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list
Re:The sum of numbers in a line from a file
kxjakkk kjaku...@gmail.com Wrote in message: Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2999-88-7766 A-FN99 100969190 name3000-00-0110AUD5100281976 name4398-72-P/FY7684496978 name5909-37-3689A-FY97941006179 For name1, I want to add together columns 4, 5, 6, and get an average from that, then do the same for the last two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) Don'ttrytodoitallinoneline.thatwayyouactuallymighthaveaplacetoinse rtsomeextralogic. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
What I've got is def stu_scores(): lines = [] with open(file.txt) as f: lines.extend(f.readlines()) return (.join(lines[11:])) scores = stu_scores() for line in scores: fields = line.split() name = fields[0] sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) sum2 = int(fields[7]) + int(fields[8]) average1 = sum1 / 3.0 average2 = sum2 / 2.0 print (%s %f %f %) (name, average1, average2) It says that the list index is out of range on the sum1 line. I need stu_scores because the table from above starts on line 11. -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
On Feb 20, 2014 1:20 PM, kjaku...@gmail.com wrote: What I've got is def stu_scores(): lines = [] with open(file.txt) as f: lines.extend(f.readlines()) return (.join(lines[11:])) scores = stu_scores() for line in scores: fields = line.split() name = fields[0] Print fields here to see what's up sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) sum2 = int(fields[7]) + int(fields[8]) average1 = sum1 / 3.0 average2 = sum2 / 2.0 print (%s %f %f %) (name, average1, average2) It says that the list index is out of range on the sum1 line. I need stu_scores because the table from above starts on line 11. -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
scores = stu_scores() for line in scores: fields = line.split() name = fields[0] print (fields) Error comes up saying IndexError: list index out of range. -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
On Thu, Feb 20, 2014 at 7:16 PM, kjaku...@gmail.com wrote: What I've got is def stu_scores(): lines = [] with open(file.txt) as f: lines.extend(f.readlines()) return (.join(lines[11:])) This returns a string, not a list. Moreover, lines.extend() is useless. Replace this with: def stu_scores(): with open(file.txt) as f: lines = f.readlines() return lines[11:] scores = stu_scores() for line in scores: `for` operating on strings iterates over each character. fields = line.split() Splitting one character will turn it into a list containing itself, or nothing if it was whitespace. name = fields[0] This is not what you want it to be — it’s only a single letter. sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) Thus it fails here, because ['n'] has just one item, and not nine. sum2 = int(fields[7]) + int(fields[8]) average1 = sum1 / 3.0 average2 = sum2 / 2.0 print (%s %f %f %) (name, average1, average2) It says that the list index is out of range on the sum1 line. I need stu_scores because the table from above starts on line 11. -- https://mail.python.org/mailman/listinfo/python-list -- Chris “Kwpolska” Warrick http://kwpolska.tk PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
kjaku...@gmail.com wrote: Error comes up saying IndexError: list index out of range. OK, then the 12th line starts with a whitespace char. Add more print statements to see the problem: scores = stu_scores() print scores for line in scores: print repr(line) fields = line.split() name = fields[0] print (fields) Hint: def stu_scores(): lines = [] with open(file.txt) as f: lines.extend(f.readlines()) return (.join(lines[11:])) Why did you .join the lines? -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
On 2014-02-20 18:16, kjaku...@gmail.com wrote: What I've got is def stu_scores(): lines = [] with open(file.txt) as f: lines.extend(f.readlines()) return (.join(lines[11:])) scores = stu_scores() for line in scores: fields = line.split() name = fields[0] sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) sum2 = int(fields[7]) + int(fields[8]) average1 = sum1 / 3.0 average2 = sum2 / 2.0 print (%s %f %f %) (name, average1, average2) It says that the list index is out of range on the sum1 line. I need stu_scores because the table from above starts on line 11. Apart from the other replies, the final print is wrong. It should be: print %s %f %f % (name, average1, average2) -- https://mail.python.org/mailman/listinfo/python-list
Re: The sum of numbers in a line from a file
On Feb 20, 2014, at 8:54 AM, Dave Angel da...@davea.name wrote: kxjakkk kjaku...@gmail.com Wrote in message: Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2999-88-7766 A-FN99 100969190 name3000-00-0110AUD5100281976 name4398-72-P/FY7684496978 name5909-37-3689A-FY97941006179 For name1, I want to add together columns 4, 5, 6, and get an average from that, then do the same for the last two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) Don'ttrytodoitallinoneline.thatwayyouactuallymighthaveaplacetoinse rtsomeextralogic. Yes. Clearly the preferred way to do it is with lots of lines with room for expandability. Sorry Dave, couldn’t resist. Clearly a balance between extremes is desirable. (Mark, I intentionally put the blank lines in this time grin) Travis Griggs “Every institution tends to perish by an excess of its own basic principle.” — Lord Acton -- https://mail.python.org/mailman/listinfo/python-list
Re: Just For Inquiry
In mailman.7196.1392914525.18130.python-l...@python.org shivang patel patelshivan...@gmail.com writes: So, I kindly request to you please, give me a very brief info regarding *Role of Project Manager*. In my organization, a project manager does these things (and a lot more): Ensure that a requirements document exists, and is approved by both the customer and the developer. Work with developers to create a list of all work steps necessary to complete the project. Create a project schedule from developer estimates for each item on the work list, and update the schedule as needed if additional steps are added or a step takes longer than anticipated. Communicate with customers to keep them informed of the project's progress. Schedule meetings with the customer as needed. Ensure that a test plan exists and is carried out. Coordinate project delivery and installation. Coordinate bug reports and bugfixes. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list
Re: Function and turtle help
On Feb 20, 2014, at 9:41 PM, Scott W Dunning swdunn...@cox.net wrote: Hello, I am trying to make a function that allows me to color in a star that was drawn in Turtle. I just keep having trouble no matter what I do. I’ll post the code I have for the star (just in case). The ultimate goal is to create a script that’ll draw the American flag (we’re learning this piece by piece in class. So, I need to create a function that will color in the star that I can call multiple times for each star. Any help is greatly appreciated! Scott from turtle import * from math import sin, sqrt, radians showturtle() def star(width): R = (width)/2*sin(radians(72)) A = (2*width)/(3+sqrt(5)) penup() left(18) penup() forward(R) pendown() left(162) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) penup() left(180-18) penup() forward(R) penup() left(180-18) pendown() showturtle() star(500) I think I’m having trouble with how functions operate. Here is what I have so far for the function to fill in the star with the color red. It’s obviously not working and not sure where I’m going wrong. def fill_color(color): color(red) begin_fill() penup() end_fill() fill_color(red) -- https://mail.python.org/mailman/listinfo/python-list
Function and turtle help
Hello, I am trying to make a function that allows me to color in a star that was drawn in Turtle. I just keep having trouble no matter what I do. I’ll post the code I have for the star (just in case). The ultimate goal is to create a script that’ll draw the American flag (we’re learning this piece by piece in class. So, I need to create a function that will color in the star that I can call multiple times for each star. Any help is greatly appreciated! Scott from turtle import * from math import sin, sqrt, radians showturtle() def star(width): R = (width)/2*sin(radians(72)) A = (2*width)/(3+sqrt(5)) penup() left(18) penup() forward(R) pendown() left(162) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) penup() left(180-18) penup() forward(R) penup() left(180-18) pendown() showturtle() star(500) -- https://mail.python.org/mailman/listinfo/python-list
Re: Just For Inquiry
On Feb 20, 2014, at 5:48 PM, John Gordon gor...@panix.com wrote: In mailman.7196.1392914525.18130.python-l...@python.org shivang patel patelshivan...@gmail.com writes: So, I kindly request to you please, give me a very brief info regarding *Role of Project Manager*. In my organization, a project manager does these things (and a lot more): Ensure that a requirements document exists, and is approved by both the customer and the developer. Work with developers to create a list of all work steps necessary to complete the project. Create a project schedule from developer estimates for each item on the work list, and update the schedule as needed if additional steps are added or a step takes longer than anticipated. Communicate with customers to keep them informed of the project's progress. Schedule meetings with the customer as needed. Ensure that a test plan exists and is carried out. Coordinate project delivery and installation. Coordinate bug reports and bugfixes. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. An excellent list, I would add that frequently the project manager has significant budget responsibilities as well. In an informal sense, the project manager is the point person for keeping a project on track, on budget, and completed in a timely fashion. Software engineers, working FOR a project manager, frequently feel that the project manager is providing no added value. This is NOT true. -Bill -- https://mail.python.org/mailman/listinfo/python-list
Re:Function and turtle help
Scott W Dunning swdunn...@cox.net Wrote in message: Hello, I am trying to make a function that allows me to color in a star that was drawn in Turtle. I just keep having trouble no matter what I do. Iâll post the code I have for the star (just in case). The ultimate goal is to create a script thatâll draw the American flag (weâre learning this piece by piece in class. So, I need to create a function that will color in the star that I can call multiple times for each star. Any help is greatly appreciated! Scott from turtle import * from math import sin, sqrt, radians showturtle() def star(width): R = (width)/2*sin(radians(72)) A = (2*width)/(3+sqrt(5)) penup() left(18) penup() forward(R) pendown() left(162) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) left(144) forward(A) right(72) forward(A) penup() left(180-18) penup() forward(R) penup() left(180-18) pendown() showturtle() star(500) Look at turtle.begin_fill and turtle.end_fill That's after making sure your star is a closed shape. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
TypeError: can't multiply sequence by non-int of type 'tuple'
HI, I have a tuple. I need to make sqaure of elements of tuple and after that i want add all suared tuple elements for total. When i trying to do it, below error came. Code: seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) x2 = [x * x for x in seriesxlist1]; Error: Traceback (most recent call last): File pyshell#188, line 1, in module x2 = [x * x for x in seriesxlist1]; TypeError: can't multiply sequence by non-int of type 'tuple' Please suggest me solution. -- https://mail.python.org/mailman/listinfo/python-list
Re: TypeError: can't multiply sequence by non-int of type 'tuple'
On Friday, February 21, 2014 12:01:53 PM UTC+5:30, Jaydeep Patil wrote: HI, I have a tuple. I need to make sqaure of elements of tuple and after that i want add all suared tuple elements for total. When i trying to do it, below error came. Code: seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) x2 = [x * x for x in seriesxlist1]; Error: Traceback (most recent call last): x2 = [x * x for x in seriesxlist1]; TypeError: can't multiply sequence by non-int of type 'tuple' Please suggest me solution. x2 = [x * x for (x,) in seriesxlist1] x2 [0.0, 0.0001, 0.0004, 0.0009, 0.0016, 0.0025005, 0.0036, 0.004901, 0.0064, 0.0081, 0.010002, 0.0121] 1 Why you are making singleton tuples dunno 2 And no need for semicolons in python -- https://mail.python.org/mailman/listinfo/python-list
Can global variable be passed into Python function?
I need to pass a global variable into a python function. However, the global variable does not seem to be assigned after the function ends. Is it because parameters are not passed by reference? How can I get function parameters to be passed by reference in Python? -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, 20 Feb 2014 14:09:19 +0200, Marko Rauhamaa wrote: Chris Angelico ros...@gmail.com: Python has a facility like this. It doesn't namespace the keywords, but it does let you choose whether to have them or not. In Python 2.5, you could type from __future__ import with_statement to turn 'with' into a keyword. After Python 2.6, it's always a keyword. That certainly softens the blow but might still cause unnecessary suffering when maintaining/resurrecting legacy Python code. How about blocking the introduction of new keywords for ever except if you specify: from __py35__ import syntax Eventually, every Python module would likely begin with a statement like that, and it would document the assumption more clearly than __future__. What *actual* problem is this supposed to solve? Do you often find that Python has introduced new keywords, breaking your code? -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: TypeError: can't multiply sequence by non-int of type 'tuple'
On Friday, 21 February 2014 12:06:54 UTC+5:30, Rustom Mody wrote: On Friday, February 21, 2014 12:01:53 PM UTC+5:30, Jaydeep Patil wrote: HI, I have a tuple. I need to make sqaure of elements of tuple and after that i want add all suared tuple elements for total. When i trying to do it, below error came. Code: seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) x2 = [x * x for x in seriesxlist1]; Error: Traceback (most recent call last): x2 = [x * x for x in seriesxlist1]; TypeError: can't multiply sequence by non-int of type 'tuple' Please suggest me solution. x2 = [x * x for (x,) in seriesxlist1] x2 [0.0, 0.0001, 0.0004, 0.0009, 0.0016, 0.0025005, 0.0036, 0.004901, 0.0064, 0.0081, 0.010002, 0.0121] 1 Why you are making singleton tuples dunno 2 And no need for semicolons in python Answer: 1. This tupple, i get it from excel range extraction. e.g. seriesxlist = newws.Range(newws.Cells(3,2),newws.Cells(usedRows,2)).Value 2. i removed semicolon, still i am facing same error. I am unable to get multiplies values. Please suggest. I have input as below tuple only. seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) -- https://mail.python.org/mailman/listinfo/python-list
Re: Just For Inquiry
On Thu, 20 Feb 2014 22:48:18 +, John Gordon wrote: In mailman.7196.1392914525.18130.python-l...@python.org shivang patel patelshivan...@gmail.com writes: So, I kindly request to you please, give me a very brief info regarding *Role of Project Manager*. In my organization, a project manager does these things (and a lot more): What does this have to do with Python? Please don't encourage people to choose a random, inappropriate newsgroup/ mailing list to ask unrelated questions. Some slack can be given to regulars who raise interesting OT questions, but not drive-by posters. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Remove comma from tuples in python.
I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) please suggest me solution. Regards jay -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, 20 Feb 2014 14:46:35 +0200, Marko Rauhamaa wrote: I would imagine there would be dozens of branches in the interpreter if the latest interpreter were to support all past Python dialects (as it should, IMO). Well thank goodness you're not in charge of Python's future development. That way leads to madness: madness for the core developers (if you think maintaining Python 2 and 3 branches is hard imagine maintaining *dozens* of them, *forever*), madness of the programmers using the language, and madness for anyone trying to learn the language. It's hard enough for newbies to deal with *two* dialects, 2 and 3. And you want to introduce dozens. Thanks, but no thanks. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, 20 Feb 2014 20:39:10 +1100, Chris Angelico wrote: In working on a proposal that might result in the creation of a new keyword, I needed to ascertain what names were used extensively in existing Python code. I would love to steal^W see your script for doing this :-) -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Thu, 20 Feb 2014 12:22:29 +0200, Marko Rauhamaa wrote: Chris Angelico ros...@gmail.com: In working on a proposal that might result in the creation of a new keyword, I'm looking forward to the day when every application can add its own keywords as is customary in Lisp. And what a wonderful day that will be! Reading any piece of code you didn't write yourself -- or wrote a long time ago -- will be an adventure! Every script will have it's own exciting new set of keywords doing who knows what, which makes every script nearly it's own language! Oh joy, I cannot wait! That's sarcasm, by the way. I needed to ascertain what names were used extensively in existing Python code One advantage of Perl is that names and keywords are in separate namespaces so introducing new keywords is easy. Then I can write code like: for for in in: while while: if if: raise raise which will go a long way to ensuring that my code is an hostile and unreadable as possible. (Sometimes, less can be more. That's especially true of programming languages.) -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Fri, Feb 21, 2014 at 5:51 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 20 Feb 2014 20:39:10 +1100, Chris Angelico wrote: In working on a proposal that might result in the creation of a new keyword, I needed to ascertain what names were used extensively in existing Python code. I would love to steal^W see your script for doing this :-) No probs! It's part of my ancillary stuff for the PEP 463 research: https://github.com/Rosuav/ExceptExpr/blob/master/find_except_expr.py It basically just runs over one file at a time, parses it into an AST, and walks the tree. Pretty simple. Actually, some of these sorts of things might make neat examples of what can be done with the ast module. Until this week, I had no idea how easy it was to analyze Python code this way. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Remove comma from tuples in python.
vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) please suggest me solution. Regards jay i think you have a tuple of tuples there. a tuple of 12 tuples. you need to parse each one and represent it as you wish -- https://mail.python.org/mailman/listinfo/python-list
Looking for an open-source: Task, feature and issue tracker
Dear Python list, Do you know of any open-source task, feature and issue trackers which are built with Python? Preferably with: - git integration (commits and solve issue/task ; issue is assigned to repo ) - prioritisation of tasks, features and issues - ability to show dependencies between tasks, features and issues - milestones; ability to link milestones with git tags; and milestone dependencies - Kanban boards - Scrum (support for multiple sprints, burndown charts and backlogs) If you don't know of any ones written in Python which cover this list; then do you know of ones written in any language with this support? Finally if there are no open-source projects fully covering this feature-set; can you recommend a proprietary offering? Thanks for all suggestions, Alec Taylor -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
On Fri, Feb 21, 2014 at 5:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Then I can write code like: for for in in: while while: if if: raise raise which will go a long way to ensuring that my code is an hostile and unreadable as possible. REXX allows that. Most people wouldn't use classic keywords like 'if', as that'll only cause confusion (although if if then then; else else is legal), but some of the other keywords are useful in other contexts. The main advantage is that, for instance, the PARSE command can freely use keywords: PARSE VAR x blah blah PARSE VALUE linein(blah) WITH blah blah All those words (parse, var, value, with) are keywords - in that context. But I can happily use var and value elsewhere, and will do so. Python, on the other hand, has to be more careful; so you see things like cls instead of class, or import_ and so on, with the trailing underscore. Trade-offs. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Remove comma from tuples in python.
This is just a tuple of integers and not a tuple of tuples of integers, the parentheses around the number is just there for the evaluation. On 21 févr. 2014, at 08:02 AM, Mircescu Andrei mircescu.and...@gmail.com wrote: vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) please suggest me solution. Regards jay i think you have a tuple of tuples there. a tuple of 12 tuples. you need to parse each one and represent it as you wish -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Can global variable be passed into Python function?
Sam lightai...@gmail.com writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears to be a variable is in fact only the binding of an object to a name. If you assign something to a variable, all you do is binding a different object to the name. Thus, if you have: i = 1 def f(x): x = 5 f(i) Then i will remain 1 and not become 5. The effect of x = 5 is that the name x gets bound to 5 (where is formerly was bound to 1). However, the global variable does not seem to be assigned after the function ends. Is it because parameters are not passed by reference? Python lacks the notion of variable. Thus, it does not pass variables into functions but objects. The objects, however, get passed by reference. How can I get function parameters to be passed by reference in Python? You can implement your own concept of variable, e.g. like this: class Variable(object): def __init__(self, value): self.value = value The little program above then becomes: i = Variable(1) def f(x): x.value = 5 f(i) i.value # this is now 5 -- https://mail.python.org/mailman/listinfo/python-list
Re: Remove comma from tuples in python.
On 2014-02-21, Mircescu Andrei wrote: vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) i think you have a tuple of tuples there. a tuple of 12 tuples. No it isn't: #v+ a = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) a (0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11) #v- The comma makes a tuple, not the parenthesis alone: #v+ a = ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) a ((0.0,), (0.01,), (0.02,), (0.03,), (0.04,), (0.05,), (0.06,), (0.07,), (0.08,), (0.09,), (0.1,), (0.11,)) #v- Bernd -- no time toulouse -- https://mail.python.org/mailman/listinfo/python-list
Re: Commonly-used names in the Python standard library
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Thu, 20 Feb 2014 12:22:29 +0200, Marko Rauhamaa wrote: I'm looking forward to the day when every application can add its own keywords as is customary in Lisp. And what a wonderful day that will be! Reading any piece of code you didn't write yourself -- or wrote a long time ago -- will be an adventure! Every script will have it's own exciting new set of keywords doing who knows what, which makes every script nearly it's own language! Oh joy, I cannot wait! That's sarcasm, by the way. I don't hear Lispers or C programmers complaining. Yes, you can shoot yourself in the foot with macro trickery, but macros can greatly enhance code readability and remove the need for code generators. That's why they are used extensively in Linux kernel code and GOOPS (Guile's object system), for example. One advantage of Perl is that names and keywords are in separate namespaces so introducing new keywords is easy. Then I can write code like: for for in in: while while: if if: raise raise which will go a long way to ensuring that my code is an hostile and unreadable as possible. Perl does that by forcing you to prefix you variables with $ et al. The analogy would be: for $for in @in: while $while: if $if: raise $raise I'm not saying I like the look of that, but it does have a distinct advantage in introducing new keywords. Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: Can global variable be passed into Python function?
Sam wrote: I need to pass a global variable into a python function. However, the global variable does not seem to be assigned after the function ends. Is it because parameters are not passed by reference? How can I get function parameters to be passed by reference in Python? If the variable you want to process is always the same global variable you can declare it: x = 0 def inc_x(): ... global x ... x += 1 ... x 0 inc_x() x 1 inc_x(); inc_x() x 3 If you want to change (rebind) varying global names you have to be explicit: def inc(x): ... return x + 1 ... x = 0 x = inc(x) y = 0 y = inc(y) y = inc(y) x, y (1, 2) Then there are ugly hacks that make your code hard to follow. Don't use these: def inc(name): ... globals()[name] += 1 ... inc(x) inc(x) x 3 def inc(module, name): ... setattr(module, name, getattr(module, name) + 1) ... import __main__ inc(__main__, x) inc(__main__, x) inc(__main__, x) x 6 -- https://mail.python.org/mailman/listinfo/python-list
Re: IDLE won't run after installing Python 3.3 in Windows
Well firstly being windows I assume that you did a restart after install. Python.org python doesn't come with the windows extensions which can be installed separately. On windows I use winpython is totally portable and can be installed as system version includes all extensions as well as Numpy and matplotlib etc which can be a bit tricky to install otherwise. There is enthought and anaconda packaged python a well but my choice is winpython Give it a try and you'll definitely have a working system version. Sayth -- https://mail.python.org/mailman/listinfo/python-list
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: Should these be cherry-picked too? We discuss with Guido and Yury to only include critical changes, so in short: yes, all commits related to asyncio should be cherrry-picked into RC2. It should also be easier for you to include all changes, to avoid conflicts. And the code should be the same in default and RC2 for asyncio. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: changeset: 89300:c3abdf016b18 tag: tip user:Victor Stinner victor.stin...@gmail.com date:Thu Feb 20 10:12:59 2014 +0100 files: Lib/asyncio/subprocess.py description: asyncio.subprocess: Fix a race condition in communicate() Use self._loop instead of self._transport._loop, because transport._loop is set to None at process exit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20699] Behavior of ZipFile with file-like object and BufferedWriter.
New submission from Henning von Bargen: Regression: Behavior of ZipFile with file-like object and BufferedWriter. The following code worked with Python 2.6: LOB_BLOCKSIZE = 1024*1024 # 1 MB class UnbufferedBlobWriter(io.RawIOBase): A file-like wrapper for a write-only cx_Oracle BLOB object. def __init__(self, blobLocator): self.blobLocator = blobLocator self.offset = 0 self.blobLocator.open() def seekable(self): return True def seek(self, offset, whence): if whence == 0: self.offset = offset elif whence == 1: self.offset += offset if self.offset 0: self.offset = 0 elif whence == 2: if offset = 0 and -offset = self.blobLocator.size(): self.offset = self.blobLocator.size() + offset else: raise IOError(96, Invalid offset for BlobWriter) else: self._unsupported(seek) return self.offset def writable(self): return True def write(self, data, offset=None): if offset is None: offset = self.offset self.blobLocator.write(bytes(data), offset + 1) self.offset = offset + len(data) return len(data) def close(self): self.flush() self.blobLocator.close() def BlobWriter(blobLocator): A file-like wrapper (buffered) for a write-only cx_Oracle BLOB object. return io.BufferedWriter(UnbufferedBlobWriter(blobLocator), LOB_BLOCKGROESSE) Note: The cx_Oracle BLOB object is used to store binary content inside a database. It's basically a file-like-like object. I'm using it in conjunction with a ZipFile object to store a ZipFile as a BLOB inside the DB, like this: curs.execute( insert into ... values (..., Empty_BLOB()) returning BDATA into :po_BDATA , [..., blobvar]) blob = BlobWriter(blobvar.getvalue()) archive = ZipFile(blob, w, ZIP_DEFLATED) for filename in ...: self.log.debug(Saving to ZIP file in the DB: %s, filename) archive.write(filename, filename) archive.close() This used to work with Python 2.6. With Python 2.7.5 however, somethin like this gets written into the blob: memory at 0x.. Digging deeper, I found out that when using the UnbufferedBlobWriter directly (without BufferedWriter), the problem does not occur. It seems like the behaviour of the BufferedWriter class changed from 2.6 to 2.7, most probably caused by the internal optimization of using the memoryview class. As a workaround, I had to change my write method, calling tobytes() if necessary: def write(self, data, offset=None): if offset is None: offset = self.offset if hasattr(data, tobytes): self.blobLocator.write(data.tobytes(), offset + 1) else: self.blobLocator.write(bytes(data), offset + 1) self.offset = offset + len(data) return len(data) I'm not sure if this is actually a bug in 2.7 or if my usage of BufferedWriter is incorrect (see remark). For understanding the problem it is important to know that the ZipFile.write method often calls write and seek. Remark: If I am mis-using BufferedWriter: What precisely is wrong? And if so, why is it so complicated to support a buffered-random-writer? I cannot use io.BufferedRandom because I don't have a read method (and ZipFile.write does not need that). -- components: IO messages: 211714 nosy: Henning.von.Bargen priority: normal severity: normal status: open title: Behavior of ZipFile with file-like object and BufferedWriter. type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: changeset: 89302:3e19634b396f tag: tip user:Victor Stinner victor.stin...@gmail.com date:Thu Feb 20 10:37:27 2014 +0100 files: Lib/asyncio/events.py Lib/asyncio/futures.py Lib/asyncio/tasks.py Lib/asyncio/test_utils.py Lib/asyncio/unix_events.py Lib/a description: asyncio: remove unused imports and unused variables noticed by pyflakes changeset: 89301:c412243b9d61 user:Victor Stinner victor.stin...@gmail.com date:Thu Feb 20 10:33:01 2014 +0100 files: Lib/asyncio/proactor_events.py description: asyncio: Fix _ProactorWritePipeTransport._pipe_closed() The exc variable was not defined, pass a BrokenPipeError exception instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: Sorry, I found new bugs /o\ You may skip 3e19634b396f if the last commit to cherry-pick, it's just cleanup. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: You may skip 3e19634b396f if the last commit to cherry-pick, it's just cleanup. (Ooops, if *it is* the last commit) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20687] Change in expectedFailure breaks testtools
Antoine Pitrou added the comment: Antoine: would it be reasonable to rework the implementation of subTest in a way that permitted us to revert the changes to expectedFailure? I can't tell you for sure, but certainly not in an easy way. Expected failures were the most delicate feature to keep compatible when adding subtests. (in other words: not for 3.4, IMO) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20687 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19974] tarfile doesn't overwrite symlink by directory
Vajrasky Kok added the comment: Here is the preliminary patch to address Serhiy's concern. I added some regression tests as well. Give me a time to think how to refactor the code (especially the test). -- Added file: http://bugs.python.org/file34152/fix_tarfile_overwrites_symlink_v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20621] Issue with zipimport in 3.3.4 and 3.4.0rc1
Gregory P. Smith added the comment: there's a separate issue open for you with the necessary rollback patch to apply to your 3.4 release branch. http://bugs.python.org/issue20651 This particular issue is actually solved in default, 3.3 and 2.7 as benjamin did the backouts/rollbacks of the problematic changes. i'll be figuring out the bugs and redoing those only after finding appropriate test cases back in #19081. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20621 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20686] Confusing statement
Daniel U. Thibault added the comment: It seems to me the statement is correct as written. What experiments indicate otherwise? Here's a simple one: print «1» The guillemets are certainly not ASCII (Unicode AB and BB, well outside ASCII's 7F upper limit) but are rendered as guillemets. (Guillemets are easy for me 'cause I use a French keyboard) I haven't actually checked yet what happens when writing to a file. If Python is unable to write anything but ASCII to file, it becomes nearly useless. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20686 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20698] 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder methods on instances
Barry A. Warsaw added the comment: On Feb 20, 2014, at 06:13 AM, Larry Hastings wrote: Benjamin, Barry: I take it #20261 should go in to 3.4.0? Yes please! -- title: 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder methods on instances - 3.4 cherry-pick: b328f8ccbccf pickle shouldn't look up dunder methods on instances ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20698 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20653] Pickle enums by name
Eli Bendersky added the comment: Ethan, the patch you committed here seems obscure to me. Why __reduce_ex__ and not __reduce__? Where are the accompanying documentation changes? Can you clarify more how the full logic of pickling now works - preferably in comments withing the code? -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20653 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior
Eli Bendersky added the comment: I left some comments in #20653 As for cherry-picking this into 3.4, I'm not sure. Ethan - what is the worst scenario this patch enables to overcome? Someone getting locked in to by-value pickling with certain enums in 3.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20679 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20199] status of module_for_loader and utils._module_to_load
R. David Murray added the comment: I think the docs are accurate (but I haven't been *all* the way down the NEWS chain yet). I have a fix for whatsnew in my buffer that I haven't applied yet. Probably this weekend. But as a doc change, I don't see this as a release blocker anyway. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20199 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20686] Confusing statement
R. David Murray added the comment: Thanks, yes, Georg already pointed out the issue with print. I suppose that this is something that changed at some point in Python2's history but this bit of the docs was not updated. Python can write anything to a file, you just have to tell it what encoding to use, either by explicitly encoding the unicode to binary before writing it to the file, or by using codecs.open and specifying an encoding for the file. (This is all much easier in python3, where the unicode support is part of the core of the language.) -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20686 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7231] Windows installer does not add \Scripts folder to the path
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19748] test_time failures on AIX
David Edelsohn added the comment: time.mktime((-100, 1, 10) + (0,)*6) -897577382.0 time.mktime((100, 1, 10) + (0,)*6) 111922.0 time.mktime((1900, 1, 10) + (0,)*6) 2086784896.0 time.mktime((1930, 1, 10) + (0,)*6) -1261497600.0 time.mktime((1969,12,31, 23,59,59, 0,0,0)) 28799.0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19748 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19748] test_time failures on AIX
STINNER Victor added the comment: @David Edelsohn: Oh nice, mktime() has an integer overflow on AIX. Could you please try to apply attached mktime_aix.patch, run test_time and try again my examples of msg211616? Thanks. -- Added file: http://bugs.python.org/file34153/mktime_aix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19748 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20700] Docs sidebar scrolls strangely in 3.4 docs
New submission from David Felix: On longer documentation pages, the sidebar is scrolling out of view and in an unexpected manner when the main page is scrolled. Seems to only affect 3.4 docs, but I'm not positive. http://docs.python.org/3.4/whatsnew/3.4.html is a good example. Using Firefox 27.0.1 I view this page and scroll down. When I scroll down in the main area (the page is moving upwards in my view) past the summary section, the left side bar/navigation begins scrolling in the opposite direction, presumably to keep up with my scrolling. Its movement is not proportional to my downward scrolling and it is quickly lost below the view. -- assignee: docs@python components: Documentation messages: 211729 nosy: David.Felix, docs@python priority: normal severity: normal status: open title: Docs sidebar scrolls strangely in 3.4 docs versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20693] Sidebar scrolls down 2x as fast as page content
Changes by Zachary Ware zachary.w...@gmail.com: -- nosy: +David.Felix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20693 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20700] Docs sidebar scrolls strangely in 3.4 docs
Zachary Ware added the comment: Hi David, Thanks for the report, but this has already been reported in issue20693. I've added you to the nosy list on that issue. -- assignee: docs@python - nosy: +zach.ware resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - Sidebar scrolls down 2x as fast as page content ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: changeset: 89303:d1f0ec5a9317 tag: tip user:Victor Stinner victor.stin...@gmail.com date:Thu Feb 20 16:43:09 2014 +0100 files: Lib/asyncio/base_events.py description: asyncio: Fix _check_resolved_address() for IPv6 address -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20693] Sidebar scrolls down 2x as fast as page content
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, pitrou stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20693 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20648] 3.4 cherry-pick: multiple changesets for asyncio
STINNER Victor added the comment: changeset: 89304:03b14690a9be tag: tip user:Victor Stinner victor.stin...@gmail.com date:Thu Feb 20 17:01:11 2014 +0100 files: Lib/test/test_asyncio/test_events.py description: asyncio: ops, and now fix also the unit test for IPv6 address: test_sock_connect_address() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20701] warning in compileall.rst
New submission from Antoine Pitrou: When building the docs, I get the following message: /home/antoine/cpython/default/Doc/library/compileall.rst:23: WARNING: Malformed option description u'[directory|file]...', should look like -opt args, --opt args or /opt args -- assignee: docs@python components: Documentation messages: 211733 nosy: docs@python, pitrou priority: normal severity: normal status: open title: warning in compileall.rst type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20701 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com