[Tutor] Picking up citations

2009-02-06 Thread Dinesh B Vadhia
Hi! I want to process text that contains citations, in this case in legal documents, and pull-out each individual citation. Here is a sample text: text = "Page 500 Carter v. Jury Commission of Greene County, 396 U.S. 320, 90 S.Ct. 518, 24 L.Ed.2d 549 (1970); Lathe Turner v. Fouche, 396 U.S. 34

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Daniel
These are really valuable info. I will try. Thanks a lot. On Fri, Feb 6, 2009 at 7:44 PM, Kent Johnson wrote: > On Fri, Feb 6, 2009 at 4:11 AM, Daniel wrote: > > Hi Tutors, > > > > I want to use python to finish some routine data processing tasks > > automatically (on Windows). > > > > The ma

Re: [Tutor] Designing a Dialog in Python

2009-02-06 Thread W W
On Fri, Feb 6, 2009 at 3:12 AM, Alan Gauld wrote: > "Wayne Watson" wrote > >> Signature.htmlWhen I used VBasic many years ago, it had the ability to >> design a dialog and then attach it to the code. Is there something like this >> available for Python? >> > > However most Python programmers stil

Re: [Tutor] WINSOCK stdin question

2009-02-06 Thread Tom Green
The Python app is on the Server side. Sorry, I don't mean to cause hassle for anyone. I appreciate everyone's assistance. I am trying to reproduce what Netcat does. Thanks, Mike On Fri, Feb 6, 2009 at 9:19 PM, Kent Johnson wrote: > On Fri, Feb 6, 2009 at 3:52 PM, Tom Green wrote: > > Hello P

Re: [Tutor] WINSOCK stdin question

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 3:52 PM, Tom Green wrote: > Hello Python group, > > I need some advice on a problem I am facing. Basically I have a binary that > sends out a reverse shell (CMD prompt). I have a listening Python socket > and I would like to know how I can redirect the CMD prompt to stdin,

Re: [Tutor] Closing and Open File--TkFileDialogs

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 6:53 PM, Wayne Watson wrote: > I'm using asksaveasfilename, and, as I understand it, it returns the file > name to me in write mode. I don't recall that there's a way to reference the > file with only the filename. That is, there's no filename.write(). Comments? I think you

[Tutor] How to avoid error message: "_csv.Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?"

2009-02-06 Thread Judith Flores
Hello, I get the error message above quite often when trying to open some csv files. I noticed that if I open the csv file in excel and delete the "empty" columns at the right end of my data, the error message doesn't appear. My code looks like this: myfile=open(csvfile) reader=csv.reader(m

Re: [Tutor] WINSOCK stdin question

2009-02-06 Thread Alan Gauld
"Tom Green" wrote I need some advice on a problem I am facing. Basically I have a binary that sends out a reverse shell (CMD prompt). OK, You lost me right here. What is a reverse shell? That's a new one for me? (I tried wikipedia but drew a blank) I have a listening Python socket and I

[Tutor] Closing and Open File--TkFileDialogs

2009-02-06 Thread Wayne Watson
Title: Signature.html I'm using asksaveasfilename, and, as I understand it, it returns the file name to me in write mode. I don't recall that there's a way to reference the file with only the filename. That is, there's no filename.write(). Comments? While I'm at it, I have found a good example

Re: [Tutor] improving the speed of prime number code

2009-02-06 Thread bob gailer
H.G. le Roy wrote: Hi, I'm stuck with Problem 10 (http://projecteuler.net/index.php?section=problems&id=10 ) :-) A part of my code deals with the calculation of prime numbers. However it is really slow. Hopefully you have some ideas

Re: [Tutor] improving the speed of prime number code

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 4:19 PM, H.G. le Roy wrote: > A part of my code deals with the calculation of prime numbers. However it is > really slow. Hopefully you have some ideas how to make it faster. > > pz = [2] > # only iterate over odd numbers > for i in xrange(3,200,2): > remprod = 1 # p

Re: [Tutor] improving the speed of prime number code

2009-02-06 Thread taserian
One potential way to speed up is not to divide by every prime in your pz list, but only up to the square root of i. For example, to test if 37 is prime, you would only need to look at primes less than or equal to int(sqrt(37)) = 6.08. . . Tony R. On Fri, Feb 6, 2009 at 4:19 PM, H.G. le Roy wrot

[Tutor] improving the speed of prime number code

2009-02-06 Thread H.G. le Roy
Hi, I'm stuck with Problem 10 ( http://projecteuler.net/index.php?section=problems&id=10) :-) A part of my code deals with the calculation of prime numbers. However it is really slow. Hopefully you have some ideas how to make it faster. pz = [2] # only iterate over odd numbers for i in xrange(3,

[Tutor] WINSOCK stdin question

2009-02-06 Thread Tom Green
Hello Python group, I need some advice on a problem I am facing. Basically I have a binary that sends out a reverse shell (CMD prompt). I have a listening Python socket and I would like to know how I can redirect the CMD prompt to stdin, so I can interact with the host that is sending the shell.

[Tutor] parallel port help

2009-02-06 Thread Patrick
Hi Everyone I would like to write a Python program to control the data lines of a parallel port. PyParallel seems buggy, even the install script has one and it has practically no documentation. Portio also failed to install for me. Is there any other library you could point me too, or do y

Re: [Tutor] (no subject)

2009-02-06 Thread OkaMthembo
Lol..indeed [?] On Fri, Feb 6, 2009 at 5:08 PM, bob gailer wrote: > Okeke emmanuel wrote: > >> >> >> >> >> ___ >> Tutor maillist - Tutor@python.org >> http://mail.python.org/ma

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread bob gailer
Kent Johnson wrote: On Fri, Feb 6, 2009 at 7:21 AM, spir wrote: see also http://en.wikipedia.org/wiki/Python_Pipelines That looks pretty dead, or at least unpublished. The google code project is almost two years old but it contains no code. It is sluggish but not dead. The code

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread bob gailer
spir wrote: Le Fri, 6 Feb 2009 06:44:11 -0500, Kent Johnson a écrit : My first thought was, use shell pipelines and bash. Then I remembered, David Beazley shows how to use generators to implement a processing pipeline in Python: http://www.dabeaz.com/generators-uk/ see also http://en

Re: [Tutor] (no subject)

2009-02-06 Thread bob gailer
Okeke emmanuel wrote: ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor At least the subject is accurate! -- Bob Gailer Chapel Hill NC 9

Re: [Tutor] 'sphere' object is unindexable

2009-02-06 Thread Carnell, James E
Sorry, I do see that I wrote that question in a confusing way, but I've worked out where I was going wrong now. Thanks for taking a look. > > m.pick = ["stab","stab","stab","..."] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailma

[Tutor] (no subject)

2009-02-06 Thread Okeke emmanuel
___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] confusing enumerate behavior

2009-02-06 Thread عماد نوفل
On Fri, Feb 6, 2009 at 6:54 AM, Kent Johnson wrote: > 2009/2/6 jitendra gupta : > > > Try this if u r looking for this kind of solution > my_input = "one two three four five six seven eight nine ten" > text = my_input.split() > for i in range(len(text)): > >if i+3>=len(text):

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 7:21 AM, spir wrote: > see also > http://en.wikipedia.org/wiki/Python_Pipelines That looks pretty dead, or at least unpublished. The google code project is almost two years old but it contains no code. Kent ___ Tutor maillist -

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread spir
Le Fri, 6 Feb 2009 06:44:11 -0500, Kent Johnson a écrit : > My first thought was, use shell pipelines and bash. Then I remembered, > David Beazley shows how to use generators to implement a processing > pipeline in Python: > http://www.dabeaz.com/generators-uk/ see also http://en.wikipedia.org/w

Re: [Tutor] confusing enumerate behavior

2009-02-06 Thread Kent Johnson
2009/2/6 jitendra gupta : > Try this if u r looking for this kind of solution my_input = "one two three four five six seven eight nine ten" text = my_input.split() for i in range(len(text)): >if i+3>=len(text): >print text[i-3:len(text):1] >elif i<=2: >

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 4:11 AM, Daniel wrote: > Hi Tutors, > > I want to use python to finish some routine data processing tasks > automatically (on Windows). > > The main task could be split to sub small tasks. Each can be done by > executing some small tools like "awk" or by some other python sc

Re: [Tutor] totally stumped on signal code, wont work in this instance

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 4:06 AM, dave selby wrote: > import sys, threading, time, os.path, urllib, time, signal, ConfigParser, > logger > > > def main(): > >while True: # sleep to keep daemons alive :) >time.sleep(60 * 60 * 24) > > > def signal_hup(signum, frame): >""" >S

Re: [Tutor] passing unknown no of arguments

2009-02-06 Thread Kent Johnson
On Fri, Feb 6, 2009 at 3:43 AM, amit sethi wrote: >>> AFAIK MS Silverlight allows you to run .NET languages in your browser, > > so for that i guess i would have to use ironpython and not Cpython which is > what i normally use . Are there any big problems porting the code from one > to other that

Re: [Tutor] confusing enumerate behavior

2009-02-06 Thread spir
Le Fri, 6 Feb 2009 12:30:31 +0530, jitendra gupta a écrit : > > #BEGIN > > my_input = "one two three four five six seven eight nine ten" > > text = my_input.split() > > for i,v in enumerate(text): > > line = text[i-3], text[i-2], text[i-1], v, text[i+1], text[i+2], > > text[i+3] > > prin

Re: [Tutor] 'sphere' object is unindexable

2009-02-06 Thread Mr Gerard Kelly
Sorry, I do see that I wrote that question in a confusing way, but I've worked out where I was going wrong now. Thanks for taking a look. - Original Message - From: Alan Gauld Date: Friday, February 6, 2009 7:22 pm Subject: Re: [Tutor] 'sphere' object is unindexable > "Mr Gerard Kelly" w

Re: [Tutor] 'sphere' object is unindexable

2009-02-06 Thread Alan Gauld
"Mr Gerard Kelly" wrote I am trying to get around the problem of sphere object being unindexable. Can you give some background? Where are you getting these spheres? Is this a graphics program or a tookit of some kind? I need to make spheres appear, positioned according to some list, for ex

Re: [Tutor] Designing a Dialog in Python

2009-02-06 Thread Alan Gauld
"Wayne Watson" wrote Signature.htmlWhen I used VBasic many years ago, it had the ability to design a dialog and then attach it to the code. Is there something like this available for Python? What I think you are looking for is a GUI design tool. There are several for Python, some commercial

[Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Daniel
Hi Tutors, I want to use python to finish some routine data processing tasks automatically (on Windows). The main task could be split to sub small tasks. Each can be done by executing some small tools like "awk" or by some other python scripts. One example of such task is conducting a data proces

[Tutor] totally stumped on signal code, wont work in this instance

2009-02-06 Thread dave selby
Hi, I have been hitting my head on a brick wall on a bit of code that refuses to work. I have similar code in other scripts that works AOK I have commented out all functionality except the core problem ... import sys, threading, time, os.path, urllib, time, signal, ConfigParser, logger def

Re: [Tutor] passing unknown no of arguments

2009-02-06 Thread amit sethi
>> AFAIK MS Silverlight allows you to run .NET languages in your browser, so for that i guess i would have to use ironpython and not Cpython which is what i normally use . Are there any big problems porting the code from one to other that i need to be worried about. On Fri, Feb 6, 2009 at 12:30

[Tutor] 'sphere' object is unindexable

2009-02-06 Thread Mr Gerard Kelly
I am trying to get around the problem of sphere object being unindexable. I need to make spheres appear, positioned according to some list, for example: for i in [0,1]: sphere(pos=(0,i,0), radius=0.1) Is there any way of making these different spheres behave differently without using indexi