>
> Did you include an ORDER BY?
See three posts above, line 6.
>
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> ___
> Tutor maillist - tu...@python.org
> To unsubscribe or change subscription options:
>
On Tue, Oct 12, 2010 at 10:23 AM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
>> > Did you include an ORDER BY?
>>
>> See three posts above, line 6.
>
> Looks like our posts crossed in transit :-)
>
> So you order by graphname, and you only h
Quick note: forgot to add that the initial db file is setup with the following:
import sqlite3 as lite
class db(object):
def onNewProjSQLDB(self):
self.con =
lite.connect('/home/david/pythonfiles/pythonscripts/roughdraftapps/dataplot3/db/dpdb.db')
On Wed, Oct 13, 2010 at 8:17 AM, Joel Goldstick
wrote:
>
>
> On Wed, Oct 13, 2010 at 4:01 AM, Alan Gauld
> wrote:
>>
>> "David Hutto" wrote
>>
>>> Below is the output before converting:
>>>
>>> [(u'.hjvkjgfkj/bdgfkjbg
On Wed, Oct 13, 2010 at 9:27 AM, Steven D'Aprano wrote:
> On Thu, 14 Oct 2010 12:13:50 am David Hutto wrote:
>> I see it now. I knew that the u outside ' ' is the coding for the
>> string, but I thought I had to strip it before using it since that
>> was how i
self.bgcolor = line[3]
self.plot = line[4]
self.grid = line[5]
self.x_y_axis_range = line[6]
I get the error:
ValueError: invalid literal for float(): 1,2,3,4
So my question is, how do I convert the unicode '' to a plain n
On Thu, Oct 14, 2010 at 10:14 AM, David Hutto wrote:
> Hey Buddy Pals,
>
> I receive the following output from a sqlite db
>
> (u'graph1', u'Line', u'222', u'BLUE', u'1,2,3,4', u'True', u'0,5,0,10')
>
>
On Thu, Oct 14, 2010 at 11:16 AM, David Hutto wrote:
> On Thu, Oct 14, 2010 at 10:14 AM, David Hutto wrote:
>> Hey Buddy Pals,
>>
>> I receive the following output from a sqlite db
>>
>> (u'graph1', u'Line', u'222', u'BLUE
On Thu, Oct 14, 2010 at 2:19 PM, Sander Sweers wrote:
> On 14 October 2010 16:14, David Hutto wrote:
>> (u'graph1', u'Line', u'222', u'BLUE', u'1,2,3,4', u'True', u'0,5,0,10')
>>
>> Which is a tuple of un
On Thu, Oct 14, 2010 at 2:58 PM, Adam Bark wrote:
> On 14/10/10 19:29, David Hutto wrote:
>>
>> On Thu, Oct 14, 2010 at 2:19 PM, Sander Sweers
>> wrote:
>>
>>>
>>> On 14 October 2010 16:14, David Hutto wrote:
>>>
>>>>
>>
On Thu, Oct 14, 2010 at 3:02 PM, Sander Sweers wrote:
> On 14 October 2010 20:29, David Hutto wrote:
>> Actually, I needed it to be converted to something without a string
>> attached to it. See a post above, and it was fixed by eval(),
>
> Using eval is a big security risk
On Thu, Oct 14, 2010 at 3:24 PM, Adam Bark wrote:
> On 14/10/10 20:21, David Hutto wrote:
>>
>> On Thu, Oct 14, 2010 at 2:58 PM, Adam Bark wrote:
>>
>>>
>>>> Actually, I needed it to be converted to something without a string
>>>> atta
On Thu, Oct 14, 2010 at 3:31 PM, David Hutto wrote:
> On Thu, Oct 14, 2010 at 3:24 PM, Adam Bark wrote:
>> On 14/10/10 20:21, David Hutto wrote:
>>>
>>> On Thu, Oct 14, 2010 at 2:58 PM, Adam Bark wrote:
>>>
>>>>
>>>>> Actu
27;field' when
replacing a variable so that
self.plot = [1,2,3,4]
instead of
self.plot = u'[1,2,3,4]'
Let me know, meanwhile I'll be reviewing the replies more thoroughly,
now that I've had a nap.
Thanks,
David
_
On Thu, Oct 14, 2010 at 3:02 PM, Sander Sweers wrote:
> On 14 October 2010 20:29, David Hutto wrote:
>> Actually, I needed it to be converted to something without a string
>> attached to it. See a post above, and it was fixed by eval(),
>
> Using eval is a big security risk
On Thu, Oct 14, 2010 at 2:58 PM, Adam Bark wrote:
> On 14/10/10 19:29, David Hutto wrote:
>>
>> On Thu, Oct 14, 2010 at 2:19 PM, Sander Sweers
>> wrote:
>>
>>>
>>> On 14 October 2010 16:14, David Hutto wrote:
>>>
>>>>
>>
> In which case the code Sanders sent you is a much more sensible way of
> recovering your data. Evalling the string u'plot' still doesn't make much
> sense to me though.
But it's the only thing working correctly though, so until I have a
better solution, I'm forced to deal with any bugs in interp
On Thu, Oct 14, 2010 at 6:56 PM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
>> In other words I needed (1,2,3,4) not u'(1,2,3,4)' to be inserted
>> for variable self.plot
>
> You appear to be making this much more difficult than it needs to be.
On Thu, Oct 14, 2010 at 7:00 PM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
>> it's not necessary to worry about insertion of data other than my own
>> inputs.
>
> But can you be sure that you won't accidentally mistype something
> that e
On Thu, Oct 14, 2010 at 10:09 PM, Steven D'Aprano wrote:
> On Fri, 15 Oct 2010 04:43:46 am David Hutto wrote:
>
>> Fixed with:
>>
>> self.lines = self.newplot.plot(eval(self.plot))
>
> Anytime you use eval, chances are that it isn't fixed at all, but j
This isn't an answer to your question, but I'm doing about the same in
reverse(it sounds like) as you're doing. More directly just processing
data for 2-d/3d graphs using matplotlib and wxpython. So, I was
wondering if you think it's similar to those ends, and good enough to
let someone else look a
On Fri, Oct 15, 2010 at 6:39 PM, Paul wrote:
> On Fri, Oct 15, 2010 at 3:07 PM, David Hutto wrote:
>> This isn't an answer to your question, but I'm doing about the same in
>> reverse(it sounds like) as you're doing. More directly just processing
>> data fo
On Mon, Oct 18, 2010 at 6:34 PM, Raquel wrote:
> Hi,
> I am new to Python, and have hit a WALL. Any help is appreciated! Below
> is what I have so far, for the "High Low Game"...when I try to run it,
> nothing happens, so I have been unable to finish it. I am sure it is
> something simple...
>
More importantly, outside the function it calls.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Fri, Oct 22, 2010 at 9:42 AM, Richard D. Moores wrote:
> On Thu, Oct 21, 2010 at 15:44, Richard D. Moores wrote:
>>> If you want to control the number of decimal places in the string
>>> formatting do something like:
>>>
>> i = 3
>> print ("NEW LOW: %%.%sf at %%s" % i) % (lowz, timesta
On Fri, Oct 22, 2010 at 9:55 AM, Richard D. Moores wrote:
> On Fri, Oct 22, 2010 at 06:47, David Hutto wrote:
>>> which works fine, but a question remains: n is an integer. Why the 's'
>>> in '%sf'?
>>
>> Right here:
>> http://docs.p
If I understand what i just said correctly, it just means it tells the
string what type to convert from when placing it into the final
result.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/ma
What my buddy pal is saying, is that you should start at the
beginning. I first downloaded x version of python to x operating
system, then I tried this tutorial with these explicit
modules/requirements(which I may or not have) then progress to the
smaller aspects, like this won't iterate, or that d
lf.oblist = self.canvas.find_withtag('object')
print self.oblist
self.list = []
for item in self.oblist:
self.itemname = self.canvas.gettags(item)
if self.itemname[1] != 'default&
> repeatedly, returning a list of results. ...
>
> I'm sorry, Steven, but I could you revise this code to use repeat=5
> instead of the for loop? I can't see how to do it.
>>> help(timeit.Timer
repeat(self, repeat=3, number=100)
| Call timeit() a few times.
|
| This is a
Apologies, forgot to add I'm using 2.6.4 on ubuntu 9.10
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Apologies, missed that part. Didn't mean to seem rude.
import timeit
def anyName():
pass
for num in range(10):
t = timeit.Timer('anyName()','from __main__ import anyName')
print t.repeat(repeat=5)
#or
import timeit
def anyName():
pass
t = timeit.Timer('anyNa
This is a more precise question, the above was after trying different methods,
and it got a little confusing.
Why in the below does using in line 12:self.objectsvars =
'menuitemhere','menuitemhere','menuitemhere','menuitemhere', not work,
but placing 'menuitemhere','menuitemhere','menuitemhere','m
For what you're looking for you could use:
>>>help(raw_input)
In the python terminal,meaning type python first.
For pydoc on ubuntu in the command line,
pydoc -p 1234
and then take your
browser to http://localhost:1234, you might need
to select the work offline mode.
On windows IIRC it's abou
canvas.gettags(item)
if self.itemname[1] != 'default':
self.list.append(self.itemname[1])
print self.list
self.objectsvars = str(self.list).strip('[]')
print self.objectsvars
itemname[1] != 'default':
self.list.append(self.itemname[1])
self.objectsvars = str(self.list).strip('[]')
self.var = StringVar(self.root)
self.var.set(self.objectsvars[0])
self.f1 =
On Fri, Nov 12, 2010 at 9:43 PM, Michael Stover
wrote:
> My apologies for my last email, admittedly I was more tired that I thought
> as after re-reading it and the emails coming in, I found that I did not
> provided "proper" information.
>
> 1. I have a script that is detecting multiple various b
On Mon, Apr 6, 2009 at 8:29 PM, David wrote:
> Sifis Sifakis wrote:
>>
>> Hi,
>> I'm a student in Applied Informatics and i need to make a project in
>> Python. More specificaly,i have to create a simple online bookstore using
>> Python.
>
Hi, I'm new to python and have decided to develop a web crawler / file
downloader as my first application. I am at the stage where the script
requests a page and parses the page for URLs, then prints them out. However,
I'd like to change my current regex that greps for 'http' to one that will
grep
()
for line in lines:
print line
print line[0]
text_file.close()
And an example of the type of text :-
['a','b','c']
['e','d','f']
Any ideas?
Thanks in advance
David Holland
Thanks for all the suggestions. I will have to try this.
--- On Sun, 26/4/09, Kent Johnson wrote:
From: Kent Johnson
Subject: Re: [Tutor] Lists in a file
To: "Robert Berman"
Cc: "David Holland" , "tutor python"
Date: Sunday, 26 April, 2009, 8:04 PM
On Sun, A
rces that
you want to clean up could have already been garbage collected. To
protect against this I see people doing things like::
def __del__(self):
try:
self.f.close()
except:
pass
To me this is just silly.
--
David
blog: http://www.traceback.org
twitter: http://t
Hello all,
I have two questions I'm hoping someone will have the patience to
answer as an act of mercy.
I. How to get past a Terms of Service page?
I've just started learning python (have never done any programming
prior) and am trying to figure out how to open or download a website
to scrape da
On Tue, Jul 7, 2009 at 7:26 AM, Kent Johnson wrote:
>
> curl works because it ignores the redirect to the ToS page, and the
> site is (astoundingly) dumb enough to serve the content with the
> redirect. You could make urllib2 behave the same way by defining a 302
> handler that does nothing.
Many
Thanks Kent, perhaps I'll cool the Python jets and move on to HTTP and
HTML. I was hoping it would be something I could just pick up along
the way, looks like I was wrong.
dk
On Tue, Jul 7, 2009 at 1:56 PM, Kent Johnson wrote:
> On Tue, Jul 7, 2009 at 1:20 PM, David Kim wrote:
>>
Hello everyone,
I've been learning python in a vacuum for the past few months and I
was wondering whether anyone would be willing to take a look at some
code? I've been messing around with sqlite and matplotlib, but I
couldn't get all the string substitution (using ?s). I ended up
getting the scri
Thanks so much for the comments! I appreciate the look. It's hard to know
what the best practices are (or if they even exist).
On Sat, Aug 8, 2009 at 2:28 PM, Kent Johnson wrote:
>
> You don't seem to actually have a main(). Are you running this by importing
> it?
>
> I would make a separate func
Hi everyone,
I'm wondering what people consider the most efficient and brain-damage free
way to automate the creation of presentation slides with Python. Scripting
Powerpoint via COM? Generating a Keynote XML file? Something else that's
easier (hopefully)?
I'm imagining a case where one does cert
rs,
DK
On Wed, Aug 12, 2009 at 8:52 AM, Kent Johnson wrote:
> On Wed, Aug 12, 2009 at 12:51 AM, David Kim wrote:
> > Hi everyone,
> >
> > I'm wondering what people consider the most efficient and brain-damage
> free
> > way to automate the creation o
Unfortunately I live on the East Coast, otherwise I'd definitely attend! I
am attracted to the declarative nature of reStructuredText, but I also
recognize that A LOT of people use Powerpoint and are comfortable with it.
Going with something else might freak people out.
It also occurs to me that E
I don't know how much it's in use, but I thought gadfly (
http://gadfly.sourceforge.net/) was the db that's implemented in python.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I'm trying to learn Python, but keep running into the erroor message
ImportError: no module named area.
I created a file area.py in IDLE. I'm using Python 3.1 and Window XP. After
saving the file in c:/Python31/Lib/Python Modules/area.py
I can run the program using F5. But when I start a new s
r)
#removing the last , from the output_str variable
output_str = output_str[0:(str_length-1)]
print "The final output string is ",output_str
print "The output string is of type ",type(output_str)
#list(output_str)
csv.writer(file_out).writerow([time_stamp, output
quot;,output_str
> print "The output string is of type ",type(output_str)
> #list(output_str)
> csv.writer(file_out).writerow([time_stamp, output_str]+['2'])
>Here you are saying that you want to write a row with three elements -
&
I have successfully used the builtin "wave" module to read an audio
file in as a string of bytes:
>>> x=wave.open('DaCWL.wav','rb')
>>> x.getparams()
(1, 2, 44100, 15440, 'NONE', 'not compressed')
>>> samp=x.readframes(15440)
>>> type(samp)
The x.getparams() indicates that there is one audio
Regards,
>>> Allen
>>>
>>>
>>> ___
>>> Tutor maillist - Tutor@python.org
>>> To unsubscribe or change subscription options:
>>>
On Fri, 2009-09-04 at 06:18 -0700, dan06 wrote:
> I'd like to learn a programming language - and I need help deciding between
> python and ruby. I'm interesting in learning what are the difference, both
> objective and subjective, between the two languages. I know this is a python
> mailing list, s
I'm not sure why I'm getting an error at the end here:
>>> class dummy:
... def __init__(self,dur=0):
... self.dur=dur
...
>>> z=dummy(3)
>>> z.dur
3
>>> z=dummy(dur=3)
>>> z.dur
3
That worked fine, of course.
>>> class dummy2(str):
... def __init__(self,dur=0):
...
Well, here's what I am really doing:
class oneStim(str):
def __init__(self, time, mods=[], dur=None, format='%1.2f'):
self.time=time
self.mods=mods
self.dur=dur
self.format=format
def __cmp__(self,other):
return cmp(self.time,other.time)
def _
Yeah, this seems to be the best answer in this situation. :)
On Sep 10, 2009, at 4:17 PM, Kent Johnson wrote:
I would skip the cleverness of trying to subclass string. You can use
str(z).rjust(20) as above, or use string formatting:
'%20s' % z
--
-dave---
Hello all,
I've finally gotten around to my 'learn how to parse html' project. For
those of you looking for examples (like me!), hopefully it will show you one
potentially thickheaded way to do it.
For those of you with powerful python-fu, I would appreciate any feedback
regarding the direction I
ok at the
link you posted as well (I'm traveling at the moment).
Cheers,
--
David Kim
"I hear and I forget. I see and I remember. I do and I understand." --
Confucius
morenotestoself.wordpress.com
financialpython.wordpress.com
___
Tutor m
Very new to python..getting accustomed to files, directories etc
I installed a few versions of python and ended up with a very long PATH
variable, do i need this or can i change it to something shorter?
Doing an online tutorial one exercise was to move a simple program,
helloworld into the PATH so
OK, I thought I had this one fixed but it was weirder than I thought.
I think I understand what's going on, but I wanted to check with the
experts here.
I have the following class definition, which does not subclass anything:
class oneStim:
def __init__(self, time, mods=[], dur=None, fo
dvance for any responses to my questions.
--
Cheers David.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
doing a python tutorial and one of the assignments says to develop a program
that backsup files to zip files into a backup directory
im using Darwin 10.0.0 unix version:
this is what i came up with thus far, i did copy the sample program given
but made changes for my unix OS:
#!/usr/bin/env pyth
On Tue, Oct 13, 2009 at 4:14 PM, Dave Angel wrote:
> (You top-posted, instead of adding your part to the end. That's frowned
> upon in a mailing list, at least in this one.)
> (You replied privately, and forgot to CC the tutor list. I'm forwarding it
> there with my resp
On Tue, Oct 13, 2009 at 4:02 PM, Kent Johnson wrote:
> On Tue, Oct 13, 2009 at 2:58 PM, David Eric wrote:
> > printing the command line,
> > would it be
> > print('gzip {0} {1}'.format(target, ' '.join(source))?
>
> Yes, or just
> print zip
On Tue, Oct 13, 2009 at 5:17 PM, Kent Johnson wrote:
> On Tue, Oct 13, 2009 at 4:38 PM, David Eric wrote:
>
> > as far as print zip_command, i would add that to the program however,
> doesnt
> > just declaring it actually trigger it..thus it would executed and the
>
I'm trying to figure out how to define a class so that its instances
have a method that return a different object of the same class.
In particular, I'm trying to run a simple prisoner's dilemma game, and
I want to make a "game" object that has a method which returns the
"game" object with t
Oh my goodness, it really is that easy! I guess I assumed that was
too simple to work. Silly me. Thanks Andre!
On Oct 15, 2009, at 10:31 AM, Andre Engels wrote:
On Thu, Oct 15, 2009 at 5:14 PM, David Perlman
wrote:
I'm trying to figure out how to define a class so that its
inst
Maybe there's a prettier way to do this, but I did it explicitly like
this because the "transpose" I needed was specific to the structure of
the game payoff matrix; it isn't a normal mathematical transpose. I
agree that it's hard to read but I'm not sure the specific needs of
this applicat
If I make a subclass of a built-in class, like this:
class mylist(list):
def __init__(self):
list.__init__(self)
Then it is valid for me to do this:
>>> x=mylist()
>>> x.hello=3
>>>
But I can't do this:
>>> y=list()
>>> y.hello=3
Traceback (most recent call last):
File "", line
On Sat, 2009-12-26 at 16:46 +0100, Norman Khine wrote:
> Hello,
>
> I am trying to authenticate on http://commerce.sage.com/Solidarmonde/
> using urllib but have a problem in that there are some hidden fields
> that use javascript to create a security token which then is passed to
> the submit but
Sadly in my IT company (which I better not name),
mainframe experience seems to be a route to redundancy
! Fortunately I work with Oracle.
=== message truncated ===
___
ALL-NEW Yahoo! Messenger - all ne
As the sig says, I'm David Broadwell.
I'm 29, 30 this July. Married in hurricane alley (Florida), with a 18 month
old daughter. I'm a student as well, finishing my AA.ENGR and heading to USF
for a Dual Bachelors of CS and EE. I'm instrumentally challenged as far as
making
I am trying to use a program that usea s '£' symbolon
the pygame screen and I get this message :-
'sys:1: DeprecationWarning: Non-ASCII character '\xc2'
in file birdgame29e.py on line 88, but no encoding
declared; see http://www.python.org/peps/pep-0263.html
for details
line 86
'
Now I did look th
I am 31 married, living in London UK.
I can play guitar but I am not that good.
I work in IT as Oracle support but the only languages
I know apart from basic python is basic PL/SQL and of
course SQL. Of course I know how to use various
Oracle applications.
I studied Chemistry but sadly there were
I ran a program with a "£" sign, and I got this
message :-
"sys:1: DeprecationWarning: Non-ASCII character '\xc2'
in file birdgame32a.py on line 93, but no encoding
declared; see http://www.python.org/peps/pep-0263.html
for details'
I looked at the message but I am not sure what
encoding to use fo
Apologies,
I did not see that Kent had already answered this !
Thanks Kent I put that encoding and it works fine.
Although surprisingly the other idea :-
write the string with '\xc2' did not work.
--- David Holland <[EMAIL PROTECTED]> wrote:
> Date: Fri, 31 Dec 2004 16:28:59
so it
> is more specific
> than "Re: Contents of Tutor digest..."
>
>
> Today's Topics:
>
> 1. Re: O.T. (Michael Lange)
>2. OT (David Holland)
>3. ASCII encoding for a ? sign (David Holland)
>4. Fwd: ASCII encoding for a ? sign (David
&g
I have written my first cgi script :-
The .html code is :-
Friends CGI Demo (Static Screen)
Friends list for:New User
Enter your name>
How many friends do you have ?
0
10
25
50
100
The python code is :-
#!/usr/bin/env python
import cgi
reshtml = '''Content-Type: text/html\n
Friends CGI Demo (
Rich,
That worked although I had to set the address to :-
http://127.0.0.1:8000/friends1.html
Thanks.
___
ALL-NEW Yahoo! Messenger - all new features - even more fun!
http://uk.messenger.yahoo.com
__
You can use idle while using linux, just type in idle from a command prompt !
ALL-NEW
Yahoo! Messenger
- all new features - even more fun!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Does anyone know about tutorials (or open source projects) about writing in games in pure python (ie without using pygame).
The reason is because I wrote a game using pygame but I would like to convert it to a game that can be played in a webpage as a Jython, (like a Java game) of course this is ha
I wrote a program to create crosswords in python.
It is not perfect but it works, is there any open
source place I can put this for it to be used by
anyone who wants it ? (Subject to the gpl licence).
Here is the code in case anyone is interested.
from Tkinter import *
#Crossword program David
ChiPy, is going to have a speaker on Jython this Thursday, January 13th.
For more information, check out the group site at:
http://www.chipy.org
Everyone is welcome, benginner to advanced. We love all kinds of input.
You'd be surprised what you can learn when you get the chance to
actually
o)
return info
print "Content-type: text/html\n"
print "Languages"
print "This will happen"
showboroughinfo(form)
#print "Hi"
print ''
For some reason it is not get the info in the try
block.
If I do not have the try block I get this m
Thanks for the help it solved the problem.
Message: 8
Date: Mon, 10 Jan 2005 16:05:59 -0800
From: "Patric Michael" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] CGI problem
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII
Hi
The best one I've
You might want to check out sqlobject, too
http://sqlobject.org/
It gives you a relatively simple way to "objectify" SQL statements.
--
David Rock
[EMAIL PROTECTED]
pgpRBRwPdqdc0.pgp
Description: PGP signature
___
Thanks Alan for that suggestion. I will try and tidy it up myself and then ask the tutor list for another suggestions.Alan Gauld <[EMAIL PROTECTED]> wrote:
Hi David,Its probably the kind of thing you could put on theUseless Python website. Useless is a collection ofnot-too-serious so
know ;-)
Still, I can't help wishing I had a simple way to create a dict from a
DOM. From a Python perspective, that seems more "Pythonic" to me as
well. I guess it's just a different way of looking at it.
--
David Rock
[EMAIL PROTECTED]
pgpq4Ua00eRSO.pgp
Description: PGP signa
* Max Noel <[EMAIL PROTECTED]> [2005-01-19 11:48]:
>
> On Jan 19, 2005, at 03:58, David Rock wrote:
>
> >For me, it seems that the way you are supposed to interact with an XML
> >DOM is to already know what you are looking for, and in theory, you
> >_should
This will get a random record
I hope you do not think the comments are patronising
but you did say you are new so I did not want to give
naked code.
import random
#the above gives the program the ability to get a
#pseudo random number
file = open('test.rantxt')
listcontents = file.readlines()
#gi
--- "Jacob S." <[EMAIL PROTECTED]> wrote:
> > This will get a random record
> > I hope you do not think the comments are
> patronising
> > but you did say you are new so I did not want to
> give
> > naked code.
> >
> > import random
> > #the above gives the program the ability to get a
> > #pseud
1. Re: Print record x in a file (Kent Johnson)
>2. How would python messure up in performance?
> (Kevin)
>3. Re: How would python messure up in
> performance? (Max Noel)
>4. Re: Print record x in a file (David Holland)
>5. on the way to find p
Kent,
Yes you are right. I looked at your code and that makes sense now.
Thanks for explaining that.
ALL-NEW
Yahoo! Messenger
- all new features - even more fun!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t
this means. Thanks again.
It means it didn't find anything that matches that pattern, which
suggests that the directory does not contain *.py files. That might be a
problem. ;-)
--
David Rock
[EMAIL PROTECTED]
pgpmTRknYUp8c.pgp
Description: PGP signature
roach to this, I like to use the fileinput module. In the
case of the original example of mimicing grep, it allows you to easily
handle both a list of files passed to the command or use it as a pipe.
The default action if there are no files given is to use stdin.
http://www.python.org/doc/2.4/l
I have a game I wrote using python and pygame that I am trying to change into a .exeI created the script setup.py which has this code :- setup.pyfrom distutils.core import setupimport py2exesetup(console=["Gamename.py"])
In a dos prompt with all the files there I ran :-python setup.py py2exe
It Com
401 - 500 of 1103 matches
Mail list logo