Hi,
I'm just starting to get my feet wet with Python. I'm trying to write
a CGI script to create an XML document using input from a web form.
The created document would be a MODS record[1], so I already have a
Schema for it. I think I could make it work if I just feed the input
into a long strin
So, as a newbie, I see this thread and I check out the PEP and I see
that for future compatibility we should use sys.stdin.readline(). So
I import sys to see how it works. Of course, sys.stdin.readline('type
anything: ') doesn't work in quite the same way as raw_input('type
anything: ') does. Th
how about
manyones = [ 1 for x in range(96) ]
On Sat, Mar 26, 2005 at 03:02:34AM +0800, jrlen balane wrote:
> basically, i'm going to create a list with 96 members but with only one value:
>
> list1[1,1,1,1...,1]
>
> is there a shorter way to write this one???
> ___
Hello all,
I'm trying to modify the sys.path in my cgi scripts to import modules
that I've installed in my home directory. The top of the script reads
as follows:
#!/usr/local/bin/python
import cgi, sys
sys.path.append('/net/u/16/g/gsf/lib/python2.4/site-packages')
from ElementTree import Elem
Sorry, addendum to that post. The line
from ElementTree import Element, SubElement, tostring
should read
from elementtree.ElementTree import Element, SubElement, tostring
but that still doesn't work.
gabe
___
Tutor maillist - Tutor@python.org
h
e libs are simply not accessible.
This situation is particular to my web hosting service, so it may not
apply to others who are running python cgi scripts and importing
modules.
gabe
On Thu, Apr 14, 2005 at 06:43:26PM -0400, Gabriel Farrell wrote:
> Hello all,
>
> I'm trying to m
Greetings,
I'm setting up a search for an online catalog. It works right now by
passing the cgi search query to the command-line swish-e via os.popen.
I'll do it via a direct interface as soon as I figure out how to do
that with swig or the swishe module. In the meantime, I'm trying to
sanitize
On Thu, 5 May 2005, Smith, Jeff wrote:
> I'm able to use the built in XML parser to effect "normal" XML parsing
> usage but frequently, I'm not doing anything to complicated and would
> simply like to translate the XML file into a more "Pythonic" structure.
> What's the best way to do this? Some
take a look at pickle and shelve. info about both can be found at
http://docs.python.org/lib/python.html
On Tue, May 10, 2005 at 08:46:50AM -0700, Tom Cloyd wrote:
> I'm creating a small database using a dictionary of dictionaries, and I
> want to output it to a file. It seems that only strings
Hi William,
The short answer is go with the default until you run into something
you can't do without 2.4.
For the skinny on all the changes you'll want to check out
http://python.org/doc/2.4/whatsnew/whatsnew24.html . That document
lays it out about as well as can be done. If you find somethin
On Thu, Jun 02, 2005 at 10:41:20PM +0100, Alan G wrote:
> Why not convert the list to a tuple before applying str():
>
> str(tuple(ids_to_process))
I'm just getting started with Python and PostgreSQL but I found that
str(tuple(valueList)) wouldn't work for me because I had a few values
with apost
On Fri, Jun 03, 2005 at 03:50:09PM -0400, Lloyd Kvam wrote:
> The code to update the database should look something like:
> the_cursor.execute( sql_cmd, data)
>
In PyGreSQL/pgdb it's cursor.execute(query[, params]) but it means
more or less the same thing because pgdb's paramstyle (I knew from the
Are you using PyGreSQL? import pgdb works fine for me with PyGreSQL.
I'm on Debian but I assume there's a package for it for SUSE.
gsf
On Wed, Jul 27, 2005 at 10:13:22AM -0400, Don Parris wrote:
> O.k., I'm running SUSE Linux 9.2, Python 2.3.4,
>
> I have changed my DB back-end from MySQL t
I assume you have checked out
http://wiki.python.org/moin/VolunteerOpportunities .
I've improved a lot by just reading this list and following along with
the successes and failures (always temporary, I hope) of others.
gsf
On Wed, Jul 27, 2005 at 10:20:43PM +0500, Mustafa wrote:
> i hav just fi
On Wed, Jul 27, 2005 at 07:13:49PM -0400, Don Parris wrote:
> pg/pgdb are both part of the PyGreSQL distribution. You can choose
> whichever you want to use, but pgdb supports the 2.0 API, whereas
> (according to the readme) pg does not. I will try pg when I get back
> to my box tonight, but woul
Uh oh, looks like you're begging for an editor war.
That said, I'm in the vim camp. It can do everything you specified
for all of the languages you mention (well, I'm not sure about
collapsible code...web search...aha![1]). After using it for four
years, I'm still learning new tricks (see, for
You can read some of what Guido has to say about Python and C at
http://python.org/doc/essays/omg-darpa-mcc-position.html
and see SWIG documentation (a few pertain to Python) at
http://www.swig.org/doc.html
gsf
On Tue, Sep 27, 2005 at 08:41:31AM -0600, Eric Walker wrote:
> There is a program cal
Welcome to the list, Carl. Feel free to browse the list archive at
http://mail.python.org/pipermail/tutor/ or
http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/python-Tutor to
get some idea of the kinds of questions asked and answers given.
You'll find a lot of suggestions for beginners among
On Wed, Dec 07, 2005 at 11:52:20AM -0800, Danny Yoo wrote:
> On Wed, 7 Dec 2005, Eric Walker wrote:
>
> > Looking for easiest way to get a files permissions in linux.
>
> Hi Eric,
>
> What have you looked at so far?
I agree with Danny, the question lacks any evidence of prior
investigation on t
On Wed, Dec 07, 2005 at 02:51:55PM -0700, Eric Walker wrote:
> After 4+ hours
> of playing around with this I made the futile post.
Don't let the post be futile! Post what you've tried so far and
you'll get help.
gsf
___
Tutor maillist - Tutor@p
This is great news. And the thread on comp.lang.python is awesome.
The eff-bot and the martelli-bot and everyone's just talking about how
great it would be to have it in the core, and, then, it just ...
happens. Wow!
gsf
On Wed, Dec 14, 2005 at 03:20:38PM -0500, Kent Johnson wrote:
> By some m
I have an issue with the tempfile module that I can't figure out.
Snippet of relevant script looks like so:
1 bob = tempfile.NamedTemporaryFile()
2 bob.write('Hallo!')
3 bob.read()
4 sam = tempfile.NamedTemporaryFile()
5 bobHandle = file(bob.name)
6 bobHandle.read()
As you can see, I
On Tue, Jul 11, 2006 at 03:04:02PM -0400, Kent Johnson wrote:
> Try bob.flush() instead of bob.read(), my guess is the read() is forcing
> a flush().
That works! Thanks, Kent. If I understand flush (looking at [1]), I
got no output because the data for the stream wasn't written to the
file befo
I'm trying to create a master dictionary in aspell, and I can do so
with the following:
inFile = tempfile.NamedTemporaryFile()
inFile.write(wordList)
inFile.flush()
command = 'aspell --lang=en --dont-validate-words create master %s < %s' % \
('./dict.cwl', inFile.name)
In trying to combine a set of lists together, I landed upon
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302478 , which
does the job beautifully. The problem is I really want to understand
how it does it, and I can't quite get my brain wrapped around it.
I'll try to explain, step by ste
On Tue, Jul 18, 2006 at 01:33:27PM -0400, Kent Johnson wrote:
> Each call to rloop() has its own local variables and its own state.
> Returning from one call doesn't pop all the way up the stack, it
> resumes execution at the point of call with the local state restored
> to what it was before the c
On Sat, Jul 22, 2006 at 06:20:12AM -0400, Kent Johnson wrote:
> We just had a discussion of recursion, you might want to look at it -
> though the code is a bit more complex than this example.
> http://mail.python.org/pipermail/tutor/2006-July/048081.html
Glad to see I'm not the only one to get t
On Mon, Oct 09, 2006 at 10:51:26AM -0700, josip wrote:
> Hi.
>
> Hi I have finished Learning Python 2nd ed.
> What to do next?
> Should I go with Programming Python book or Python Cookbook or?
> Or maybe something else?
>
> Thanks people!
>
I went from Learning Python to the
On Fri, Oct 27, 2006 at 11:24:00AM +0100, Asrarahmed Kadri wrote:
> Hi Folks,
>
> ANy comments about ELementTree module...
>
> I have heard that it is more 'Pythonic'...
>
> I need some basic examples to start learning the stuff.. If anyone has got
> the information, please pass it along..
>
E
On Thu, Nov 09, 2006 at 06:23:50PM +, Asrarahmed Kadri wrote:
> Hi Folks,
>
>
> I am trying to parse XML documents using elementtree.
> I have just started with it. Can somebody help me with how to select nodes
> with a particular atribute set to some value. For example, I have the
> followin
On Fri, Nov 10, 2006 at 10:23:49AM +1300, John Fouhy wrote:
> On 10/11/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
> > I am trying to parse XML documents using elementtree.
> > I have just started with it. Can somebody help me with how to select nodes
> > with a particular atribute set to some
On Sat, Jan 27, 2007 at 02:58:38AM -0800, Dick Moores wrote:
>
>
> At 07:12 PM 1/24/2007, Shadab Sayani wrote:
> Hi,
> I am using vim editor to code my project in python.Is there a good
> IDEĀ where in I type the name of the class object and then dot then
> all the attributes of the object are di
):
User ${username | h} has been removed.
% endfor
% if form.getvalue('no_backups'):
No backups to revert to.
% endif
% if form.getvalue('bak_days'):
% if form.getvalue('bak_days') == 1:
Reverted to
33 matches
Mail list logo