Re: Searching for a list of strings in a file with Python

2013-10-13 Thread Peter Otten
Starriol wrote: > Hi guys, > > I'm trying to search for several strings, which I have in a .txt file line > by line, on another file. So the idea is, take input.txt and search for > each line in that file in another file, let's call it rules.txt. > > So far, I've been able to do this, to search

Query on Python Compiled source--Urgent

2013-10-13 Thread chandan kumar
Hi, I'm working on a python project for protocol testing.I need to provide only python compiled source to our customer. Here are the steps followed to take python compiled from actual source. 1.There are 5 different test suites under the project 2..Run all 5  test suite with python sources. 3.Af

Searching for a list of strings in a file with Python

2013-10-13 Thread Starriol
Hi guys, I'm trying to search for several strings, which I have in a .txt file line by line, on another file. So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt. So far, I've been able to do this, to search for individual strings: [cod

Re: converting letters to numbers

2013-10-13 Thread Steven D'Aprano
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: > def add(c1, c2): > % Decode > c1 = ord(c1) - 65 > c2 = ord(c2) - 65 > % Process > i1 = (c1 + c2) % 26 > % Encode > return chr(i1+65) Python uses # for comments, not %, as I'm sure you know. What language

Re: converting letters to numbers

2013-10-13 Thread Tim Roberts
kjaku...@gmail.com wrote: > >Transfer it to an uppercase letter if it's a letter, if it's not then an error. >This isn't right, I know, just testing around > >def add(c1, c2): >ans = '' >for i in c1 + c2: >ans += chrord(i)-65))%26) + 65) >return ans It's close. I think you

Re: Would you l like to take over lockfile?

2013-10-13 Thread Ben Finney
Skip Montanaro writes: > I don't have the time or inclination to continue supporting lockfile ( > https://pypi.python.org/pypi/lockfile/). If you'd like to take it over, let > me know. I have some experience working with the above project, and am willing to assist. Please join us on the develope

Re: basic maze problem with turtle

2013-10-13 Thread Steven D'Aprano
On Sun, 13 Oct 2013 22:03:04 +, Denis McMahon wrote: > On Sun, 13 Oct 2013 14:53:36 -0700, baujacob wrote: > >> Is there anyway I can force the user back to the starting point when >> the turtle hits the wall? [skip useful advise to a beginner] > Except perhaps [skip completely uncalled for

Re: basic maze problem with turtle

2013-10-13 Thread Gary Herron
On 10/13/2013 03:03 PM, Denis McMahon wrote: Except perhaps Nikos. Nikos can probably write you extremely elegant one line python solutions to any coding problem you describe to him. His solutions might suffer the very minor flaw of not working, but they're guaranteed to be Nikos certified aesthe

Trying to force turtle back to beginning of maze after collides with wall

2013-10-13 Thread baujacob
Hi everyone, I'm trying to create a simple maze program. When the user finishes the maze, I want to print in big letters "You Win!" and when the user hits a wall, I want the user to go back to the beginning of the maze. The problem is "collision detection" which is an advanced topic and I'm only

Re: basic maze problem with turtle

2013-10-13 Thread baujacob
On Sunday, October 13, 2013 2:52:50 PM UTC-7, bauj...@gmail.com wrote: > Hi everyone, I'm trying to create a simple maze program. When the user > finishes the maze, I want to print in big letters "You Win!" and when the > user hits a wall, I want the user to go back to the beginning of the maze.

Re: basic maze problem with turtle

2013-10-13 Thread Denis McMahon
On Sun, 13 Oct 2013 14:53:36 -0700, baujacob wrote: > Is there anyway I can force the user back to the starting point > when the turtle hits the wall? Yes, however, do not expect us to code it for you. Rather, discuss your method, and how you think it should be coded, or even better your soluti

basic maze problem with turtle

2013-10-13 Thread baujacob
Hi everyone, I'm trying to create a simple maze program. When the user finishes the maze, I want to print in big letters "You Win!" and when the user hits a wall, I want the user to go back to the beginning of the maze. The problem is "collision detection" which is an advanced topic and I'm only

basic maze problem with turtle

2013-10-13 Thread baujacob
Hi everyone, I'm trying to create a simple maze program. When the user finishes the maze, I want to print in big letters "You Win!" and when the user hits a wall, I want the user to go back to the beginning of the maze. The problem is "collision detection" which is an advanced topic and I'm only

Re: OT: looking for best solutions for tracking projects and skills

2013-10-13 Thread Chris “Kwpolska” Warrick
On Sun, Oct 13, 2013 at 8:40 PM, Jason Friedman wrote: > I highly recommend JIRA, free for non-profit use: > https://www.atlassian.com/software/jira. As usual, the free version is hidden and available only on request: https://www.atlassian.com/software/views/open-source-license-request -- Chris

Re: OT: looking for best solutions for tracking projects and skills

2013-10-13 Thread Jason Friedman
I highly recommend JIRA, free for non-profit use: https://www.atlassian.com/software/jira. On Fri, Oct 11, 2013 at 9:09 PM, Jason Hsu wrote: > I realize this is off-topic, but I'm not sure what forum is best for asking > about this. I figure that at least a few of you are involved in civic > h

Re: What version of glibc is Python using?

2013-10-13 Thread Mark Lawrence
On 13/10/2013 18:43, John Nagle wrote: The documentation is badly written. The next line, "Note that this function has intimate knowledge of how different libc versions add symbols to the executable is probably only usable for executables compiled using gcc" isn't even a sentence. The d

Re: What version of glibc is Python using?

2013-10-13 Thread Ian Kelly
On Sun, Oct 13, 2013 at 11:43 AM, John Nagle wrote: >Ah, the apologist approach. I'm not trying to defend it. I'm saying that patching the function to fix the issue at hand risks breaking existing code that relies upon the function doing what the documentation says it does. >The documen

Re: web scraping

2013-10-13 Thread John Nagle
On 10/12/2013 1:35 PM, dvgh...@gmail.com wrote: > On Saturday, October 12, 2013 7:12:38 AM UTC-7, Ronald Routt wrote: >> I am new to programming and trying to figure out python. >> >> >> >> I am trying to learn which tools and tutorials I need to use along >> with some good beginner tutorials in

Re: What version of glibc is Python using?

2013-10-13 Thread John Nagle
On 10/12/2013 1:28 PM, Ian Kelly wrote: > Reading the docs more closely, I think that the function is actually > working as intended. It says that it determines "the libc version > against which the file executable (defaults to the Python interpreter) > is linked" -- or in other words, the minimum

Re: Would you l like to take over lockfile?

2013-10-13 Thread Piet van Oostrum
Skip Montanaro writes: > I don't have the time or inclination to continue supporting lockfile ( > https://pypi.python.org/ > pypi/lockfile/). If you'd like to take it over, let me know. > > Skip Hi Skip, I am interested. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-13 Thread Roy Smith
In article <525a15ad$0$29984$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > While I agree with your general thrust, I don't think it's quite so > simple. Perl has a king, Larry Wall, but his design is more or less > "throw everything into the pot, it'll be fine" and consequently

Would you l like to take over lockfile?

2013-10-13 Thread Skip Montanaro
I don't have the time or inclination to continue supporting lockfile ( https://pypi.python.org/pypi/lockfile/). If you'd like to take it over, let me know. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Inter-process locking

2013-10-13 Thread Piet van Oostrum
Jason Friedman writes: > The lockfile solution seems to be working, thank you. There is one caveat, however. If a process that has the lock crashes without releasing the lock, the lock file will stay around and prevent other processes to acquire it. Then you will have to manually remove it. I

Re: Doubt on generators behavior

2013-10-13 Thread Terry Reedy
On 10/13/2013 4:19 AM, Krishnan Shankar wrote: Hi Friends, I am new to Generators and was learning the same by experimenting. I wrote a small code which is as below. >>> def test_gen(var): ... print "The number is", var ... if var % 2 == 0: ... yield var ... else: ...

Re: Doubt on generators behavior

2013-10-13 Thread Steven D'Aprano
On Sun, 13 Oct 2013 13:49:53 +0530, Krishnan Shankar wrote: > Hi Friends, > > I am new to Generators and was learning the same by experimenting. I > wrote a small code which is as below. > def test_gen(var): > ... print "The number is", var > ... if var % 2 == 0: > ... yield

Re: Doubt on generators behavior

2013-10-13 Thread Jussi Piitulainen
Krishnan Shankar writes: > Hi Friends, > > I am new to Generators and was learning the same by experimenting. I > wrote a small code which is as below. > > >>> def test_gen(var): > ... print "The number is", var > ... if var % 2 == 0: > ... yield var > ... else: > ...

Doubt on generators behavior

2013-10-13 Thread Krishnan Shankar
Hi Friends, I am new to Generators and was learning the same by experimenting. I wrote a small code which is as below. >>> def test_gen(var): ... print "The number is", var ... if var % 2 == 0: ... yield var ... else: ... print "Number is odd" ... >>> But when i was e

Re: What version of glibc is Python using?

2013-10-13 Thread John Nagle
On 10/12/2013 4:43 AM, Ian Kelly wrote: > On Sat, Oct 12, 2013 at 2:46 AM, Terry Reedy wrote: >> On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: >>> >>> That function is really bogus. It states itself, that it has "intimate >>> knowledge of how different libc versions add symbols to the executa