Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-10 Thread Virgil Stokes
use Python's built-in datetime module as follows: from datetime import date, timedelta  d0 = date(2018,02,01) This gave the following error: Syntax Error: invalid token: C:\Users\Virgil Stokes\Desktop\Important Notes_Files\CheckProcessingDate_02.py, line 7, pos 17 d0 = date(2018,02,01)

Re: Installation of tensorflow via pip -- messages?

2018-04-26 Thread Virgil Stokes
oore wrote: On 26 April 2018 at 19:33, Virgil Stokes wrote: Why am I getting this message, that I need to consider adding this directory to PATH when it is already in PATH? Note, all of these *.exe files are in C:\Python36\Scripts. The PATH entry ends with a backslash, which is confusing the check d

Installation of tensorflow via pip -- messages?

2018-04-26 Thread Virgil Stokes
First I upgraded my pip *C:\Python36>python -m pip install --upgrade pip* Collecting pip   Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)     100% ||

Re: Processing a key pressed in Python 3.6

2018-01-24 Thread Virgil Stokes
+0100, Virgil Stokes *declaimed* ? the following:     key = msvcrt.getwch() NOTE: per documentation, that is a blocking read... It won't return unless a key (any key) has been pressed. That means your "more work to do" loop requires a key press for each loop.

Re: Processing a key pressed in Python 3.6

2018-01-23 Thread Virgil Stokes
opic. On 2018-01-23 20:37, Dennis Lee Bieber wrote: On Tue, 23 Jan 2018 19:50:57 +0100, Virgil Stokes declaimed the following: I am running the code with Python 3.6 on a windows 10 platform. I have tried many approaches (mainly those posted on stackoverflow) but I have yet to find an approa

Re: Processing a key pressed in Python 3.6

2018-01-23 Thread Virgil Stokes
Another follow-up question: How would this code be modified to handle using the "Esc" key instead of the "Enter" key? On 2018-01-23 20:15, Chris Angelico wrote: On Wed, Jan 24, 2018 at 5:50 AM, Virgil Stokes wrote: I would appreciate help on finding a solution to fol

Re: Processing a key pressed in Python 3.6 🦉

2018-01-23 Thread Virgil Stokes
at 5:50 AM, Virgil Stokes wrote: I would appreciate help on finding a solution to following problem. This is the general structure of the "problem" code: while True # Get some data from the web and process it ... ... # Write these data to a file ... ...

Processing a key pressed in Python 3.6

2018-01-23 Thread Virgil Stokes
I would appreciate help on finding a solution to following problem. This is the general structure of the "problem" code: while True     # Get some data from the web and process it     ...     ...     # Write these data to a file     ...     ...     # Check if a_key has been pressed in the comma

Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Virgil Stokes
On 2016-Feb-27 19:13, wrong.addres...@gmail.com wrote: On Saturday, 27 February 2016 18:08:36 UTC+2, Dietmar Schwertberger wrote: On 27.02.2016 12:18, wrong.addres...@gmail.com wrote: Isn't there any good GUI IDE like Visual Basic? I hope there are some less well known GUI IDEs which I did no

Questions on Pickle and Shelve

2015-11-06 Thread Virgil Stokes
Here is snippet of Python (vers. 2.7.10) code that bothers me. import cPickle as pickle print "Pickle lists:" dogs = ['Rover','King','Spot','Rufus'] cats = ['Mimi','Misty','Sasha'] with open('pickle.dat', 'wb') as pfile: pickle.dump(dogs, pfile) pickle.dump(cats,pfile) del(dogs); del(c

An improved version of the main snippet

2015-05-05 Thread Virgil Stokes
I have attached what I believe to be an improved version of my main snippet for testing. --V :-) ''' Purpose: get current bid, ask and rate for currency exchanges (FOREX trading) Note: 1. yahoo seems to give the best estimates for the currency exchange rates 2. Not sure where the "b

Re: Sudoku solver

2015-03-28 Thread Virgil Stokes
On 27-Mar-2015 15:09, Dave Angel wrote: On 03/27/2015 09:56 AM, Marko Rauhamaa wrote: "Frank Millman" : So what I am talking about is called a "satisfactory" puzzle, which is a subset of a "proper" puzzle. That is impossible to define, though, because some people are mental acrobats and can

Saving a file "in the background" -- How?

2014-10-30 Thread Virgil Stokes
While running a python program I need to save some of the data that is being created. I would like to save the data to a file on a disk according to a periodical schedule (e.g. every 10 minutes). Initially, the amount of data is small (< 1 MB) but after sometime the amount of data can be >10MB

Butterflow installation on windows

2014-10-11 Thread Virgil Stokes
The butterflow package (https://pypi.python.org/pypi/butterflow/0.1.4a1) has recently been released. I would like to know if anyone has been able to install it on a windows platform. -- https://mail.python.org/mailman/listinfo/python-list

Test for an empty directory that could be very large if it is not empty?

2014-08-06 Thread Virgil Stokes
Suppose I have a directory C:/Test that is either empty or contains more than 200 files, all with the same extension (e.g. *.txt). How can I determine if the directory is empty WITHOUT the generation of a list of the file names in it (e.g. using os.listdir('C:/Test')) when it is not empty?

Loading a module from a subdirectory

2014-03-10 Thread Virgil Stokes
I have the following folder-file structure: C:/PythonCode/VideoPlayerSimulator/ +-- __init__.py (empty file) +-- GlbVars.py (contains the single class Glb) C:/PythonCode/VideoPlayerSimulator/RubberBanding/

Re: Loading a module from a subdirectory

2014-03-10 Thread Virgil Stokes
On 10-Mar-14 21:31, Virgil Stokes wrote: I have the following folder-file structure: C:/PythonCode/VideoPlayerSimulator/ +-- __init__.py (empty file) +-- GlbVars.py (contains the single class Glb) C:/PythonCode

Re: Reading data from 2 different files and writing to a single file

2013-01-28 Thread Virgil Stokes
On 28-Jan-2013 15:49, Chris Angelico wrote: On Tue, Jan 29, 2013 at 1:37 AM, Dave Angel wrote: What you want is the zip() function for l,s in zip(f1, f2): #you now have one line from each file, # which you can then validate and process Note, this assumes that when a line is "bad"

Re: Formatting a column's value output

2013-01-27 Thread Virgil Stokes
On 27-Jan-2013 17:12, ru...@yahoo.com wrote: On 01/27/2013 02:04 AM, Ferrous Cranus wrote: [...] data = cur.fetchall() for row in data: print ( "" ) for item in row:

Re: Beginner Tutorials

2013-01-18 Thread Virgil Stokes
On 18-Jan-2013 15:47, Rik wrote: Hi, I've developed a website for beginners to Python. I'd appreciate any comments or criticism. It's still under development, and should be finished in the next few months. Oh, and it's free to use. www.usingpython.com You have done well Rik. I like your appro

Re: Obnoxious postings from Google Groups

2012-11-04 Thread Virgil Stokes
On 04-Nov-2012 12:13, Jamie Paul Griffin wrote: / ru...@yahoo.com wrote on Fri 2.Nov'12 at 11:39:10 -0700 / (I also hope I haven't just been suckered by a troll attempt, windows/unix is better then unix/windows being an age-old means of trolling.) No, i'm not a "troll". I was just adding my o

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 2012-10-28 19:21, Oscar Benjamin wrote: On 28 October 2012 14:20, Virgil Stokes wrote: On 28-Oct-2012 12:18, Dave Angel wrote: On 10/24/2012 03:14 AM, Virgil Stokes wrote: On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 28-Oct-2012 12:18, Dave Angel wrote: On 10/24/2012 03:14 AM, Virgil Stokes wrote: On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the "forward in time" file will be in binary. I really think it will be simplest to just

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the "forward in time" file will be in binary. I really think it will be simplest to just write the file in forward order, then use mmap to read it one record at a time. I

Re: Fast forward-backward (write-read)

2012-10-25 Thread Virgil Stokes
On 24-Oct-2012 17:11, rusi wrote: On Oct 23, 7:52 pm, Virgil Stokes wrote: I am working with some rather large data files (>100GB) that contain time series data. The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format. I perform various types of processing on these data (e.g. mov

Re: Fast forward-backward (write-read)

2012-10-24 Thread Virgil Stokes
On 23-Oct-2012 22:03, Cousin Stanley wrote: Virgil Stokes wrote: Not sure about "tac" --- could you provide more details on this and/or a simple example of how it could be used for fast reversed "reading" of a data file ? tac is available as a command under linux .

Re: Fast forward-backward (write-read)

2012-10-24 Thread Virgil Stokes
On 24-Oct-2012 00:53, Steven D'Aprano wrote: On Tue, 23 Oct 2012 17:50:55 -0400, David Hutto wrote: On Tue, Oct 23, 2012 at 10:31 AM, Virgil Stokes wrote: I am working with some rather large data files (>100GB) [...] Finally, to my question --- What is a fast way to write these v

Re: Fast forward-backward (write-read)

2012-10-24 Thread Virgil Stokes
On 24-Oct-2012 00:57, Demian Brecht wrote: This is a classic example of why the old external processing algorithms of the 1960s and 70s will never be obsolete. No matter how much memory you have, there will always be times when you want to process more data than you can fit into memory. But sur

Re: Fast forward-backward (write-read)

2012-10-24 Thread Virgil Stokes
On 24-Oct-2012 02:06, Oscar Benjamin wrote: On 23 October 2012 15:31, Virgil Stokes wrote: I am working with some rather large data files (>100GB) that contain time series data. The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format. I perform various types of processing on these d

Re: Fast forward-backward (write-read)

2012-10-24 Thread Virgil Stokes
On 24-Oct-2012 00:36, David Hutto wrote: Don't forget to use timeit for an average OS utilization. I'd suggest two list comprehensions for now, until I've reviewed it some more: forward = ["%i = %s" % (i,chr(i)) for i in range(33,126)] backward = ["%i = %s" % (i,chr(i)) for i in range(126,32,-

Re: Fast forward-backward (write-read)

2012-10-23 Thread Virgil Stokes
On 23-Oct-2012 19:56, Tim Chase wrote: On 10/23/12 12:17, Virgil Stokes wrote: On 23-Oct-2012 18:09, Tim Chase wrote: Finally, to my question --- What is a fast way to write these variables to an external file and then read them in backwards? Am I missing something, or would the fairly

Re: Fast forward-backward (write-read)

2012-10-23 Thread Virgil Stokes
On 23-Oct-2012 18:35, Dennis Lee Bieber wrote: On Tue, 23 Oct 2012 16:31:17 +0200, Virgil Stokes declaimed the following in gmane.comp.python.general: Finally, to my question --- What is a fast way to write these variables to an external file and then read them in backwards? Stuff

Re: Fast forward-backward (write-read)

2012-10-23 Thread Virgil Stokes
On 23-Oct-2012 18:17, Paul Rubin wrote: Virgil Stokes writes: Finally, to my question --- What is a fast way to write these variables to an external file and then read them in backwards? Seeking backwards in files works, but the performance hit is significant. There is also a performance hit

Re: Fast forward-backward (write-read)

2012-10-23 Thread Virgil Stokes
On 23-Oct-2012 18:09, Tim Chase wrote: On 10/23/12 09:31, Virgil Stokes wrote: I am working with some rather large data files (>100GB) that contain time series data. The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format. I perform various types of processing on these data (e.g. mov

Fast forward-backward (write-read)

2012-10-23 Thread Virgil Stokes
I am working with some rather large data files (>100GB) that contain time series data. The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format. I perform various types of processing on these data (e.g. moving median, moving average, and Kalman-filter, Kalman-smoother) in a sequential man

Re: OT Questions

2012-10-17 Thread Virgil Stokes
On 17-Oct-2012 11:31, Chris Angelico wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter

Re: Installation of yappi (timing module)

2012-08-25 Thread Virgil Stokes
On 24-Aug-2012 12:28, Virgil Stokes wrote: I have been doing some experiments with different modules for the timing of functions and code segments. One module I would like to test is yappi (thread aware timer) which is listed at PyPI. However, I have been unable to install it on Windows Vista

Installation of yappi (timing module)

2012-08-24 Thread Virgil Stokes
tried both easy_install and pip (as suggested at http://code.google.com/p/yappi/). Here is what happens with easy_install C:\Users\Virgil>easy_install yappi Searching for yappi Reading http://pypi.python.org/simple/yappi/ Reading http://yappi.googlecode.com/ Best match: yappi 0.62 Download

Re: Books?

2012-08-22 Thread Virgil Stokes
On 22-Aug-2012 16:04, Steven D'Aprano wrote: On Tue, 21 Aug 2012 18:36:50 -0700, Anonymous Group wrote: What books do you recomend for learning python? Preferably free and/or online. Completely by coincidence, I have just discovered, and I mean *literally* just a few minutes ago, this book: h

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 16-Aug-2012 19:40, Steven D'Aprano wrote: On Thu, 16 Aug 2012 13:18:59 +0200, Virgil Stokes wrote: On 15-Aug-2012 02:19, Steven D'Aprano wrote: On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote: You might find the following useful: def testFunc(startingList):

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 16-Aug-2012 15:02, Peter Otten wrote: Virgil Stokes wrote: def testFunc(startingList): xOnlyList = []; j = -1 for xl in startingList: if (xl[0] == 'x'): That's going to fail in the starting list contains an empty string. Use xl.startswith('x') instead. Yes, but th

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 15-Aug-2012 02:19, Steven D'Aprano wrote: On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote: You might find the following useful: def testFunc(startingList): xOnlyList = []; j = -1 for xl in startingList: if (xl[0] == 'x'): That's going to

Fwd: Re: Strange behavior

2012-08-14 Thread Virgil Stokes
Original Message Subject:Re: Strange behavior Date: Tue, 14 Aug 2012 21:32:16 +0200 From: Virgil Stokes To: light1qu...@gmail.com On 2012-08-14 17:38, light1qu...@gmail.com wrote: Hi, I am migrating from PHP to Python and I am slightly confused. I am

Re: Strange behavior

2012-08-14 Thread Virgil Stokes
On 2012-08-14 17:38, light1qu...@gmail.com wrote: Hi, I am migrating from PHP to Python and I am slightly confused. I am making a function that takes a startingList, finds all the strings in the list that begin with 'x', removes those strings and puts them into a xOnlyList. However if you run

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Virgil Stokes
On 20-Jul-2012 10:27, Steven D'Aprano wrote: On Fri, 20 Jul 2012 08:20:57 +1000, Chris Angelico wrote: Since the current evidence indicates the universe will just keep expanding, it's more of a "deep freeze death..." Heat death means *lack* of heat. The second law of thermodynamics sta

Re: [ANN] IPython 0.13 is officially out!

2012-07-01 Thread Virgil Stokes
On 01-Jul-2012 13:56, Leo wrote: On 2012-07-01 01:55 +0800, Fernando Perez wrote: - ~6 months of work. - 373 pull requests merged. - 742 issues closed (non-pull requests). - contributions from 62 authors. - 1760 commits. - a diff of 114226 lines. Thank you for the hard work. Leo I have tried t

PyOpenCV -- help?

2012-04-23 Thread Virgil Stokes
I have tried to install PyOpenCV without success (error occurs during the installation procedure). I reported the problem to the opencv user group (http://groups.google.com/group/ctypes-opencv) but this group has not been active since June of last year. Anyone know of how to get help with PyO

Fast file data retrieval?

2012-03-12 Thread Virgil Stokes
I have a rather large ASCII file that is structured as follows header line 9 nonblank lines with alphanumeric data header line 9 nonblank lines with alphanumeric data ... ... ... header line 9 nonblank lines with alphanumeric data EOF where, a data set contains 10 lines (header + 9 nonblank) and

Re: Module msvcrt for Python

2011-12-18 Thread Virgil Stokes
On 18-Dec-2011 11:31, Virgil Stokes wrote: I am running Python 2.6.6 on a Windows Vista platform and for some reason the module msvcrt is not present. How can I install the msvcrt module in my Python 2.6.6? God Jul :-) I found the problem! My code was using Python 2.5 (inside cygwin) by

Module msvcrt for Python

2011-12-18 Thread Virgil Stokes
I am running Python 2.6.6 on a Windows Vista platform and for some reason the module msvcrt is not present. How can I install the msvcrt module in my Python 2.6.6? God Jul :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Agent-based modeling

2011-11-10 Thread Virgil Stokes
On 10-Nov-2011 16:16, Jerry Zhang wrote: 2011/11/10 Virgil Stokes mailto:v...@it.uu.se>> Python seems like a good language to use for agent-based modeling. However, before starting to work on a Python package for this, I would be very interested in knowing about any ex

Agent-based modeling

2011-11-10 Thread Virgil Stokes
Python seems like a good language to use for agent-based modeling. However, before starting to work on a Python package for this, I would be very interested in knowing about any existing Python code for agent-based modeling. --V -- http://mail.python.org/mailman/listinfo/python-list

Execute code after Shut Down command given --- How?

2011-09-22 Thread Virgil Stokes
I would like to execute some Python code (popup message to be displayed) when Windows Vista/7 is shut down. That is, this code should execute after "Shut Down" is given from the "Shut Down Windows" popup, but before the actual shut down sequence starts. How to write Python code to accomplish

How to schedule execution of code?

2011-03-15 Thread Virgil Stokes
Suppose that I have some Python code (vers. 2.6) that has been converted into an *.exe file and can be executed on a Windows (Vista or 7) platform. What can one do to have this *.exe executed at a set of specific times each day? In addition, if a day is missed (e.g. computer on which it resides

Universal Feed Browser problem in feedparser.py

2011-02-07 Thread Virgil Stokes
I am running Python 2.6 on a Windows Vista (32-bit) platform. I recently installed the Universal Feed Parser package (feedparser-5-0). When I try to execute the following commands: >>> import feedparser >>> d = feedparser.parse("http://feedparser.org/docs/examples/atom10.xml";) which is given

A web site using Python

2010-12-04 Thread Virgil Stokes
I would like to design a web site that can be used to help people to find a cat that they can adopt. Note, this is a non-profit project, but one that I believe to be quite important. Here are some of my initial thoughts on this project. /Site purpose:/ *To provide a web site for anyone to look

Re: Financial time series data

2010-09-03 Thread Virgil Stokes
A more direct question on accessing stock information from Yahoo. First, use your browser to go to: http://finance.yahoo.com/q/cp?s=%5EGSPC+Components Now, you see the first 50 rows of a 500 row table of information on S&P 500 index. You can LM click on 1 -50 of 500 |First|Previous|Next

Re: Financial time series data

2010-09-02 Thread Virgil Stokes
On 09/02/2010 08:15 PM, Hidura wrote: But what kind of data you want to download?, because the financial time it's basicly html code and you can work very well with a parser 2010/9/2, Virgil Stokes: Has anyone written code or worked with Python software for downloading financial

Financial time series data

2010-09-02 Thread Virgil Stokes
Has anyone written code or worked with Python software for downloading financial time series data (e.g. from Yahoo financial)? If yes, would you please contact me. --Thanks, V. Stokes -- http://mail.python.org/mailman/listinfo/python-list

Re: Sikuli: the coolest Python project I have yet seen...

2010-01-25 Thread Virgil Stokes
On 25-Jan-2010 04:18, Ron wrote: Sikuli is the coolest Python project I have ever seen in my ten year hobbyist career. An MIT oepn source project, Sikuli uses Python to automate GUI tasks (in any GUI or GUI baed app that runs the JVM) by simply drag and dropping GUI elements into Python scripts a

Java-to-Python?

2009-12-18 Thread Virgil Stokes
I have a rather large Java package for the analysis of networks that I would like to convert to Python. Many of the classes in the Java package are "Serializable". Any recommendations on Java-to-Python (2.6) would be appreciated. --V -- http://mail.python.org/mailman/listinfo/python-list

Accessing a Web server --- how?

2009-11-17 Thread Virgil Stokes
If one goes to the following URL: http://www.nordea.se/Privat/Spara%2boch%2bplacera/Strukturerade%2bprodukter/Aktieobligation%2bNr%2b99%2bEuropa%2bAlfa/973822.html it contains a link (click on "Current courses NBD AT99 3113A") to: http://service.nordea.com/nordea-openpages/six.action?target=/nord

Web servers

2009-11-16 Thread Virgil Stokes
Any suggestions on using Python to connect to Web servers (e.g. to access financial time series data)? --V. Stokes -- http://mail.python.org/mailman/listinfo/python-list

Start-up program

2009-08-18 Thread Virgil Stokes
How difficult is to create a program that will be executed when Windows Vista is started? As Windows Calendar does, for example. I am actually more interested in the Python tools that might be used for this task. I hope that this question is not inappropriate for the list. :-\ --V -- http://

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Virgil Stokes
Virgil Stokes wrote: Diez B. Roggisch wrote: Virgil Stokes schrieb: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Virgil Stokes
Diez B. Roggisch wrote: Virgil Stokes schrieb: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26

"Deprecated sets module" with Python 2.6

2009-07-28 Thread Virgil Stokes
I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26\lib\site-packages\py2exe\build_exe.py:16: Deprecatio

Re: On out-of-date Python Applications

2009-07-20 Thread Virgil Stokes
David Robinow wrote: On Mon, Jul 20, 2009 at 7:24 AM, John Machin wrote: ... The next step would be to try to compile ODE 0.7 or 0.8 with VS9 -- however this would require "project files" for ODE for VS9, and there aren't any on the ODE website; it has only those for VS3 and VS5.

On out-of-date Python Applications

2009-07-19 Thread Virgil Stokes
I am not a heavy user of Python; but, I do work with it and some of its application packages (e.g. PyODE), in an academic setting. Many of these applications packages have a Windows installer which usually works fine. However, I also try to keep up with the latest release of Python, and this is

PyODE

2009-07-12 Thread Virgil Stokes
Does anyone have PyODE running on Python 2.6.2? --V -- http://mail.python.org/mailman/listinfo/python-list

On the property function

2009-06-15 Thread Virgil Stokes
Does anyone have a good example (or examples) of when "property(...)" can be useful? Thank you, --V. Stokes -- http://mail.python.org/mailman/listinfo/python-list

matplotlib installation

2009-06-12 Thread Virgil Stokes
Any suggestions on installing matplotlib for Python 2.6.2 on a Windows Vista platform? --V -- http://mail.python.org/mailman/listinfo/python-list

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Virgil Stokes
John Yeung wrote: On Jun 10, 1:52 am, Steven D'Aprano wrote: On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote: Therefore, to me the most up-to-date docs (which say that uniform(a, b) returns a float in the closed interval [a, b]) is closer to correct than befor

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Virgil Dupras
hat does this, allowing keywords as method names? I don't know, but if not, there's probably a reason for it. Your views on code elegance are also rather Javaish. I'd go for "class_reference(object)" (and why the heck would you "be limited to using method for casting"?). Ciao, Virgil -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a file's time stamp -- followup

2008-08-12 Thread Virgil Stokes
Christian Heimes wrote: William Purcell wrote: Hi all, I am wanting to check to see the last time a file was edited. For example, I have a directory containing two text files, file1.txt and file2.txt. I want to be able to process these files but only if they have been edited since the last

CAB files

2008-08-08 Thread Virgil Stokes
I would appreciate python code for creating *.cab files. --V. Stokes -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclassing list the right way?

2008-04-25 Thread Virgil Dupras
On Apr 25, 4:03 pm, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I want to subclass list so that each value in it is calculated at call > time.  I had initially thought I could do that by defining my own > __getitem__, but 1) apparently that's deprecated (although I can't > find that; got a link?), a

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Virgil Dupras
On Apr 24, 10:22 pm, Brian Munroe <[EMAIL PROTECTED]> wrote: > My example: > > class A(object): > >         def __init__(self, name): >                 self.__name = name > >         def getName(self): >                 return self.__name > > class B(A): > >         def __init__(self,name=None): >

Re: Test driven development

2008-01-24 Thread Virgil Dupras
On Jan 24, 1:30 pm, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Virgil Dupras schreef: > > > I know what you mean by top-down vs. bottom-up and I used to have the > > same dilemma, but now I would tend to agree with Albert. Your issue > > with top-down or bottom-up is

Re: Test driven development

2008-01-24 Thread Virgil Dupras
test below them, they all have to be "brought up" to the highest level of tests so you can re-organize your code. Since doing this is a lot of work, and usually messing with tests is a lot more dangerous than messing with the code itself, you would tend to stay with your old design, even if

Re: Best way to protect my new commercial software.

2007-12-10 Thread Virgil Dupras
On Dec 10, 9:55 am, farsheed <[EMAIL PROTECTED]> wrote: > Thanks. But I ask this question technically, I mean I know nothing is > uncrackable and popular softwares are not well protected. But my > software is not that type and I don't want this specific software > popular. > It is some kind of in h

Re: a Python person's experience with Ruby

2007-12-10 Thread Virgil Dupras
On Dec 9, 1:15 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Richard Jones a écrit : > > > > > Bruno Desthuilliers wrote: > > >>class A(object): > >> @apply > >> def a(): > >> def fget(self): > >> return self._a > >> def fset(self, val): > >> self._a = val > >> re

Re: Best way to protect my new commercial software.

2007-12-10 Thread Virgil Dupras
On Dec 10, 8:15 am, farsheed <[EMAIL PROTECTED]> wrote: > I wrote a software and I want to protect it so can not be cracked > easily. I wrote it in python and compile it using py2exe. what is the > best way in your opinion? Don't. This is a fight you already lost. Besides, people who crack softwar

Re: Any simpler way to do this

2007-12-07 Thread Virgil Dupras
On Dec 7, 9:37 am, Lars Johansen <[EMAIL PROTECTED]> wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED > elif color == "BLUE": > x = term.BLUE > elif color == "GREEN": >

Re: Dictionary instantiation?

2007-12-07 Thread Virgil Dupras
On Dec 7, 9:05 am, Matt_D <[EMAIL PROTECTED]> wrote: > Hello there, this is my first post to the list. Only been working with > Python for a few days. Basically a complete newbie to programming. > > I'm working with csv module as an exercise to parse out a spreadsheet > I use for work.(I am an edit

Re: Can I embed Windows Python in C# or VC++?

2007-12-07 Thread Virgil Dupras
On Dec 7, 9:03 am, grbgooglefan <[EMAIL PROTECTED]> wrote: > On Dec 7, 3:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > En Fri, 07 Dec 2007 01:24:57 -0300, grbgooglefan <[EMAIL PROTECTED]> > > escribió: > > > > On Dec 7, 12:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > > wro

Re: >>> CIA Squashes Democracy in Pakistan <<

2007-11-05 Thread Virgil
In article <[EMAIL PROTECTED]>, Ivar Rosquist <[EMAIL PROTECTED]> wrote: > On Mon, 05 Nov 2007 21:43:09 +, zionist.news wrote: What has this to do with mathematics? -- http://mail.python.org/mailman/listinfo/python-list

Refactoring test units after an extract method

2007-06-05 Thread Virgil Dupras
This is not strictly python related, but it's not strictly TDD related either. Anyway, here it goes. There's something that I was never quite sure how to handle with test units: How to handle the test unit refactoring after a method extraction. Let's say that you have a function foo() that does A

Re: Good Python style?

2007-05-31 Thread Virgil Dupras
On May 31, 3:59 am, Andreas Beyer <[EMAIL PROTECTED]> wrote: > Hi, > > I found the following quite cryptic code, which basically reads the > first column of some_file into a set. > In Python I am used to seeing much more verbose/explicit code. However, > the example below _may_ actually be faster t

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Virgil Dupras
On May 13, 11:44 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > PEP 1 specifies that PEP authors need to collect feedback from the > community. As the author of PEP 3131, I'd like to encourage comments > to the PEP included below, either here (comp.lang.python), or to > [EMAIL PROTECTED] > > In

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:33 pm, Virgil Dupras <[EMAIL PROTECTED]> wrote: > On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > > > > > Okay does anyone know how to decorate class member functions? > > > The following code gives me an error: > > &g

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-21 Thread Virgil Dupras
On Mar 21, 10:05 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Virgil Dupras wrote: > > On Mar 21, 9:24 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Marcin Ciura wrote: > >>> Steven D'Aprano wrote: > >>>>>>> x, y, z =

Re: Python 3000 idea: reversing the order of chained assignments

2007-03-21 Thread Virgil Dupras
On Mar 21, 9:24 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Marcin Ciura wrote: > > Steven D'Aprano wrote: > > x, y, z = 1, 2, 3 > > x = y = z > > x, y, z > >> (3, 3, 3) > > >> I certainly wouldn't expect to get (2, 3, 3). > > > Neither would I. I must have expressed myself not clearl

Re: Flatten a two-level list --> one liner?

2007-03-07 Thread Virgil Dupras
On Mar 7, 7:14 pm, "Sergio Correia" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm looking for an easy way to flatten a two level list like this > > spam = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]] > > Into something like > eggs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] > > There are *no* special c

Re: Nested Parameter Definitions

2007-02-25 Thread Virgil Dupras
On Feb 25, 1:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > I blogged on finding a new-to-me feature of Python, in that you are > allowed to nnest parameter definitions: > > >>> def x ((p0, p1), p2): > > ... return p0,p1,p2 > ...>>> x(('Does', 'this'), 'work') > > ('Does', 'this', 'work') > > > >

Re: Inheriting str object

2007-02-05 Thread Virgil Dupras
On Feb 5, 5:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I want to have a str with custom methods, but I have this problem: > > class myStr(str): > def hello(self): > return 'hello '+self > > s=myStr('world') > print s.hello() # prints 'hello world' > s=s.upper() > print s.he

Re: Matching Directory Names and Grouping Them

2007-01-11 Thread Virgil Dupras
>From your example, if you want to group every path that has the same last 9 characters, a simple solution could be something like: groups = {} for path in paths: group = groups.setdefault(path[-9:],[]) group.append(path) I didn't actually test it, there ight be syntax errors. J wrote: >

Re: About the 79 character line recommendation

2006-12-05 Thread Virgil Dupras
Steve Bergman wrote: > As I study Python, I am trying to develop good, Pythonic, habits. For > one thing, I am trying to keep Guido's the style guide in mind. > > And I know that it starts out saying that it should not be applied in > an absolute fashion. > > However, I am finding that the 79 char

  1   2   >