Re: Help a noob out

2019-05-02 Thread DL Neil
On 2/05/19 9:30 PM, Arup Rakshit wrote: The input function returns the string value. So you need to convert it to number before the math you do. birth_year = input("What year are you born? ") current_year = 2019 print(type(birth_year)) age = current_year - int(birth_year) print(age) — py

Re: Help a noob out

2019-05-02 Thread Hampus Sjödin
Den torsdag 2 maj 2019 kl. 11:43:53 UTC+2 skrev inhahe: > On Thu, May 2, 2019 at 5:26 AM wrote: > > > Hey guys, can someone quickly explain why this piece of code doesn't work? > > (I'm really new to Python) > > > > birth_year = input("What year are you born? ") > > current_year = 2019 > > age =

Re: Help a noob out

2019-05-02 Thread inhahe
On Thu, May 2, 2019 at 5:26 AM wrote: > Hey guys, can someone quickly explain why this piece of code doesn't work? > (I'm really new to Python) > > birth_year = input("What year are you born? ") > current_year = 2019 > age = current_year - birth_year > print(age) > -- > https://mail.python.org/ma

Re: Help a noob out

2019-05-02 Thread Arup Rakshit
The input function returns the string value. So you need to convert it to number before the math you do. birth_year = input("What year are you born? ") current_year = 2019 print(type(birth_year)) age = current_year - int(birth_year) print(age) — python3 age.py What year are you born? 1989

Re: Help a noob out

2019-05-02 Thread Chris Angelico
On Thu, May 2, 2019 at 7:26 PM wrote: > > Hey guys, can someone quickly explain why this piece of code doesn't work? > (I'm really new to Python) > > birth_year = input("What year are you born? ") > current_year = 2019 > age = current_year - birth_year > print(age) Have you looked at the excepti

Help a noob out

2019-05-02 Thread felixen989
Hey guys, can someone quickly explain why this piece of code doesn't work? (I'm really new to Python) birth_year = input("What year are you born? ") current_year = 2019 age = current_year - birth_year print(age) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python noob having a little trouble with strings

2017-10-28 Thread William Ray Wing
OSX has been shipping with Python 2.7 for several years. I’m not sure why you are seeing 2.6. Bill > On Oct 27, 2017, at 2:48 AM, Lutz Horn wrote: > > On Thu, Oct 26, 2017 at 07:59:10PM -0700, randyli...@gmail.com wrote: >> Hi Bob, thanks for responding. I'm not sure where to do so, my >> pro

Re: Python noob having a little trouble with strings

2017-10-27 Thread Lutz Horn
On Thu, Oct 26, 2017 at 07:59:10PM -0700, randyli...@gmail.com wrote: > Hi Bob, thanks for responding. I'm not sure where to do so, my > professor had us download Pycharm for mac's which uses python 2.6 The code from your question is not specific to Python 2 or 3. Just try it in the Python install

Re: Python noob having a little trouble with strings

2017-10-27 Thread Naman Bhalla
I guess your professor just asked you to download Pycharm. It is just MacOS that happens to have Python 2.6 inbuilt. Had your professor actually wanted you to be using Python 2 (I doubt), that would have been 2.7. Regardless of that I recommend having latest Python 2 or 3 as per your requirement

Re: Python noob having a little trouble with strings

2017-10-27 Thread Chris Angelico
On Sat, Oct 28, 2017 at 1:14 AM, Christopher Reimer wrote: > On Oct 27, 2017, at 1:49 AM, Peter J. Holzer wrote: >> >> BTW, I find it hard to believe that PyCharm for the Mac "comes with" >> Python 2.6. Python 2.6 is quite old. The Linux version isn't bundled >> with a python interpreter and just

Re: Python noob having a little trouble with strings

2017-10-27 Thread Christopher Reimer
On Oct 27, 2017, at 1:49 AM, Peter J. Holzer wrote: > > BTW, I find it hard to believe that PyCharm for the Mac "comes with" > Python 2.6. Python 2.6 is quite old. The Linux version isn't bundled > with a python interpreter and just uses whatever is already installed on > the machine. I guess it'

Re: Python noob having a little trouble with strings

2017-10-27 Thread Peter J. Holzer
On 2017-10-27 02:59, randyli...@gmail.com wrote: > On Thursday, October 26, 2017 at 7:41:10 PM UTC-7, boB Stepp wrote: >> On Thu, Oct 26, 2017 at 9:25 PM, wrote: [...] >> Why not find out for yourself and print these in the Python >> interpreter? For instance: >> >> > py >> Python 3.6.2 (v3.6.

Re: Python noob having a little trouble with strings

2017-10-26 Thread randyliu17
On Thursday, October 26, 2017 at 7:41:10 PM UTC-7, boB Stepp wrote: > On Thu, Oct 26, 2017 at 9:25 PM, wrote: > > If s1 = "Welcome students", what is the output when you print the following: > > > > 1. s4 = 3 * s1 > > > > 2. s1[3 : 6] > > > > 3. 'W' in s1 > > > > 4. S1[-1] > > > > 5. S1[:-1] > >

Re: Python noob having a little trouble with strings

2017-10-26 Thread boB Stepp
On Thu, Oct 26, 2017 at 9:25 PM, wrote: > If s1 = "Welcome students", what is the output when you print the following: > > 1. s4 = 3 * s1 > > 2. s1[3 : 6] > > 3. 'W' in s1 > > 4. S1[-1] > > 5. S1[:-1] > > Any help would be great, thanks! Why not find out for yourself and print these in the Pytho

Python noob having a little trouble with strings

2017-10-26 Thread randyliu17
If s1 = "Welcome students", what is the output when you print the following: 1. s4 = 3 * s1 2. s1[3 : 6] 3. 'W' in s1 4. S1[-1] 5. S1[:-1] Any help would be great, thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello from a super noob!

2017-06-08 Thread Andre Müller
Hello, you can refactor your code a little bit and learn more about exceptions: def get_numbers(): first = None second = None while True: try: if first is None: first = int(input('Enter your first number: ')) if second is None:

Re: Hello from a super noob!

2017-06-08 Thread Rhodri James
On 08/06/17 00:56, CB wrote: Hi everyone, I am taking a python class and I'm stuck in an exercise. what am i doing wrong? Can anyone try to run it? Thanks so much! It helps if you describe what is going wrong. Not just us, either; "Teddy Bear Debugging", explaining to a colleague (or indeed

Re: Hello from a super noob!

2017-06-07 Thread Steve D'Aprano
On Thu, 8 Jun 2017 09:56 am, CB wrote: > Can anyone try to run it? Yes, you can. Doctor to patient: "So, what seems to be the problem?" Patient: "You're the doctor, you tell me." -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse.

Re: Hello from a super noob!

2017-06-07 Thread MRAB
On 2017-06-08 00:56, CB wrote: Hi everyone, I am taking a python class and I'm stuck in an exercise. what am i doing wrong? Can anyone try to run it? Thanks so much! #Description:Input validation and while loops. import random def main(): #main function need in all programs for automated test

Hello from a super noob!

2017-06-07 Thread CB
Hi everyone, I am taking a python class and I'm stuck in an exercise. what am i doing wrong? Can anyone try to run it? Thanks so much! #Description:Input validation and while loops. import random def main(): #main function need in all programs for automated testing #your program goes

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Tim Chase
On 2017-02-21 00:04, Peter Otten wrote: > Tim Chase wrote: >> On 2017-02-20 10:45, Peter Otten wrote: >>> value = parser.get("section-1", "option-1", fallback="default >>> value") >> >> Huh. Do you remember when this was added? > > I don't use configparser regularly, so I had to look around myse

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Peter Otten
Tim Chase wrote: > On 2017-02-20 10:45, Peter Otten wrote: >> value = parser.get("section-1", "option-1", fallback="default >> value") > > Huh. Do you remember when this was added? I see it in the 3.x docs, > but not the 2.x docs. I remember writing my own wrappers multiple > times for exactly

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Tim Chase
On 2017-02-20 10:45, Peter Otten wrote: > value = parser.get("section-1", "option-1", fallback="default > value") Huh. Do you remember when this was added? I see it in the 3.x docs, but not the 2.x docs. I remember writing my own wrappers multiple times for exactly these purposes, even to the

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Ian Pilcher
On 02/20/2017 03:45 AM, Peter Otten wrote: You can provide a default value in your code with parser = configparser.ConfigParser() parser.read(configfile) value = parser.get("section-1", "option-1", fallback="default value") Perfect. Thank you! -- =

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Ian Pilcher
On 02/20/2017 01:39 AM, Ben Finney wrote: I think you misinderstand the semantics of what ‘configparser’ expects https://docs.python.org/3/library/configparser.html#configparser-objects>: You are absolutely correct. Thank you! -- ===

Re: Noob confused by ConfigParser defaults

2017-02-20 Thread Peter Otten
Ian Pilcher wrote: > I am trying to use ConfigParser for the first time (while also writing > my first quasi-serious Python program). Assume that I want to parse a > a configuration file of the following form: > >[section-1] >option-1 = value1 >option-2 = value2 > >[section-2] >

Re: Noob confused by ConfigParser defaults

2017-02-19 Thread Ben Finney
Ian Pilcher writes: > How do a set a default for option-1 *only* in section-1? I think you misinderstand the semantics of what ‘configparser’ expects https://docs.python.org/3/library/configparser.html#configparser-objects>: Default values […] are used in interpolation if an option used is

Noob confused by ConfigParser defaults

2017-02-19 Thread Ian Pilcher
I am trying to use ConfigParser for the first time (while also writing my first quasi-serious Python program). Assume that I want to parse a a configuration file of the following form: [section-1] option-1 = value1 option-2 = value2 [section-2] option-1 = value3 option-2 = value4 H

Re: need help for an assignment plz noob here

2016-10-18 Thread Sayth Renshaw
> > > Hello guys. so my assignment consists in creating a key generator so i can > > use it in later steps of my work. In my first step i have to write a > > function called key_generator that receives an argument, letters, that > > consists in a tuple of 25 caracters. The function returns a t

Re: need help for an assignment plz noob here

2016-10-18 Thread Kaur Männamaa
How exactly did you get the final product if you don't know how to get there? I'm sorry but what you are trying to do does not seem fair:) One hint: for loops PS generators are actually specific functions in Python: http://stackoverflow.com/questions/1756096/understanding-generators-in-python#1

Re: need help for an assignment plz noob here

2016-10-17 Thread Rob Gaddi
pedrorenato1...@gmail.com wrote: > Hello guys. so my assignment consists in creating a key generator so i can > use it in later steps of my work. In my first step i have to write a function > called key_generator that receives an argument, letters, that consists in a > tuple of 25 caracters. Th

need help for an assignment plz noob here

2016-10-17 Thread pedrorenato1998
Hello guys. so my assignment consists in creating a key generator so i can use it in later steps of my work. In my first step i have to write a function called key_generator that receives an argument, letters, that consists in a tuple of 25 caracters. The function returns a tuple of 5 tuples of

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Larry Hudson via Python-list
You've already received a lot of answers and guidance, but here is on more point... On 09/25/2015 12:03 PM, Cody Cox wrote: [snip] this I am not sure about, I set Kilo=get_input(kilo), ... Watch your capitalization! Kilo is _NOT_ the same as kilo. Case is significant in Python (as wel

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Terry Reedy
On 9/25/2015 2:50 PM, Cody Cox wrote: Awesome guys! Thank you for helping me understand this material. Parameters and Arguments are tricky. Looks like its mainly a game of connect the dots with variables. lol. If you stick with the convention that parameters are names in the header of a functi

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Denis McMahon
On Fri, 25 Sep 2015 12:03:43 -0700, Cody Cox wrote: > #Design a modular program that asks the user to enter a distance in > kilometers and then covert it to miles # Miles = Kilometers * 0.6214 #!/usr/bin/python # main calls the input routine to get the km value, then # calls the conversion rout

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Cody Cox
On Friday, September 25, 2015 at 1:26:02 PM UTC-7, Laura Creighton wrote: > In a message of Fri, 25 Sep 2015 22:15:26 +0200, Laura Creighton writes: > > >No. You are going to return whatever is called 'experience' and > >whatever is called 'monsters' and assign them to 'count' and 'monsters'. >

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Laura Creighton
In a message of Fri, 25 Sep 2015 22:15:26 +0200, Laura Creighton writes: >No. You are going to return whatever is called 'experience' and >whatever is called 'monsters' and assign them to 'count' and 'monsters'. ARRGH! I meant assign them to 'count' and 'animals'. (I read that 3 times and _stil

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Laura Creighton
In a message of Fri, 25 Sep 2015 11:50:10 -0700, Cody Cox writes: >Awesome guys! Thank you for helping me understand this material. Parameters >and Arguments are tricky. Looks like its mainly a game of connect the dots >with variables. lol. > >When you return a variable, it needs somewhere to go,

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Ian Kelly
On Fri, Sep 25, 2015 at 1:03 PM, Cody Cox wrote: > def main(): > #set the variable to 0.0, makes it a float and creates a place in memory > for the variable. > kilo = 0.0 This is addressing a symptom, not the actual problem. Initializing kilo here prevents Python from complaining when yo

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Cody Cox
#Cody Cox #9/16/2015 #Programming Exercise 1 - Kilometer Converter #Design a modular program that asks the user to enter a distance in kilometers and then covert it to miles # Miles = Kilometers * 0.6214 def main(): #set the variable to 0.0, makes it a float and creates a place in memory fo

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Cody Cox
Oh, i also noticed that declaring the variable I was using and setting it =0.0 helped me out, seems the program had "garbage" in it... (that's what my professor said.) -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread Cody Cox
Awesome guys! Thank you for helping me understand this material. Parameters and Arguments are tricky. Looks like its mainly a game of connect the dots with variables. lol. When you return a variable, it needs somewhere to go, and that's why it goes to the next call into the argument area if I n

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-25 Thread alister
On Thu, 24 Sep 2015 11:45:06 -0700, codywcox wrote: > I seem to be having a problem understanding how arguments and parameters > work, Most likely why my code will not run. > Can anyone elaborate on what I am doing wrong? > > ''' > Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter D

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread Larry Hudson via Python-list
On 09/24/2015 11:45 AM, codyw...@gmail.com wrote: I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a modu

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread John Gordon
In <7ad8941d-04aa-42c5-82e9-10cdf02ab...@googlegroups.com> codyw...@gmail.com writes: > I seem to be having a problem understanding how arguments and parameters > work, Most likely why my code will not run. Can anyone elaborate on what > I am doing wrong? > def get_input(kilo): >kilo = floa

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread MRAB
On 2015-09-24 19:45, codyw...@gmail.com wrote: I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a modular

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread Joel Goldstick
On Thu, Sep 24, 2015 at 2:45 PM, wrote: > I seem to be having a problem understanding how arguments and parameters > work, Most likely why my code will not run. > Can anyone elaborate on what I am doing wrong? > > ''' > Cody Cox > 9/16/2015 > Programming Exercise 1 - Kilometer Converter > Design

Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread codywcox
I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a modular program that asks the user to enter a distance

Re: Noob in Python. Problem with fairly simple test case

2015-07-21 Thread Chris Angelico
On Wed, Jul 22, 2015 at 3:38 AM, Jason P. wrote: > Despite the impression that surely I gave, I'm quite familiar with > programming and general bug hunting rules. The problem is that I'm > inexperienced with Python and the subtle details of multiple threads ;) > Heh, it doesn't hurt to remind p

Re: Noob in Python. Problem with fairly simple test case

2015-07-21 Thread Jason P.
El miércoles, 15 de julio de 2015, 14:12:08 (UTC+2), Chris Angelico escribió: > On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote: > > I can't understand very well what's happening. It seems that the main > > thread gets blocked listening to the web server. My intent was to spawn > > another proc

Off-topic: Europe [was Re: Noob in Python. Problem with fairly simple test case]

2015-07-19 Thread Steven D'Aprano
On Mon, 20 Jul 2015 03:25 am, Rick Johnson wrote: > On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: >> And, despite Norway not being part of the EU, Scandinavia >> is still in Europe. > > This is a bit off topic: But i don't consider Scandinavia to > be a part of the EU. La

Re: Noob in Python. Problem with fairly simple test case

2015-07-19 Thread Laura Creighton
In a message of Sun, 19 Jul 2015 10:25:35 -0700, Rick Johnson writes: >On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: >> And, despite Norway not being part of the EU, Scandinavia >> is still in Europe. > >This is a bit off topic: But i don't consider Scandinavia to >be a part

Re: Noob in Python. Problem with fairly simple test case

2015-07-19 Thread MRAB
On 2015-07-19 18:25, Rick Johnson wrote: On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: And, despite Norway not being part of the EU, Scandinavia is still in Europe. This is a bit off topic: But i don't consider Scandinavia to be a part of the EU. Not anymore than i would

Re: Noob in Python. Problem with fairly simple test case

2015-07-19 Thread Rick Johnson
On Sunday, July 19, 2015 at 4:18:31 AM UTC-5, Laura Creighton wrote: > And, despite Norway not being part of the EU, Scandinavia > is still in Europe. This is a bit off topic: But i don't consider Scandinavia to be a part of the EU. Not anymore than i would consider America to be a part of the EU

Re: Noob in Python. Problem with fairly simple test case

2015-07-19 Thread Laura Creighton
In a message of Sat, 18 Jul 2015 16:18:57 -0700, Rick Johnson writes: >I'll have to admit you make a good point here. Although the >argument is diminished by observing that Ruby is far more >popular in Asia than Python. Python seems to be mainly a >Scandinavian, European, and American toy. For the

Re: Noob in Python. Problem with fairly simple test case

2015-07-18 Thread Rick Johnson
On Friday, July 17, 2015 at 5:46:01 PM UTC-5, Terry Reedy wrote: > But these relative numbers are, as near as I can tell, > restricted to the english-speaking world, perhaps extended > to the latin-1 based world. Anyone who wants unicode > identifiers must use Python 3 (or a translated Python like

Re: Noob in Python. Problem with fairly simple test case

2015-07-18 Thread Rick Johnson
On Friday, July 17, 2015 at 3:39:02 PM UTC-5, Laura Creighton wrote: > I think kivy is doing a very nice job of python-on-the-mobile. > Have you looked? Please do not rant at me, just tell me what you > think. Hello Laura, I'm not sure if you're replying to me (as there is no quoted context) but

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Emile van Sebille
On 7/17/2015 3:45 PM, Terry Reedy wrote: Now my question for you or anyone else: If the vast majority of Python programmers are focused on 2.7, I consider myself in this group. why are volunteers to help fix 2.7 bugs so scarce? perhaps the bugs that are show stoppers are providing the impe

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Terry Reedy
On 7/17/2015 12:15 AM, Rick Johnson wrote: On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote: [...] My take from all this is that overall, Python 3 take-up is probably > around 10% of all Python users, All that rambling just to agree with me? My educated guess is a minimum

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Mark Lawrence
On 17/07/2015 21:38, Laura Creighton wrote: I think kivy is doing a very nice job of python-on-the-mobile. Have you looked? Please do not rant at me, just tell me what you think. Laura At least rr occasionally comes out with something useful, usually WRT tkinter. He's in the bottom divisio

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Laura Creighton
I think kivy is doing a very nice job of python-on-the-mobile. Have you looked? Please do not rant at me, just tell me what you think. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Rick Johnson
On Friday, July 17, 2015 at 1:38:52 AM UTC-5, Steven D'Aprano wrote: > 75% or 90% is not a "vast majority". Vast majority implies more than 99%. > > But regardless of the precise meaning of "vast", if you want to dismiss one > in four people (25%) or one in ten (10%) as inconsequential, then you'v

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 4:47 PM, Steven D'Aprano wrote: >> Jessie's default should be 2.7, at least. Wheezy shipped 2.7, too; >> it's only Squeeze (now out of support) that didn't ship any 2.7.x >> Python. Are you sure you can't at least upgrade to 2.7? > > I'm not sure, I'm not actively involved

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Jean-Michel Pichavant
- Original Message - > From: "Steven D'Aprano" > 75% or 90% is not a "vast majority". Vast majority implies more than > 99%. You could not be more wrong. More than 99% is a stupendous majority, while within 95 to 99% is a tremendous majority. >From the official "Majority rating" 2015 ed

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Steven D'Aprano
On Fri, 17 Jul 2015 01:01 pm, Chris Angelico wrote: > On Fri, Jul 17, 2015 at 12:44 PM, Steven D'Aprano > wrote: >> My take from all this is that overall, Python 3 take-up is probably >> around 10% of all Python users... > > Really? That low? Wow. Well, that's based on a guess that for every P

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Steven D'Aprano
On Fri, 17 Jul 2015 02:15 pm, Rick Johnson wrote: > On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote: >> [...] My take from all this is that overall, Python 3 >> take-up is probably > around 10% of all Python users, > > All that rambling just to agree with me? My educated gue

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Chris Angelico
On Fri, Jul 17, 2015 at 2:15 PM, Rick Johnson wrote: > On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote: >> [...] My take from all this is that overall, Python 3 >> take-up is probably > around 10% of all Python users, > > All that rambling just to agree with me? My educated g

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Rick Johnson
On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote: > [...] My take from all this is that overall, Python 3 > take-up is probably > around 10% of all Python users, All that rambling just to agree with me? My educated guess is a minimum of 75% still using Python2.x. But i'll take

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Larry Hudson via Python-list
On 07/15/2015 08:11 PM, Chris Angelico wrote: On Thu, Jul 16, 2015 at 1:01 PM, Larry Hudson via Python-list wrote: On 07/15/2015 05:11 AM, Chris Angelico wrote: [snip] In addition to using print(), in some places I like using input() instead, as in: input('x={}, y={} --> '.format(x,

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Chris Angelico
On Fri, Jul 17, 2015 at 12:44 PM, Steven D'Aprano wrote: > My take from all this is that overall, Python 3 take-up is probably around > 10% of all Python users... Really? That low? Wow. I guess 90% could count as Rick's declared "vast majority", although that term does imply more like 99%. > Fur

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Steven D'Aprano
It amuses me that this discussion started because the OP stated explicitly that he uses Python 3, and Rick gave an answer for Python 2. Rather than accept his mistake, Rick's defence is that practically nobody uses Python 3. (Presumably he means "apart from the guy who actually asked the question".

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Rick Johnson
On Thursday, July 16, 2015 at 6:24:21 PM UTC-5, Chris Angelico wrote: Any attempt to translate downloads into *REAL* usage statistics is doomed to be unreliable. Chris, you're smarter than this! (1) for instance: Python2.x coders have been around long enough that they don't need to download as mu

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Chris Angelico
On Fri, Jul 17, 2015 at 7:27 AM, Emile van Sebille wrote: > On Thursday, July 16, 2015 at 3:11:56 PM UTC-5, Chris Angelico wrote: > >> Where's the latest survey results? I think the numbers don't agree >> with you any more. > > > Not that there's a source for that info, but a quick survey of yahoo

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Emile van Sebille
On Thursday, July 16, 2015 at 3:11:56 PM UTC-5, Chris Angelico wrote: Where's the latest survey results? I think the numbers don't agree with you any more. Not that there's a source for that info, but a quick survey of yahoo results certainly continues to show more v2 activity. --anytime--

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Rick Johnson
On Thursday, July 16, 2015 at 3:11:56 PM UTC-5, Chris Angelico wrote: > Where's the latest survey results? I think the numbers don't agree > with you any more. What? You think the handful of regulars on this list in any way shape or form somehow represents the multitude of *REAL* python programmer

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Chris Angelico
On Fri, Jul 17, 2015 at 6:03 AM, Rick Johnson wrote: > but a vast majority of the Python community is currently > using, and will for many years continue using, Python<3.0. Where's the latest survey results? I think the numbers don't agree with you any more. ChrisA -- https://mail.python.org/ma

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Rick Johnson
On Wednesday, July 15, 2015 at 10:45:12 PM UTC-5, Chris Angelico wrote: > A GUI is another form of console. And a blindingly obvious association is another form of patronizing! What's next, are you going to tell us that a Volvo is a street-legal Scandinavian version of an armored personal carrier

Re: Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Chris Angelico
On Thu, Jul 16, 2015 at 1:33 PM, Rick Johnson wrote: > On Wednesday, July 15, 2015 at 10:11:43 PM UTC-5, Chris Angelico wrote: >> That's a neat trick, as long as you actually do have a console. > > Well if you don't have a console, another option is to use the > dialogs of the "batteries included

Re: Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Rick Johnson
On Wednesday, July 15, 2015 at 10:11:43 PM UTC-5, Chris Angelico wrote: > That's a neat trick, as long as you actually do have a console. Well if you don't have a console, another option is to use the dialogs of the "batteries included GUI" named Tkinter. from tkMessageBox import showinfo # Syn

Re: Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Chris Angelico
On Thu, Jul 16, 2015 at 1:01 PM, Larry Hudson via Python-list wrote: > On 07/15/2015 05:11 AM, Chris Angelico wrote: >> >> On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote: >>> >>> I can't understand very well what's happening. It seems that the main >>> thread gets blocked listening to the web se

Re: Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Larry Hudson via Python-list
On 07/15/2015 05:11 AM, Chris Angelico wrote: On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote: I can't understand very well what's happening. It seems that the main thread gets blocked listening to the web server. My intent was to spawn another process for the server independent of the test.

Re: Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Chris Angelico
On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote: > I can't understand very well what's happening. It seems that the main thread > gets blocked listening to the web server. My intent was to spawn another > process for the server independent of the test. Obviously I'm doing something > wrong. I'v

Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Jason P.
Hi all! I'm working in a little Python exercise with testing since the beginning. So far I'm with my first end to end test (not even finished yet) trying to: 1) Launch a development web server linked to a demo app that just returns 'Hello World!' 2) Make a GET request successfully I can't un

Re: Noob Parsing question

2015-02-18 Thread kai . peters
> >> > Given > >> > > >> > data = > >> > '{[][]}' > >> > > >> > How can I efficiently get dictionaries for each of the data blocks > >> > framed by <> ? > >> > > >> > Thanks for any help > >> > >> The question here is: What _can't_ happen? For instance, what happens > >> if Fred's name contains

Re: Noob Parsing question

2015-02-17 Thread Chris Angelico
On Wed, Feb 18, 2015 at 3:35 PM, wrote: >> > Given >> > >> > data = >> > '{[][]}' >> > >> > How can I efficiently get dictionaries for each of the data blocks framed >> > by <> ? >> > >> > Thanks for any help >> >> The question here is: What _can't_ happen? For instance, what happens >> if Fred

Re: Noob Parsing question

2015-02-17 Thread kai . peters
> > Given > > > > data = > > '{[][]}' > > > > How can I efficiently get dictionaries for each of the data blocks framed > > by <> ? > > > > Thanks for any help > > The question here is: What _can't_ happen? For instance, what happens > if Fred's name contains a greater-than symbol, or a caret?

Re: Noob Parsing question

2015-02-17 Thread Chris Angelico
On Wed, Feb 18, 2015 at 3:07 PM, wrote: > Given > > data = '{[][]}' > > How can I efficiently get dictionaries for each of the data blocks framed by > <> ? > > Thanks for any help The question here is: What _can't_ happen? For instance, what happens if Fred's name contains a greater-than symbol

Noob Parsing question

2015-02-17 Thread kai . peters
Given data = '{[][]}' How can I efficiently get dictionaries for each of the data blocks framed by <> ? Thanks for any help KP -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Noob, open file dialog

2014-06-18 Thread Mark Lawrence
On 18/06/2014 10:03, cutey Love wrote: I'm on windows, I'm going to uninstall python and reinstall On Wednesday, June 18, 2014 9:32:40 AM UTC+1, alister wrote: Please also see the various comments regarding top posting & google groups Please note that if you carry on top posting and (mis)us

Re: Python Noob, open file dialog

2014-06-18 Thread cutey Love
I'm on windows, I'm going to uninstall python and reinstall On Wednesday, June 18, 2014 9:32:40 AM UTC+1, alister wrote: > On Wed, 18 Jun 2014 00:36:29 -0700, cutey Love wrote: > > > > > No it's still paused after selection and only excutes when the window is > > > closed. > > > > > > On Tu

Re: Python Noob, open file dialog

2014-06-18 Thread alister
On Wed, 18 Jun 2014 00:36:29 -0700, cutey Love wrote: > No it's still paused after selection and only excutes when the window is > closed. > > On Tuesday, June 17, 2014 6:34:41 PM UTC+1, MRAB wrote: >> On 2014-06-17 17:49, cutey Love wrote: >> >> > My first attempt at Python, >> > I'm using Tkin

Re: Python Noob, open file dialog

2014-06-18 Thread Chris Angelico
On Wed, Jun 18, 2014 at 5:36 PM, cutey Love wrote: > No it's still paused after selection and only excutes when the window is > closed. Treat the file dialog exactly the way you would in a text editor or word processor. Does your program continue as normal then? If not, please be really specific

Re: Python Noob, open file dialog

2014-06-18 Thread cutey Love
No it's still paused after selection and only excutes when the window is closed. On Tuesday, June 17, 2014 6:34:41 PM UTC+1, MRAB wrote: > On 2014-06-17 17:49, cutey Love wrote: > > > My first attempt at Python, > > > > > > I'm using Tkinter and all is going well except when I'm using > > > >

Re: Python Noob, open file dialog

2014-06-17 Thread MRAB
On 2014-06-17 17:49, cutey Love wrote: My first attempt at Python, I'm using Tkinter and all is going well except when I'm using file_path = tkFileDialog.askopenfilename() print "test" opens great and lets me select a file, the problem is it then pauses? instead of continuing with t

Python Noob, open file dialog

2014-06-17 Thread cutey Love
My first attempt at Python, I'm using Tkinter and all is going well except when I'm using file_path = tkFileDialog.askopenfilename() print "test" opens great and lets me select a file, the problem is it then pauses? instead of continuing with the function? until I close, then it goes a

Re: ipy %run noob confusion

2013-10-04 Thread Jeff Shrager
Thank you. This is extremely helpful. The key that I was missing is that it's running them outside of the ipy context. I also discovered that if you call the script .ipy instead of .py, it actually does more or less what I was expecting -- that is, it allows magic commands, and I got the thing work

Re: ipy %run noob confusion

2013-10-04 Thread Oscar Benjamin
On 3 October 2013 18:42, wrote: > I have some rather complex code that works perfectly well if I paste it in by > hand to ipython, but if I use %run it can't find some of the libraries, but > others it can. The confusion seems to have to do with mathplotlib. I get it > in stream by: > >%py

Re: ipy %run noob confusion

2013-10-03 Thread Mark Lawrence
On 03/10/2013 20:26, Terry Reedy wrote: On 10/3/2013 1:42 PM, jshra...@gmail.com wrote: I have some rather complex code that works perfectly well if I paste it in by hand to ipython, but if I use %run it can't find some of the libraries, but others it can. Ipython is a separate product built o

Re: ipy %run noob confusion

2013-10-03 Thread Terry Reedy
On 10/3/2013 1:42 PM, jshra...@gmail.com wrote: I have some rather complex code that works perfectly well if I paste it in by hand to ipython, but if I use %run it can't find some of the libraries, but others it can. Ipython is a separate product built on top of Python. If no answer here, lo

ipy %run noob confusion

2013-10-03 Thread jshrager
I have some rather complex code that works perfectly well if I paste it in by hand to ipython, but if I use %run it can't find some of the libraries, but others it can. The confusion seems to have to do with mathplotlib. I get it in stream by: %pylab osx and do a bunch of stuff interactivel

  1   2   3   4   5   6   7   >