"Andre Engels" wrote
What is this: d = [ int(x) for x in s.split(":") ]
That's called list comprehension. The notation
[f(x) for x in A if p(x)]
means:
Form a list in the following way:
For Wayne's benefit...
You will also find a similar construction in parens called
a generator expressio
On Wed, Mar 4, 2009 at 11:13 AM, Eric Dorsey wrote:
> I know, for example, that the > code means >, but what I don't know is
> how to convert it in all my data to show properly? I
Feedparser returns the output in html only so except html tags and
entities in the output.
What you want is to Unesca
Eric Dorsey wrote:
_So here is my program, I'm pulling some information off of my Snipt
feed .._
I know, for example, that the > code means >, but what I don't know
is how to convert it in all my data to show properly? In all the
feedparser examples it just smoothly has the output correct
*So here is my program, I'm pulling some information off of my Snipt feed ..
*
import feedparser
d = feedparser.parse('http://snipt.net/dorseye/feed')
x=0
for i in d['entries']:
print d['entries'][x].title
print d['entries'][x].summary
print
x+=1
*Output*
Explode / Implode List
Hello list,
I have been coding in python a short while and I have been wondering
which approach should I take on documentation (API docs) for a python
library I have been working on, there is currently code docstrings,
docstrings with some markup (epydoc, etc), or external programs such
as Sphinx
On Tue, Mar 3, 2009 at 7:01 PM, Lie Ryan wrote:
> Marc Tompkins wrote:
> > List comprehensions will make your head hurt the first few dozen times
>
>> you encounter them. After that, they become easier to use than the longer
>> for-loop structure they replace - as André pointed out, they read a
Marc Tompkins wrote:
> List comprehensions will make your head hurt the first few dozen times
you encounter them. After that, they become easier to use than the
longer for-loop structure they replace - as André pointed out, they read
almost like English.
I have to disagree, I immediately fell
Title: Signature.html
Memory malfunction. I've been using the program to add features so much
with IDLE my brain went IDLE. One starts it by double clicking on the
py file. It is possible some users might have drifted off into IDLE
though, but unlikely.
Wayne Watson wrote:
Nope. I just tr
Title: Signature.html
There's another way?
Alan Gauld wrote:
"Wayne Watson" wrote
Note though the use of control variables like
IntVar, etc.
FWIW. Personally I never use those "convenience" features of Tk. I
prefer to explicitly set and get them myself.
Alan G
___
Title: Signature.html
Nope. I just tried it. It works fine from there. Interesting, as far as
I know, the author wanted us to run it from IDLE. That may explain some
other oddities. I'll check with him. I'm quite sure in his user manual
he never talks about the command console.
Alan Gauld wro
"Wayne Watson" wrote
Note though the use of control variables like IntVar, etc.
FWIW. Personally I never use those "convenience" features of Tk.
I prefer to explicitly set and get them myself.
Alan G
___
Tutor maillist - Tutor@python.org
http
Title: Signature.html
An interesting thought, I'll ponder it. Note though the use of control
variables like IntVar, etc. In the 2000 line original version of all
the program, integers, dates, and booleans are in use for the
simplified widget I produced. Note to the use of self.anumberVar.set.
(
Title: Signature.html
I browsed through your response, and it looks like this may be doable.
I'll look this over more carefully this evening. It seems as though
someone should have had a similar problem in the past. The Tkinter
interface seems to be a, I hope, temporary logjam. I don't recall
X
"Wayne Watson" wrote
Comments?
class IntVar_GUI:
I just noticed the name of the class. This kind of implies that you
are
intending writing GUIs for each data type? That shouldn't be necessary
since the inputs will be strings in each case. You only need to call
the appropriate conversion
destroy() took care of it, but I wonder what advantage there was to
Quit()?
destroy destroys the widget, quit exits the main loop.
destroying the top level widget usually causes the mainloop; to die
too
so the end result is the same (provided you have no non-modal dialogs
open?).
HTH,
Ala
"Wayne Watson" wrote
BTW, the Quit function is original but doesn't kill the window when
Quit is used.
Does that include running from the command console?
Is this another IDLE/Tkinter issue maybe?
Alan G.
___
Tutor maillist - Tutor@python.
"Wayne Watson" wrote
see my post of yesterday, "Maintaining the Same Variable
Type--Tkinter",
went over like a lead balloon. :-)
Yeah, I had no idea what you meant :-)
I've heavily modified the original code to accept a config file,
and set up variable to initialize the widgets, trying to
Title: Signature.html
WW,
good. Thanks.
destroy() took care of it, but I wonder what advantage there was to
Quit()?
WW
W W wrote:
On Tue, Mar 3, 2009 at 1:54 PM, Wayne Watson
wrote:
BTW, the Quit function is original but doesn't kill the window when Quit is
used. What fixe
import datetime
s = '09:35:23'
datetime.datetime.strptime(s, '%H:%M:%S')
datetime.datetime(1900, 1, 1, 9, 35, 23)
Can you figure out how to proceed from there?
In case she doesn't know:
import datetime as dt
start="09:35:23"
end="10:23:00"
start_dt = dt.datetime.strptime(start, '%H:%
import datetime
s = '09:35:23'
datetime.datetime.strptime(s, '%H:%M:%S')
datetime.datetime(1900, 1, 1, 9, 35, 23)
Can you figure out how to proceed from there?
In case she doesn't know:
import datetime as dt
start="09:35:23"
end="10:23:00"
start_dt = dt.datetime.strptime(start, '%H:%M:
On Tue, Mar 3, 2009 at 1:54 PM, Wayne Watson
wrote:
>
> BTW, the Quit function is original but doesn't kill the window when Quit is
> used. What fixes that? For more bonus points, it seems as though the try
> statement in the dialog should really bring up an "Error" dialog saying
> something is wr
Title: Signature.html
I see my post of yesterday, "Maintaining the Same Variable
Type--Tkinter", went over like a lead balloon. :-)
(Note though the Myth Busters TV series successfully built and flew a
lead balloon.)
Let's see if I can really simplify what I'm after. I've pulled the
essential
On Tue, Mar 3, 2009 at 12:18 PM, Timo wrote:
> Hello all, I'm using the Shelve module to store dictionaries in a list as a
> value of a key.
>
> So:
>
> key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}]
>
> The problem is I can't remove a dictionary from the list.
>
>
> import shelve
>
>
Hello all, I'm using the Shelve module to store dictionaries in a list
as a value of a key.
So:
key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}]
The problem is I can't remove a dictionary from the list.
import shelve
s = shelve.open('file')
try:
for index, value in enumerate(s[
On Tue, Mar 3, 2009 at 3:05 AM, Mr Gerard Kelly
wrote:
> Hello, I am attempting to make a simple animation of a vibrating string using
> Tkinter canvas.
> I haven't been able to find much information on how to do it.
> I have my data of position x on the string at time t. I can plot it
> with
> r
Hello, I am attempting to make a simple animation of a vibrating string using
Tkinter canvas.
I haven't been able to find much information on how to do it.
I have my data of position x on the string at time t. I can plot it with
Tkinter showing the string for all times at once:
width=1500
height
Hi, I am looking for someone to write a touchscreen GUI for PyKaraoke (
http://www.kibosh.org/pykaraoke/). Looking for someone based in or around
London with a lot of experience of Python and Linux who willl be able to
complete this project quickly. Knowledge of sound and video processing on
Linux
On Mon, Mar 2, 2009 at 11:18 PM, Andre Engels wrote:
> On Tue, Mar 3, 2009 at 4:54 AM, Wayne Watson
> wrote:
> >self.recent_events = [ event for event in self.recent_events
> >if os.path.exists(event) and
> >(time.time() - o
28 matches
Mail list logo