Re: Show off your Python chops and compete with others

2013-11-07 Thread Alister
On Thu, 07 Nov 2013 10:38:40 -0800, Nathaniel Sokoll-Ward wrote: Wow! Thanks for all the feedback everyone. This content is fresh so I appreciate everyone's comments. As opposed to responding to each post individually, I'll just lump everything in here... My answer: Defines a function

Re: To whoever hacked into my Database

2013-11-06 Thread Alister
On Wed, 06 Nov 2013 17:25:04 +0200, Νίκος Γκρ33κ wrote: Okey let the hacker try again to mess with my database!!! He is done it twice, lets see if he will make it again! I'am waiting! I don't think any cracker (hacker is something different) would need to. you are doing a more than

Re: First day beginner to python, add to counter after nested loop

2013-11-01 Thread Alister
On Thu, 31 Oct 2013 04:07:14 -0700, rusi wrote: Also others (Alister?) were double-space-reply-posting as well. When you mean to point out a behavior without getting personal, it helps to point out all instances of that behavior. Otherwise it looks like you are going for someone, when

Re: how to extract page-URL using BeautifulSoup

2013-11-01 Thread Alister
On Thu, 31 Oct 2013 08:59:00 -0700, bhaktanishant wrote: I want to extract the page-url. for example: if i have this code import urllib2 from bs4 import BeautifulSoup link = http://www.google.com; page = urllib2.urlopen(link).read() soup = BeautifulSoup(page) then i can extract title

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 03:08:11 -0700, jonas.thornvall wrote: Den onsdagen den 30:e oktober 2013 kl. 08:07:31 UTC+1 skrev Tim Roberts: jonas.thornv...@gmail.com wrote: I certainly do not like the old bracket style it was a catastrophe, but in honesty the gui editor of python should have what

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 13:42:37 +0100, Antoon Pardon wrote: Op 30-10-13 13:17, Chris Angelico schreef: On Wed, Oct 30, 2013 at 11:01 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: I broadly agree with your post (I'm of the school of thought that braces are better than indentation for

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 07:31:04 -0700, jonas.thornvall wrote: Den onsdagen den 30:e oktober 2013 kl. 15:22:50 UTC+1 skrev Alister: On Wed, 30 Oct 2013 13:42:37 +0100, Antoon Pardon wrote: Op 30-10-13 13:17, Chris Angelico schreef: On Wed, Oct 30, 2013 at 11:01 PM, Antoon Pardon

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 08:35:29 -0700, jonas.thornvall wrote: Den onsdagen den 30:e oktober 2013 kl. 16:09:25 UTC+1 skrev Mark Lawrence: On 30/10/2013 14:31, jonas.thornv...@gmail.com wrote: Would you please be kind enough to read, digest and action this

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 15:56:32 +0100, Antoon Pardon wrote: Op 30-10-13 15:22, Alister schreef: On Wed, 30 Oct 2013 13:42:37 +0100, Antoon Pardon wrote: Op 30-10-13 13:17, Chris Angelico schreef: On Wed, Oct 30, 2013 at 11:01 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: I broadly

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 08:57:08 -0700, jonas.thornvall wrote: Den onsdagen den 30:e oktober 2013 kl. 16:54:19 UTC+1 skrev Mark Lawrence: On 30/10/2013 15:35, jonas.thornv...@gmail.com wrote: Den onsdagen den 30:e oktober 2013 kl. 16:09:25 UTC+1 skrev Mark Lawrence: On 30/10/2013 14:31,

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Alister
On Wed, 30 Oct 2013 16:07:47 +, Alister wrote: On Wed, 30 Oct 2013 15:56:32 +0100, Antoon Pardon wrote: Op 30-10-13 15:22, Alister schreef: On Wed, 30 Oct 2013 13:42:37 +0100, Antoon Pardon wrote: Op 30-10-13 13:17, Chris Angelico schreef: On Wed, Oct 30, 2013 at 11:01 PM, Antoon

Re: Help with guessing game :D

2013-10-29 Thread Alister
On Tue, 29 Oct 2013 05:05:19 -0700, Robert Gonda wrote: converting input()'s result to an integer, both of which suggest if you need to be checking individual digits you are probably best keeping the input number to be checked as strings. it would then be a trivial task to expand

Re: Help with guessing game :D

2013-10-29 Thread Alister
On Tue, 29 Oct 2013 06:03:55 -0700, Robert Gonda wrote: On Tuesday, 29 October 2013 12:58:09 UTC, Alister wrote: On Tue, 29 Oct 2013 05:05:19 -0700, Robert Gonda wrote: converting input()'s result to an integer, both of which suggest if you need to be checking

Re: Help with guessing game :D

2013-10-29 Thread Alister
On Tue, 29 Oct 2013 06:10:30 -0700, Robert Gonda wrote: On Tuesday, 29 October 2013 13:07:08 UTC, Alister wrote: On Tue, 29 Oct 2013 06:03:55 -0700, Robert Gonda wrote: On Tuesday, 29 October 2013 12:58:09 UTC, Alister wrote: On Tue, 29 Oct 2013 05:05:19 -0700, Robert Gonda wrote

Re: Help with guessing game :D

2013-10-29 Thread Alister
On Tue, 29 Oct 2013 07:40:20 -0700, Robert Gonda wrote: remember that strings are a sequence. they can be used as iterators sliced in the same way as lists tuples. Let a fool hold his tongue and he will pass for a sage. -- Publilius Syrus Now you have

Re: Will Python 3.x ever become the actual standard?

2013-10-24 Thread Alister
On Thu, 24 Oct 2013 09:43:18 +0100, Mark Lawrence wrote: On 24/10/2013 09:30, Antoine Pitrou wrote: dufriz at gmail.com writes: I am starting to have doubts as to whether Python 3.x will ever be actually adopted by the Python community at large as their standard. We're planning to start

Re: basic maze problem with turtle

2013-10-14 Thread Alister
On Sun, 13 Oct 2013 14:53:36 -0700, baujacob 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. The problem is

Re: Query on Python Compiled source--Urgent

2013-10-14 Thread Alister
On Mon, 14 Oct 2013 13:41:35 +0800, chandan kumar wrote: Now my question is of there any issue with logging to excel it should happen for the first test suite itself,but it occurs in either 2,3,4 or 5 test suite. Some it runs without any issues. Logging to excel is probably a wrong thing to

Re: basic maze problem with turtle

2013-10-14 Thread Alister
On Mon, 14 Oct 2013 13:13:15 +, Neil Cerutti wrote: On 2013-10-14, Sam Fourman Jr. sfour...@gmail.com wrote: Who the hell is Nikos? I hear reference to this guy ALL the time, is he a troll or a python god? this simply isn't clear.. I have only been on this list a few months. Check the

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Alister
On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to run arbitrary code on a linux server? Yes, it is possible. Is

Re: JUST GOT HACKED

2013-10-01 Thread Alister
On Tue, 01 Oct 2013 16:42:31 +0300, Νίκος wrote: Στις 1/10/2013 4:27 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Tue, Oct 1, 2013 at 3:15 PM, Νίκος nikos.gr...@gmail.com wrote: Στις 1/10/2013 4:06 μμ, ο/η Mark Lawrence έγραψε: On 01/10/2013 10:58, Νίκος wrote: Just logged in via FTP to my

Re: card dealer

2013-09-27 Thread Alister
On Fri, 27 Sep 2013 03:24:28 -0700, markotaht wrote: from random import * from math import floor kaarte_alles = 52 kaart_tõmmatud = [False for i in range(52)] mast = [ärtu, ruutu, poti, risti] aste = [äss, kaks, kolm, neli,viis, kuus, \ seitse, kaheksa, üheksa, kümme,

Re: How to send an anonymous mail via Python script

2013-09-24 Thread Alister
On Sat, 21 Sep 2013 20:41:25 +1000, Chris Angelico wrote: On Sat, Sep 21, 2013 at 8:15 PM, Νίκος nikos.gr...@gmail.com wrote: On 21/9/2013 1:04 μμ, Chris Angelico wrote: On Sat, Sep 21, 2013 at 7:58 PM, Νίκος nikos.gr...@gmail.com wrote: Can you please tell me what alternation must be made

Re: How to send an anonymous mail via Python script

2013-09-24 Thread Alister
On Tue, 24 Sep 2013 12:29:14 +, Steven D'Aprano wrote: On Tue, 24 Sep 2013 11:36:16 +, Alister wrote: To put it even more simply If you have a legitimate reason to send me emails then you have no legitimate reason to withhold your true Identity. Dear Alister, snip

Re: sqlite issue in 2.7.5

2013-09-03 Thread Alister
On Mon, 02 Sep 2013 22:13:27 +, Joseph L. Casale wrote: I have been battling an issue hopefully someone here has insight with. I have a database with a few tables I perform a query against with some joins against columns collated with NOCASE that leverage = comparisons. Running the

Re: semicolon at end of python's statements

2013-08-29 Thread Alister
On Wed, 28 Aug 2013 22:10:16 -0400, Sam Fourman Jr. wrote: On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org wrote: Dear all, I'm C++ programmer and unfortunately put semicolon at end of my statements in python. Quesion: What's really defferences between

Re: Improving the web page download code.

2013-08-28 Thread Alister
On Tue, 27 Aug 2013 12:41:10 -0700, mukesh tiwari wrote: Hello All, I am doing web stuff first time in python so I am looking for suggestions. I wrote this code to download the title of webpages using as much less resource ( server time, data download) as possible and should be fast enough.

Re: .split() Qeustion

2013-08-14 Thread Alister
On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a method?) without instead of writing each comma between words in the pie list in the following code? Also, is there a

Re: .split() Qeustion

2013-08-14 Thread Alister
On Wed, 14 Aug 2013 11:31:01 +0100, Joshua Landau wrote: On 14 August 2013 09:30, Alister alister.w...@ntlworld.com wrote: On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling

Re: The meaning of doubt, was Re: Python Basic Doubt

2013-08-10 Thread Alister
On Sat, 10 Aug 2013 20:36:52 +0200, Peter Otten wrote: Terry Reedy wrote: On 8/10/2013 11:33 AM, Krishnan Shankar wrote: Hi Fellow Python Friends, I am new to Python and recently subscribed to the mailing list.I have a doubt regarding the basics of Python. Please help me in understanding

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Alister
On Mon, 05 Aug 2013 06:09:53 -0700, Luca Cerone wrote: Hi everybody, I am trying to understand how to use named pipes in python to launch external processes (in a Linux environment). As an example I am trying to imitate the behaviour of the following sets of commands is bash: mkfifo

Re: Python script help

2013-08-01 Thread Alister
On Thu, 01 Aug 2013 10:57:01 +1000, alex23 wrote: On 31/07/2013 6:15 PM, cool1...@gmail.com wrote: Here are some scripts, how do I put them together to create the script I want? (to search a online document and download all the links in it) 1. Think about the requirements. 2. Write some

Re: Critic my module

2013-07-27 Thread Alister
On Sat, 27 Jul 2013 08:56:10 -0400, Devyn Collier Johnson wrote: Good point about the Made by/Copyright suggestion. Although, I have not copyrighted the file, can I still say Copyrighted by -- There is no special process to Copyright anything. the simple act of writing it automatically

Re: Critic my module

2013-07-26 Thread Alister
The main point of this is for shell users that are using Python and do not know some of the Python commands. This module would make Python more like a Linux shell. For instance, a shell user would type boash.uname() because they may not know they can type import platform; platform.uname().

Re: Wedding Planning Shortcuts

2013-07-11 Thread Alister
On Wed, 10 Jul 2013 23:42:14 -0700, fletcherbenjiaa wrote: A wedding is truly a labor of love for most engaged couples, and it's natural to feel a bit wary of the wedding planning process. However, it doesn't have to be so intimidating or cumbersome. Sure there are lots of details in even the

Re: Newbie. Need help

2013-07-08 Thread Alister
On Mon, 08 Jul 2013 01:53:06 -0700, Sanza101 wrote: I just started using Python recently, and i need help with the following: Please assist. 1.Create another function that generates a random number (You will have to import the relevant library to do this) 2.Create a function that

Re: private class attributes

2013-06-27 Thread Alister
On Wed, 26 Jun 2013 23:28:49 -0700, wgtrey wrote: good question but a very poor reply, you should at least quote SOME of the original post to give context. especially as msg threading in this newsgroup is less than perfect. -- How sharper than a serpent's tooth is a sister's See?

Re: Limit Lines of Output

2013-06-26 Thread Alister
On Tue, 25 Jun 2013 14:39:30 -0600, Ian Kelly wrote: On Tue, Jun 25, 2013 at 2:31 PM, Joshua Landau joshua.landau...@gmail.com wrote: On 25 June 2013 21:22, Bryan Britten britten.br...@gmail.com wrote: Ah, I always forget to mention my OS on these forums. I'm running Windows. Supposedly,

Re: n00b question on spacing

2013-06-22 Thread Alister
On Sat, 22 Jun 2013 17:11:00 +0100, Joshua Landau wrote: On 22 June 2013 16:55, Rick Johnson rantingrickjohn...@gmail.com wrote: On Saturday, June 22, 2013 10:40:24 AM UTC-5, Joshua Landau wrote: Plus, your use of the format syntax is incorrect. Wut? Well what i mean exactly is not that

Re: Does upgrade from 2.7.3 to 2.7.5 require uninstall?

2013-06-20 Thread Alister
On Thu, 20 Jun 2013 11:35:49 -0700, Wanderer wrote: Do I need to uninstall Python 2.7.3 before installing Python 2.7.5? Thanks that will depend on your operating system an possibly the variety of python -- I don't even butter my bread. I consider that cooking. --

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 21:06:16 +0300, Νίκος wrote: But the comma inside the execute statement doesn't protect me from such actions opposed when i was using a substitute operator? You are correct Nicos, passing the values as a parameter list does protect you from SQL injection JT has made an

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 22:30:57 +0300, Νίκος wrote: On 17/6/2013 10:05 μμ, Alister wrote: You are correct Nicos, passing the values as a parameter list does protect you from SQL injection JT has made an error. Even if the query is somehting like: http://superhost.gr/cgi-bin/files.py

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 19:16:02 +, Jens Thoms Toerring wrote: MRAB pyt...@mrabarnett.plus.com wrote: On 17/06/2013 19:32, Jens Thoms Toerring wrote: As I wrote you need *single* quotes around strings in SQL statements. Double quotes won't do - this is SQL and not Python so you're dealing

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 22:28:47 +0300, Νίκος wrote: On 17/6/2013 10:19 μμ, John Gordon wrote: Print the cur.rowcount attribute, which contains the number of rows that were affected by the update. If it's zero, that should tell you something. #update file's counter if cookie does not exist

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 20:44:03 +, John Gordon wrote: In MtKvt.47400$ja6.35986@fx18.am4 Alister alister.w...@ntlworld.com writes: #update file's counter if cookie does not exist cur.execute('''UPDATE files SET hits = hits + 1, host = %s, lastvisit = %s WHERE url = %s''', (host

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Alister
On Mon, 17 Jun 2013 20:26:57 +, Alister wrote: On Mon, 17 Jun 2013 22:30:57 +0300, Νίκος wrote: On 17/6/2013 10:05 μμ, Alister wrote: You are correct Nicos, passing the values as a parameter list does protect you from SQL injection JT has made an error. Even if the query is somehting

Re: My son wants me to teach him Python

2013-06-17 Thread Alister
On Sun, 16 Jun 2013 15:33:29 -0700, Rick Johnson wrote: On Sunday, June 16, 2013 4:52:16 PM UTC-5, Chris Angelico wrote: Okay... I'm trying to get my head around what you've done here. Isn't it simply that you've made a way to, with what looks like a point-and-click interface, let the user

Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread Alister
On Sat, 15 Jun 2013 20:29:09 +0300, Nick the Gr33k wrote: On 15/6/2013 8:11 μμ, Chris “Kwpolska” Warrick wrote: On Fri, Jun 14, 2013 at 5:25 AM, alex23 wuwe...@gmail.com wrote: On Jun 14, 2:24 am, Νικόλαος Κούρας supp...@superhost.gr wrote: iam researchign a solution to this as we speak.

Re: My son wants me to teach him Python

2013-06-14 Thread Alister
On Fri, 14 Jun 2013 05:41:20 -0500, Tim Chase wrote: On 2013-06-14 17:21, Chris Angelico wrote: On Fri, Jun 14, 2013 at 4:13 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Here's another Pepsi Challenge for you: There is a certain directory on your system containing 50

Re: PyGame tutorial?

2013-06-11 Thread Alister
On Tue, 11 Jun 2013 09:57:17 -0700, Eam onn wrote: On Tuesday, June 11, 2013 5:31:22 PM UTC+1, Mark Lawrence wrote: On 11/06/2013 16:47, Eam onn wrote: Is there a PyGame tutorial out there? I've seen TheNewBoston's tuts, but he didn't finish his. MetalX100 did a VERY good tutorial. I've

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Alister
On Wed, 05 Jun 2013 07:40:52 -0700, Armando Montes De Oca wrote: Traceback (most recent call last): File Guessing_Game.py, line 32, in module input (enter) File string, line 0 ^ SyntaxError: unexpected EOF while parsing -- (program exited with code: 1) This is

Re: PyWart: The problem with print

2013-06-03 Thread Alister
On Mon, 03 Jun 2013 17:17:12 +1000, Chris Angelico wrote: On Mon, Jun 3, 2013 at 3:49 PM, Michael Torrie torr...@gmail.com wrote: On 06/02/2013 12:18 PM, Rick Johnson wrote: On Sunday, June 2, 2013 12:49:02 PM UTC-5, Dan Sommers wrote: On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: On 30/05/2013 19:44, Chris Angelico wrote: On Fri, May 31, 2013 at 4:36 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, May 29, 2013 at 8:49 PM, rusi rustompm...@gmail.com wrote: On May 30, 6:14 am, Ma Xiaojun damage3...@gmail.com wrote:

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Fri, 31 May 2013 03:27:52 -0700, rusi wrote: On May 31, 2:08 pm, Alister alister.w...@ntlworld.com wrote: On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: And additional argument (pun not intended) for putting sep second is that you can give it a default value:     def join(iterable

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Alister
On Fri, 31 May 2013 07:11:58 -0400, Dave Angel wrote: On 05/31/2013 05:27 AM, Luca Cerone wrote: fd = open('/etc/file','w') fd.write('jpdas') fd.close() Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Alister
On Fri, 31 May 2013 08:20:54 -0700, Νικόλαος Κούρας wrote: I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: Code: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which

Re: Reading *.json from URL - json.loads() versus urllib.urlopen.readlines()

2013-05-28 Thread Alister
On Tue, 28 May 2013 08:31:35 +0100, Fábio Santos wrote: On 28 May 2013 04:19, Bryan Britten britten.br...@gmail.com wrote: I'm not familiar with using read(4096), I'll have to look into that. When I tried to just save the file, my computer just sat in limbo for some time and didn't seem to

Re: Newbie question about evaluating raw_input() responses

2013-05-22 Thread Alister
On Tue, 21 May 2013 23:52:30 -0700, Kevin Xi wrote: On Wednesday, May 22, 2013 2:23:15 PM UTC+8, C. N. Desrosiers wrote: Hi, Hi, I'm just starting out with Python and to practice I am trying to write a script that can have a simple conversation with the user. So you may want to search

Re: Differences of != operator behavior in python3 and python2 [ bug? ]

2013-05-15 Thread Alister
!= is explicit. There is no ambiguity that needs to be guessed. Which is why i said it thought X != Y is cleaner i guess i wasn't totally clear, I would write X != Y its because the OP preferred to use the other format I recommended that he made the operator ordering explicit. --

Re: Differences of != operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Alister
On Mon, 13 May 2013 05:23:16 +0600, Mr. Joe wrote: I seem to stumble upon a situation where != operator misbehaves in python2.x. Not sure if it's my misunderstanding or a bug in python implementation. Here's a demo code to reproduce the behavior - # -*- coding: utf-8 -*- from __future__

Re: Differences of != operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Alister
On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote: I think it is more readable. When doing more complicated statements I use != instead, but when it's a single test I prefer not … == It's a personal thing. It may also have to do with the fact that I didn't know python had != when I was

Re: Python teaching book recommendations: 3.3+ and with exercises

2013-05-03 Thread Alister
On Fri, 03 May 2013 00:36:48 +1000, Chris Angelico wrote: One of my younger brothers, still school age, is to be studying some aspect of computing for the next term or two. I strongly recommended he learn Python (it has a bit more future than studying the internals of OS/2), and my/his father

Re: How to set my gui?

2013-04-19 Thread Alister
On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote: Hi all! I'm trying to make a simple program that essentially do this: 1) open a html file (extracted epub file) 2) search for occurrences like ita-ly 3) put them on a simple GUI: 1 text field and two buttons: keepy it and correct it

Re: Calling python script in dos and passing arguments

2013-04-16 Thread Alister
On Tue, 16 Apr 2013 12:10:09 -0700, Chris Rebert wrote: On Tue, Apr 16, 2013 at 7:14 AM, PEnergy prqu...@gmail.com wrote: Greetings, I am trying to write a python script that, when called from the DOS prompt, will call another python script and pass it input variables. My current code will

Re: Help with python code!

2013-04-01 Thread Alister
On Sun, 31 Mar 2013 14:32:21 -0700, gerrymcgovern wrote: On Sunday, March 31, 2013 5:27:06 PM UTC-4, Roy Smith wrote: In article 4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com, jojo wrote: Thanks for your replies. Just to be clear this is for a interview and they would

Re: Lists and Decimal numbers

2013-03-20 Thread Alister
On Wed, 20 Mar 2013 16:52:00 +0100, Peter Otten wrote: Ana Dionísio wrote: So, I have this script that puts in a list every minute in 24 hours hour=[] i=0 t=-(1.0/60.0) while i24*60: i = i+1 t = t+(1.0/60.0) hour.append([t]) In many cases you can write for i in

Re: Lists and Decimal numbers

2013-03-20 Thread Alister
On Wed, 20 Mar 2013 20:00:38 +, Grant Edwards wrote: On 2013-03-20, Alister alister.w...@ntlworld.com wrote: and a list comprehension would streamline things further t=[round(x*1.0/60),4 for x in range(1440)] #compatible with V2.7 V3.0) There's a typo in the above. It should

Re: i need help

2013-03-04 Thread Alister
On Mon, 04 Mar 2013 07:07:53 -0800, Bryan Devaney wrote: On Sunday, March 3, 2013 6:45:26 PM UTC, Kwpolska wrote: On Sun, Mar 3, 2013 at 7:46 AM, Michael Torrie torr...@gmail.com wrote: On 02/21/2013 03:18 AM, leonardo wrote: thanks, problem solved Apparently not. The shift

Re: need for help

2013-03-01 Thread Alister
On Fri, 01 Mar 2013 19:35:14 +0100, leonardo selmi wrote: hi guys i typed the following program: class ball: def _init_(self, color, size, direction): self.color = color self.size = size self.direction = direction def _str_(self): msg = 'hi, i am a ' +

Re: nested loops

2013-02-26 Thread Alister
On Mon, 25 Feb 2013 23:46:11 +0100, leonardo wrote: hi everyone, i have the following program: import time count_timer = int(raw_input('how many seconds?: ')) for i in range(count_timer, 0, -1): print i time.sleep(1) print 'blast off!' this is the result: how many seconds?:

Re: RE Help splitting CVS data

2013-01-21 Thread Alister
On Sun, 20 Jan 2013 16:41:12 -0800, Garry wrote: On Sunday, January 20, 2013 3:04:39 PM UTC-7, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files The data appears in this format:

Re: Probabilistic unit tests?

2013-01-11 Thread Alister
On Thu, 10 Jan 2013 17:59:05 -0800, Nick Mellor wrote: Hi, I've got a unit test that will usually succeed but sometimes fails. An occasional failure is expected and fine. It's failing all the time I want to test for. What I want to test is on average, there are the same number of males

Re: How to get the selected text of the webpage in chrome through python ?

2013-01-09 Thread Alister
On Mon, 07 Jan 2013 20:20:28 -0800, iMath wrote: How to get the selected text of the webpage in chrome through python ? i think you need to explain your requirement further also what do you want to do to the text once you have it? -- Genius is one percent inspiration and ninety-nine

Re: new to python and programming at large

2013-01-09 Thread Alister
On Thu, 10 Jan 2013 02:18:11 +1100, Chris Angelico wrote: On Thu, Jan 10, 2013 at 8:03 AM, kwakukwat...@gmail.com wrote: pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. from math import sqrt def squareroot(self): x = sqrt(y)

Re: How do you call a function several times in this context??

2013-01-06 Thread Alister
On Sun, 06 Jan 2013 12:26:40 -0800, kofi wrote: Using python 3.1, I have written a function called isEvenDigit Below is the code for the isEvenDigit function: def isEvenDigit(): ste=input(Please input a single character string: ) li=[0,2,4, 6, 8] if ste in li:

Re: How do you call a function several times in this context??

2013-01-06 Thread Alister
On Sun, 06 Jan 2013 14:33:26 -0700, Jason Friedman wrote: def double(value): result return result number=input('type a number') print (double(int(number))) I think what was meant: def double(value): result = 2 * value return result yes indeed thanks for correcting my typo

Re: Question on for loop

2013-01-04 Thread Alister
On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote: Dear Group, If I take a list like the following: fruits = ['banana', 'apple', 'mango'] for fruit in fruits: print 'Current fruit :', fruit Now, if I want variables like var1,var2,var3 be assigned to them, we may take,

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Alister
On Fri, 04 Jan 2013 13:33:41 +, Steven D'Aprano wrote: On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote: On 1/3/2013 6:25 PM, Grant Edwards wrote: I've written a small assembler in Python 2.[67], and it needs to evaluate integer-valued arithmetic expressions in the context of a

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-27 Thread Alister
On Thu, 27 Dec 2012 12:01:16 -0800, mogul wrote: 'Aloha! I'm new to python, got 10-20 years perl and C experience, all gained on unix alike machines hacking happily in vi, and later on in vim. Now it's python, and currently mainly on my kubuntu desktop. Do I really need a real IDE, as

Re: how to detect the character encoding in a web page ?

2012-12-24 Thread Alister
On Mon, 24 Dec 2012 13:50:39 +, Steven D'Aprano wrote: On Mon, 24 Dec 2012 13:16:16 +0100, Kwpolska wrote: On Mon, Dec 24, 2012 at 9:34 AM, Kurt Mueller kurt.alfred.muel...@gmail.com wrote: $ wget -q -O - http://python.org/ | chardetect.py stdin: ISO-8859-2 with confidence

Re: Why Doesn't This MySQL Statement Execute?

2012-12-19 Thread Alister
On Tue, 18 Dec 2012 17:34:08 -0400, Tom Borkin wrote: Hi; I have this test code: if i_id == 1186: sql = 'insert into interactions values(Null, %s, Call Back,% s)' % (i_id, date_plus_2) cursor.execute(sql) Please don't build your sql strings like this but pass the data as

Re: The curses module and licensing

2012-12-06 Thread Alister
On Thu, 06 Dec 2012 19:34:04 +0100, benjamin schnitzler wrote: I think I have accidentially not sent this to the python list: On 02:17 Fri 07 Dec , Chris Angelico wrote: Hi! Here's some info on ncurses: http://invisible-island.net/ncurses/ncurses.faq.html I would generally assume

Re: Print value from array

2012-11-22 Thread Alister
On Thu, 22 Nov 2012 10:44:02 -0800, Mike wrote: Hello, I am noob en python programing, i wrote a perl script for read from csv but now i wish print value but the value must be within double quote and I can not do this. For example now the output is: ma user@domain displayName Name

Re: Inconsistent behaviour os str.find/str.index when providing optional parameters

2012-11-21 Thread Alister
On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote: I just came across this: 'spam'.find('', 5) -1 Now, reading find's documentation: print(str.find.__doc__) S.find(sub [,start [,end]]) - int Return the lowest index in S where substring sub is found, such that sub is

Re: Point of idle curiosity

2012-11-19 Thread Alister
On Sun, 18 Nov 2012 16:08:34 +, Mark Lawrence wrote: On 18/11/2012 15:59, Steven D'Aprano wrote: On Sun, 18 Nov 2012 22:45:43 +1100, Chris Angelico wrote: (if you'll forgive the pun) Is IDLE named after Eric of that name, or is it pure coincidence? Well, IDLE is an IDE. The L doesn't

Re: debugging in eclipse

2012-11-15 Thread Alister
On Thu, 15 Nov 2012 05:46:49 -0800, chip9munk wrote: On Thursday, November 15, 2012 2:44:22 PM UTC+1, Martin P. Hellwig wrote: I assume you have at the end of the debugTest.py file something like this: if __name__ == '__main__': test() no i did not have it... is main really

Re: stackoverflow quote on Python

2012-11-13 Thread Alister
On Tue, 13 Nov 2012 03:08:54 +, Mark Lawrence wrote: http://stackoverflow.com/questions/tagged/python Python has two major versions (2 and 3) in use which have significant differences. I believe that this is incorrect. The warts have been removed, but significant differences, not in

Re: Proper place for everything

2012-11-02 Thread Alister
On Fri, 02 Nov 2012 04:20:20 -0700, Jason Benjamin wrote: Anybody know of the appropriate place to troll and flame about various Python related issues? I'm kind of mad about some Python stuff and I need a place to vent where people may or may not listen, but at at least respond. Thought

Re: Coexistence of Python 2.x and 3.x on same OS

2012-10-01 Thread Alister
On Sun, 30 Sep 2012 15:14:17 -0400, Edward Diener wrote: Has there been any official software that allows both the Python 2.x and 3.x releases to coexist on the same OS so that the end-user can easily switch between them when invoking Python scripts after each has been installed to their own

Re: howto handle nested for

2012-09-28 Thread Alister
On Fri, 28 Sep 2012 10:39:32 -0400, Neal Becker wrote: I know this should be a fairly basic question, but I'm drawing a blank. I have code that looks like: for s0 in xrange (n_syms): for s1 in xrange (n_syms): for s2 in xrange (n_syms): for s3 in

Re: regular expression : the dollar sign ($) work with re.match() or re.search()

2012-09-26 Thread Alister
On Wed, 26 Sep 2012 10:48:00 +0300, Jussi Piitulainen wrote: iMath writes: I only know the dollar sign ($) will match a pattern from the end of a string, but which method does it work with, re.match() or re.search() It works with both. With re.match, the pattern has to match at the start

Re: Blue Screen Python

2012-09-22 Thread Alister
On Fri, 21 Sep 2012 18:47:57 -0400, Dave Angel wrote: On 09/21/2012 12:01 PM, Alister wrote: On Fri, 21 Sep 2012 15:14:53 +, Grant Edwards wrote: On 2012-09-21, mikcec82 michele.cec...@gmail.com wrote: Hallo to all, I'm using Python 2.7.3 with Windows 7 @ 64 bit and an Intel Core i3

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Alister
On Sat, 22 Sep 2012 18:07:32 +1000, Chris Angelico wrote: On Sat, Sep 22, 2012 at 5:13 PM, Νίκος Γκρεεκ nikos.gr...@gmail.com wrote: The web host company pulled a previous backup and now its all good. My apologies for the annoyance i have coused you all i wanted was some insight so to make

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Alister
On Sat, 22 Sep 2012 13:09:36 +, Steven D'Aprano wrote: On Sat, 22 Sep 2012 11:13:43 +0100, Kev Dwyer wrote: This is only speculation, as I don't know exactly how your web page has been hacked, but if your page somehow exposes a database connection, and the hack involves changing the

Re: Blue Screen Python

2012-09-21 Thread Alister
On Fri, 21 Sep 2012 15:14:53 +, Grant Edwards wrote: On 2012-09-21, mikcec82 michele.cec...@gmail.com wrote: Hallo to all, I'm using Python 2.7.3 with Windows 7 @ 64 bit and an Intel Core i3 -2350M CPU @2.30GHz 2.3GHz. Sometimes, when I'm programming in Python on my screen compare this

Re: Blue Screen Python

2012-09-21 Thread Alister
On Fri, 21 Sep 2012 16:01:16 +, Alister wrote: On Fri, 21 Sep 2012 15:14:53 +, Grant Edwards wrote: On 2012-09-21, mikcec82 michele.cec...@gmail.com wrote: Hallo to all, I'm using Python 2.7.3 with Windows 7 @ 64 bit and an Intel Core i3 -2350M CPU @2.30GHz 2.3GHz. Sometimes

Re: Print Function

2012-09-21 Thread Alister
On Fri, 21 Sep 2012 14:54:14 -0600, Ian Kelly wrote: On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown rodrick.br...@gmail.com wrote: Go away troll! Troll? It looked like a sincere question to me. but one that page 1 of the documentation would answer. -- Waste not, get your budget cut

Re: Exact integer-valued floats

2012-09-21 Thread Alister
On Fri, 21 Sep 2012 17:29:13 +, Steven D'Aprano wrote: Python floats can represent exact integer values (e.g. 42.0), but above a certain value (see below), not all integers can be represented. For example: py 1e16 == 1e16 + 1 # no such float as 10001.0 True py 1e16 + 3 ==

Re: sum works in sequences (Python 3)

2012-09-19 Thread Alister
On Wed, 19 Sep 2012 16:41:20 +0200, Franck Ditter wrote: Hello, I wonder why sum does not work on the string sequence in Python 3 : sum((8,5,9,3)) 25 sum([5,8,3,9,2]) 27 sum('rtarze') TypeError: unsupported operand type(s) for +: 'int' and 'str' I naively thought that sum('abc')

Re: avoid the redefinition of a function

2012-09-13 Thread Alister
On Thu, 13 Sep 2012 10:23:22 +0200, Peter Otten wrote: MRAB wrote: On 12/09/2012 19:04, Alister wrote: On Wed, 12 Sep 2012 18:56:46 +0200, Jabba Laci wrote: For example: def install_java(): pass def install_tomcat(): pass Thanks for the answers. I decided to use numbers

<    2   3   4   5   6   7   8   >