Re: [Tutor] Splitting

2006-07-09 Thread Daniel Watkins
Abhinav Gaurav wrote: > Example :- > >>> a="43;dsds;d" b=a.split(';') > Can anybody help on resolving this issue? This is what it looks like on my computer: >>> a="43;dsds;d" >>> b=a.split(";") >>> print b ['43', 'dsds', 'd'] This is using Pyt

Re: [Tutor] activestate

2006-07-09 Thread Daniel Watkins
Danny Yoo wrote: > If it turns out that this is a good long-term solution, we'll change the > links on the Tutor mailing list page from ActiveState's searchable archive > to the one on gmane. I've been using gmane for a few months now, without any problems. Dan __

[Tutor] Splitting strings into blocks

2006-04-30 Thread Daniel Watkins
Hi list, I'm currently working on a program to parse LaTeX style maths expressions and provide an answer. For example, I have the expression "2^\frac{1}{2}". I'm trying to work out a way to split this into it's most basic blocks of LaTeX (i.e. 2^ and \frac{1}{2}) while maintaining a record of th

[Tutor] Storing Dictionaries Externally

2005-10-22 Thread Daniel Watkins
Currently, I'm writing a little project which needs to store a dictionary in an external file (so it can be accessed by another program). However, no matter how much I try, I cannot get Python to import the dictionary from the file properly. However, I know the problem. Whatever format I put the da

Re: [Tutor] line question

2005-10-10 Thread Daniel Watkins
> There are four points with coordinates: > 2,3;4,9;1,6;3,10. > How to use Python to draw one perpendicular bisector between (2,3) and > (4,9); > the other perpendicular bisector between (1,6)和(3,10); > then, makes the output like: > l1 a b c > l2 a b c > (Note: l indicates the perpendicular

[Tutor] Code Inspection

2005-10-09 Thread Daniel Watkins
Hey list, I've been working on my spider program (albeit not very much :P) and I would appreciate it if I could get some comments on the code. I'm fairly sure I haven't chosen the best method to do what I want to do, but if we can just assume that I have, that'll make things easier. ;) In particul

Re: [Tutor] FW: FW: Is it Posible? To Crack And HowTo [horribly OT]

2005-10-08 Thread Daniel Watkins
> Really? I was of the impression that proprietory code developers *ate* > small children. Goes to show, can't believe everything you read on > Slashdot. I heard that they write all their programs using the blood of cute-looking puppies (though how that doesn't short-circuit anything I'd like to

Re: [Tutor] FW: Is it Posible? To Crack And HowTo

2005-10-07 Thread Daniel Watkins
> > I've already read before, it's not hacking I'm into now but a > similar thing, Cracking Hacking and cracking are two completely different things. Hacking is a developer with some real talent actually making a contribution to computing by writing something of use. Cracking is a jackass who's too

[Tutor] Importing Modules Within Classes

2005-10-06 Thread Daniel Watkins
Recently, there has been an example of someone importing modules within a class definition. eg: class Exemplar: import re ...use re... It seems obvious to me that this is incorrect, though more through training than actual observation on my part, and it should be: import re clas

Re: [Tutor] FW: Help Needed

2005-10-05 Thread Daniel Watkins
When I am in Python Shell of the IDLE GUI, when I click Edit/Run Script, I am getting a dialog box that is titled “Not saved” and states “The buffer for Python shell is not saved. Please save it first.” With an “OK” button that just takes me back to the

Re: [Tutor] FW: Frustrated Beginner

2005-09-29 Thread Daniel Watkins
Rosalee Dubberly wrote: > ## Now I am trying to modify the function to replace eggs with toast > and spam with jelly. I have spent days and nothing works. Can you send > me in the right direction?? The obvious answer (that has already been mentioned) is to simply replace the words in the actual p

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 21:00 +0100, Alan G wrote: > Not so. print automatically calls str() on all its arguments so > the programmer doesn't need to. So it does. I think I was trying to concatenate, which it doesn't like. Sorry if I caused any confusion. Dan ___

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 15:15 +0100, [EMAIL PROTECTED] wrote: > for i in range(10): > principal = principal * (1 + apr) To calculate compound interest, you in fact don't need to use a loop at all (you could use: 'final = principal * (apr ** years)') but if you really want to use a loop,

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread Daniel Watkins
On Sat, 2005-09-03 at 03:30 +0100, Tom Strickland wrote: > > How do I get the output window to stay open, or where is the output > stored? You can open up a command prompt before running the program, which will allow you to see the output as the program runs. You get to this by 'Start > Run..' or

[Tutor] Remote Directory Reading

2005-08-25 Thread Daniel Watkins
I've run into a bit of trouble with my spider script. Thus far, it is able to retrieve all of the data off the website that is contained within standard HTML, downloading jpg, gif and bmp images that are related to the files (this restriction only being set by a lack of further definitions by mysel

[Tutor] Website Retrieval Program

2005-08-24 Thread Daniel Watkins
I'm currently trying to write a script that will get all the files necessary for a webpage to display correctly, followed by all the intra-site pages and such forth, in order to try and retrieve one of the many sites I have got jumbled up on my webspace. After starting the writing, someone introduc