Re: Hangman question

2013-08-04 Thread Dave Angel
eschneide...@comcast.net wrote: > I'm on chapter 9 of this guide to python: > http://inventwithpython.com/chapter9.html but I don't quite understand > why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + > blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional

Re: Hangman question

2013-08-04 Thread Peter Otten
eschneide...@comcast.net wrote: > I'm on chapter 9 of this guide to python: > http://inventwithpython.com/chapter9.html but I don't quite understand > why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + > blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional > i

Re: Hangman question

2013-08-04 Thread Joshua Landau
On 5 August 2013 06:11, wrote: > I'm on chapter 9 of this guide to python: > http://inventwithpython.com/chapter9.html but I don't quite > understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + > blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional > i

Hangman question

2013-08-04 Thread eschneider92
I'm on chapter 9 of this guide to python: http://inventwithpython.com/chapter9.html but I don't quite understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional information and help would be greatly ap

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-04 Thread Joshua Landau
On 5 August 2013 03:05, Francois Lafont wrote: > Hello, > > Up. ;-) > > Le 04/08/2013 04:10, Francois Lafont a écrit : > > > Is it possible with argparse to have this syntax for a script? > > > > my-script (-a -b VALUE-B | -c -d VALUE-D) > > > > I would like to do this with the argparse module. >

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-04 Thread Francois Lafont
Hello, Up. ;-) Le 04/08/2013 04:10, Francois Lafont a écrit : > Is it possible with argparse to have this syntax for a script? > > my-script (-a -b VALUE-B | -c -d VALUE-D) > > I would like to do this with the argparse module. > > Thanks in advance. I have found this post: https://groups.goo

Re: In pyqt, some signals seems not work well

2013-08-04 Thread Jack
On 2013/8/5 2:20, Vincent Vande Vyvre wrote: Le 04/08/2013 18:06, Jacknaruto a écrit : Hi, Guys! I created a thread class based QThread, and defined some signals to update UI through main thread. the UI used a stackedWidget,someone page named 'progressPage' have a progressBar and a Label, t

Re: Python script help

2013-08-04 Thread Jake Angulo
On Mon, Aug 5, 2013 at 8:58 AM, Michael Torrie wrote: > On 08/02/2013 03:46 AM, cool1...@gmail.com wrote: > > I do know some Python programming, I just dont know enough to put > > together the various scripts I need...I would really really > > appreciate if some one can help me with that... > Hi

Re: Bug? ( () == [] ) != ( ().__eq__([]) )

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 11:35 PM, Markus Rother wrote: > Hello, > > The following behaviour seen in 3.2 seems very strange to me: > > As expected: () == [] > False > > However: ().__eq__([]) > NotImplemented [].__eq__(()) > NotImplemented You don't normally want to be calling dunder

Re: Bug? ( () == [] ) != ( ().__eq__([]) )

2013-08-04 Thread MRAB
On 04/08/2013 23:35, Markus Rother wrote: Hello, The following behaviour seen in 3.2 seems very strange to me: As expected: >>> () == [] False However: >>> ().__eq__([]) NotImplemented >>> [].__eq__(()) NotImplemented And: >>> bool(NotImplemented) True Hence: >>> bool(().__eq__([])

Re: Python script help

2013-08-04 Thread Michael Torrie
On 08/02/2013 03:46 AM, cool1...@gmail.com wrote: > I do know some Python programming, I just dont know enough to put > together the various scripts I need...I would really really > appreciate if some one can help me with that... Seems like your first task, then, is to become proficient at python

Bug? ( () == [] ) != ( ().__eq__([]) )

2013-08-04 Thread Markus Rother
Hello, The following behaviour seen in 3.2 seems very strange to me: As expected: >>> () == [] False However: >>> ().__eq__([]) NotImplemented >>> [].__eq__(()) NotImplemented And: >>> bool(NotImplemented) True Hence: >>> bool(().__eq__([])) True >>> ( () == [] ) != ( ().__eq__([]) ) True Ho

Re: stupid simple scope issue

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 8:21 PM, JohnD wrote: > On 2013-08-04, Chris Angelico wrote: > [...] > Thank you very much. The dust is slowly starting to move. > The code posted is nothing like the real thing, but I tried > to capture the essence. > > From your commants I think I see my mistake. > > Than

Re: stupid simple scope issue

2013-08-04 Thread JohnD
On 2013-08-04, Chris Angelico wrote: [...] Thank you very much. The dust is slowly starting to move. The code posted is nothing like the real thing, but I tried to capture the essence. >From your commants I think I see my mistake. Thank you very much for your reply! -- http://mail.python.org/m

Re: stupid simple scope issue

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 7:20 PM, JohnD wrote: > #~/usr/bin/python If this is meant to be a Unix-style shebang, the second character needs to be ! not ~. This has no effect on Python though. > import random > class boys: > state={} > class boy: > state={ > 'name':'', > 'age

Re: Where to suggest improvements in the official Python documentation?

2013-08-04 Thread Joel Goldstick
On Sun, Aug 4, 2013 at 12:30 PM, Aseem Bansal wrote: > @ Terry Jan Reedy > > If there is an issue in place for improving the lambda forms then that's > good. I wanted a link about functional programming because it is mentioned as > if it were a household word. It depends on your household I sup

Re: PEP8 revised: max line lengths

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 7:18 PM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> programmers, like engineers, have to deal with the >> possibility (or certainty) of idiots using their products. > > As a programmer, I'm OK with the idea that idiots are using my programs. > What bother

stupid simple scope issue

2013-08-04 Thread JohnD
After 5 year of no Python programming I decided that I needed to brush up my skills. Started writing on a reasonably complicated problem. Unfortunately my basic Python skill are gone. I present the bare-bore problem. This code does not produce the expected result: can anyone tell me why? As you wi

Re: In pyqt, some signals seems not work well

2013-08-04 Thread Vincent Vande Vyvre
Le 04/08/2013 18:06, Jacknaruto a écrit : Hi, Guys! I created a thread class based QThread, and defined some signals to update UI through main thread. the UI used a stackedWidget,someone page named 'progressPage' have a progressBar and a Label, the next page named 'resultsPage' shows result

Re: PEP8 revised: max line lengths

2013-08-04 Thread Roy Smith
In article , Chris Angelico wrote: > programmers, like engineers, have to deal with the > possibility (or certainty) of idiots using their products. As a programmer, I'm OK with the idea that idiots are using my programs. What bothers me more is when, as a user of a program, I have to deal w

Re: PEP8 revised: max line lengths

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 3:07 PM, Roy Smith wrote: > In article , > wxjmfa...@gmail.com wrote: > >> I have always found, computer scientists are funny scientists. > > I have always found that sciences which contain the word "science" in > their name tend to not be very scientific. > > Biology, Chem

Re: Where to suggest improvements in the official Python documentation?

2013-08-04 Thread Aseem Bansal
@ Terry Jan Reedy If there is an issue in place for improving the lambda forms then that's good. I wanted a link about functional programming because it is mentioned as if it were a household word. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script help

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 4:57 PM, wrote: > I understand I did not ask the question correctly, but is there any chance > you can help me put together this code? I know that you all do this for fun > and enjoy it and that is why I asked you guys instead of asking some one who > will charge me for

RE: Logging help

2013-08-04 Thread Joseph L. Casale
>Oh hai - as I was reading the documentation, look what I found: > >http://docs.python.org/2/library/logging.html#filter > >Methinks that should do exactly what you want. Hi Wayne, I was too hasty when I looked at filters as I didn't think they could do what I wanted. Turns out a logging object se

In pyqt, some signals seems not work well

2013-08-04 Thread Jacknaruto
Hi, Guys! I created a thread class based QThread, and defined some signals to update UI through main thread. the UI used a stackedWidget,someone page named 'progressPage' have a progressBar and a Label, the next page named 'resultsPage' shows results(some Labels). When the window showed progress

Re: Python script help

2013-08-04 Thread cool1574
I understand I did not ask the question correctly, but is there any chance you can help me put together this code? I know that you all do this for fun and enjoy it and that is why I asked you guys instead of asking some one who will charge me for a very simple line of code. I would appreciate it

Re: Can someone suggest better resources for learning sqlite3? I wanted to use the Python library but I don't know sql.

2013-08-04 Thread inq1ltd
On Saturday, August 03, 2013 10:57:32 AM Aseem Bansal wrote: > I was writing a Python script for getting the user stats of a > website(Specifically codereview.stackexchange). I wanted to store the stats > in a database. I found Python3's sqlite3 library. I found that I needed sql > commands for us

Re: outputting time in microseconds or milliseconds

2013-08-04 Thread Roy Smith
In article <07f6b1c7-069d-458b-a9fe-ff30c09f2...@googlegroups.com>, matt.doolittl...@gmail.com wrote: > self.logfile.write('%s\t'%(str(time( > [...] > 1375588774.89 > [...] > Why is it only giving me the centisecond precision? the docs say i should > get microsecond precision When citing d

Re: Modeling life on Earth –- an object-oriented (Python?) challenge

2013-08-04 Thread David Hutto
You basically have, currently, widgets,data,data manipulation through variables and widget utilization to call the functions,and data visualization. Next step would be algorithm, and pseudo code, plus a prototyped mockup of the GUI. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 revised: max line lengths

2013-08-04 Thread Sergi Pasoev
What about Earth Science? But in this case, it is indeed science, because in its name the word science is applied to the object of its study. But in the case of "computer science", the word science is applied to the word which describes the tool this "science" uses!! It's like it was Telescope Scie

Re: PEP8 revised: max line lengths

2013-08-04 Thread Sergi Pasoev
Let's say computer science isn't science. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 revised: max line lengths

2013-08-04 Thread Roy Smith
In article , wxjmfa...@gmail.com wrote: > I have always found, computer scientists are funny scientists. I have always found that sciences which contain the word "science" in their name tend to not be very scientific. Biology, Chemistry, Physics, those are real sciences. Computer Science, So

Re: outputting time in microseconds or milliseconds

2013-08-04 Thread Dave Angel
matt.doolittl...@gmail.com wrote: > ok so now i import the module like this: > >from time import strftime, time > > i made the write statement like this: > >self.logfile.write('%s\t'%(str(strftime("%Y-%m-%d", >self.logfile.write('%s\t'%(str(strftime("%H:%M:%S", >self.logf

Re: Minions are Python Powered!

2013-08-04 Thread Kevin MacPhail
This statement might be more true than you realize. I can't speak for the tools Blue Sky uses for their films, but when the studio I worked at created the "Minion Mayem" ride for Universal Orlando we used a number of tools that relied heavily on Python for everything from character rigging to rend

Re: outputting time in microseconds or milliseconds

2013-08-04 Thread Alain Ketterlin
matt.doolittl...@gmail.com writes: >self.logfile.write('%s\t'%(str(time( [...] > 2013-08-0323:59:341375588774.89 [...] > Why is it only giving me the centisecond precision? the docs say i > should get microsecond precision with the code i put together. Because of str()'s defau

Re: outputting time in microseconds or milliseconds

2013-08-04 Thread matt . doolittle33
ok so now i import the module like this: from time import strftime, time i made the write statement like this: self.logfile.write('%s\t'%(str(strftime("%Y-%m-%d", self.logfile.write('%s\t'%(str(strftime("%H:%M:%S", self.logfile.write('%s\t'%(str(time( (oh and btw,i kno

Re: PEP8 revised: max line lengths

2013-08-04 Thread wxjmfauth
Le samedi 3 août 2013 13:35:29 UTC+2, Nicholas a écrit : > On Friday, 2 August 2013, Chris “Kwpolska” Warrick wrote: > > > [snip] > > > > So, what are you feasting for?  Nothing? > > > I have long since ceased to be amazed at the number of people who would like > their personal and arbitra