> 3. scite (very simple)
>
>All are great and I use all of the three.
Just back from vacation or I would have had
a lot more to say! :-)
But I have to agree with scite as an option,
its very lightweight and fast and is basically
the editor portion opf Pythonwin(*). That means
you get all the edit
>From windows, using a python script how can I open
> Adobe Reader without displaying a PDF document?
Just start the reader executable with no arguments.
os.system(r"C:\Program Files\Adobe\Acrobat
7.0\Reader\AcroRd32.exe")
Does it for me.
If you need to send commands etcto it you propbably nee
>>class startremail:
>>def __init__(self):
>> remailfile = open('U:\Bounce20.txt', 'r')
>> #future
>> def getday(self):
>> def Read(self,line):
>>from startremail import *
>>x = startremail()
>>print x.getday()
>>I get the following return
>>
>>NameError: name 'getday' is not defi
On 27/09/05, lmac <[EMAIL PROTECTED]> wrote:
> Hi there,
> i have a base-question. If i want to read some kind of data out of a line
> which i know the start-tag and the end-tag in an html-file how do i
> recognize
> if it's more than one line ?
>
> Example:
>
> Some textlinktext . DATA et
Well, I won't argue with anyone who chooses otherwise, but CherryPy http://www.cherrypy.org/ is easy to use, lightweight, quick, and pythonic. I write everything as plain old python, then webify it the very last thing.
It's also the basis of a new, promising framework called TurboGears http://
Maybe it's just me. I am always haunted by "coder's remorse" (the
certainty that there's a more compact, beautiful, fun, maintainable way
to code anything I finish.)
At any rate, I am currently working on a script to model an ordered
collection of geographic points, all of which must share the sa
Don Jennings wrote:
> what I would really like to know are how people decided to use any
> particular framework.
Well I stumbled into Jython / Velocity over many years. My first web
application was written in Java + servlets using the Jetty servlet engine. At
first I didn't use any template eng
Thanks for all the input!!! I really appreciate it. I need to post a
correction to my script. What I sent was an early version. I made a few
minor modifications:
import ConfigParser, string, sys, ossection = sys.argv[1]interface = sys.argv[3]INI=ConfigParser.ConfigParser()INI.read("c:\utils\int
Ron Phillips wrote:
> At any rate, I am currently working on a script to model an ordered
> collection of geographic points, all of which must share the same
> collection of attributes. So, a little collection might be:
>
> pointList = [
> {lat:40.123,lon:-81.456,
> 'attributes':{'msg':'exam
I've used CherryPy on a couple of projects now. I use it with
HTMLTemplate
(http://freespace.virgin.net/hamish.sanderson/htmltemplate.html) and
SQLObject (http://sqlobject.org/).
This has the advantage of being about as Pythonic as you can get, since
everything you manipulate is represented as a
Kent Johnson wrote:
I'm curious about why you want to do this, it is kind of a
strange requirement.
Yeah, that was bothering me, too. I was a little unsure if I'd even
defined the problem properly; that's what I meant by: "Am I even asking
the right questions?"
I'll play around with the class
Hi all, I have an xml file where the tags are all on the same line,
without any newline. This file is quite big and difficult to read. I'd
like to format it in a convenient way, using indentation and nesting.
How to pretty print my content?
I hope to have explained well enough my problem, differen
> pointList = [
> {lat:40.123,lon:-81.456,
>'attributes':{'msg':'example','beavers':34, 'distance':18.132}
> },
> {lat:40.12345,lon:-81.45678,
>'attributes':{'msg':'','beavers':0, 'distance':0.0}
> }
> ]
THis sopunds like its crying out for a class
class Point:
def __init__(self, lat
Hi,
Ok, I'll try to convince them to try python... but still, would it be
best to just:
Program in C with Python and Java scripts
Program in Python with a little bit of C?
The game we're trying to make is a Super Mario type game (or super tux
for you like linux games).
I suppose pygame would mak
Have you benchmarked it yet? 4000 lines isn't very many, even for
an older machine. Starting the Python interpreter usually takes
most of the time with simple scripts like this. Honestly,
benchmark :)
You might find it easier to do::
interface_list = INI.items(section)for i in interface_list:
Joseph Quigley wrote:
> Hi,
> Ok, I'll try to convince them to try python... but still, would it be
> best to just:
> Program in C with Python and Java scripts
This seems like a poor choice. Some commercial games have been written with the
main game engine in C and Python used to script some gam
> Subject:
> [Tutor] web development
> From:
> Don Jennings <[EMAIL PROTECTED]>
> Date:
> Tue, 27 Sep 2005 22:13:30 -0400
> To:
> tutor@python.org
>
> To:
> tutor@python.org
>
>
> Earlier this month, Kent posted that Jython and Velocity are a good way
> to develop dynamic web sites. After a lit
Negroup - schrieb:
> Hi all, I have an xml file where the tags are all on the same line,
> without any newline. This file is quite big and difficult to read. I'd
> like to format it in a convenient way, using indentation and nesting.
> How to pretty print my content?
Untested:
import sys
from xml
On Wed, 28 Sep 2005, Ron Phillips wrote:
> Maybe it's just me. I am always haunted by "coder's remorse" (the
> certainty that there's a more compact, beautiful, fun, maintainable way
> to code anything I finish.)
>
> At any rate, I am currently working on a script to model an ordered
> collecti
Ok, I have three diverse answers from three of the tutors that I respect
most.
Kent Johnson's approach: subclass dict and overloads the __getitem__ ,
__setitem__, and __delitem__ methods.
Alan G's idea:
". . .
Get the init method to update a global (or class based)
list of instances and writ
BeautifulSoup
is a brilliant module for this kind of thing. Just make an instance of
a parser feed() in the file with file.read() then .prettify()On 28/09/05, Negroup - <[EMAIL PROTECTED]> wrote:
Hi all, I have an xml file where the tags are all on the same line,without any newline. This file is qu
Danny Yoo wrote:
>You may want to change the data structure.
>
>Rather than have points all be peers, reorganize them so that there's some
>kind of hierarchy: that'll help you directly represent the "sharing" of
>attributes. Explicitly:
>
>#
hello, I'm using wxpython to write a windows app. I want to be able to hide a page in a notebook and I'm not sure how to do it. functionally its the same as doing:
notebook.Show(False)
but I want that to work for just one notebook page and not the whole notebook. I tried the wxpython list but d
I am trying to learn Python to use in my lesson plans. I am using Windows XP
and the textbooks I am using are Beginning Python by WROX and Learning
Pyhton by O'Reilly.
I am definning a range of words 0 to 55, if the number is divisible by
3,7,11 with no remainder print eggs, else print spam. T
> I am trying to learn Python to use in my lesson plans. I am using Windows XP
> and the textbooks I am using are Beginning Python by WROX and Learning
> Pyhton by O'Reilly.
> I am definning a range of words 0 to 55, if the number is divisible by
> 3,7,11 with no remainder print eggs, else prin
Rosalee Dubberly said unto the world upon 2005-09-28 15:41:
> I am trying to learn Python to use in my lesson plans. I am using
> Windows XP and the textbooks I am using are Beginning Python by WROX and
> Learning Pyhton by O'Reilly.
>
> I am definning a range of words 0 to 55, if the number is
Is it possible to call a function or class by reference, aside from
using an eval approach?
What I would like to do is have a loop that processes functions by:
1. gettting the input that consists of a function and its parameters,
2. determining if the function is on an approved function
How about something like this
def foo(bar):
print bar
d = {"foo":foo}
s = "foo"
params = "bar"
try: d[s](params)
except: KeyError
Then you can just put the allowed functions into the dictionary.On 29/09/05, DS <[EMAIL PROTECTED]
> wrote:Is it possible to call a function or class by reference
Thanks for answering my question. What I'm hoping to avoid is an
explicit reference to any of the called functions within the program.
By doing it that way, it would avoid a maintenance problem of having to
remember to put a reference for every new function in the calling program.
ds
Adam wro
Hello
I downloaded the graphics.py file and have it saved on my computer but everytime I run the following program I seem to keep getting an error.
from graphics import*
def main():
win=GraphWin()
shape = Circle(Point(50,50), 20)
shape.setOutline("red")
shape.setFill("red")
s
I want to save this file, import it and make the changes, eggs = toast, spam
= jelly and change the values if needed.
def firstpart():
for n in range(0, 55):
if n % 3 == 0 or n % 7 == 0 or n % 11 == 0:
print 'eggs,',
else:
print 'spam,',
Rosa Dubberly
_
Hi, I've got a problem:
I've got a semi working IRC client. There's a function that is for
receiving and one for sending. How can I have a loop where I can receive
messages, yet still have a send prompt?
Thanks,
Joe
___
Tutor maillist - Tutor@pyth
> Thanks for answering my question. What I'm hoping to avoid is an
> explicit reference to any of the called functions within the program.
> By doing it that way, it would avoid a maintenance problem of having to
> remember to put a reference for every new function in the calling
> program.
In
On Wed, 28 Sep 2005 [EMAIL PROTECTED] wrote:
> I downloaded the graphics.py file and have it saved on my computer but
> everytime I run the following program I seem to keep getting an error.
[some text cut]
> Traceback (most recent call last):
> File "C:/Python24/circle", line 1, in -topleve
Hello
How would I get the following program to draw squares instead of circles?
from graphics import*
def main():
win=GraphWin()
shape = Circle(Point(50,50), 20)
shape.setOutline("red")
shape.setFill("blue")
shape.draw(win)
for i in range(10):
p = win.getMouse()
On Wed, 28 Sep 2005, Rosalee Dubberly wrote:
> I want to save this file, import it and make the changes, eggs = toast, spam
> = jelly and change the values if needed.
>
> def firstpart():
>for n in range(0, 55):
> if n % 3 == 0 or n % 7 == 0 or n % 11 == 0:
> print 'eggs,',
>
On Wed, 28 Sep 2005 [EMAIL PROTECTED] wrote:
> How would I get the following program to draw squares instead of circles?
What have you tried so far? What part of your program is the part
responsible for drawing circles? What happens if you change that part?
To tell the blunt truth, the ques
-- Forwarded message --
Date: Wed, 28 Sep 2005 17:11:07 -0700
From: DS <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] call a def/class by reference
Danny Yoo wrote:
>
>
>>Thanks for answering my question. What I'm hoping to avoid is an
>>explicit ref
Danny Yoo wrote:
>
>
>>Thanks for answering my question. What I'm hoping to avoid is an
>>explicit reference to any of the called functions within the program.
>>By doing it that way, it would avoid a maintenance problem of having to
>>remember to put a reference for every new function in the
> Otherwise, it really looks like you don't care about anything other than
> getting a "right answer", and nothing demotivates a volunteer more than
> being asked to do someone else's homework. We're interested in helping
> people understand how to solve problems, but we're really not interested
I'm a little confused about threading in Python. Here is a sample class I've written for monitoring for events. Included in the comments are a couple of questions, specifically:
(1) can I use super() in the constructor, or is direct call to base class preferred?
(2) do I need to sleep in
Hello,
I have this list wich is made of tuples. I wish I could "flatten" this
list, that is, to extract each element in the tuples and build a new
flat list with it. Is there any shortcut to do that or do I have to go
through some list comprehension-like procedure?
(I have looked at sets but I ha
On Wed, 28 Sep 2005, Bernard Lebel wrote:
> I have this list wich is made of tuples. I wish I could "flatten" this
> list, that is, to extract each element in the tuples and build a new
> flat list with it. Is there any shortcut to do that or do I have to go
> through some list comprehension-lik
Thanks a lot Danny.
Bernard
On 9/28/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
>
>
> On Wed, 28 Sep 2005, Bernard Lebel wrote:
>
> > I have this list wich is made of tuples. I wish I could "flatten" this
> > list, that is, to extract each element in the tuples and build a new
> > flat list with
Hi Kent,
Thanks a lot for that answer. I have had a look at the BS code, and I
have to admit I'm a bit at a loss: how would you add several nestable
tag names in that list?
I tried
NESTABLE_TAGS = BeautifulSoup.buildTagMap( [], 'parameter', 'parameters' )
for example, but I kept having these nest
At 04:29 PM 9/28/2005, DS wrote:
>What I'm hoping to avoid is an
>explicit reference to any of the called functions within the program.
>By doing it that way, it would avoid a maintenance problem of having to
>remember to put a reference for every new function in the calling program.
Try this - a
Bernard Lebel wrote:
> Hello,
>
> I have this list wich is made of tuples. I wish I could "flatten" this
> list, that is, to extract each element in the tuples and build a new
> flat list with it. Is there any shortcut to do that or do I have to go
> through some list comprehension-like procedure?
On 29/09/05, Marcus Goldfish <[EMAIL PROTECTED]> wrote:
> I'm a little confused about threading in Python. Here is a sample class
> I've written for monitoring for events. Included in the comments are a
> couple of questions, specifically:
Hi Marcus,
>(1) can I use super() in the constructo
Hello Marcus,
Marcus Goldfish a écrit :
> I'm a little confused about threading in Python. Here is a sample class I've
> written for monitoring for events. Included in the comments are a couple of
> questions, specifically:
> (1) can I use super() in the constructor, or is direct call to base cl
2005/9/28, Christopher Arndt <[EMAIL PROTECTED]>:
[cut]
>
> See http://www.python.org/doc/current/lib/module-xml.dom.minidom.html for more
> info.
Hi, this seems to be exactly what I was looking for!
import sys
from xml.dom import minidom
INDENT = ' ' * 4
file = sys.argv[1]
content = open(file
50 matches
Mail list logo