[Note: try to avoid crossposting. The Mailing List Ettiquette FAQ:
http://www.gweep.ca/~edmonds/usenet/ml-etiquette.html
explains why crossposting isn't such a good idea usually. I'm taking
[EMAIL PROTECTED] out of CC now.]
> I am trying to pass a variable into this ESRI function and it
> I've been using BaseHTTPServer (and subclassing BaseHTTPRequestHandler,
> of course) for a project at work. However, I can't seem to close my
> connections completely once I'm done with the server. I've tried:
>
> server.server_close()
> del server
>
> but when I try to use the same port again,
> Tcl is a fun language with a wholeheap of interesting concepts new to
> Python programmers. So its definitely worth looking at - and its nearly
> always more compact than Python too.
Alan Greenspun, author of one of my favorite web-development books "Philip
and Alex's Guide to Web Publishing", a
On Sun, 17 Jul 2005, Andreas Kostyrka wrote:
> Am Samstag, den 16.07.2005, 19:39 +0500 schrieb Mustafa Abbasi:
> > is there an online exam or coarse i can take to get a certificate in
> > python. preferrably cheap and online because i live in pakistan and
> > online exams are my only hope.
>
> N
> A related question is where's the trade-off between using ``in'' with a
> list, and a dictionary? I presume that using it with small hashes will
> be faster than dictionries since it doesn't have to calculate the
> hashes.
Hi Bill,
Scanning for an elements in a list is a "linear" operation, in
On Sun, 17 Jul 2005, Servando Garcia wrote:
> Using regular expressions how do I represent Floats.
Hi Servando,
I know that you're working on a parser project, but the regex for doing
floats is pretty much a homework project. There's not much we can do
except point you toward the Regular Expr
On Mon, 18 Jul 2005, Nathan Pinno wrote:
> I find it easier to remember and faster to code than int(raw_input()).
> The faster I can code a program, the better in my opinion. So what if it
> has a few bugs, I fix them gradually.
Hi Nathan
You're right, just as long as we're writing programs th
On Mon, 18 Jul 2005, David Jimenez wrote:
> I am trying to learn to use Python. Currently, I am
> reading Michael Dawson's "Python Programming for the
> Absolute Beginner." Right now, I am having the
> following problem: I try to read all the pickles in a
> file, but keep on getting the same er
On Mon, 18 Jul 2005, geon wrote:
> Seems to me as very unuseful thing in this forum, when I choose Replay
> to any message, the field "to whom or Receiver" is all the time not
> tutor@python.org but the original sender! Why? I can not understand
> that?
[meta: mailing list admin stuff]
Hi Geo
Hello,
> This is my latest assignment:
[assignment cut]
We should make this perfectly clear: we will not do your homework.
> Please have a look and advise.
If you're having a problem with Python programming, bring up the specific
problem you're having, and we'll see what we can do to help
On Mon, 18 Jul 2005, Alberto Troiano wrote:
> I'm trying to create the buttons dinamically (that's not a problem) the
> problem is wherever I click the hello function returns the last button I
> created. I know that the problem is in the lambda part and that the variable
> i (the one I change t
On Mon, 18 Jul 2005, gordnjen wrote:
> There was an error with your script and it didn't exit properly.
>
> This was its output:
>
> File "/home/jgates/public_html/Fifthone.py", line 12
>
> print form int(["red1"].value),"%"
>
> ^
>
> SyntaxError: invalid syntax
Hi Jenn
On Mon, 18 Jul 2005, Liam Clarke wrote:
> country = {
> tag = ENG
> ai = {
> flags = { }
> combat = { DAU FRA ORL PRO }
> continent = { }
> area = { }
> region = { "British Isles" "NorthSeaSea" "ECAtlanticSea" "NAtlanticSea"
> "TagoSea" "WCAtlanticSea" }
> war = 60
> ferocity = no
> }
> }
[Long
> * There is no reason for questioner not to like to see my replay in
> mailing list, I think. Why would he do it? Why should he want me just
> for him?
[meta: mailing list stuff. Not really Python-related[]
Hi Geon,
Yes, there is a good reason.
Let us take a hypothetical situation. Let's sa
> oResult = oCursor.execute( "SHOW COLUMNS FROM " + sTableName + "" )
Hi Bernard,
Try using oCursor.fetchall() after the execution. The return value of
execute() are the number of rows affected, and you can then pull each
fetched value by using either oCursor.fetchone() or oCursor.fetchall
On Tue, 19 Jul 2005, Bernard Lebel wrote:
> Ah yeah I to mention that I indeed tried fetchall(), but Python would
> raise an attribute error:
Hi Bernard,
The cursor itself holds some internal state that mutates when we call
cursor.execute(). So we use cursor.execute() often for it's side-effe
On Tue, 19 Jul 2005, sunny sunny wrote:
> In C I have seen some programs such as kismet etc where c programs could
> be written to get the SS from the card. The idea probably is to read the
> prism 2 header from the driver. This I guess is a bit more lower than
> the "raw socket" where we can ge
On Tue, 19 Jul 2005, mdcooper wrote:
> I need to make a program that will allow a user to rotate and translate
> a molecule (using the mouse) so as to bring any given atom of that
> molecule (or plane encompassing a number of atoms) to the X-Y plane
> (i.e. the Z component would be 0). I cannot
On Wed, 20 Jul 2005, Jimmy wrote:
> My assignment is this:
[assignment cut]
> But I have no clue on how to make it work. I tried many different
> variations to get it to work but in the end nothing happened.
Hi Jimmy,
First, please note that we will not do homework assignments, so we will
On Wed, 20 Jul 2005, Jorge Louis De Castro wrote:
> Is there a way of creating a Windows .exe from a .py file that does not
> involve unzipping several files onto a folder? Does someone know of a
> program that wraps all the files needed into one single
> (non-installable) executable?
Hi Jorge,
On 21 Jul 2005 [EMAIL PROTECTED] wrote:
> [(1423, 2637),(6457, 8345),(9086, 10100),(12304, 15666)]
>
> What I want to do is use this list of coordinates to retrieve the parts
> of the string *between* each tuple. So in my example I would want the
> slices [2367:6457], [8345:9086] and [10100:123
> This is just a simple example, in my list I have ~40
> sections and ~10K people (this is repeated number and
> I do not know how many unique persons are there).
>
> Question to tutor:
>
> Could any one help me proceed further.
> Will a dictionary (key and values ) based method work
> for this k
On Thu, 21 Jul 2005, Joseph Quigley wrote:
> optparse.. Can I download that as a module or do I have to download
> epython?
Hi Joseph,
optparse derives from a hird-party library called Optik, so in a pinch,
you can probably just use Optik:
http://optik.sourceforge.net/
It's also possible
On Fri, 22 Jul 2005, Winfried Tilanus wrote:
> I am installing a server-like python program that opens a logfile in the
> following way:
>
> # redirect output for logging to file
> applog = open(config.log, 'a', 1)
> sys.stdout = applog
> sys.stderr = sys.stdout
>
> Througout the
On Mon, 25 Jul 2005, nephish wrote:
> i know how to read the lines of a txt file.
> i know how to write a txt file.
>
> but how do i overwrite a line value with another value ?
>
> i mean, how do go to, say, line 3 of a text file and replace what is
> written on line 3 with something else?
Hi N
On Wed, 27 Jul 2005, David Holland wrote:
> I know how to open files in python, however what I want to do is select
> some information from an excel spreadsheet and save it as a .dat file.
Hi David,
Excel spreadsheets are a bit more difficult to work with. They're not
plain text files, but ha
On Wed, 27 Jul 2005, Xabier Gonzalez wrote:
> Honestly, I�m new in Python. I wanted to know about the possibility of
> importing .txt text files from Excel and manage the contents (creating
> graphics...) using Python. I�ve read about the win32com module and I
> would like to find a good example
On Wed, 27 Jul 2005, Nathan Pinno wrote:
> How do I make Python draw a shape? e.g. a triangle Is there a specific
> module that I have to call, or what is the command(s)?
Hi Nathan,
If you'd like to start doing graphical stuff, you might want to look at
the Tkinter module.
http://www.pyth
On Wed, 27 Jul 2005, Nathan Pinno wrote:
> How do I go about the following: I want to write a program that will
> print two lists one after another, then show all the available
> possibilities for matches e.g a0 and x0.
> lista = [x0, x1, x2, x3]
> listb = [a0, a1, a2, a3]
Hi Nathan,
It sound
On Wed, 27 Jul 2005, luke wrote:
> > Thanks. Will ask if I have any more questions. Maybe I won't have to
> > go to Visual Basic to write my games. Maybe Python will do the trick.
>
> Oh my god.
> Don't ever compare Python to Basic on a python mailing list.
>
> You'll get eaten alive ;-)
[text
On Wed, 27 Jul 2005, Nathan Pinno wrote:
> How do I split the list members up in the following code?
Hi Nathan,
Try using a string's split() method. For example:
##
>>> "hello world this is a test".split()
['hello', 'world', 'this', 'is', 'a', 'test']
>>> "hello world this is a test".spl
> I first posted my question in this post, but no one seemed to answer me.
> >
> > It sure did, though I wish there was an easier way of coding it than
> > int(raw_input())! Any ideas would gladly be appreciated.
Hi Nathan,
About the question about int(raw_input()) being a bit verbose, Brian d
On Wed, 27 Jul 2005, Pujo Aji wrote:
> I write a program which launch pylab from windows GUI (using wxpython).
> I found some problem here.
>
> If I use the default backends program in matplotlibrc which is TkAgg
> I have this result:
> 1. I click button the plot is showed
> 2. I close the plot
On Thu, 28 Jul 2005 [EMAIL PROTECTED] wrote:
> import testTryCatch
> try:
> testTryCatch.someProcedure()
> except:
> print "encountered error"
> continue
>
> but I get the following error:
>
> SyntaxError: 'continue' not properl
On Thu, 28 Jul 2005 [EMAIL PROTECTED] wrote:
> ideally what I'd like is for my procedural program, when it runs through
> its steps and encounters an error, to log the error and pick up where it
> left off and keep going.
>
> so for the execution of someProcedure(), I want it to print the error
> I see the continue statement as a way for me to do this, and thus
> intimately linked with exception handling.
Hi Tpc,
I think you're getting too caught up with the word "continue" and its
concept as you use it in human language, rather than what it really does
in the Python language.
I sho
On Fri, 29 Jul 2005, Jeff Peery wrote:
> Hello, I have a signal that I want to do a fourier transform on. I tried
> using FFT.fft(data).real but I don't understand the output. what is
> output from this function, and why doesn't it require amplitude and time
> as inputs?
Hi Jeff,
Do you mean
> I have no idea how to get the server to receive and print a message or
> for the client to send the message. Does anyone know of some good python
> networking tutorials designed for newbies? (Not ones on
> www.awaretek.com. They seem to expect you to know some things that I
> don't even know ab
> If anyone will help me learn file I/O, it would be appreciated. I went
> through Josh Cogliani's Non-Programmer's Tutorial for Python, and I
> still can't understand it.
Hi Nathan,
Can you point out what parts don't make sense? We can try to explain
better, but we can only do so if you eithe
On Sat, 30 Jul 2005 [EMAIL PROTECTED] wrote:
> it said this is for newbies but I download the 2.4 and I tried the stuff
> it said on the tutorial like the control-z or sys.exit () I tried the
> control-p or the python -c but it always says "'something' is not
> defined" or " invalid syntax"
He
On Sun, 31 Jul 2005, Nathan Pinno wrote:
> Well, you saw my password program. That was my first attempt at using
> file I/O. Thought I'd try it big time. You saw where that went.
Ok, let's take a look. It was from this message, right?
http://mail.python.org/pipermail/tutor/2005-July/03947
On Fri, 29 Jul 2005, Miguel Lopes wrote:
> I understand the subject is advanced, but I'm a newbie without a
> technological background making some technology research for a company I
> work for.
Hi Miguel,
You may want to ask this on comp.lang.python instead. The Modbus/JBUS
protocol might be
> Thanks Luke. Saved me quite a headache. I will use in_file instead.
> Makes more sense anyway.
Hi Nathan,
Just wanted to chime in here: you may have fewer issues with name
conflicts if you use more functions.
For example:
##
>>> def test():
... input = 42
... print input
...
>>
On Mon, 1 Aug 2005, Alan G wrote:
> I'm cc'ing this back to the tutor list because others may spot things
> I miss.
>
> >K something must be wrong cause I typed python and it said "python is
> >not
> > defined" so any ideas
Hi Alan,
Are you sure that F22AceRaptor isn't trying to type 'python
On Mon, 1 Aug 2005, Xiangyi Meng wrote:
>
> I ran across this error when running a few lines of code in debian
> python, but this runs perfectly in windows python.
Hi Xiangyi,
This seems a bit specific to numarray; you may want to ask the Numeric
discussion group:
http://sourceforge.net/ma
On Mon, 1 Aug 2005, Mohammad Moghimi wrote:
> I want to install mailman.
[cut]
Hi Mohammad,
This is the python-tutor mailing list: we help in teaching how to program
in Python. However, we aren't the technical support group for the Mailman
mailing list software, and we probably won't be able
On Mon, 1 Aug 2005, Kent Johnson wrote:
> > I would like to construct some string objects using the cprintf-style
> > format:
> >
> > command_string = "diff -u %s %s > %s.patch" % ( src, dst, file )
> >
> > Of course it is illegal in python but I couldn't figure out a way to
> > construct string
On Mon, 1 Aug 2005, Kent Johnson wrote:
> [EMAIL PROTECTED] wrote:
> > hi,
> >
> > I have large txt file with lines like this:
> >
> > ['DDB0216437'] 116611749 ZZZ 100
> >
> > What I want to do is quickly count the number of lines that share a
> > value in the 4th column and 5
On Mon, 1 Aug 2005, Nathan Pinno wrote:
> I've seem to run into a jam while working on the exercise on file I/O.
> Here's the error:
> Filename to save: university.txt
> Traceback (most recent call last):
> File "D:\Python22\grades.py", line 99, in ?
> save_grades(students,filename)
> Fi
On Mon, 1 Aug 2005, Jeff Peery wrote:
> thanks for the help. I think I'm understanding this a bit better.
> although I still don't completely understand the output. here is an
> example... for the input I have 1024 samples taken from a 1 Hz square
> wave with amplitude = 1. for the output I wou
-- Forwarded message --
Date: Mon, 1 Aug 2005 16:21:33 -0700 (PDT)
From: Jeff Peery <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] fourier transform
Danny, thanks for the help. Yes, for an odd square wave the b's of the fourier
se
Hi Jeff,
> Yes, for an odd square wave the b's of the fourier series are non zero
> for even values and zero for odd values of n. these are the coefficients
> for the fourier series. Although I beleive the fft (fourier transform)
> should return the amplitude of frequencies that exist. so for e
On Mon, 1 Aug 2005, Nathan Pinno wrote:
> I want to write a program that will convert time in any other time zone
> to my time zone. Would it be better to use the Python time molecule or
> just a whole bunch of if statements?
Hi Nathan,
I'd recommend looking at the 'datetime' Python module. G
On Tue, 2 Aug 2005, [iso-8859-1] �yvind wrote:
> Is there some function/modulte that checks a files integrity wheter or
> not the file is corrupt or not?
Hello!
A general technique that people have used before is to provide file
"checksums" of large files. These checksums can be used to verif
-- Forwarded message --
Date: Tue, 2 Aug 2005 22:12:34 +0200 (CEST)
From: "[iso-8859-1] �yvind" <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Corrupt files
Hello and thank you.
I don't really think that will help. The fi
On Tue, 2 Aug 2005, Greg Lindstrom wrote:
> This must be simple, but for the life of me I can't figure out how to
> delete an entry from a dictionary. For example,
>
> meals = {}
> meals['breakfast'] = 'slimfast'
> meals['lunch'] = 'slimfast'
> meals['dinner'] = 'something sensible'
>
> How do
On Tue, 2 Aug 2005, Victor Reijs wrote:
> I am trying to simply(?) print some text in a print statement as bold
> (or itlaics or an certain color). How do I do this in python? Browsing
> the web gives we all kind of soluation, but non seem to work (a lot are
> related when printing on the web).
On Tue, 2 Aug 2005, Victor Reijs wrote:
> This is in a seperate text box, but I want to have the colors
> (bold/italics) in the default IDLE window.
[Note: please use Reply-to-all]
This will probably be more difficult. I don't believe IDLE itself allows
a user's program to set its own fonts a
On Wed, 3 Aug 2005, enas khalil wrote:
> i want to build my own arabic training corpus data and use the NLTK to
> parse and make test for unkown data
Hi Enas,
By NLTK, I'll assume that you mean the Natural Language Toolkit at:
http://nltk.sourceforge.net/
Have you gone through the introd
On Wed, 3 Aug 2005, David Holland wrote:
> I would like to do the following. I have an HTML document with a table
> with 2 columns. I would like to write a program to join the 2 columns
> together, ideally with same font etc. Ie get all the information between
> and and the next and and put
On Wed, 3 Aug 2005, Bernard Lebel wrote:
> Does anyone can recomment a good CVS for Python?
Hi Bernard,
I'm not quite sure I understand what you mean yet. Are you looking for a
revision control system for Python?
If that's what you're looking for, then CVS is one implementation of such
a sy
> I meant CVS for my own Python scripts. Right now, when I make a change
> to an existing script, I copy it into an "old" directory, rename with to
> append the version number, and overrwrite the actual script with the new
> version. This works well but sometimes is a pain to handle when multiple
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> What wrong with the following syntax?
>
> out_file.write(site+","+sitelist[site][0]+","+sitelist[site][1]"\n")
[text cut]
> It highlighted the last " if that will help any.
Take a close look at the end of the line. Here, I'll underline it:
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> > Warning: Problem with getpass. Passwords may be echoed.
> It does indeed echo. I forgot to add that.
Hi Nathan,
If you're running your program under IDLE, we shouldn't expect too much:
getpass depends on running under a console environment, and pro
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> See my latest message for how I fixed this error and got another in its
> place.
Wait, wait, before we go on: can you explain in your own words why there
was something wrong, what the correction was, and why the correction
works?
The reason I ask is be
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> Traceback (most recent call last):
> File "D:\Python24\password.py", line 82, in -toplevel-
> load_file(sitelist,filename)
> File "D:\Python24\password.py", line 51, in load_file
> [site,ID,passcard] = string.split(in_line,",")
> File "D:\P
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> I forgot to add that it works because commas separate it into groups so that
> when the reads the file it has output, the program can split it into the
> site, ID, and passcard.
Hi Nathan,
Ok, it's good that we're looking back, because that's not righ
On Wed, 3 Aug 2005, Jeff Peery wrote:
> hello, I was wondering about the license agreement for python. if I use
> python to create an application that is intended to sell commercially
> for profit is that violating the agreement listed in www.opensource.com?
> Or is that only for the interpreter
On Wed, 3 Aug 2005, Joseph Quigley wrote:
> decided to make a bot. But then I got an idea to make a chatting
> program. It worked nicely on our home network but it had a small
> problem you can't type anything and send it to the person you are
> chatting with untill they reply!!
Hi Joseph,
On Wed, 3 Aug 2005, Nathan Pinno wrote:
> I added a plus sign to show Python to add "\n" or a new line to end of
> the file.
Ok, better. So the plus sign was necessary in between:
sitelist[site][1]
and
"\n"
in order to glue them together into one string.
Just for kicks, let's loo
> sys.argv = [ 'junk', '-u jgooch.admin' ]
Hi John,
The code highlighted above looks unusual. Can you explain why the code
assigns to sys.argv?
Ah, ok, I assume that you're trying to pass state with the 'chgpwd_enq'
program:
> tran
> What's the invalid syntax? Here is the code:
Hi Nathan,
You need to have a comma between the items of a dictionary. For example:
##
>>> numerals = {
... 0 : 'zero',
... 1 : 'one',
... }
>>>
>>> numerals[0]
'zero'
>>> numerals[1]
'one'
##
Some comments on your code. I not
On Fri, 5 Aug 2005, Joseph Quigley wrote:
> Is it possible to get my internet and/or network IP address from Python?
> Is there any other way to get it?
Hi Joe,
I think you're looking for socket.gethostbyname().
http://www.python.org/doc/lib/module-socket.html#l2h-2594
Here's an example
> >I think you're looking for socket.gethostbyname().
> >
> >http://www.python.org/doc/lib/module-socket.html#l2h-2594
> >
> >Here's an example using the socket.gethostbyname() function:
> >
> >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/335890
> >
> >
> Oh.. btw I don't think
Answer: yes, very much so. *grin*
Ok, let's take a look at some snippets.
##
cd = int(raw_input("How many cards to deal (1-6) or 9 to exit:"))
if cd == 1:
a = random.choice(range(52))
if a == 0:
a = "Ace of Hearts"
elif a == 1:
a = "T
On Sun, 7 Aug 2005, Tom Cloyd wrote:
> Having just discovered the webbrowser module, I've confirmed that I can
> indeed open a URL in my default browser using something like
>
> webbrowser.get_new("{URL}")
>
> What I want to do is open a web page stored on my local machine. I'm not
> getting it
> What I'm looking for is a way to design my programs, big or small, other
> than just pseudo-coding them on a piece of paper.
>
> How do you design your programs?
[Apologies to the list in advance: not much Python-specific information]
I hope you don't mind the "academic" answer, but:
htt
> is there any way in Python to simply add or subtract one from a
> variable like i++ or i--? I don't mind doing a i = i + 1, but would
> prefer something more simple and faster.
Out of curiosity, why are you incrementing variables? I know this might
sound silly, but I'm just curious.
> I have attached what I got so far if you feel like taking a look, but it
> is probably nasty by your standards :)
Good, this is exactly what I want. Yes, there are a few things here that
you will want to learn how to fix. Let me point out one or two, and I'm
sure others here on the list c
>> All these values "belong" together. Rather than pass them separately,
>> glue them together as a "structure". In Python, can we use a class to
>> glue things together...
>
> Okay, that makes good sense :) This should be a good exercise for OOP
> Programming :)
Just to clarify: structures
> There where some values I did not want saved to the character file. A couple
> where values that are for all characters, so I put them into their own class.
>
> ###
> class Master_stats:
> def __init__(self, year, month):
> self.year = year
> self
On Wed, 6 Jun 2007, scott wrote:
> Danny Yoo wrote:
>> In the context of the new Master_stats class, it makes more sense for
>> mfile_read() to return a Master_stats object now rather than a two-tuple
>> list.
> I was able to change the [year, month] to just maste
On Wed, 6 Jun 2007, David Heiser wrote:
> or..
>
> def is_yes(question):
> while True:
> try:
> s = raw_input(question).lower()[0]
> if s == 'y':
> return True
> elif s == 'n':
> return False
> except:
>
> Ok, what I have is a RNA sequence (about 5 million nucleotides
> [characters] long) and have (4100) subsequences (from another sequence)
> and the sub-sequences are 6 characters long, that I want to find in it.
Hi Lauren,
I am positive that this problem has been tackled before. Have you ta
auren <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Finding all locations of a sequence
Ok, these may be useful. I do have a potentially embarrassing problem,
however I will preface this with I'm practically computer illiterate. Ok
after I download the
>> At first blush it sounds to me like you want rsync, as has been
>> pointed out. If on of the systems is running an OS that doesn't come
>> with rsync... I have used http://www.vdesmedt.com/~vds2212/rsync.html
>> to achieve the same result.
>>
>
> When I need to deal with Windows computers, I so
>> Use list when you want a sequence of items indexed by sequential
>> integers. Lists
>> - preserve order
>> - are fast for indexed lookup
>> - are relatively slow (O(n)) for adding, deleting and searching (though
>> for small lists this should not be a consideration)
>
> Are you sure they take O
> Hello:
> I'm seeing some strange behavior with lstrip operating
> on string representations of *nix-style file paths
> Example:
s = '/home/test/'
s1 = s.lstrip('/home')
s1
> 'test/' ## '/test/' was expected! '/' was unexpectedly removed
> Any comments or corrective measures are w
Kent and Bob,
Are you thinking of the first problem in Bentley's Programming Pearls?
The original poster's questions sounds like it could be in that domain.
http://netlib.bell-labs.com/cm/cs/pearls/cto.html
So I agree: the next questions we probably should ask the original poster:
* W
Hi Jason,
Looking back at that Java code:
static String convertDigitToEnglish(int d) {
switch ( d )
{
case 1: return "one";
case 2: return "two";
case 3: return "three";
case 4: retu
> > http://www.faqs.org/rfcs/rfc1738.html
> >
> > shows the syntax of file URLs.
>
> Man, that Berners-Lee can sure write plain English, can he not? I didn't
> find that reference much use at all, in truth.
Hi Tom,
[Note: when you're responding to a message on Python-tutor, please make
su
On Mon, 8 Aug 2005, Jan Eden wrote:
> Is there a recommended way to receive the results of an SQL query in the
> form I need? Or do I have to create a dictionary of fieldname tuples
> which can be zipped with the query result tuple?
Hi Jan,
MySQLdb supports the concept of customized cursor ty
On Mon, 8 Aug 2005, Hossein Movahhedian wrote:
>I have copied the following example from "Learning to Program by Alan
> Gauld (section: Event Driven Programming)". To run it on Linux
> (Redhat 8.0; Python 2.4) the tutorial says to replace 'msvcrt'
> with 'curses.stdscr'.
Hi Hossein,
A
On Mon, 8 Aug 2005, Greg Lindstrom wrote:
> I found the conversation of dealing cards interesting, so I took a few
> minutes (about 20 while I waited for a production run to finish) and
> came up with the following Dealer class.
[text cut]
> What type of Pythonic changes would make this? What
> Traceback (most recent call last):
>File "", line 1, in -toplevel-
> sys.ps2
> AttributeError: 'module' object has no attribute 'ps2'
>
> What's wrong?
IDLE doesn't use sys.ps2. See the thread starting at:
http://mail.python.org/pipermail/idle-dev/2002-February/000862.html
_
On Mon, 8 Aug 2005, Dick Moores wrote:
> Danny Yoo wrote at 16:57 8/8/2005:
> > > Traceback (most recent call last):
> > >File "", line 1, in -toplevel-
> > > sys.ps2
> > > AttributeError: 'module' object has no attribute
> This is just an example, in my application I don't need to check strings
> against a huge number of cases. If however it would happen, how to
> modify startswith in order to make it accept a list instead of a simple
> string?
>
> [valid for valid in f.readlines() if valid.startswith(['abc', '12
On Wed, 10 Aug 2005, Srinivas Iyyer wrote:
> There is no cutoff. I would choose top 20% of the all the scores.
Hi Srinivas,
Those are GenBank accessions, aren't they?
> 2. I know how to read a tab delim txt file as list but not into the
> tupeles.
Can you write a function that takes a line
Hi Terry,
Ok, let's take a look at the problem. First, let's look at the error
message again:
> Traceback (most recent call last):
>File "timings.py", line 16, in ?
> do_timing(100, (makezeros.lots_of_appends, makezeros.one_multiply))
>File "timings.py", line 9, in do_timing
>
> Traceback (most recent call last):
>File "timings.py", line 16, in ?
> do_timing(100, makezeros.lots_of_appends, makezeros.one_multiply)
>File "timings.py", line 12, in do_timing
> totals[func] = totals[func] + elapsed
> KeyError:
> help(KeyError) tells me Mapping key not fou
401 - 500 of 2125 matches
Mail list logo