Re: ignorance and intolerance in computing communties

2007-05-02 Thread Edward
On May 2, 8:33 am, Xah Lee <[EMAIL PROTECTED]> wrote: > As i have indicated in my post, it is non-trivial to implement a > function that returns the positive angle of a vector. For example, it > can be done with sign checking of the coordinate components (in total > 4 cases, which can be done as

Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Edward Diener
Has there been any official software that allows both the Python 2.x and 3.x releases to coexist on the same OS so that the end-user can easily switch between them when invoking Python scripts after each has been installed to their own directories/folders ? I know of some unoffical solutions,

Re: Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Edward Diener
On 9/30/2012 3:38 PM, Andrew Berg wrote: On 2012.09.30 14:14, Edward Diener wrote: The situation is so confusing on Windows, where the file associations, registry entries, and other internal software which allows a given Python release to work properly when invoking Python is so complicated

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-05 Thread Edward Diener
On 10/1/2012 1:32 PM, Dennis Lee Bieber wrote: On Sun, 30 Sep 2012 23:06:04 -0400, Edward Diener declaimed the following in gmane.comp.python.general: My thought is a program distributed by Python which finds the versions of Python on an OS, lets the end-user choose which version should be

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-05 Thread Edward Diener
On 10/1/2012 12:02 PM, Alister wrote: On Sun, 30 Sep 2012 15:14:17 -0400, Edward Diener wrote: Has there been any official software that allows both the Python 2.x and 3.x releases to coexist on the same OS so that the end-user can easily switch between them when invoking Python scripts after

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-05 Thread Edward Diener
On 9/30/2012 3:38 PM, Andrew Berg wrote: On 2012.09.30 14:14, Edward Diener wrote: The situation is so confusing on Windows, where the file associations, registry entries, and other internal software which allows a given Python release to work properly when invoking Python is so complicated

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-05 Thread Edward Diener
On 10/5/2012 5:32 PM, Dennis Lee Bieber wrote: On Fri, 05 Oct 2012 08:15:30 -0400, Edward Diener declaimed the following in gmane.comp.python.general: Windows installs of Python do not distinguish releases by Pythonx(.x) but just install different versions of Python in different directories

How to determine if IO redirection is occurring with the output from a Python program?

2012-04-17 Thread Edward d'Auvergne
output is solely to the terminal, and in all other cases (redirection to file via '>', pipes via '|', or more complex redirections) the ascii escape characters are suppressed. Any ideas would be appreciated! Cheers, Edward -- Edward d'Auvergne, PhD Lead develope

Re: How to determine if IO redirection is occurring with the output from a Python program?

2012-04-17 Thread Edward d'Auvergne
what happens when the ansi escape characters are not supported. Cheers, Edward On 17 April 2012 16:29, pat wrote: > Check os.isatty(fd). It will return True if fd is a terminal-like device. > > On Tue, Apr 17, 2012 at 5:21 PM, Edward d'Auvergne > wrote: >> >> Hi, &g

Suppressing newline writing to file after variable

2011-06-28 Thread Ellerbee, Edward
Hi all, newbie question here. I'm using python 2.7. I've built my first program to pull some info off the web, process it, and build dialpeers for a cisco router. I have 2 problems - the first is the formatting of printing the gathered information to a file. It seems to be inserting a new line afte

RE: Suppressing newline writing to file after variable

2011-06-28 Thread Ellerbee, Edward
04799 (all numbers listed individually in a file) Condense to: 25220[568] 25222[0-3] (or 25222[0123] is fine too) 9197[248]5 7047[0-9][0-9] Any recommendations on where to start, a method or function to research? Thanks! Edward Ellerbee -Original Message- From: Noah Hall [mailto:enali...

I don't know list, I not good at list.

2011-07-13 Thread Ellerbee, Edward
I've been beating my head against the desk trying to figure out a method to accomplish this: Take a list (this example is 5 items, It could be 150 or more - i.e. it's variable length depending on the city/local calling zones) The first 6 digits of phone numbers(NPA/NXX) in a local calling area. I

RE: I don't know list, I not good at list.

2011-07-14 Thread Ellerbee, Edward
s there a way to determine the common (first-5 digits) denominator among a list (or file) of data? 3. and... Could those common numbers be inserted in a dict for processing? Sorry for the book! thanks Edward Ellerbee -Original Message- From: python-list-bounces+eellerbee=bbandt@

RE: Suppressing newline writing to file after variable

2011-07-14 Thread Ellerbee, Edward
Holy cow, that's perfect! Thanks so much :) Would it be alright if I post my code on the list for critiquing? I'm learning python to supplement my voice engineering position - time consuming tasks that can be automated will take less time. Edward Ellerbee -Original Message

Please critique my script

2011-07-14 Thread Ellerbee, Edward
tt = "destination-pattern %s" % line.rstrip() o.write(destpatt) o.write('\n') port = "port " + p o.write(port) o.write('\n') if line[0:3] == y and q == "y": o.write("forward-digits 7") o.write('\n') o.write('\n') count3 = count3 + 1 o.close() #--- Thanks! Edward Ellerbee -- http://mail.python.org/mailman/listinfo/python-list

Switching between Python releases under Windows

2011-03-08 Thread Edward Diener
I have multiple versions of Python installed under Vista. Is there any easy way of switching between them so that invoking python and file associations for Python extensions files work automatically ? -- http://mail.python.org/mailman/listinfo/python-list

matchpy

2017-11-12 Thread Edward Montague
After successfully installing python 3.6.3 and the appropriate version of IDLE , I attempted to run a matchpy example , to no avail . I'm using a debian distribution , 8.x or greater , is there something I need to be aware of . The error report points to a statement containing a ' -> ' character

Add a method to list the current named logging levels

2021-09-02 Thread Edward Spencer
Sometimes I like to pass the logging level up to the command line params so my user can specific what level of logging they want. However there is no easy method for pulling the named logging level names. Looking into the code, it would actually be incredibly easy to implement; in `logging.__in

Re: Add a method to list the current named logging levels

2022-03-30 Thread Edward Spencer
在 2021年9月3日星期五 UTC+1 18:50:51, 写道: > > On 2 Sep 2021, at 23:38, Dieter Maurer wrote: > > > > Edward Spencer wrote at 2021-9-2 10:02 -0700: > >> Sometimes I like to pass the logging level up to the command line params > >> so my user can specific what level

Re: Add a method to list the current named logging levels

2022-03-30 Thread Edward Spencer
在 2022年3月30日星期三 UTC+1 16:38:26, 写道: > > On 30 Mar 2022, at 16:11, Edward Spencer wrote: > > > > 在 2021年9月3日星期五 UTC+1 18:50:51, 写道: > >>>> On 2 Sep 2021, at 23:38, Dieter Maurer wrote: > >>> > >>> Edward Spencer wrote at 2021-9-2

os with python[s]

2018-07-13 Thread Edward Montague
I encounter numerous problems when changing between versions of python ; one possible answer , Fedora 28 Labs python . So far this has been fairly reliable , I installed Geany , as this is my preferred editor for Python. -- https://mail.python.org/mailman/listinfo/python-list

mayavi mlab mesh plot3d grid from mesh

2016-06-15 Thread Edward Montague
Hi, I'm wondering if there's any way to overlay a grid upon a mlab.mesh or mlab.surf graph. As an example of what I mean I shall attempt to attach a small file maya2.jpg . -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 3 on Windows

2016-08-02 Thread Edward Diener
On 8/2/2016 8:11 AM, Uri Even-Chen wrote: Hi, I want to install Python 3 on Windows, but I also need Python 2 for Google App Engine SDK. When I type a name of a Python file in command line, I want it to run with Python 3. However, I checked with "print 3/5" and it printed 0 - Python 2. I have th

Unable to find newly installed Python 3.7.1

2018-11-23 Thread Edward Popko
Snake people: I'm a Java person and thought to try Python for Windows. I installed Python 3.7.1 (64-bit) hoping for an IDE, documentation and even a sample or two. The python-3.7.1-amd64.exe unpacks and installs fine. Only problem is I cannot find it. There was no install option to add an shortcu

wxFormBuilder

2020-02-28 Thread Edward Montague
The videos on YouTube by fandangleproductions, have been of some use. However as I also use the Geany editor, I find that I need to append this extra code to the Python script generated from wxFormBuilder. # - extra code --- class MyApp(wx.App): def OnI

rubi integrate

2020-04-19 Thread Edward Montague
After wrestling with version incompatibilities and incomplete code, I have produced test code and an edited version of rubi.py . For rubi.py I found it necessary to replace exp with rubi_exp, in a few locations; you may want to check this, files are attached. Perhaps this isn't an issue with a m

multiprocessing

2020-04-20 Thread Edward Montague
Upon using sympy's rubi_integrate upon my quad core computer, I find that the first CPU is being used 100%, whilst the other three are around 1% and 2% . I'm wondering if you have some code to overcome this limitation. -- https://mail.python.org/mailman/listinfo/python-list

Name of IDLE on Linux

2005-04-02 Thread Edward Diener
What is the name of the IDLE program on Linux and where is it installed in a normal Linux distribution ? I have installed all the Python 2.3.5 RPMs on my Fedora 3 system but I have no idea where they are installed or what IDLE is called. I lloked in the Python web pages to try to find a list of

Re: Name of IDLE on Linux

2005-04-02 Thread Edward Diener
Jim Benson wrote: On Sat, 2 Apr 2005, Edward Diener wrote: What is the name of the IDLE program on Linux and where is it installed in a normal Linux distribution ? I have installed all the Python 2.3.5 RPMs on my Fedora 3 system but I have no idea where they are installed or what IDLE is

Re: Name of IDLE on Linux

2005-04-02 Thread Edward Diener
Thomas Rast wrote: > Edward Diener <[EMAIL PROTECTED]> writes: > >> It is a pity the Python Linux binary installations do not >> create folders on the desktop or in the Gnome menu system with links >> to the Python to the documentation and a readme telling me what

Installing Python 2.4 on Linux

2005-04-05 Thread Edward Diener
I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation. What happens is that Python 2.4 replaces the /usr/bin/python module with the Python 2.4 version. If

Re: Installing Python 2.4 on Linux

2005-04-05 Thread Edward Diener
Marcin Stêpnicki wrote: > Dnia Tue, 05 Apr 2005 21:21:37 +0000, Edward Diener napisal(a): > >> I can install Python 2.4 on the Fedora 3 Linux system, but after I >> do a number of Linux utilities and commands, like yum, stop working >> because they were dependent on the

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Edward Diener
David Fraser wrote: Edward Diener wrote: I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation. What happens is that Python 2.4 replaces the /usr/bin

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Edward Diener
John Ridley wrote: --- Edward Diener <[EMAIL PROTECTED]> wrote: [snip] I do not know whether this is a Python problem or a Fedora 3 problem but I thought I would ask here first and see if anybody else had the same problem. I imagine the problem might exist on other Linux systems. On my Ma

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Edward Diener
there must be about 50 other packages mentioned. Which one of these specifically use python2.3 to execute their .py scripts and which ones just use python2.3 shared libraries is another matter which will take much work to discover. But thanks for your suggestion nonetheless. Edward Diener w

Re: Installing Python 2.4 on Linux

2005-04-09 Thread Edward Diener
John Ridley wrote: * Edward Diener wrote: I need python to be python2.3 else many utilities no longer work. Then leave your 2.3 installation exactly as it is (so that python is a link to python2.3) and run python2.4 where needed. To specifically use python 2.4 to run IDLE, simply type in a shell

Re: Python 2.4.1 install broke RedHat 9 printconf-backend

2005-04-10 Thread Edward Diener
BrianS wrote: > Hi, > > I'm trying to learn Python and wanted to play with Tkinter. I > couldn't get it to work so I figured it would help if I installed the > newest verison of Python. I downloaded the source, compiled it and > installed it. No problem. The next time I booted my machine I the

Python launcher options

2016-01-05 Thread Edward Diener
The Python launcher in Windows is a neat tool for running multiple versions of Python 2 and Python 3 at different times. It allows as options the ability to specify the latest version of either Python 2 or Python 3 defaulting to the 64-bit version if both exist, or a specific 32-bit or 64-bit v

Re: Python launcher options

2016-01-09 Thread Edward Diener
On 1/9/2016 11:03 AM, Tim Golden wrote: On 06/01/2016 00:48, Edward Diener wrote: The Python launcher in Windows is a neat tool for running multiple versions of Python 2 and Python 3 at different times. It allows as options the ability to specify the latest version of either Python 2 or Python

Re: Python launcher options

2016-01-10 Thread Edward Diener
On 1/10/2016 6:38 AM, Tim Golden wrote: On 10/01/2016 05:18, Edward Diener wrote: On 1/9/2016 11:03 AM, Tim Golden wrote: On 06/01/2016 00:48, Edward Diener wrote: The Python launcher in Windows is a neat tool for running multiple versions of Python 2 and Python 3 at different times. It

Re: Python launcher options

2016-01-10 Thread Edward Diener
On 1/10/2016 6:38 AM, Tim Golden wrote: On 10/01/2016 05:18, Edward Diener wrote: On 1/9/2016 11:03 AM, Tim Golden wrote: On 06/01/2016 00:48, Edward Diener wrote: The Python launcher in Windows is a neat tool for running multiple versions of Python 2 and Python 3 at different times. It

Help with exscript with Cisco asa

2014-12-07 Thread Edward Manning
I am trying to login to enable mode on a Cisco ASA with this script. I can’t seem to get the enable mode to work. Can anyone help. Does anyone know of a good doc for exscript lib. Thank you Ed from Exscript.util.start import quickstart from Exscript.util.file import get_hosts_from_fil

gethostbyaddr()

2014-07-28 Thread Edward Manning
I wrote this code, but it seem to work fine if I only have one ip in the file. When I have more than one IP in the file I get a error. Does anyone have an idea why. import socket def main(): # get file names infileName = input ("What file our the IP adderss in? ") outfile

Re: gethostbyaddr()

2014-07-28 Thread Edward Manning
Chris Thank you for the info. I figure it out. But thank you again. Ed > On Jul 28, 2014, at 5:42 PM, Chris Kaynor wrote: > > On Mon, Jul 28, 2014 at 2:33 PM, Edward Manning wrote: > I wrote this code, but it seem to work fine if I only have one ip in the > file. When I hav

Controlling py.exe launcher on Windows

2014-08-05 Thread Edward Diener
I am trying to control the default version of the py.exe launcher on Windows. I have the Python 2.7.8 and 3.4.1 installed with both the 32 bit and 64 bit versions, all in different directories. I assume that .py and .pyw files are associated with the py.exe launcher. I am trying to control whi

Python 3.4.1 install does not create a file association for .py files on Windows

2014-08-05 Thread Edward Diener
I install Python 3.4.1 64-bit on Windows. After the install I type: assoc .py and I get back: File association not found for extension .py Why does not the Python install to associate extension .py with the Python Launcher for Windows ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.4.1 install does not create a file association for .py files on Windows

2014-08-05 Thread Edward Diener
On 8/5/2014 6:16 PM, Terry Reedy wrote: On 8/5/2014 3:36 PM, Edward Diener wrote: I install Python 3.4.1 64-bit on Windows. After the install I type: I have done the same, on Win 7, but I had previous installs going back 3 years on this machine. assoc .py and I get back: File association

Re: Controlling py.exe launcher on Windows

2014-08-05 Thread Edward Diener
On 8/5/2014 1:27 PM, Edward Diener wrote: I am trying to control the default version of the py.exe launcher on Windows. I have the Python 2.7.8 and 3.4.1 installed with both the 32 bit and 64 bit versions, all in different directories. I assume that .py and .pyw files are associated with the

Hands on Documentation for Python methods and Library

2006-10-04 Thread Wijaya Edward
Hi, One can do the following with Perl $ perldoc -f chomp $ perldoc -f function_name or $ perldoc List::MoreUtils $ perldoc Some::Module Can we do the same thing in Python? -- Edward SINGAPORE Institute For Infocomm Research - Disclaimer - This email is

Initialization of variables using no-arg constructor

2006-10-09 Thread Edward Waugh
or classes that have a no-arg constructor (through this is probably almost always the case). Thanks, Edward -- http://mail.python.org/mailman/listinfo/python-list

Click and Drag Functionality in Web Apps with Python

2006-10-12 Thread Wijaya Edward
in Python. Do you guys have any experience with it? Any Python module that support that? Regards, Edward WIJAYA SINGAPOE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please

Python Best Practice References

2006-10-13 Thread Wijaya Edward
Can anybody suggest any references (links, books, etc)about this? I'm thinking of something similar with D.Conway's "Perl Best Practice". -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be

Loops Control with Python

2006-10-13 Thread Wijaya Edward
) { next OUT; } else { last IN; } } } How can we implement that construct with Python? -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you

Where to find pydoc?

2006-10-16 Thread Wijaya Edward
s (this may take a while) Reading http://www.python.org/pypi/ <http://www.python.org/pypi/> No local packages or download links found for pydoc error: Could not find suitable distribution for Requirement.parse('pydoc') Hope to hear from you again. Regards, Edward WIJAYA SINGAPORE ---

RE: Where to find pydoc?

2006-10-16 Thread Wijaya Edward
Hi, Thanks for the reply. Red Hat Linux Enterprise: Linux host.com 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686 i686 i386 GNU/Linux Python 2.3.4. Any problem with that? --- Edward From: [EMAIL PROTECTED] on behalf of Marc 'BlackJack

RE: Where to find pydoc?

2006-10-18 Thread Wijaya Edward
Hi, Can you be specific on which URLs can I find "python-tools". Cause I tried the one under easy_install, I still can't find it. Thanks and hope to hear from you again. -- Edward WIJAYA SINGAPORE From: [EMAIL PROTECTED] on behalf of Fredrik

Auto Completion for Python in VIM editor

2006-10-23 Thread Wijaya Edward
kind of autocompletion. Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it fo

Problem Commenting within Filehandle Iteration

2006-10-26 Thread Wijaya Edward
that I wanted to comment out the #print line there. However I found problem with myfile.close(), with identation error. This error doesn't occur when commenting (#) is not in use. Why so? Is there away to do the commenting in correct way under this circumstances? -- Edward WIJAYA SING

Printing Hidden Character in Python

2006-10-26 Thread Wijaya Edward
Hi, How can we print out the hidden character like "\n", "\r" etc in Python? -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient,

RE: Printing Hidden Character in Python

2006-10-26 Thread Wijaya Edward
Ben, I mean while opening a file, like this for line in open('somefile.txt'): print line printing "line" will not show the hidden chars like "\n","\r". Is there a way to print it out? -- Edward WIJAYA SINGAPORE

Insert Content of a File into a Variable

2006-10-26 Thread Wijaya Edward
Hi, How can we slurp all content of a single file into one variable? I tried this: >>> myfile_content = open('somefile.txt') >>> print myfile_content, >>> But it doesn't print the content of the file. Regards, -- Edward WIJAYA SINGAPORE --

How to Split Chinese Character with backslash representation?

2006-10-26 Thread Wijaya Edward
e split function here doesn't seem to do the job for obtaining the desired result: ['\xc5','\xeb','\xc7','\xd5','\xbc'] Regards, -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email i

RE: How to Split Chinese Character with backslash representation?

2006-10-26 Thread Wijaya Edward
xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-', '-', 'B', 'A', 'R'] What we want as the output is this instead: ['\xc5', '\xeb', '

Slurping All Content of a File into a Variable

2006-10-26 Thread Wijaya Edward
Hi, How can we slurp content of a single file into one variable? I tried this: >>> myfile_content = open('somefile.txt') >>> print myfile_content, >>> But it doesn't print the content of the file. Regards, -- Edward WIJAYA SINGAPORE --

RE: Slurping All Content of a File into a Variable

2006-10-26 Thread Wijaya Edward
From: [EMAIL PROTECTED] on behalf of Wijaya Edward Sent: Thu 10/26/2006 11:47 PM To: python-list@python.org Subject: Slurping All Content of a File into a Variable Hi, How can we slurp content of a single file into one variable? I tried this

Matching Pure Numeric and '' with Python re

2006-10-27 Thread Wijaya Edward
+|[0-9]+") m = p.match(word) if m: print word, Namely it doesn't print 0123 and ''. What's wrong with my regex? -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential a

Re: send an email with picture/rich text format in the body

2006-05-29 Thread Edward Elliott
Ten wrote: > Sorry for the rant, good luck to the guy if he's solved his problem, > but damn, that "90% so let's not bother doing things properly" stuff makes > my blood boil. You must really hate browsing the web then. :) -- Edward Elliott UC Berkeley School of La

Re: Finding a lost PYTHONPATH with find

2006-05-29 Thread Edward Elliott
is > redundant since I think find searches breadth-first by default. ??? maxdepth determines how deep the search will look, not the order the search occurs. Your search only find things within 3 levels of the root, unless your directory tree goes no deeper than that (very unlikely) the maxdep

Re: HTMLParser chokes on bad end tag in comment

2006-05-29 Thread Edward Elliott
won't work</EM>") In JavaScript, this code can be expressed legally by hiding the ETAGO delimiter before an SGML name start character: document.write ("<EM>This will work<\/EM>") Guess you learn something new every day. Too bad the

Re: Ricerca Programmatore Python

2006-05-29 Thread Edward Elliott
g the relative resume to me. I hope of to have made what appreciate postando this announcement. In contrary case, I make excuses myself for the disturbance. Salutes, Giandomenico Sica -- Edward Elliott UC Berkeley School of Law (Boalt Hall) complangpython at eddeye dot net -- http://mail.pyt

Re: Need C# Coding for MD5 Algorithm...

2006-05-29 Thread Edward Elliott
orrectly as it is. Leave it to the experts and use a library. -- Edward Elliott UC Berkeley School of Law (Boalt Hall) complangpython at eddeye dot net -- http://mail.python.org/mailman/listinfo/python-list

Howto pass Array/Hash into Function

2006-10-03 Thread Wijaya Edward
done in Python. Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any

RE: Howto pass Array/Hash into Function

2006-10-03 Thread Wijaya Edward
Thanks for your understanding Steve. Furthermore, my related concern is how does Python actually deal with 'reference' in Perl. But now, it is clear to me now that Python simply treats them as object. Regards, Edward WIJAYA SINGAPORE From: [EMAIL

Benchmarking Python's subroutines/function

2006-10-03 Thread Wijaya Edward
Hi, How does one benchmark multiple subroutines in Python? Is there a built-in library for that? -- Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended

Re: list1.append(list2) returns None

2006-12-20 Thread Edward Kozlowski
Pyenos wrote: > def enlargetable(table,col): > return table.append(col) > > def removecolfromtable(table,col): > return table.remove(col) > > print enlargetable([[1],[2],[3]],[4]) # returns None > > Why does it return None instead of [[1],[2],[3],[4]] which I expected? return the table.

Re: failing to instantiate an inner class because of order of inner classes

2006-12-27 Thread Edward Kozlowski
Pyenos wrote: > class model:pass > class view: > model() > class controller: > model() > > I can instantiate clsss model from inside class view but I can't > instantiate class model from inside controller, due to the nature of > python interpreter. > > I wish to circumvent this rest

Number Format function

2006-02-08 Thread Edward Hartfield
unt % 3 == 0: formatted.append(",") integer = "".join(formatted[::-1]) return integer+decimal begin:vcard fn:Edward Hartfield n:Hartfield;Edward org:BungeeCraft Technologies adr;dom:;;4824 W Medford Avenue;Milwaukee;Wisconsin;53216 email;internet:[EMAIL PROT

Re: Number Format function

2006-02-08 Thread Edward Hartfield
rmat(12345, 2), '12,345.00') self.assertEqual(number_format(123, 2), '123.00') self.assertEqual(number_format(123456.33, 2), '123,456.33') self.assertEqual(number_format(12345.333, 2), '12,345.33') self.assertEqual(number_format

unicode question

2006-02-24 Thread Edward Loper
ly there's a better way than converting back and forth 3 times? Is there a reason that the 'backslashreplace' error mode can't be used with codecs.decode? >>> 'abc \xff\xe8 def'.decode('ascii', 'backslashreplace') Traceback

Re: unicode question

2006-02-27 Thread Edward Loper
Walter Dörwald wrote: > Edward Loper wrote: > >> [...] >> Surely there's a better way than converting back and forth 3 times? Is >> there a reason that the 'backslashreplace' error mode can't be used >> with codecs.decode? >> >

Getting the home directory in Python and a bug in os.path.expanduser

2007-07-06 Thread Edward Diener
What is the generic operating system way of getting the home directory ? I am guessing it is os.path.expanduser("~"). Is there a better way or an alternate way ? If it is as I surmise, the aforementioned expanduser("~") of os.path seems incorrect to me under Windows. The document says: "On Win

Re: Getting the home directory in Python and a bug in os.path.expanduser

2007-07-07 Thread Edward Diener
Josiah Carlson wrote: > Edward Diener wrote: >> What is the generic operating system way of getting the home directory ? >> >> I am guessing it is os.path.expanduser("~"). Is there a better way or >> an alternate way ? >> >> If it is as I surmi

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-07 Thread Edward Dodge
ould include the publishers of books on "easy-to-use" Microsoft products. -- Edward Dodge -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting the home directory in Python and a bug in os.path.expanduser

2007-07-07 Thread Edward Diener
Neil Hodgson wrote: > Edward Diener: > >> Probably most reliable on Windows is a Windows API function, if it >> exists, for getting the home directory, as opposed to using >> environment variables, but I can not find any Windows API for it at >> present. &

Re: Emacs + python

2007-08-01 Thread Edward O'Connor
Ted -- Edward O'Connor [EMAIL PROTECTED] Ense petit placidam sub libertate quietem. -- http://mail.python.org/mailman/listinfo/python-list

re: mmm-mode, python-mode and doctest-mode?

2007-08-07 Thread Edward Loper
gt; optionally indented prompts (>>>) and end with blank lines. Use > (C-c % C-e) to insert a new doctest-example region. When > `doctest-execute' (C-c C-c) is called inside a doctest-example > region, it executes all examples in the buffer. Take care, -Edwar

Python FNV Hash

2007-08-07 Thread Edward Blake
Before I go through the work of wrapping the FNV hash source found on http://isthe.com/chongo/tech/comp/fnv/ I thought I would ask here to see if anyone already has an implementation of it available. I'm particularly interested in hash_64, the 64 bit Fowler/Noll/Vo-0 FNV-1a hash code. -- http://ma

mmm-mode, python-mode and doctest-mode?

2007-08-08 Thread Edward Loper
oes it depend on the contents of the buffer? Does it freeze if you run it in an empty buffer? You could try changing the value of doctest-python-command, to see if that helps -- "M-x customize-variable doctest-python-command". Set it to the full path to a Python interpreter.

Re: mmm-mode, python-mode and doctest-mode?

2007-08-09 Thread Edward Loper
Edward Loper wrote: >> Anyone testing on xemacs? I tried it, and C-c C-c sent xemacs into an >> infinite loop (apparantly). I may have tracked down the cause of this problem. Please download the most recent version, and try again. And when you do, let me know whether t

Re: simple question on dictionary usage

2007-10-26 Thread Edward Kozlowski
of the keys that start with the letter 'E'. In > otherwords it should look like this: > > egt = {'E6': '1182','E1': '1137','E4': '1157','E5': '1148', >'E2': '1169','E3': '1163'} > > This should be pretty easy, but somehow with all my googling I've > not found a hint. > > Thanks in advance > > -- > Frank Stutzman I think this should do the trick. There's probably something more concise than this, but I can't think of it at the moment. egt = {} for key in record: if key.startswith('E'): egt[key] = record[key] print egt {'E5': '1148', 'E4': '1157', 'E6': '1182', 'E1': '1137', 'E3': '1163', 'E2': '1169'} -Edward Kozlowski -- http://mail.python.org/mailman/listinfo/python-list

Epydoc 3.0 beta release

2007-02-26 Thread Edward Loper
Epydoc 3.0 beta is now available for download from SourceForge. Epydoc is a tool for generating API documentation for Python modules, based on their docstrings. - The epydoc homepage. - Download epydoc 3.0 beta.

Re: SimpleXMLRPCServer interruptable?

2007-12-05 Thread Edward Kozlowski
lina Try this: def __init__(self, host, port): self.done = False server = SimpleXMLRPCServer((host, port)) : : Bunch of server.register_function calls : def serverWrapper(): try: while not self.done: server.handle_request() except:

Re: SimpleXMLRPCServer interruptable?

2007-12-05 Thread Edward Kozlowski
On Dec 5, 10:19 pm, Edward Kozlowski <[EMAIL PROTECTED]> wrote: > On Dec 5, 6:22 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > En Wed, 05 Dec 2007 18:20:35 -0300, Bret <[EMAIL PROTECTED]> escribió: > > > > I jus

Re: Uniquifying a list?

2006-04-18 Thread Edward Elliott
You could do >>> uniq = [x for x in set(myList)] but that's not really any different than what you already have. This almost works: >>> uniq = [x for x in myList if x not in uniq] except the r-val uniq isn't updated after each iteration. Personally I think list(set(myList)) is as optimal as

multiline comments

2006-04-18 Thread Edward Elliott
At the risk of flogging a dead horse, I'm wondering why Python doesn't have any multiline comments. One can abuse triple-quotes for that purpose, but that's obviously not what it's for and doesn't nest properly. ML has a very elegant system for nested comments with (* and *). Using an editor

temporary scope change

2006-04-18 Thread Edward Elliott
The only time I miss block delimiters in Python is when I want to temporarily change the scope of a block. Suppose I have this code: for x in list1: i += 1 for y in list2: print x * i Ignore the semantics for the moment (yes the code is suboptimal). Say I need to disable th

Re: temporary scope change

2006-04-18 Thread Edward Elliott
Michael Spencer wrote: > Just replace: > for y in list2: > with: > if True: Of course. I knew it would be blindingly obvious. Sometimes you just can't shake the blinders off though. Thanks. > Note that neither the `if` nor the `for` statement actually creates a > new scope. Good cat

Re: multiline comments

2006-04-18 Thread Edward Elliott
Atanas Banov wrote: > want to comment block of code? use tripple-quotes. does not nest? ahhh, > maybe it's time to get rid of that block you commented out a month ago > "just in case the new code doesnt work". > > that gives you incentive to tidy up. don't be a code slob... don't > leave a mess fo

Re: multiline comments

2006-04-18 Thread Edward Elliott
Ben Finney wrote: > And/or switch to an editor that can perform editing operations on a > range of lines. I'm not unsympathetic to this point of view, as I would feel hamstrung without my vim. It's more that I object to the paternalism of telling people they have to use such an editor. There a

Re: multiline comments

2006-04-18 Thread Edward Elliott
Ben Finney wrote: > Indeed. Using revision control means never needing to comment out > blocks of code. Typing (* and *) on a few line will always be quicker, easier, and less confusing than any rcs diffs/restores. Once you delete the code you can no longer see it or add pieces back in without

  1   2   3   4   5   6   >