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)
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
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% ||
+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.
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
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
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
...
...
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
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
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
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
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
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
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
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?
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/
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
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"
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:
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
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
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
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
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
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
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 .
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
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
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
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,-
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
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
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
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
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
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
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
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
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
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):
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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://
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
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
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
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.
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
Does anyone have PyODE running on Python 2.6.2?
--V
--
http://mail.python.org/mailman/listinfo/python-list
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
Any suggestions on installing matplotlib for Python 2.6.2 on a Windows
Vista platform?
--V
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
I would appreciate python code for creating *.cab files.
--V. Stokes
--
http://mail.python.org/mailman/listinfo/python-list
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
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):
>
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
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
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
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
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
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":
>
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
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
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
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
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
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
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
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
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
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 =
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
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
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')
>
>
>
>
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
>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:
>
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 - 100 of 105 matches
Mail list logo