Re: IDLE won't run after installing Python 3.3 in Windows
On Tue, Feb 18, 2014 at 9:56 AM, eglowstei...@gmail.com wrote: The next adventure in Python was to install Python 3 into a Windows XP machine. I had a previous 2.7 installation that I uninstalled and carefully removed all traces of from the directory and the registry. It is not necessary to uninstall previous versions of Python. They can live happily together. Not only does it work, it's a supported configuration. That's what the launcher is for. Mucking with the registry is generally inadvisable. It's too easy to make a mistake. If you do decide to uninstall a Python version, do it through the Control Panel. If that results in problems, submit a bug report. I got the 'python-3.3.3.msi' from Python.org and installed it. From a command window I can run 'python' and I get the Python prompt. I have several Python programs on the machine. If I right click o one, I have the option of 'Edit in IDLE'. If I do that, the disk light blinks briefly, and then nothing. So I went into the \python33\lib\idlelib directory and from a CMD window, ran 'python idle.py'. That loads IDLE. but when I ask IDLE to load a file, it navigates to a FileOpen dialog and then closes everything when I actually open the file. I then tried the same thing but used 'pythonw' instead. Same deal. I also saw some other threads here about how Python can get befuddled by firewalls, so I disabled that with no effect. Any suggestions? Thanks in advance! I would reinstall Python2.7 and then reinstall Python3.3. That may straighten out your registry. (It may not) Let us know if that works. -- https://mail.python.org/mailman/listinfo/python-list
Re: Newcomer Help
On Thu, Feb 13, 2014 at 11:32 AM, Larry Martell larry.mart...@gmail.com wrote: 18) If you're on AOL, don't worry about anything I've said here. You're already a fucking laughing stock, and there's no hope for you. Ah, the email bigots. That's why I keep an AOL address around for occasional use against these jerks. -- https://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Python 3.4.0 release candidate 1
On Tue, Feb 11, 2014 at 5:45 AM, Terry Reedy tjre...@udel.edu wrote: On 2/11/2014 5:13 AM, Terry Reedy wrote: ... I installed 64 bit 3.3.4 yesterday with no problem. I reran it today in repair mode and again, no problem. With 64 bit 3.4.0, I get There is a problem with this Windows Installer package. A program required for the install to complete could not be run. No, the generic message does not bother to say *which* program :-(. 34 bit 3.4.0 installed fine. I wrote too soon. Python 3.4.0rc1 (v3.4.0rc1:5e088cea8660, Feb 11 2014, 05:54:25) [MSC import tkinter Traceback ... import _tkinter ImportError: DLL load failed: %1 is not a valid Win32 application. So tkinter, Idle, turtle fail and the corresponding tests get skipped. 32 bit and 64 bit both work for me. Windows 7. -- https://mail.python.org/mailman/listinfo/python-list
Re: Editor for Python
On Thu, Jan 9, 2014 at 10:50 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: - Original Message - On Jan 8, 2014, at 10:53 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I tried to negotiate this with my IT guys, but it looks like it's now mandatory, something related to being in the USA stock market. Yeah, when in doubt blame the Americans. Sorry if I hurt your feelings, have a look at http://www.sarbanes-oxley-101.com/ You didn't. I was just having fun. However, I couldn't find anything at that site which referred to email disclaimers. It seems to me that this sort of thing has gone out of style. It was more common ten years ago. However, I won't waste any more time arguing the point. I don't blame anyone, would I be blaming the law, that wouldn't imply the americans anyway. cheers, JM -- https://mail.python.org/mailman/listinfo/python-list
Re: Editor for Python
On Jan 8, 2014, at 10:53 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: -- IMPORTANT NOTICE: too late you have sent this to a public forum No pb with that, the python list is the intended recipient :) I tried to negotiate this with my IT guys, but it looks like it's now mandatory, something related to being in the USA stock market. Yeah, when in doubt blame the Americans. I have no way to remove it, it's added by the email server. I apologise for the noise. Maybe you should try Google Groups. -- https://mail.python.org/mailman/listinfo/python-list
Re: Bytes indexing returns an int
treating bytes as chars considered harmful? I don't know the answer to your question but the behavior seems right to me. Python 3 grudgingly allows the abomination of byte strings (is that what they're called? I haven't fully embraced Python3 yet). If you want a substring you use a slice. b = b'xyz' b[1:2] = b'y' also, chr(121) = 'y' which is really what the Python 3 gods prefer. On Tue, Jan 7, 2014 at 6:13 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Does anyone know what the rationale behind making byte-string indexing return an int rather than a byte-string of length one? That is, given b = b'xyz', b[1] returns 121 rather than b'y'. This is especially surprising when one considers that it's easy to extract the ordinal value of a byte: ord(b'y') = 121 -- Steven -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Bytes indexing returns an int
Sorry for top-posting. I thought I'd mastered gmail. -- https://mail.python.org/mailman/listinfo/python-list
Re: Wrapping around a list in Python.
On Mon, Dec 16, 2013 at 12:26 AM, shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4 elements of the array under such a condition? I assume you mean 'list' rather than 'array'. If all you want to do is 'display' the last 4 elements: big_list = [0,1,2,3,4,5,6,7,8,9] last4 = big_list[-4:] print(last4) -- https://mail.python.org/mailman/listinfo/python-list
Re: Installing Python from sources with all the modules
On Mon, Dec 16, 2013 at 8:55 PM, shankha shankhabaner...@gmail.com wrote: Hi, I am trying to install Python 3.3 from the latest sources on linux. After the installation when I try to run the following I get a error: ./python Python 3.3.3 (default, Dec 16 2013, 18:28:25) [GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux Type help, copyright, credits or license for more information. import ssl Traceback (most recent call last): File stdin, line 1, in module File /home/shankha/Python-git/Python3-3/Python-3.3.3/Lib/ssl.py, line 60, in module import _ssl # if we can't import it, let the error propagate ImportError: No module named '_ssl' Is there a way while installing from sources I enable all modules to be installed. You need to install the openssl development package. I don't know how you do that on Red Hat. Don't use it myself. There will probably be other missing modules for which you will have to install prerequisites for. Once you do that they should build automatically when you rebuild. -- https://mail.python.org/mailman/listinfo/python-list
Re: Problem when applying Patch from issue1424152 to get https over authenticating proxies working with urllib2 in Python 2.5
On Tue, Dec 10, 2013 at 11:59 AM, ru...@yahoo.com wrote: On 12/10/2013 09:22 AM, Mark Lawrence wrote: ... Mark is one of the resident trolls here. Among his other traits is his delusion that he is Lord High Commander of this list. Like with other trolls, the best advice is to ignore him (which I'm not doing this once as a public service). Please don't do this. I can decide for myself whether I prefer to read Mark's posts. [By the way, I don't consider Mark Lawrence a troll. He's just a guy who can't help himself. I've chosen not to listen any more but others are entitled to their own choices.]+ -- https://mail.python.org/mailman/listinfo/python-list
Re: Automation
On Mon, Nov 18, 2013 at 11:49 AM, Grant Edwards invalid@invalid.invalid wrote: ... I don't make those mistakes typing on a phone (where I have to actually think about the act of typing), but I do make them with a regular keyboard, where I don't have to think about mechanics of typing the words. OTOH, maybe that's just me... It's me too. I certainly know the difference between 'there' and 'their', etc. but that fact is not always reflected in my typing. -- https://mail.python.org/mailman/listinfo/python-list
Re: What's wrong with Windows Command Prompt (was Re: Error Testing)
On Sat, Oct 19, 2013 at 4:35 PM, Terry Reedy tjre...@udel.edu wrote: On 10/19/2013 2:31 PM, Tim Chase wrote: On 2013-10-19 14:08, David Robinow wrote: On Sat, Oct 19, 2013 at 9:01 AM, Chris Angelico wrote: You can try all these out in the interactive interpreter (you probably have IDLE installed, which on Windows is rather nicer to work with than the default interactive mode). IDLE is cross-platform. Could you explain why you say on Windows? ... [Description of idle vs. Command Prompt] Not quite what I was trying to ask. I'm well aware that Idle has features that the Python interpreter on Windows doesn't. Idle also has features that the unix variants doesn't. I don't use my Ubuntu much so I'm somewhat ignorant, but I wasn't aware that the interactive interpreter on Linux had features that the Windows version didn't. I'm curious what those features might be. -- https://mail.python.org/mailman/listinfo/python-list
Re: Error Testing
On Sat, Oct 19, 2013 at 9:01 AM, Chris Angelico ros...@gmail.com wrote: You can try all these out in the interactive interpreter (you probably have IDLE installed, which on Windows is rather nicer to work with than the default interactive mode). IDLE is cross-platform. Could you explain why you say on Windows? -- https://mail.python.org/mailman/listinfo/python-list
Re: LibreOffice
On Fri, Aug 2, 2013 at 9:26 PM, Terry Reedy tjre...@udel.edu wrote: ... Of relevance to this list, Libre Office upgraded the included Python interpreter to 3.3. I have no idea whether OO is still using 2.3 or also updated. They're up to 2.7 now. -- http://mail.python.org/mailman/listinfo/python-list
Re: embedded python and threading
Works for me. Except that if I then do: touch time.py I get the same error as you do. Can you figure out the problem now? On Fri, Jul 26, 2013 at 11:57 AM, David M. Cotter m...@davecotter.com wrote: okay, i have simplified it: here is the code == import time def main(): while True: print i'm alive time.sleep(0.25) #- if __name__ == __main__: main() == the new error is: == 9: Traceback (most recent call last): 9: File string, line 10, in ? 9: File string, line 6, in main 9: AttributeError: 'builtin_function_or_method' object has no attribute 'sleep' == -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Issues compiling hunspell from source on windows
It appears you are using a 32 bit compiler with a 64-bit python. Install a 32 bit python. On Sun, Jun 30, 2013 at 11:54 AM, Akshay Kayastha akshay.k...@gmail.com wrote: Hi I am trying to compile a python module called hunspell from the following [source](https://pypi.python.org/pypi/hunspell). But I get the following error message. C:\Users\KURO\Desktop\hunspell-0.1setup.py install running install running build running build_ext building 'hunspell' extension C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_LINUX -I/usr/include/hunspell -IC:\Python27\include -IC:\Python27\PC -c hunspell.c -o build\temp.win-amd64-2. 7\Release\hunspell.o -Wall writing build\temp.win-amd64-2.7\Release\hunspell.def C:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win-amd64-2.7\Release\hun spell.o build\temp.win-amd64-2.7\Release\hunspell.def -LC:\Python27\libs -LC:\Py thon27\PCbuild\amd64 -lhunspell-1.2 -lpython27 -lmsvcr90 -o build\lib.win-amd64- 2.7\hunspell.pyd c:/mingw/bin/../lib/gcc/mingw32/4.3.3/../../../../mingw32/bin/ld.exe: cannot fin d -lhunspell-1.2 collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 I tried downloading libhunspell-1.2-0.dll and put it into my system. But I still get the same error message. How do I deal with this? I have Windows 7 and [mingw](http://www.develer.com/oss/GccWinBinaries) -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Include and lib files for Visual Studio?
On Sat, Apr 20, 2013 at 4:59 PM, xuc...@gmail.com wrote: I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like to use python 3.3.1 if possible. I found the msi on python.org but is says they don't include source. I am assuming there is a dev sdk or something similar but can't seem to find it. You are misinterpreting what you are reading. Install the msi. Look in C:\Python33\include and C:\Python33\libs -- http://mail.python.org/mailman/listinfo/python-list
Re: equivalent to C pointer
On Thu, Apr 18, 2013 at 1:06 PM, abdelkader belahcene abelahc...@gmail.comwrote: Hi everybody, I am new to python and I am discovering it. I know C well, and want to know if python knows how to manage Pointers like pointer to function here is a C example how to write it in python Intergration with trapeze method When we write Trapeze ( at the compilation level) we don't know which functions Fonc to handle. Here for example we use sin and a user defined F1 The program is attached too #include stdio.h #include math.h double F1 (double x){ return x*x; } double Trapeze(double Fonc(double ), double left, double right, double step){ double X1, X0, Y0, Y1, Z = 0; for(X0=left; X0 right ; X0 = X0 + step) { X1 = X0 + step; Y1 = Fonc(X1);Y0 = Fonc(X0); Z += (Y1 + Y0) * step * 0.5; } return Z; } int main(){ double y; y=Trapeze(sin, -2.5, 3.2, 0.1); printf(\n\tValue for sin is : \t %8.3lf , y); y=Trapeze(F1, 0, 3, 0.1); printf(\n\tValue for F1 is : \t %8.3lf , y); return 0; } /** Value for sin is : 0.197 Value for F1 is : 9.005 */ Python doesn't have pointers, but don't let that bother you. A python version is actually a lot simpler. See below (I didn't bother with getting the print formats just right) -- import math def F1(x): return x*x def Trapeze(f, left, right, step): X0 = left Z = 0.0 while (X0 right): X1 = X0 + step Y1 = f(X1) Y0 = f(X0) Z += (Y1 + Y0) * step * 0.5 X0 = X1 return Z def main(): y = Trapeze(math.sin, -2.5, 3.2, 0.1) print(Value for sin is:{0} .format(y)) y = Trapeze(F1, 0, 3, 0.1) print(Value for F1 is {0} .format(y)) if __name__ == __main__: main() -- http://mail.python.org/mailman/listinfo/python-list
Re: equivalent to C pointer
On Thu, Apr 18, 2013 at 1:50 PM, abdelkader belahcene abelahc...@gmail.comwrote: Thanks for answer, but with C we can compile the trapeze function and put it in librairy, If we try to save the trapeze alone in package to import it later, I think, I am not sure it will be refused because F1 and sin are not define !!! this is the power of the C pointers !!! the link is dynamic You don't need C pointers. The design below is demonstrative, not ideal. # file MyFuncs.py def F1(x): return x*x def Trapeze(f, left, right, step): X0 = left Z = 0.0 while (X0 right): X1 = X0 + step Y1 = f(X1) Y0 = f(X0) Z += (Y1 + Y0) * step * 0.5 X0 = X1 return Z # file UseMyFuncs.py import math import MyFuncs def main(): y = MyFuncs.Trapeze(math.sin, -2.5, 3.2, 0.1) print(Value for sin is:{0} .format(y)) y = MyFuncs.Trapeze(MyFuncs.F1, 0, 3, 0.1) print(Value for F1 is {0} .format(y)) if __name__ == __main__: main() ### #python3 UseMyFuncs.py ### -- http://mail.python.org/mailman/listinfo/python-list
Re: Interactrive Python under Cygwin in Win7
On Mon, Apr 8, 2013 at 11:20 AM, Grant Edwards invalid@invalid.invalidwrote: I just installed ActiveState 2.7 64-bit on a Windows 7 machine running a current version of Cygwin. While python programs (both GUI and text-mode) run fine, I'm unable to use Python interactively from either the Cygwin terminal or in an ssh session. I tried adding the -u option, but that makes no difference. Interactive C-Python just hangs on startup. Is this bug specific to ActiveState Python, or is it also present in the vanilla C-Python build for Windows? It's present in the vanilla build. I assume you're running mintty as I do. I just use the cygwin build for fooling around with python, and [WARNING: hold your nose] the cmd shell when I need Windows Python. You can also use the (old-fashioned?) cygwin.bat do start cygwin which doesn't give you as nice a terminal but does allow you to run bash and /c/Python27/Python interactively. Another option, which I just discovered, is bash under msys. It's been a while since I've used it so I can't remember the pro and con but you can run an interactive Windows python. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help installing latest PyQT
On Tue, Apr 2, 2013 at 11:39 AM, D. Xenakis gouzouna...@hotmail.com wrote: Hi there im trying to install PyQT (version PyQt4-4.10-gpl-Py3.3-Qt5.0.1-x64-2.exe) but i dont know how to make sure i have installed everything correctly. I tried to find documentation about this but most links were very dead.. So far so good.. i have: 1)Downloaded and installed Python 3.3.0 Windows X86-64 MSI Installer from http://www.python.org/download/ , here: C:\Python33 (i have 64 bit Win7 pro Greek edition) 2)Downloaded and unzipped sip-4.14.5.zip from http://www.riverbankcomputing.com/software/sip/download , here: D:\Downloads\sip-4.14.5 (other than that, haven't played with this folder any further, cause i dont know what exactly i should do with that so everything is get properly done..) I suppose after having it unzipped, i should then move that somewhere (maybe here C:\Python33) and then maybe run some commands but.. help needed here so i dont do something wrong, as this link http://goo.gl/UuLjz doesnt make that clear to me what exact steps i should follow :( . sip is not required unless you're building PyQt from sources. You don't need to do anything with this. 3)Downloaded and installed PyQt4-4.10-gpl-Py3.3-Qt5.0.1-x64-2.exe from http://www.riverbankcomputing.com/software/pyqt/download , here: C:\Python33 (It was the setup's default choice so i assumed it was also the right one). Yes. And thats it.. What should i do exactly now foks :) You should be done.Start an interactive python and enter: import PyQt4 If there's no traceback you're good to go. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python install Win 7 Problem
On Mon, Apr 1, 2013 at 9:02 PM, Joe Hill j...@nospamever.com wrote: ... In a Windows 7 environment (even a 64-bit Windows 7 environment), you must install the 32-bit version of Python 3. The 64-bit version will not work with NumPy 1.6. 1.7 is the current version. I use 32-bit Python myself. Furthermore, the 32-bit version of Python 3 must be installed 'just for me', and not 'for everyone on this computer'. Nonsense. Finally, make sure you select the proper NumPy version (for Python 3.2), not the default version from SourceForge (which is for Python 2.6). Use http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/numpy-1.7.0-win32-superpack-python3.2.exe/download In this post I'm assuming you have already installed Python 3 and that you're running Windows 7. Specifically, I'm running Windows 7 Professional, 64-bit, Service Pack 1. What follows is the whole story of the troubleshooting, in case it helps out anyone else having the same issues. etc. I'm running Windows 7 Home Premium http://docs.python.org/3.2/install/ More alternatives than an encyclopedia! See no reference to Win 7. This is NO help I'm not aware of any peculiarities due to use of Win 7 (except it's not Linux) http://www.python.org/getit/releases/3.2.3/ got Gzipped source tar ball (3.2.3) (sig), ~ 13 MB which was a file: Python-3.2.3.tgz Download the Windows executables. ... I'm a total novice - my last program writing was 35+ years ago. My reason for wanting Python is purely for fun an recreation. I used to just love code writing. Questions: 1. is 3.2.3 the correct version for me? On April 6 I see that additional releases will become available. I see value in having the latest stable programs. Is any of this for me - I can wait 5 days? 3.3.0 is the current version 2. Would it make sense to install Python on the D: drive or will that just further confuse matters? It shouldn't hurt anything but why would you want to? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python install Win 7 Problem
On Tue, Apr 2, 2013 at 12:45 PM, Joe Hill j...@nospamever.com wrote: On Tue, 2 Apr 2013 11:44:55 -0400, David Robinow drobi...@gmail.com Download the Windows executables. 3.3.0 is the current version Is numpy an option that is needed (guess for math?)? No, it's not needed to run Python. It can be useful. I only mentioned it because you did. Assuming 3.3 the current version - what are the Download the Windows executables. files? and in which order must they be installed? The 32 bit version is at http://www.python.org/ftp/python/3.3.0/python-3.3.0.msi The 64 bit version is at http://www.python.org/ftp/python/3.3.0/python-3.3.0.amd64.msi Install one or the other. That's it. If you want to install numpy, do it after you install python. [The suggestion to install the Activestate version is reasonable. I've never used it. Please use a search engine if you decide to look for it.] I never claimed to be a mind reader grin. -- http://mail.python.org/mailman/listinfo/python-list
Re: ISO deprecates ASCII Horizontal Tab control character
If only On Mon, Apr 1, 2013 at 3:10 PM, f...@thefsb.org wrote: The subcommittee of ISO Joint Technical Committee 1 that is responsible for coded character sets has deprecated the Horizontal Tab control character in an approved revision of ISO/IEC 646 to be published in the next few months. The days of HT's usefulness in printer control are long gone, said Dr. Yishoki Makimi, chair of the subcommittee. Today tabs are only used in software source code. Our research revealed they serve no function in software engineering other than to provoke arguments and therefore waste time. We measured that HTs accumulated economic cost surpassed that of big vs. little-endian byte order in 2007 and started the committee work to deprecate it shortly after that. The width of a horizontal tab was originally adjustable in printer mechanism and was never standardized. Its subsequent use for indentation of instructions in the source code of block-oriented languages was economical when computer storage was expensive. Eventually many programmers adopted spaces leading to the contraversy that motivated the subcommittee. Microsoft has responded to ISO's move by announcing that HT will contunue be supported in Windows through Version 8, after which the code point will be repurposed for the Windows Key. Hillary Jeremy, Microsoft's code quality and standards boss, welcomed the move saying, We've probably spent more time, over the years, fighting over tabs than we have spent fixing bugs in Office. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Differentiation in Python
On Thu, Mar 28, 2013 at 8:17 AM, zingbagbam...@gmail.com wrote: How do I differentiate(first order and 2nd order) the following equations in python. I want to differentiate C wrt Q. C = (Q**3)-15*(Q**2)+ 93*Q + 100 Years ago, when I actually worked for a living, I would have done something like this: coeffs = [1, -15, 93, 100] num_coeffs = len(coeffs)-1 deriv = [coeffs[i]*(num_coeffs-i) for i in range(num_coeffs)] print(deriv) The above is somewhat obscure and requires one to add some documentation. Who wants to do that? Below is a version using numpy. You get the numpy docs for free. import numpy as np p = np.poly1d(coeffs) deriv_np = np.polyder(p) print(deriv_np) # or print(list(deriv_np)) -- http://mail.python.org/mailman/listinfo/python-list
Re: Windows Deployment Of Python Modules
On Thu, Mar 21, 2013 at 6:23 PM, Adam Tauno Williams awill...@whitemice.org wrote: David Robinow drobi...@gmail.com wrote: On Thu, Mar 21, 2013 at 4:14 PM, Adam Tauno Williams awill...@whitemice.org wrote: Python itself is easy to deploy on Windows; just toss the MSI in your local update server and away it goes. That's slick; LSUS is awesome. http://www.localupdatepublisher.com/ But that gives you Python with no pip, easy_install, etc... And *that* is not packaged appropriately. Is there some trick to getting modules installed on Windows workstations en masse [in an automated fashion]? It seems like I must be missing something. For example, I want Python installed, and the iniparse module. python setup.py install Am I missing something? Yes! That does not get the package to the workstation. It also is not conducive to automation (or success auditing). OK, I have no idea what you're talking about. Clearly you want something more than installing packages. -- http://mail.python.org/mailman/listinfo/python-list
Re: Global NameError Fix?
On Thu, Mar 21, 2013 at 7:43 PM, maiden129 sengokubasarafe...@gmail.com wrote: Hello, I'm using the version 3.2.3 of Python and I am having an issue in my program and I don't know how to fix it: counterLabel[text] = str(counter) NameError: global name 'counterLabel' is not defined Here is my program: from tkinter import * class CounterButton(Button): def __init__(self, window): super(CounterButton,self).__init__(window, text = 0, command=self.startCounter) def startCounter(self): counter = int(self[text]) counter +=1 counterLabel[text] = str(counter) This should be: self[text] = str(counter) window = Tk() window.title(counter) ... -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python-ideas] string.format() default variable assignment
Ignoring my own posting ban, since I've clearly been misunderstood .. On Sat, Mar 2, 2013 at 10:21 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 02 Mar 2013 21:11:04 -0500, David Robinow wrote: Do you consider it rude that you choose to use a newsreader, thus inconveniencing those of us who use the mailing list, as God intended. How the flying fuck does my choice of where and how *I* read this forum inconvenience YOU? Talk about an overactive sense of entitlement. The world does not revolve around you and I do not arrange my day to suit your preferences. This surprises me. Not the language but the content, since the inconvenience was explicitly discussed. Many list members use gmail. It works for me. I never see double posts. gmail knows not to do that. The lack of a reply to list option would not concern me if everybody else used gmail. I could just use reply all, nobody would see double posts, and we're all happy. However, some people prefer to read comp.lang.python. Thus if I use what is most convenient me, the news users see double posts. To avoid being thought rude (please note that many people are, or 'were' in the case of python-list, unaware of this issue and should be classified as ignorant rather than rude) I need to, after clicking Reply All Move mouse to CC: area. Highlight python-list address C-x (i.e., CUT) Move mouse to TO: area. Highlight the address (of the poster to whom I am replying) C-v (i.e., PASTE) Is that horribly difficult? No, and I intend to do it in the future. I'm mostly a lurker anyway (I knew python better 10 years ago when I was still working - inactivity and advanced age have made me dumber. I mostly read python-list for recreation) so it's not a big deal. I might be annoyed if I posted more. But here's what I don't understand. Why does somebody who posts as much as Steven (and thanks for that. Getting cussed at occasionally is a cheap price for all the free advice) not set up a simple mail filter which trashes all mail from python-list. Wouldn't that solve the problem? Or am I misunderstanding something? -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python-ideas] string.format() default variable assignment
Crap. I just forgot to do what I just said I would do and didn't go through my inconvenient sequence. Sorry, Steven. It was unintentional. -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python-ideas] string.format() default variable assignment
On Sat, Mar 2, 2013 at 7:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 02 Mar 2013 09:53:47 -0500, Devin Jeanpierre wrote: On Sat, Mar 2, 2013 at 1:54 AM, Chris Angelico ros...@gmail.com wrote: Yes, but reply-all sends a copy to the poster as well as the list. What I want is reply-list, acknowledging the list headers... and Gmail simply doesn't have that. I've been replying to the poster and the list for ages. Is it bad netiquette? I find it annoying, and yes I consider it rude. When we receive messages ... Do you consider it rude that you choose to use a newsreader, thus inconveniencing those of us who use the mailing list, as God intended. (I honestly can't remember if there's any advantage to News, not having used it this century) [Going out of my way to respond only to the list] -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python-ideas] string.format() default variable assignment
On Sat, Mar 2, 2013 at 9:15 PM, Roy Smith r...@panix.com wrote: In article mailman.2806.1362276667.2939.python-l...@python.org, David Robinow drobi...@gmail.com wrote: On Sat, Mar 2, 2013 at 7:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 02 Mar 2013 09:53:47 -0500, Devin Jeanpierre wrote: On Sat, Mar 2, 2013 at 1:54 AM, Chris Angelico ros...@gmail.com wrote: Yes, but reply-all sends a copy to the poster as well as the list. What I want is reply-list, acknowledging the list headers... and Gmail simply doesn't have that. I've been replying to the poster and the list for ages. Is it bad netiquette? I find it annoying, and yes I consider it rude. When we receive messages ... Do you consider it rude that you choose to use a newsreader, thus inconveniencing those of us who use the mailing list, as God intended. (I honestly can't remember if there's any advantage to News, not having used it this century) [Going out of my way to respond only to the list] There's a number of advantages to news vs. mail. The biggest is that news spools generally keep a long history around, so it's easy to go back and review a long thread. That can't be the biggest since mail stays around forever unless deliberately deleted. -- http://mail.python.org/mailman/listinfo/python-list
Re: [Python-ideas] string.format() default variable assignment
On Sat, Mar 2, 2013 at 10:06 PM, Chris Angelico ros...@gmail.com wrote: On Sun, Mar 3, 2013 at 2:01 PM, David Robinow drobi...@gmail.com wrote: On Sat, Mar 2, 2013 at 9:15 PM, Roy Smith r...@panix.com wrote: There's a number of advantages to news vs. mail. The biggest is that news spools generally keep a long history around, so it's easy to go back and review a long thread. That can't be the biggest since mail stays around forever unless deliberately deleted. But your mail has only what you receive. You have to hunt down a separate archive of what was posted before you joined the thread. Advantage goes to news, but a slight one, and if that's the biggest, it's not a great advertisement. I have no idea what you're trying to say here. As far as I know, when I subscribe to a list I get all the mail. I don't join threads. I don't even know what that means. [This has drifted way off topic so I won't be responding again, but I'll enjoy reading what anyone cares to write.] -- http://mail.python.org/mailman/listinfo/python-list
Re: Shebang line on Windows?
On Mon, Feb 25, 2013 at 12:29 PM, D'Arcy J.M. Cain da...@druid.net wrote: ... I don't run Windows myself so I can't test it but doesn't Python on Windows work fine with Unix style EOL? So why not strip out the CR and run the same file everywhere? That's the ideal solution, but so many Windows tools default to text mode that it's easy to create the wrong type file, especially for beginners who are moving there code to Linux for the first time. I've done it myself, even though I should no better by now. In addition, the error message is rather obscure (if I remember right - I'm not near my Ubuntu at the moment and Cygwin handles this fine, as it should) I'm afraid this problem won't go away. People are just going to have to learn from experience. -- http://mail.python.org/mailman/listinfo/python-list
Re: python on windows
On Sat, Feb 16, 2013 at 4:40 PM, babatunde akerele babs...@gmail.com wrote: hello, i'm having problem coding and running python on my pc...i just started learning python last month in codeacademy.com but i've not been able to code offline 'cos i don't knw how to go abt installing the compiler and all that. Any help please? Download the Python 3.3 installer from http://www.python.org/download/ and run it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Howto parse a string using a char in python
On Fri, Feb 15, 2013 at 6:04 PM, Steve Goodwin sgood...@cfl.rr.com wrote: Hi, I am looking for the python2.7 function(s) to parse a string from a colon character : Sounds simple enough. For example, a string like 123456:789. I just need the 123456 substring.(left of the :) 123456:789.split(:)[0] -- http://mail.python.org/mailman/listinfo/python-list
Re: Statistics...help with numpy/scipy install
On Sun, Feb 10, 2013 at 1:14 PM, Michael Torrie torr...@gmail.com wrote: On 02/10/2013 10:35 AM, Rex Macey wrote: A casual google search seems to indicate that for now, SciPy and NumPy are for Python 2.x (2.7 is the latest). I could be wrong though and often am. I know a number of popular and useful packages are not yet available on Python 3. My casual google search finds www.numpy.org as the first entry. Clicking on the download link, one can find numpy 1.7.0 for Python 3.3 In all fairness, this was just released a few hours and is the first official version supporting 3.3 However, numpy 1.6.2 did support 3.2 There's not yet a Scipy release supporting 3.3 so the OP may wish to downgrade to Python3.2 If you need to do a lot math stuff, there's a complete python system that bundles a lot of these tools together into a nice package. It's called Sage. http://www.sagemath.org/ Sage doesn't run natively on Windows. Not necessarily a problem but should be mentioned. -- http://mail.python.org/mailman/listinfo/python-list
Re: Statistics...help with numpy/scipy install
On Sun, Feb 10, 2013 at 5:14 PM, Rex Macey xer0...@hotmail.com wrote: I should have added that the setup gives an error window Cannot install Python version 3.3 required, which was not found in the registry. I'm guessing that you installed a 64-bit python and are using a 32-bit numpy. -- http://mail.python.org/mailman/listinfo/python-list
Re: Plz Suggest... How can i install the pure python package py-bidi in WIndows.
On Sat, Dec 22, 2012 at 9:10 AM, Arsalan Khan m.arsi.k...@gmail.com wrote: I tried installing but it gives error.. Can anyone guide the procedure of configuring/Installing a python package in windows ??? What did you do to try to install? What error(s) did you get? Where can I find this package if I want to help you? What version of Windows are you using. Sometimes it matters. Does the package support Windows at all? Some packages don't. What version of Python are you running? A number of packages don't yet support Python3 -- http://mail.python.org/mailman/listinfo/python-list
Re: I need help installing pypng in Python 3.3
On Mon, Oct 29, 2012 at 8:23 AM, ic...@tagyourself.com wrote: Hello all, I am very new to python. I am currently porting a little project of mine from java to python and I need to be able to construct and write png images. I naturally turned myself toward pypng to accomplish this. I learned from the net that pypng 0.0.13 is supposed to work in Python 3.x when run through '2to3'. However, in my case, it apparently does not. You haven't shown that. I ran into various problems when trying to install it, some of them I could fix myself. First I attempted to install pip but I couldn't get Windows to recognize pip as an internal command as the prompt informs me. No, it's not an internal command, but you don't need that. I'm assuming your python is installed under C:\Python33. If not, adjust as needed. Try: C:\Python33\Scripts\pip install pypng [You didn't say what you did to install pip so I don't know if pip.exe actually exists in C:\Python33\Scripts] Then I tried to directly run setup.py install from the pypng folder. It didn't work as I got a syntax error. I noticed that in the beginning of the installation process, the following warning was displayed: conf[use_2to3 = true] unrecognized configuration option The following works for me: C:\Python33\python setup.py install At that point I was already pretty pissed but I managed to make the warning disappear by updating (installing?) distribute. After that there are no more errors during the installation process and everything seems to work fine. (This seems still strange to me as 2to3 was present in Tools/Script out of the box) It's not clear what you did here. setup.py should run 2to3 for you. What command did you use to successfully? install it? I use pydev in Eclipse and pydev reports several error in png.py anytime I want to import or use it. When trying to import from IDLE I get: except ValueError, e: ^ Syntax error, line 1863 It's clear that the install process didn't run 2to3. that paricular error I was able to fix by changing it to except ValueError as e: but I don't understand why 2to3 didn't do it automatically. 2to3 does do it automatically. There are several more errors reported by pydev, here are a few: line 1368 : raise ValueError('Chunk %s too short for checksum.', tag) Undefined variable: tag Looking at the code, this appears to be a bug. line 2736 : rows = [map(numpy.uint16, range(0,0x1,0x))] Undefined variable from import: uint16 The second one made me suspect I needed to install numpy too. As there are no installers for numpy aimed toward Python3.3. A few lines above there's a try/except for importing numpy. It should skip this test if numpy is not available. I'm not sure how you were able to execute that line [unless you've got a stray numpy.py file somewhere somewhere] I decided to install Python2.7 and retry the whole process. Unfortunately I didn't get much more success. I get the exact same errors in pydev when using the 2.7 version of the interpreter and I cannot install numpy either because when I run the .exe file aimed toward Python 2.7 i get the error message: Python version 2.7 required, which was not found in the registry I then have the option to manually enter the path to Python 2.7 but the textform is greyed out and I can't type in anything. Do you have the file c:\Python33\Lib\site-packages\pypng-0.0.13-py3.3.egg ? If not, you have not successfully installed pypng. Please try one of the methods I gave above. -- http://mail.python.org/mailman/listinfo/python-list
Re: SSH Connection with Python
On Sun, Oct 28, 2012 at 4:09 PM, Gelonida N gelon...@gmail.com wrote: The only thing I'm concerned about paramiko is, that I don't see any activity on the paramiko site and that one library it depends on is not available is windows binary package for newer versions of python. I don't understand why this is a problem. \python27\python setup.py install #for pycrypto paramiko \python27\python test.py # for paramiko Works for me. Of course, you need Visual C++ 2008, but the free express edition is sufficient, and you should have that anyway if you're doing Windows development. If that's too hard for you, try http://www.serenethinking.com/bitlift/download.html [not my site, no guarantees] -- http://mail.python.org/mailman/listinfo/python-list
Re: A desperate lunge for on-topic-ness
On Sat, Oct 20, 2012 at 3:10 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sat, 20 Oct 2012 14:18:47 + (UTC), Grant Edwards invalid@invalid.invalid declaimed the following in gmane.comp.python.general: True, but nobody prints source code out on paper do they? Seriously -- I can't remember the last time I printed souce code... Well, having been unemployed for a year, I can't speak much of recent practice... But I did tend to run up listings when I had to take over maintenance of some programs and needed to become familiar with the overall code base... Same here. I've been unemployed (retired!) 6 years, but I'd occasionally print code written by someone else, never anything of my own. -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Wed, Oct 17, 2012 at 1:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote: return len(w) != len(w_decomposed) is all you need. Thanks for helping, but I already knew that. -- http://mail.python.org/mailman/listinfo/python-list
Re: Coexistence of Python 2.x and 3.x on same OS
On Sun, Sep 30, 2012 at 11:55 PM, Dave Angel d...@davea.name wrote: The problem with that is that one has to already being using 3.3 to use this facility. I was hoping for a solution which was backwards compatible with Python 2.x. ... That does not solve the problem for Python 2.x distributions. If you read the Pep, it says the launcher will work for both 2.x and 3.x http://www.python.org/dev/peps/pep-0397/ http://www.python.org/dev/peps/pep-0397/ I've read that elsewhere, but I can't see just where you would get the necessary modules to run it with 2.x Possibly you'd have to build it from sources, as there are Windows binaries that get installed to the C:\Windows directory. I'm not sure what you're getting at here. The solution is to install Python 3.3, which provides the launcher. It works with Python 2.x. Is there some reason not to install 3.3? -- http://mail.python.org/mailman/listinfo/python-list
Re: Stop feeding the trolls (Was: which a is used?)
On Tue, Sep 25, 2012 at 9:53 AM, D'Arcy Cain da...@druid.net wrote: ... Now if only people would stop feeding the troll, those of us who have already *plonked* him can stop seeing his ramblings in the responses. I'm hating myself for jumping in to this nonsense, but ... +1 -- http://mail.python.org/mailman/listinfo/python-list
Re: Filter versus comprehension (was Re: something about split()???)
On Fri, Aug 24, 2012 at 3:03 PM, Walter Hurry walterhu...@lavabit.com wrote: On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: It appears to be a change Google made in the last month or two... My hypothesis is that they are replacing hard EOL found in inbound NNTP with an HTML p, and then on outgoing replacing the p with a pair of NNTP line endings. In contrast, text composed on Google is coming in as long single lines (since quoting said text in a response produces on a at the start of the paragraph. Google Groups sucks. These are computer literate people here. Why don't they just use a proper newsreader? I haven't used a newsreader in over a decade. I'm quite happy with a mailing list. Am I missing something? -- http://mail.python.org/mailman/listinfo/python-list
Re: Converting a list of strings into a list of integers?
On Sun, Jul 22, 2012 at 12:20 PM, Jan Riechers janpet...@freenet.de wrote: On 22.07.2012 18:39, Alister wrote: looks like a classic list comprehension to me and can be achieved in a single line MODUS_LIST=[int(x) for x in options.modus_list] Hi, I am not sure why everyone is using the for-iterator option over a map, but I would do it like that: MODUS_LIST= map(int, options.modus_list) map works on a list and does commandX (here int conversion, use str for string.. et cetera) on sequenceY, returning a sequence. More in the help file. And if I'm not completely mistaken, it's also the quicker way to do performance wise. But I can't completely recall the exact reason. Because if you don't have a functional background 'map' is unfamiliar. Although I've been aware of it for years I still can't remember if it's map(int, list) or map(list,int) and although with a small effort I could force it into my brain, I know that many of the people reading my code are as ignorant as I am. The list comprehension seems clearer to me. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Interview Questions
On Tue, Jul 10, 2012 at 1:02 PM, Ethan Furman et...@stoneleaf.us wrote: ... Reminds me of a job posting a few years ago where the prospective employer wanted three plus years experience in some language, and that language had only been created a year and a half before. I saw several of those when Java was new. -- http://mail.python.org/mailman/listinfo/python-list
Re: usenet reading
On Sat, May 26, 2012 at 11:43 AM, Roy Smith r...@panix.com wrote: I use panix.com. For $100/year, I get mail, news, and unix shell access. By some measures, it's an expensive way to get mail access, but I'd much rather give Panix $100 than take advantage of any of the free mail services who does who-knows-what with my mail. Not to mention that I get access to such private newsgroups as panix.nytel.abuse. I'm happy enough with several of the free services and haven't used news in over a decade, but if it works for you, great. I'm curious, though, what makes you think that panix.com protects your privacy more than yahoo, google, or AOL? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Gotcha's?
On Sun, Apr 15, 2012 at 4:01 PM, Bryan bryanjugglercryptograp...@yahoo.com wrote: On Windows the file extension determines what executable opens the file. Running both Python 2 and Python 3 on Windows is painful where it doesn't need to be. I'd like to encourage my users to check out Python 3, but installing it on Windows will take over the '.py' extension and break stuff that currently works. Hire a qualified Windows specialist. Tell him to type: FTYPE Python.File=C:\Python27\python.exe :%1: %* Pay him $200.00 -- http://mail.python.org/mailman/listinfo/python-list
Re: f python?
On Sun, Apr 8, 2012 at 6:55 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: The main reason, as I recall, for the command line using \ for file paths is that it inherited / as command OPTION prefix from CP/M; MS-DOS being a 32-bit work-alike for CP/M in the first generation. I also thought it was because Bill Gates used a PDP-11 in high school and DEC used the / as command OPTION I found out later that Gates purchased DOS rather than wrote it, so this story may be erroneous. Nevertheless, at the time, DEC was way bigger than ATT (in computers) and the choice really wasn't surprising. -- http://mail.python.org/mailman/listinfo/python-list
Re: Number of languages known [was Re: Python is readable] - somewhat OT
On Sat, Mar 31, 2012 at 4:13 PM, Tim Rowe digi...@gmail.com wrote: I know 10 languages. But I'm not telling you what base that number is :) The fact that you know there are bases other than 10 puts you in the top half of the candidates already! -- http://mail.python.org/mailman/listinfo/python-list
Re: errors building python 2.7.3
On Thu, Mar 29, 2012 at 6:55 AM, Alexey Luchko l...@ank-sia.com wrote: On 28.03.2012 18:42, David Robinow wrote: On Wed, Mar 28, 2012 at 7:50 AM, Alexey Luchkol...@ank-sia.com wrote: I've tried to build Python 2.7.3rc2 on cygwin and got the following errors: $ CFLAGS=-I/usr/include/ncursesw/ CPPFLAGS=-I/usr/include/ncursesw/ ./configure I haven't tried 2.7.3 yet, so I'll describe my experience with 2.7.2 I use /usr/include/ncurses rather than /usr/include/ncursesw I don't remember what the difference is but ncurses seems to work. I've tried ncurses too. It does not matter. Have you included the patch to Include/py_curses.h ? If you don't know what that is, download the cygwin src package for Python-2.6 and look at the patches. Not all of them are still necessary for 2.7 but some are. -- http://mail.python.org/mailman/listinfo/python-list
Re: errors building python 2.7.3
On Wed, Mar 28, 2012 at 7:50 AM, Alexey Luchko l...@ank-sia.com wrote: I've tried to build Python 2.7.3rc2 on cygwin and got the following errors: $ CFLAGS=-I/usr/include/ncursesw/ CPPFLAGS=-I/usr/include/ncursesw/ ./configure I haven't tried 2.7.3 yet, so I'll describe my experience with 2.7.2 I use /usr/include/ncurses rather than /usr/include/ncursesw I don't remember what the difference is but ncurses seems to work. $ make ... gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bufferedio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bytesio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/fileio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/iobase.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/_iomodule.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/stringio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/textio.o -L/usr/local/lib -L. -lpython2.7 -o build/lib.cygwin-1.7.11-i686-2.7/_io.dll build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bufferedio.o: In function `_set_BlockingIOError': /Python-2.7.3rc2/Modules/_io/bufferedio.c:579: undefined reference to `__imp__PyExc_BlockingIOError' In Modules/_io/_iomodule.h, use: PyObject *PyExc_BlockingIOError; instead of: PyAPI_DATA(PyObject *) PyExc_BlockingIOError; Failed to build these modules: _curses _io But please note that Cygwin does not support Python-2.7. There may be other reasons. I don't really use cygwin Python for anything important. It's just nice to have around since I spend a lot of time in the bash shell. It would probably be helpful to ask on the Cygwin mailing list -- http://mail.python.org/mailman/listinfo/python-list
Re: Nested Function Question
On Fri, Jan 6, 2012 at 5:04 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Jan 6, 2012 at 2:46 PM, GZ zyzhu2...@gmail.com wrote: Hi, I am reading the documentation of functools.partial (http:// docs.python.org/library/functools.html#functools.partial) and found the following 'reference implementation' of functools.partial. def partial(func, *args, **keywords): def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.update(fkeywords) return func(*(args + fargs), **newkeywords) newfunc.func = func newfunc.args = args newfunc.keywords = keywords return newfunc I don't understand why the below 3 lines are needed: newfunc.func = func newfunc.args = args newfunc.keywords = keywords It is as if they are trying to prevent garbage collection, but I don't get why it is needed. As long as something holds reference to newfunc, because it in turn references keywords and args, nothing will be freed. If nothing is referencing newfunc, then everything should be freed. They exist for introspection. The partial object has to store the function and arguments it was passed so that it can call it later, so as long as they're being stored anyway, why not make them visible? I tend toward the minimalist end of the spectrum when it comes to code commenting, but it seems to me this would be a good place for a few words of explanation. -- http://mail.python.org/mailman/listinfo/python-list
Re: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS ?????????
On Tue, Jan 3, 2012 at 2:24 PM, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Tue, Jan 3, 2012 at 1:49 PM, D'Arcy Cain da...@druid.net wrote: On 12-01-03 01:24 PM, gene heskett wrote: The solution is to chop the link between google.groups and this list. But that subject has been declared verboten. Too much inconvenience to ask the googlers to subscribe to the real list I guess. Because my spamassassin Perhaps they just need to be reminded from time to time that many of us have already chopped the link and for us there is no Google Groups on this list. I never even saw the original message because everything from GG goes straight to /dev/null on my system. Now if only I could automatically kill the replies to GG messages. :-) P.S. if you use Spamassassin: :0 Hir * ^List-Id:.*python-list.python.org * ^From:.*@gmail.com * ^Newsgroups:.* /dev/null Wouldn't that just kill everything sent from a gmail account? That's not the same thing as Google Groups. The mailing list posts, at least, have an Organization: http://groups.google.com; header. You'd probably be better off filtering on that. Interesting. I read the list using gmail, and I never saw the original post. IIn fact I rarely see any spam at all. Apparently, somebody at google knows how to identify spam. I wonder why they can't do it for google groups. [I also wonder if anybody will see this post, coming from an evil source.] -- http://mail.python.org/mailman/listinfo/python-list
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]
On Fri, Dec 16, 2011 at 7:54 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 16 Dec 2011 11:40:11 -0800, Eelco wrote: On 16 dec, 18:38, rusi rustompm...@gmail.com wrote: On Dec 16, 3:25 pm, Eelco hoogendoorn.ee...@gmail.com wrote: Pseudo-backwards compatibility with other languages, I couldnt not care less for. Double negations n Goedelian situations have interesting implications (tho here its triple) Heh. Well at least my extra (unintended) negation is semantically consistent with the actual english usage of the phrase, which omits the negation completely :). (I could care less) Oh please. I could care less is not English. That's American. Here in Australia, we follow the English practice of saying that we couldn't care less. Well the phrase is still somewhat controversial in the US. I never heard it until age 19 (in 1966) and have always been somewhat disdainful of those using it. But it appears to be hopeless. http://articles.boston.com/2010-10-24/lifestyle/29303907_1_care-peeves-decades -- http://mail.python.org/mailman/listinfo/python-list
Re: python shell that saves history of typed in commands that will persist between reboots
On Wed, Nov 16, 2011 at 4:09 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: goldtech goldt...@worldpost.com writes: Using Windows. Is there a python shell that has a history of typed in commands? I don't know about MS Windows, but the Python interactive shell can be linked with the GNU Readline library for managing its command line URL:http://docs.python.org/library/readline.html including editing features, tab completion, history management, and a persistent history file. You can then use that functionality in your Python interactive startup file. Here's mine: = # $HOME/.pythonrc # User configuration for interactive Python shell. import sys import os import os.path import atexit # Tab completion with readline. # Cribbed from URL:http://docs.python.org/lib/module-rlcompleter.html. try: import readline except ImportError: sys.stderr.write(Module readline not available.\n) else: import rlcompleter # Enable tab completion. readline.parse_and_bind(tab: complete) # Persistent command history. histfile = os.path.join(os.environ[HOME], .python_history) try: readline.read_history_file(histfile) except IOError: # Existing history file can't be read. pass atexit.register(readline.write_history_file, histfile) del histfile del sys, os, atexit = Reading the documentation, I see that the ‘readline’ library is only linked with Python on Unix-alike operating systems. Yet another reason why MS Windows is not a good choice for developing software I guess. I'm not sure what documentation you're reading, but your code works fine on Windows. Thanks. [It is necessary to properly set PYTHONSTARTUP] -- http://mail.python.org/mailman/listinfo/python-list
Re: python shell that saves history of typed in commands that will persist between reboots
On Wed, Nov 16, 2011 at 6:59 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: David Robinow drobi...@gmail.com writes: On Wed, Nov 16, 2011 at 4:09 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: I don't know about MS Windows, but the Python interactive shell can be linked with the GNU Readline library for managing its command line URL:http://docs.python.org/library/readline.html […] Reading the documentation, I see that the ‘readline’ library is only linked with Python on Unix-alike operating systems. I'm not sure what documentation you're reading The same documentation I linked to above. Immediately below the title, it specifies a limited set of platforms: “Platforms: Unix” limiting the availability of the described module. but your code works fine on Windows. Thanks. I'm glad to know that. Perhaps you could investigate why, and suggest an update to the above documentation if it's wrong? The bug tracker at URL:http://bugs.python.org/ would be the appropriate place for such a suggestion. Upon further investigation, it turns out that I'm using pyreadline from http://pypi.python.org/pypi/pyreadline. I'd forgotten I'd installed it. No documentation fixes appear to be necessary. The pyreadline package is a python implementation of GNU readline functionality it is based on the ctypes based UNC readline package by Gary Bishop. It is not complete. It has been tested for use with windows 2000 and windows xp. It appears to work in Vista also, at least for the purposes discussed in this thread. -- http://mail.python.org/mailman/listinfo/python-list
Re: guppy
On Wed, Nov 9, 2011 at 2:38 PM, Juan Declet-Barreto juan.declet-barr...@mesaaz.gov wrote: I am using Cygwin build of Python2.6. This Cygwin install has both a Cygwin gcc (versions 3.4.4 and 4.5.3) and mingw32 (3.4.4), as listed in lib/gcc/. I also tried the mingw32 shell separately, but I get the same results even when I pass the -c mingw32 option. The error is reproduced below: ... It works for me. guppy 0.1.9 gcc 4.5.3 Python 2.6.5 cygwin 1.7.9 [I have no idea if it works as intended. I don't use guppy.] -- http://mail.python.org/mailman/listinfo/python-list
Re: leftover pyc files
On Thu, Nov 3, 2011 at 1:54 PM, Andrea Crotti andrea.crott...@gmail.com wrote: All these ideas (shell and git hooks) are nice, but unfortunately - it's svn not git - it's windows not *nix - we have to remove only the ones without the corresponding *py... -- http://mail.python.org/mailman/listinfo/python-list Barely tested. Change the print functions to removes. Pass the top directory as the argument. import os, sys for dirpath, dirnames, filenames in os.walk(sys.argv[1]): if dirpath.endswith(__pycache__): thispath = dirpath[:-11] for f in filenames: if f.endswith(.pyc): if not os.path.exists(os.path.join(thispath,f[:-1])): print(delete + os.path.join(thispath,f)) else: for f in filenames: if f.endswith(.pyc): if not os.path.exists(os.path.join(dirpath,f[:-1])): print(delete + os.path.join(dirpath,f)) #os.remove(os.path.join(dirpath,f)) -- http://mail.python.org/mailman/listinfo/python-list
Re: [NUMPY] ValueError: total size of new array must be unchanged just on Windows
2011/10/11 Paolo Zaffino zaffin...@gmail.com: Nobody can help me? Nope, not unless you post some code. Your problem description is too vague. -- http://mail.python.org/mailman/listinfo/python-list
Re: how to run in xp?
On Wed, Sep 28, 2011 at 9:29 AM, Peter Otten __pete...@web.de wrote: =?gbk?B?ytjW6rT9zcM=?= wrote: it can run ,but there is still a problem ,nothing in my file. please run the code in xp+python32 import urllib.request, urllib.parse, urllib.error exchange=['NASDAQ','NYSE','AMEX'] for down in exchange: url='http://www.nasdaq.com/screening/companies-by- industry.aspx?exchange='+down+'render=download' file=urllib.request.urlopen(url).read() print (file) what you get is: b'' b'' b'' how to fix it? I get the expected output, but I'm on Linux. Are you using the latest bugfix release (Python 3.2.2)? Can you download the data with your browser? I get the expected output, but I'm on Windows (Vista, Python 3.2.2.) -- http://mail.python.org/mailman/listinfo/python-list
Re: install packages with pip to older Python versions
On Mon, Sep 26, 2011 at 4:39 PM, Jabba Laci jabba.l...@gmail.com wrote: Hi, I have Python 2.7 on my system. Today I wanted to try Google App Engine but it runs on Python 2.5 at Google so I installed this version on my machine next to v2.7 to avoid compatibility problems. However, when I start the Python shell v2.5 and try to import something from the GAE SDK (for instance from google.appengine.ext import webapp), I get an error: ImportError: No module named webob. (Note that with v2.7 I don't have this problem.) So, how can I install packages for a specific version of Python (here, v2.5)? With 2.7 I use sudo pip install package_name. sudo pip-2.5 install package_name (You may need to install pip in your 2.5) -- http://mail.python.org/mailman/listinfo/python-list
Re: Stop quoting spam [was Re: Hot Girls ...]
On Sat, Aug 20, 2011 at 4:16 AM, Alec Taylor alec.tayl...@gmail.com wrote: ... I found said joke rather funny :P Perhaps, as a retired amateur comedian, my standards are too high, but I don't think adding a smilie to a stupid post suddenly turns it into a joke. Nevertheless, the quality of the attempt is not really the issue here. The would-be humorist did not need to quote the spam. Please, don't do it. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to convert a list of strings into a list of variables
On Thu, Aug 18, 2011 at 10:57 AM, noydb jenn.du...@gmail.com wrote: How would you convert a list of strings into a list of variables using the same name of the strings? So, [red, one, maple] into [red, one, maple] Why would you want to? -- http://mail.python.org/mailman/listinfo/python-list
Re: TypeError: 'module' object is not callable
On Thu, Aug 11, 2011 at 6:43 PM, Forafo San ppv.g...@gmail.com wrote: I wrote a class, Univariate, that resides in a directory that is in my PYTHONPATH. I'm able to import that class into a *.py file. However when I try to instantiate an object with that class like: What makes you think you're able to import that class? x = Univariate(a) # a is a list that is expected by the Univariate class python raises the TypeError: 'module' object is not callable. If I embed the code of the Univariate class in my *.py file, there is no problem. Also, when the class is imported and I do a print dir(Univariate) it does not print all the methods that are in the class, while if the class code appears in my *.py file, all the methods are available and a list with the correct methods are printed. It appears that you are importing the module Univariate from the file Univariate.py If you want to instantiate the class Univariate contained in the module Univariate, try x = Univariate.Univariate(a) In the future, please try to include more of your code. -- http://mail.python.org/mailman/listinfo/python-list
Re: how to separate a list into two lists?
On Sat, Aug 6, 2011 at 1:23 PM, Kabie kabie2...@gmail.com wrote: No. L1, L2 = zip(*L) Not quite. That makes L1 L2 tuples. L1, L2 = zip(*L) L1 = list(L1) L2 = list(L2) ??? -- http://mail.python.org/mailman/listinfo/python-list
Re: Compiling Python 3.2 on Cygwin fails
On Mon, Jul 4, 2011 at 3:49 PM, Aly Tawfik aly.taw...@gmail.com wrote: On Jun 20, 12:44 pm, sewpafly sewpa...@gmail.com wrote: I was able to a little further by changing 2 lines in Makefile.pre.in. On line 170, changed: DLLLIBRARY= @DLLLIBRARY@ to: DLLLIBRARY= libpython$(VERSION).dll On line 509 it had: $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS) which I changed to: $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) Compile finishes with: Python build finished, but the necessary bits to build these modules were not found: _gdbm _sqlite3 _tkinter nis ossaudiodev spwd To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _curses _curses_panel But 'make test' returns many errors. I'm thinking I'll try Python 3.1 instead. I, too, am facing the same problem. Which version of Python 3.1 did you install, and did it work? Thanks! -- http://mail.python.org/mailman/listinfo/python-list Cygwin is not really a supported platform. Reverting to Python 3.1 won't help at all. Download the 2.6.5 source version (i.e., click the Src box) using cygwin setup. Apply the included patches [some don't apply cleanly any more]. That will get you most of the way there. There are a few other issues the details of which I don't remember. I'm not sure why there hasn't been a cygwin distribution lately. You might ask on the cygwin mailing list. [Ultimately somebody with an interest in cygwin will need to get active in python development. I've been meaning to do this but life gets in the way.] DR -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a better way to solve this?
On Mon, May 23, 2011 at 2:55 PM, kracekumar ramaraju kracethekingma...@gmail.com wrote: You can use sizeof function, a=12234 b=23456.8 a.__sizeof__() 12 b.__sizeof__() 16 So sizeof int is 12 bytes and float is 16 bytes I'm not sure what you're trying to show here, but try the following in Python 3.2 a = for i in range(5): ... a*= 10 ... a.__sizeof__() ... -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to understand html.parser.HTMLParser
On Sun, May 15, 2011 at 4:45 PM, Andrew Berg bahamutzero8...@gmail.com wrote: I'm trying to understand why HMTLParser.feed() isn't returning the whole page. My test script is this: import urllib.request import html.parser class MyHTMLParser(html.parser.HTMLParser): def handle_starttag(self, tag, attrs): if tag == 'a' and attrs: print(tag,'-',attrs) url = 'http://x264.nl/x264/?dir=./64bit/8bit_depth' page = urllib.request.urlopen(url).read() parser = MyHTMLParser() parser.feed(str(page)) I can do print(page) and get the entire HTML source, but parser.feed(str(page)) only spits out the information for the top links and none of the revision links. Ultimately, I just want to find the name of the first revision link (right now it's revision1995, when a new build is uploaded it will be revision2000 or whatever). I figure this is a relatively simple page; once I understand all of this, I can move on to more complicated pages. You've got bad HTML. Look closely and you'll see the there's no space between the revision strings and the style tag following. The parser doesn't like this. I don't know a solution other than fixing the html. (I created a local copy, edited it and it worked.) -- http://mail.python.org/mailman/listinfo/python-list
Re: checking if a list is empty
On Fri, May 13, 2011 at 10:34 PM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: rusi wrote: Dijkstra's problem (paraphrased) is that python, by choosing the FORTRAN alternative of having a non-first-class boolean type, hinders scientific/mathematical thinking/progress. Python doesn't have the flaw that Dijkstra was talking about. Fortran's flaw wasn't so much the lack of a boolean type, but that you couldn't assign the result of a logical expression to a variable. Python has always been able to do that, even before it had a distinct boolean type. And Fortran could do it at least 25 years before Python was invented. -- http://mail.python.org/mailman/listinfo/python-list
Re: setuptools for 64-bit 2.7.1 on 64-bit Windows 7?
On Fri, May 6, 2011 at 1:43 PM, Dick Bridges dick.brid...@wdc.com wrote: Simple question: Is it true that no setuptools (or any other module installer) exists for 64-bit python 2.7.1? If there is an installer that works, what terms might I use to Google for information on how to acquire and install it? Doesn't the installer at http://www.lfd.uci.edu/~gohlke/pythonlibs/ work? -- http://mail.python.org/mailman/listinfo/python-list
Re: [python-list] - what do you think ?
On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James rho...@wildebst.demon.co.uk wrote: On Tue, 08 Feb 2011 12:18:50 -, przemol...@poczta.fm wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: Either your mail client already knows how to filter messages appropriately depending on which mailing list they came from; or, you should use a better mail client. mutt is quite good ;-) Definitely a step up from Outlook :-) Not sure what your beef with Outlook is, but it does know how to filter messages appropriately. [I've never used mutt.] -- http://mail.python.org/mailman/listinfo/python-list
Re: trouble installing MySQLdb (cygwin) + Bonus question
On Tue, Jan 25, 2011 at 5:59 PM, Matthew Roth mgrot...@gmail.com wrote: On Jan 25, 9:34 pm, John Nagle na...@animats.com wrote: ... You can install a MySQL server under Windows, and talk to the server from the Cygwin environment. That's a useful way to test. John Nagle Right, that is precisely what I have. I am able to talk to it from cygwin, however, during the installing of the MySQLdb module it cannot find the mysql_config. This is because It is not installed? The setup sees that I am on a posix system not windows, as python is installed in cygwin, a virtual posix system. I am trying to bulid a mysql client from source for cygwin, however, I am running into an error there. Unless, can I talk to the windows mysql_config? if so, what does that look like The obvious answer is to use a Windows python. You haven't explained why you think you need to run a cygwin python. Can you explain that? -- http://mail.python.org/mailman/listinfo/python-list
Re: type(d) != type(d.copy()) when type(d).issubclass(dict)
On Fri, Dec 24, 2010 at 1:52 PM, kj no.em...@please.post wrote: Watch this: class neodict(dict): pass ... d = neodict() type(d) class '__main__.neodict' type(d.copy()) type 'dict' Bug? Feature? Genius beyond the grasp of schlubs like me? copy, here, is a dict method. It will create a dict. If you really need it, you could try this: import copy class neodict(dict): def copy(self): return copy.copy(self) d = neodict() print type(d) dd = d.copy() print type(dd) -- http://mail.python.org/mailman/listinfo/python-list
Re: If/then style question
On Thu, Dec 16, 2010 at 6:51 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: ... Functions always have one entry. The only way to have multiple entry points is if the language allows you to GOTO into the middle of a function, and Python sensibly does not allow this. The one entry, one exit rule comes from the days when people would routinely write spaghetti code, jumping into and out of blocks of code without using functions at all. Only 99.7% true. Fortran still allows the appalling ENTRY statement. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.7
On Mon, Nov 8, 2010 at 6:22 AM, Antonio de Haro Millan antoniodeharomil...@gmail.com wrote: I can not install Python Imaging Library 1.1.7 for Python 2.6 (Windows only) because I have the Python 2.7. A solution please... download http://effbot.org/media/downloads/PIL-1.1.7/win32-py2.7.exe -- http://mail.python.org/mailman/listinfo/python-list
Re: PyRTF object model
On Thu, Sep 30, 2010 at 8:14 AM, Rustom Mody rustompm...@gmail.com wrote: I am trying to use PyRTF. I gather that an RTF doc consists of a list of sections, a section consists of a list of paras, paras seem to be just text (not sure on that one) Some questions: When does one end one section and start another? How does one handle lists (as in numbered, bulleted etc)? You might find the RTF specification helpful. One source is: http://msdn.microsoft.com/en-us/library/aa140277%28office.10%29.aspx -- http://mail.python.org/mailman/listinfo/python-list
Re: Pyflakes and IPython does not work for Emacs on Windows?
On Fri, Sep 24, 2010 at 4:59 PM, Dsrt Egle dsrte...@gmail.com wrote: ... I can't invoke IPython by Emacs on Windows, either. Looks ipyhon.el only works for Linux? There don't appear to be a lot of ipython.el users on Windows. You may have better look on an emacs list since there appear to be some configuration issues. Does https://bugs.launchpad.net/ipython/+bug/290228 help at all? -- http://mail.python.org/mailman/listinfo/python-list
Re: Accessing windoze file attributes
On Wed, Sep 15, 2010 at 4:51 AM, Douglas mumm...@gmail.com wrote: Environment: X86, 1Gb RAM, Win XP, latest SP, Excel 2003. Hi, can anyone direct a relative newbie to the best source of info? I am writing my own backup app in Python 2.5.2 (all my company will allow me to use) using IDLE. I intend to run this app daily via the Task Scheduler to back up a mission-critical spreadsheet that only I use. It works well enough, but now I want to make it sensitive to the A attribute (only backup the file if it is set), and update it afterwards (unset it). This will help me avoid wasted disk due to needless backups. I have searched the inter-web and not found any info on how to do access/alter Windows file attributes. Please can someone direct me to a web page with suitable info (preferably with code snyppyts)? http://code.activestate.com/recipes/303343-changing-file-attributes-on-windows/ -- http://mail.python.org/mailman/listinfo/python-list
Re: business date and calendar libraries?
On Mon, Sep 13, 2010 at 1:06 PM, Chris Withers ch...@simplistix.co.uk wrote: I'm wondering what libraries people would use to answer the following questions relating to business days: - on a naive level; what's give me the last business day (ie: skipping weekends) import datetime def is_weekend(year, month, day): return datetime.date(year, month, day).weekday() in (5,6) That should get you started. - on a less-naive level; same question but taking into account public holidays This depends on which government is oppressing you. - on a horrific level; same question, but taking into account business days of a particular market (NYSE, LSE, etc) This is just an instance of the public holiday case. You need to define the holidays. If you read lisp you might want to look at the emacs calendar module for some hints on how they describe holidays, such as, for a US-biased example, Martin Luther King day is the third Monday in January, Memorial Day is the last Monday in May, Good Friday is not a public holiday but some markets are closed. -- http://mail.python.org/mailman/listinfo/python-list
Re: bool constructor is inconsistent?
On Fri, Sep 10, 2010 at 2:35 PM, Stefan Schwarzer sschwar...@sschwarzer.net wrote: Hi Neal, On 2010-09-10 20:23, Neal Becker wrote: IN [3]: bool('False') Out[3]: True If you consider strings, only an empty string has a false value. So the string 'False' which is non-empty, results in a true boolean value. ... I've always felt that if a humorous post needs a smiley, that it's not funny. However, there is the risk of being misunderstood. -- http://mail.python.org/mailman/listinfo/python-list
Re: Windows vs. file.read
On Wed, Sep 1, 2010 at 1:03 PM, Mike henne...@web.cs.ndsu.nodak.edu wrote: I have a ppm file that python 2.5 on Windows XP cannot read completely. Python on linux can read the file with no problem Python on Windows can read similar files. I've placed test code and data here: http://www.cs.ndsu.nodak.edu/~hennebry/ppm_test.zip Within the directory ppm_test, type python ppm_test.py The chunk size commentary occurs only if file.read cannot read enough bytes. The commentary only occurs for the last file. Any ideas? Any ideas that don't require getting rid of Windows? It's not my option. Open the files in binary mode. i.e., x=Ppm(file(ff48x32.ppm,'rb')) x=Ppm(file(bw48x32.ppm,'rb')) x=Ppm(file(bisonfootball.ppm,'rb')) You were just lucky on the first two files. -- http://mail.python.org/mailman/listinfo/python-list
Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?
On Sun, Aug 8, 2010 at 12:51 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 08/08/2010 17:16, W. eWatson wrote: See Subject. I use matplotlib, scipy, numpy and possibly one other module. If I go to the control panel, I only see numpy listed. Why? I use a search and find only numpy and Python itself. How can matplotlib and scipy be uninstalled? Have you heard of google? google is not relevant to this issue. This group is the correct forum. I'm not sure what the answer to the OP's problem is. If you no longer wish to use these modules I suggest doing nothing. No harm will result. If you want to upgrade just install the new version. If that doesn't work, file a bug report. -- http://mail.python.org/mailman/listinfo/python-list
Re: Why is there no platform independent way of clearing a terminal?
On Wed, Aug 4, 2010 at 6:47 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.1445.1280767895.1673.python-l...@python.org, David Robinow wrote: As an admittedly stupid comparison, I have 1579 DLLs in my \windows\system32 directory. Some number of these have been upgraded by Windows Update. What about the ones that aren’t? How do you maintain those? Lawrence, you've been asking a lot of off-topic questions about Microsoft Windows. I think it's wonderful that you're so open to new ideas, but suggest that you take it to a Windows group, where I'm sure you'll get a friendly response. -- http://mail.python.org/mailman/listinfo/python-list
Re: Why is there no platform independent way of clearing a terminal?
On Mon, Aug 2, 2010 at 11:41 AM, Benjamin Kaplan benjamin.kap...@case.edu wrote: ... So these are the packages needed just to run Python in Ubuntu. It doesn't include the packages required for the kernel, the desktop environment, the window manager, the terminal, and whatever else you want running. In my fairly clean Ubuntu VM (I use it almost exclusively for testing), I have close to 1500 packages installed. As an admittedly stupid comparison, I have 1579 DLLs in my \windows\system32 directory. Some number of these have been upgraded by Windows Update. This is XP Service Pack 3. I'm not sure if this means that Windows is better because it has more packages or that it is worse because it's got too many. :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question regarding SSL and certificate verification
On Thu, Jul 29, 2010 at 10:07 AM, Jeffrey Gaynor jgay...@ncsa.uiuc.edu wrote: ... A final question -- how widely is M2Crypto used? Since I will have to now pitch to our group that this is preferable the first questions they will ask are about stability, who is using it and how secure is it really, especially since it is at version 0.20.2 (i.e. no major release yet). I know very little about security, but one thing I think I know. Never use security software version 1.0 or greater. It was written by an author insufficiently paranoid. -- http://mail.python.org/mailman/listinfo/python-list
Re: Multiple versions of Python coexisting in the same OS
On Sun, Jul 25, 2010 at 8:40 PM, Edward Diener eldie...@tropicsoft.invalid wrote: On 7/25/2010 5:57 PM, Thomas Jollans wrote: So if a standard library module ( or distributed library ) executes a call internally to 'python xxx yyy' or executes a call internally to 'someScript.py yyy', you're fine with multiple co-existing versions of Python on your system ? Because under Windows the first call will look for the python.exe first found in the PATH while the second call will find the python.exe associated with the .py extension. And it does not matter in either case what version of the multiple installed versions of Python which are on my system is currently executing that script. And please don't say that there is some sort of guarantee that no library or installation would invoke Python in such a way as opposed to the normal 'import AScript.py' method of using functionality in Python scripts. Edward, I'm having a really hard time understanding your problem. Could you give an example of some real code that is causing you difficulty? -- http://mail.python.org/mailman/listinfo/python-list
Re: Q for Emacs users: code-folding (hideshow)
On Fri, Jul 16, 2010 at 9:29 AM, ernest nfdi...@gmail.com wrote: On 15 Jul, 18:45, kj no.em...@please.post wrote: This is a question _for Emacs users_ (the rest of you, go away :) ). How do you do Python code-folding in Emacs? Thanks! ~K I tried the outline-mode and it seemed to work. It can collapse different blocks of code, such as functions, classes, etc. However, I never got used to it because of the bizarre key bindings. Really, if you can't be bothered to set your key bindings to something you prefer, then I don't think Emacs is the right tool for you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP
On Tue, Jul 6, 2010 at 1:46 PM, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Public download that is, people like me who have a MSDN subscription can still download old versions like Visual Studio 2005. So I would say that there is no particular hurry. I would think that everyone really serious about MS development with MS tools should get an MSDN subscription anyway, it saves you a lot of money in the long run. Amazing! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.7 released
On Mon, Jul 5, 2010 at 8:15 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Mon, 05 Jul 2010 12:59:00 -0700, Martineau wrote: I'd like to view the contents of the help file without actually installing the release which would wipe out any currently installed version (I'm one of those rare people who actually reads manuals *before* using or installing most things.) ... Are there any Windows users out there who can confirm that the installer does or doesn't leave existing versions in place? The installer does leave existing versions in place. I have no idea what the OP is referring to. -- http://mail.python.org/mailman/listinfo/python-list
Re: python source code - win/dos executable (on linux)
On Sun, Jun 27, 2010 at 9:16 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message 4c24c152$0$31381$4fafb...@reader1.news.tin.it, superpollo wrote: suppose i work in a linux environment, but i would like to ship a win/dos executable file from time to time, just for test purposes (my testers are windows users and don't want to go through the hassle of installing python on their win boxes). Is it really such a hassle to install things on Windows? I find it somewhat easier than on Ubuntu, but I think you've missed the point. -- http://mail.python.org/mailman/listinfo/python-list
Re: a +b ?
On Wed, Jun 16, 2010 at 11:34 PM, Aahz a...@pythoncraft.com wrote: In article mailman.1662.1276743037.32709.python-l...@python.org, James Mills prolo...@shortcircuit.net.au wrote: ... What in particular do you _not_ enjoy about using map/reduce (and possibly other functional features of the Python programing language) ? map() never felt particularly Pythonic, especially the way it works with None as the function combined with multiple arguments. I can't explain why I loathe reduce() -- it just doesn't fit my brain. FWIW, I don't know what reduce() does. Every time I see it I have to look it up. I think I understand map() but probably wouldn't use it (Note: I haven't actually written any code in a few years, being retired, or unemployed, or something) -- http://mail.python.org/mailman/listinfo/python-list
Re: Community (A Modest Proposal)
On Sun, Jun 13, 2010 at 1:57 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 13 Jun 2010 08:42:57 -0700, rantingrick wrote: i will start a fork. That is the most sensible thing you have said yet. Please do so, it will be a great thing for the Python community. Eagerly awaiting the transfer of this thread to comp.lang.rython -- http://mail.python.org/mailman/listinfo/python-list
Re: virtualenvwrapper for Windows (Powershell)
On Tue, May 11, 2010 at 1:43 AM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message 22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com, Guillermo wrote: If you've ever missed it on Windows and you can use Powershell ... I thought the whole point of Windows was to get away from this command-line stuff. Not such a good idea after all? The whole point of Windows was to make money for Microsoft. Microsoft can be criticized for many things but a mindless devotion to principle is not one of them. -- http://mail.python.org/mailman/listinfo/python-list
Re: condition and True or False
On Sun, May 2, 2010 at 1:14 PM, Paul McGuire pt...@austin.rr.com wrote: While sifting through some code looking for old x and y or z code that might better be coded using y if x else z, I came across this puzzler: x = boolean expression and True or False What is and True or False adding to this picture? The boolean expression part is already evaluating to a boolean, so I don't understand why a code author would feel compelled to beat this one over the head with the additional and True or False. I did a little code Googling and found a few other Python instances of this, but also many Lua instances. I'm not that familiar with Lua, is this a practice that one who uses Lua frequently might carry over to Python, not realizing that the added and True or False is redundant? Other theories? -- Paul -- http://mail.python.org/mailman/listinfo/python-list True and False were added in Python 2.2.1 (PEP 285) Perhaps this was a silly way to ensure that the user wouldn't try to run it in earlier versions. -- http://mail.python.org/mailman/listinfo/python-list
Re: off topic but please forgive me me and answer
On Thu, Apr 1, 2010 at 7:34 PM, Patrick Maupin pmau...@gmail.com wrote: On Apr 1, 4:42 pm, Tim Chase python.l...@tim.thechases.com wrote: superpollo wrote: how much is one half times one half? Uh, did you try it at the python prompt? If not, here's the answer: 0.1b * 0.1b = 0.01b Now all you need is to find the recent thread that converts binary floats to decimal floats ;-) -tkc I thought it was 0b0.1 * 0b0.1 == 0b0.01 Otherwise, you might get it confused with hexadecimal floats :D Well, my python says: $ python -c print 1/2 * 1/2 0 But that's not what I learned in grade school. (Maybe I should upgrade to 3.1?) -- http://mail.python.org/mailman/listinfo/python-list
Re: off topic but please forgive me me and answer
On Thu, Apr 1, 2010 at 10:44 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Thu, 01 Apr 2010 19:49:43 -0500, Tim Chase wrote: David Robinow wrote: $ python -c print 1/2 * 1/2 0 But that's not what I learned in grade school. (Maybe I should upgrade to 3.1?) That's because you need to promote one of them to a float so you get a floating-point result: 1/2 * 1/2 0 1/2 * 1/2.0 0.0 Oh...wait ;-) Tim, I'm sure you know the answer to this, but for the benefit of the Original Poster, the problem is that you need to promote *both* divisions to floating point. Otherwise one of them will give int 0, which gives 0.0 when multiplied by 0.5. 1.0/2 * 1/2.0 0.25 If you want an exact result when multiplying arbitrary fractions, you need to avoid floats and decimals and use Fractions: Fraction(1, 2)**2 Fraction(1, 4) I should have known he wouldn't get it. -- http://mail.python.org/mailman/listinfo/python-list
Re: use of multiple versions of python
On Thu, Mar 11, 2010 at 12:40 AM, Bujji sivait...@gmail.com wrote: hi all, I have installed python 2.6 in addition to python 2.5 in my system Now for some modules(while installing ) it needs to use python 2.6 how can i do that in case of easy_install what should i do to it to use python 2.6 You should have an easy_install-2.5 and easy_install-2.6. One of them will be linked to easy_install, depending on how you did the install. Just use the one you need. -- http://mail.python.org/mailman/listinfo/python-list
Re: Docstrings considered too complicated
On Wed, Mar 3, 2010 at 10:30 AM, Grant Edwards inva...@invalid.invalid wrote: On 2010-03-03, Grant Edwards inva...@invalid.invalid wrote: I definitely remember that old MS-DOS programs would treat Ctrl-Z as an EOF marker when it was read from a text file and would terminate a text file with a Ctrl-Z when writing one. Actually cmd.exe (at least on Windows XP) still treats Ctrl-Z as an EOF marker. -- http://mail.python.org/mailman/listinfo/python-list