[Tutor] Problem with Saved File

2019-04-07 Thread Stephen P. Molnar
I am using Spyder v-3.3.3 on Debian Stretch and have written a script to process data from another application. I am having a problem saving the resulting file [A] as a column vector. The vector is saved by np.savetxt(name_s,[A]). When I open the file in Spyder it is a column vector, but whe

Re: [Tutor] Problem with Saved File

2019-04-06 Thread Alan Gauld via Tutor
On 05/04/2019 19:59, Stephen P. Molnar wrote: > I am using Spyder v-3.3.3 on Debian Stretch and have written a script to > process data from another application. I am having a problem saving the > resulting file [A] as a column vector. > > The vector is saved by np.savetxt(name_s,[A]). > > Wh

[Tutor] Problem with Saved File

2019-04-05 Thread Stephen P. Molnar
I am using Spyder v-3.3.3 on Debian Stretch and have written a script to process data from another application. I am having a problem saving the resulting file [A] as a column vector. The vector is saved by np.savetxt(name_s,[A]). When I open the file in Spyder it is a column vector, but whe

Re: [Tutor] Problem using termcolor and colorama

2018-11-15 Thread Peter Otten
John Blower wrote: > I try to create colour text by using these two modules , only returns the > colour code, no colour text. How to solve this problem. > import termcolor import colorama colorama.init() termcolor.cprint('Hello World','red') > [31mHello World[0m Start with o

Re: [Tutor] Problem using termcolor and colorama

2018-11-15 Thread Steven D'Aprano
On Thu, Nov 15, 2018 at 01:18:16PM +, John Blower wrote: > I try to create colour text by using these two modules , only returns the > colour code, no colour text. > How to solve this problem. Use a terminal that supports colour codes. > >>> import termcolor > >>> import colorama > >>> co

Re: [Tutor] Problem using termcolor and colorama

2018-11-15 Thread David Rock
> On Nov 15, 2018, at 07:18, John Blower wrote: > > I try to create colour text by using these two modules , only returns the > colour code, no colour text. > How to solve this problem. > import termcolor import colorama colorama.init() termcolor.cprint('Hello World','red'

[Tutor] Problem using termcolor and colorama

2018-11-15 Thread John Blower
I try to create colour text by using these two modules , only returns the colour code, no colour text. How to solve this problem. >>> import termcolor >>> import colorama >>> colorama.init() >>> termcolor.cprint('Hello World','red') [31mHello World[0m Sent from Mail

Re: [Tutor] Problem with task, please help!

2018-10-28 Thread Alan Gauld via Tutor
On 27/10/2018 20:41, michiel nijs wrote: > I am an engineering student and we have to use Python. > We don't have lessons so we all have to learn it on our own. What, no lessons at all?! Or just no lessons on Python? Have you done any kind of programming before? > We got a task and I am stuck o

[Tutor] Problem with task, please help!

2018-10-28 Thread michiel nijs
Hello, I am an engineering student and we have to use Python. We don't have lessons so we all have to learn it on our own. We got a task and I am stuck on this: "Count the number of parcels for forrest ground and count the number of parcels for orchard ground". I think I have to use the for-loop

Re: [Tutor] problem with creating paths

2018-10-17 Thread Mark Lawrence
On 17/10/18 18:18, Mats Wichmann wrote: On 10/17/2018 10:07 AM, Shall, Sydney via Tutor wrote: Firstly, I would like to thank Steven for reminding me of the assert statement. I should have remembered this. It allowed me to isolate the problem, which predictably (for me) was very elementary. I am

Re: [Tutor] problem with creating paths

2018-10-17 Thread Shall, Sydney via Tutor
On 17/10/2018 18:18, Mats Wichmann wrote: On 10/17/2018 10:07 AM, Shall, Sydney via Tutor wrote: Firstly, I would like to thank Steven for reminding me of the assert statement. I should have remembered this. It allowed me to isolate the problem, which predictably (for me) was very elementary. I

Re: [Tutor] problem with creating paths

2018-10-17 Thread Mats Wichmann
On 10/17/2018 10:07 AM, Shall, Sydney via Tutor wrote: > Firstly, I would like to thank Steven for reminding me of the assert > statement. I should have remembered this. It allowed me to isolate the > problem, which predictably (for me) was very elementary. I am too > embarrassed to say how simple

Re: [Tutor] problem with creating paths

2018-10-17 Thread Shall, Sydney via Tutor
Firstly, I would like to thank Steven for reminding me of the assert statement. I should have remembered this. It allowed me to isolate the problem, which predictably (for me) was very elementary. I am too embarrassed to say how simple the error was. However, my original problem was not solved

Re: [Tutor] problem with creating paths

2018-10-17 Thread Peter Otten
Shall, Sydney via Tutor wrote: > There are two items that are 'wrong' in this output. > > 1. The property 'paths' is defined in the program as a list and the > items are added using paths.append(), yet the test says that when tested > it is a tuple. >>> paths = ["foo", "bar"], >>> paths += "baz"

[Tutor] problem with creating paths

2018-10-17 Thread Shall, Sydney via Tutor
I can now add to my previous email the following observation. If I do not delete the output file and redo the test I get the following as the 'extra' entry in paths: '/Users/sydney/AnacondaProjects/capital_reproduction/Current_Version/Results/20181017D/B_Cycle_Zero/Text_Files') If however, I

Re: [Tutor] problem with creating paths

2018-10-17 Thread Steven D'Aprano
On Wed, Oct 17, 2018 at 03:18:00PM +0100, Shall, Sydney via Tutor wrote: [...] > After searching I have found this unexpected output illustrated in the > copy-paste below. > > > test > > > The type of the paths is: Believe Python when it tells you something is a tuple. Trust me, it

[Tutor] problem with creating paths

2018-10-17 Thread Shall, Sydney via Tutor
I am a novice (at programming). I use MAC OS 10.13.6 Anaconda. Python 3.5.4 Spyder 3.5.6 I have just re-written a moderately complex program (a Class) on the advice of Alan and Steven. The rewriting proved to be very useful. The working program uses instances of the Class with User chosen par

Re: [Tutor] Problem compiling code from GitHub

2018-09-02 Thread Dave Hill
I now have 'odswriter' working, thank you. I, eventually, uninstalled all versions of python and cleaned out as many references to python and odswriter as I could find. I then installed 3.7, and odswriter using $ cd odswriter $ python setup.py install I guess that the first attempt a

Re: [Tutor] Problem compiling code from GitHub

2018-08-29 Thread Oscar Benjamin
On Mon, 27 Aug 2018 at 13:18, Dave Hill wrote: > > I have found 'odswriter' on GitHub > https://github.com/mmulqueen/odswriter which appears to provide what I > want. However, I have come to a halt, due to the limitation of my knowledge. > > I admit that I am confounded as to where/how to access t

Re: [Tutor] Problem compiling code from GitHub

2018-08-29 Thread Peter Otten
Dave Hill wrote: > I did as suggested but with the same result. Make sure that your script is *not* in the same directory as ODSWriter.py and that the directory containing ODSWriter is *not* in sys.path. Then try again. ___ Tutor maillist - Tutor

Re: [Tutor] Problem compiling code from GitHub

2018-08-28 Thread Dave Hill
I did as suggested but with the same result. I am now looking at extracting the code from the the separate files to form a single module, and hopefully get a result. On 27/08/2018 14:14, Steven D'Aprano wrote: Hi Dave, and welcome! On Mon, Aug 27, 2018 at 12:14:33PM +0100, Dave Hill wrote:

Re: [Tutor] Problem compiling code from GitHub

2018-08-27 Thread Mats Wichmann
On 08/27/2018 05:14 AM, Dave Hill wrote: > I get the following error > >    Traceback (most recent call last): >       File "C:\Code\Python\ODS_Writer\Test_ODS#1.py", line 5, in >         from OdsWriter import odswriter as ods >       File "C:\Code\Python\ODS_Writer\OdsWriter.py", line 7, in >

Re: [Tutor] Problem compiling code from GitHub

2018-08-27 Thread Steven D'Aprano
Hi Dave, and welcome! On Mon, Aug 27, 2018 at 12:14:33PM +0100, Dave Hill wrote: > I have found 'odswriter' on GitHub > https://github.com/mmulqueen/odswriter which appears to provide what I > want. However, I have come to a halt, due to the limitation of my knowledge. [...] > I get the fol

[Tutor] Problem compiling code from GitHub

2018-08-27 Thread Dave Hill
Hi, As a volunteer on a Welsh Heritage Railway I undertake their Electrical Equipment testing, for which I use a Megger PAT420. This device stores data in 'sqlite', which using Python I can read and generate a number of reports in 'csv' format. I now wish to collate asset data for various loc

Re: [Tutor] Problem importing pandas library

2018-05-27 Thread Mats Wichmann
On 05/27/2018 01:18 AM, Alan Gauld via Tutor wrote: > On 27/05/18 04:43, Bhavna Soni wrote: >> I installed pandas library using pip9. I get errors while importing >> it, Uninstalling and Re-installing won't help. It says DLL load failed >> as window file is not found. The next time I import it says

Re: [Tutor] Problem importing pandas library

2018-05-27 Thread Alan Gauld via Tutor
On 27/05/18 04:43, Bhavna Soni wrote: > I installed pandas library using pip9. I get errors while importing > it, Uninstalling and Re-installing won't help. It says DLL load failed > as window file is not found. The next time I import it says pandas > don't have core attribute, ut core folder is pr

[Tutor] Problem importing pandas library

2018-05-27 Thread Bhavna Soni
I installed pandas library using pip9. I get errors while importing it, Uninstalling and Re-installing won't help. It says DLL load failed as window file is not found. The next time I import it says pandas don't have core attribute, ut core folder is present in the directory. I am using Python 3.6

Re: [Tutor] Problem regarding NZEC error

2018-04-08 Thread Alan Gauld via Tutor
On 08/04/18 06:16, SUNIL KUMAR MAURYA wrote: > NZEC error occurs often in Python 3.5. How can it be resolved? A Non Zero Error Code occurs when the interpreter exits with an error. Those are very rarely errors in the interpreter they are due to errors in the code which it is executing. So, to sto

[Tutor] Problem regarding NZEC error

2018-04-08 Thread SUNIL KUMAR MAURYA
NZEC error occurs often in Python 3.5. How can it be resolved? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem with testing - container

2018-03-29 Thread Albert-Jan Roskam
Op 29 mrt. 2018 21:06 schreef "Shall, Sydney" : > > I have a problem with a specific test, I think. > > I use a Mac with OS X 10.13.3 > I use Anaconda with Python 3.5 > > I have been writing tests for a Class that I have written. I am not > finished yet, but there are already nearly 400 tests. The

[Tutor] Problem with testing - container

2018-03-29 Thread Shall, Sydney
I have a problem with a specific test, I think. I use a Mac with OS X 10.13.3 I use Anaconda with Python 3.5 I have been writing tests for a Class that I have written. I am not finished yet, but there are already nearly 400 tests. The tests run and return OK. [After cleaning up many silly mist

Re: [Tutor] Problem in python online class

2017-12-23 Thread Albert-Jan Roskam
On Dec 21, 2017 09:58, Tim Cordsen via Tutor wrote: > > Hello everybody, > I am doing a python online class and I am lost. The "teacher" is a little > chaotic and doesn't provide his code, so everyone must type on their own. > > Now the class reached a point where I am lost. It is about doing a s

Re: [Tutor] Problem in python online class

2017-12-21 Thread Alan Gauld via Tutor
On 21/12/17 08:40, Tim Cordsen via Tutor wrote: > ...doesn't provide his code, so everyone must type on their own. Thats not necessarily a bad thing. You only really learn when you type in your own code. Its like muscle memory for the brain and fingers. > web frontend with a form and saving the

[Tutor] Problem in python online class

2017-12-21 Thread Tim Cordsen via Tutor
Hello everybody, I am doing a python online class and I am lost. The "teacher" is a little chaotic and doesn't provide his code, so everyone must type on their own. Now the class reached a point where I am lost. It is about doing a simple web frontend with a form and saving the data of the form to

Re: [Tutor] Problem python script

2017-12-19 Thread William Ray Wing
Sent from my iPhone > On Dec 19, 2017, at 3:47 AM, Antoan Hristov wrote: > > Hello, > > I am using a script which extracts data from internet every Monday, but > sometimes I have a problem that the script is not finishing properly. In > terminal I stop it with Ctrl-C and the message it gives

Re: [Tutor] Problem python script

2017-12-19 Thread Alan Gauld via Tutor
On 19/12/17 09:47, Antoan Hristov wrote: > I am using a script which extracts data from internet every Monday, but > sometimes I have a problem that the script is not finishing properly. In > terminal I stop it with Ctrl-C and the message it gives me is: It is very hard to comment on code which y

[Tutor] Problem python script

2017-12-19 Thread Antoan Hristov
Hello, I am using a script which extracts data from internet every Monday, but sometimes I have a problem that the script is not finishing properly. In terminal I stop it with Ctrl-C and the message it gives me is: File "castorama.py", line 255, in main p.map(get_all_data,magasins) File "/us

Re: [Tutor] Problem with 'IF' condition

2017-12-04 Thread Alan Gauld via Tutor
s are same". > But it doesnot. >   > Please let me know if you find any errors. >   > Best Regards, > Achyut Ajmera  >   >   > > - Original Message - > Subject: Re: [Tutor] Problem with 'IF' condition > From: "Alan

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Steven D'Aprano
On Fri, Dec 01, 2017 at 07:02:47AM -0700, a.ajm...@incycleautomation.com wrote: > I copied my program as plain text below, Unfortunately you didn't, as the text you quote below will not run as Python code due to indentation errors. So you have (accidentally, I trust) messed up the indentation.

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Peter Otten
a.ajm...@incycleautomation.com wrote: > I am trying to compare two different values using "IF" condition in my > program. Everything is working fine except this. I copied my program as > plain text below Your code has indentation errors, my analysis assumes # the following was added to make it r

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Alan Gauld via Tutor
On 01/12/17 14:02, a.ajm...@incycleautomation.com wrote: > - If you see in my code, I'm writing to "test1.txt" and saving that value in > "nao" as well. > On the other side, I'm reading from "test3.txt" and saving that value in > "abb" just like above. > > Now, my goal is to compare these two

[Tutor] Problem with 'IF' condition

2017-12-01 Thread a.ajmera
Hi, I am trying to compare two different values using "IF" condition in my program. Everything is working fine except this. I copied my program as plain text below, in the last section I used "IF" condition. - If you see in my code, I'm writing to "test1.txt" and saving that value in "nao" as w

Re: [Tutor] problem with a sub-class

2017-12-01 Thread Sydney Shall
On 30/11/2017 22:08, Alan Gauld via Tutor wrote: On 30/11/17 15:37, Shall, Sydney wrote: My problem is with constructing a sub-class. My sub-class is constructed as follows: import Population_ProductivityV24 as POCWP Note that POCWP is an alias for the *module* Population_ProductivityV24. I

Re: [Tutor] problem with a sub-class

2017-12-01 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 30/11/17 15:37, Shall, Sydney wrote: > >> My problem is with constructing a sub-class. >> >> My sub-class is constructed as follows: >> >> import Population_ProductivityV24 as POCWP > > Note that POCWP is an alias for the *module* Population_ProductivityV24. >

Re: [Tutor] problem with a sub-class

2017-11-30 Thread Alan Gauld via Tutor
On 30/11/17 15:37, Shall, Sydney wrote: > My problem is with constructing a sub-class. > > My sub-class is constructed as follows: > > import Population_ProductivityV24 as POCWP Note that POCWP is an alias for the *module* Population_ProductivityV24. It is not a class. > line 27 : class Simula

[Tutor] problem with sub-classing

2017-11-30 Thread Sydney282003 via Tutor
I am almost a beginner. I have an error message which I cannot understand. My problem is with constructing a sub-class. I use; MAC OS V10.13.1 Anaconda Python 3.5 My base Class works properly and all 136 tests of the Base Class are correct. My sub-class is constructed as follows: import sys

[Tutor] problem with a sub-class

2017-11-30 Thread Shall, Sydney
I am almost a beginner. I have an error message which I cannot understand. My problem is with constructing a sub-class. I use; MAC OS V10.13.1 Anaconda Python 3.5 My base Class works properly and all 136 tests of the Base Class are correct. My sub-class is constructed as follows: import sys

Re: [Tutor] problem with program in python in easy steps

2017-10-26 Thread boB Stepp
On Thu, Oct 26, 2017 at 3:02 PM, Chris Coleman wrote: > > i wrote these programs and saved them per instructions on page 128 and 129 > in the book "python in easy steps". > > class Person: > '''A base class to define Person properties.''' > def__init__(self,name): The above line should ge

Re: [Tutor] problem with program in python in easy steps

2017-10-26 Thread Alan Gauld via Tutor
On 26/10/17 21:02, Chris Coleman wrote: > i wrote these programs and saved them per instructions on page 128 and 129 > in the book "python in easy steps". I don't know the book but... > > class Person: > '''A base class to define Person properties.''' > def__init__(self,name): > s

[Tutor] problem with program in python in easy steps

2017-10-26 Thread Chris Coleman
i wrote these programs and saved them per instructions on page 128 and 129 in the book "python in easy steps". class Person: '''A base class to define Person properties.''' def__init__(self,name): self.name = name def speak( self,msg = '(Calling The Base Class)'): print

Re: [Tutor] problem with program

2017-10-13 Thread Alan Gauld via Tutor
On 13/10/17 18:53, Alan Gauld via Tutor wrote: > On 13/10/17 13:04, Chris Coleman wrote: > >> def_init_(self,chat): > >> File "scripts/bird.py", line 4 >> def_init_(self,chat): >> ^ >> SyntaxError: invalid syntax > > There are two problems here. I meant to

Re: [Tutor] problem with program

2017-10-13 Thread Mark Lawrence via Tutor
On 13/10/17 13:04, Chris Coleman wrote: just learning python as my first programming language. going through the book "python in easy steps" by mike mcgrath. i am going through the programs in chapter 7 and can't get them to work. here is the first one in the chapter: class Bird: '''A bas

Re: [Tutor] problem with program

2017-10-13 Thread Alan Gauld via Tutor
On 13/10/17 13:04, Chris Coleman wrote: > def_init_(self,chat): > File "scripts/bird.py", line 4 > def_init_(self,chat): > ^ > SyntaxError: invalid syntax There are two problems here. The first is that you need a space after the def. The second is that ther

[Tutor] problem with program

2017-10-13 Thread Chris Coleman
just learning python as my first programming language. going through the book "python in easy steps" by mike mcgrath. i am going through the programs in chapter 7 and can't get them to work. here is the first one in the chapter: class Bird: '''A base class to define bird properties.''' c

Re: [Tutor] problem with python3.5 headfirst python 2nd ed chpt 10 test drive example decorator issues

2017-09-29 Thread Rajesh Balel
Hi I don't see any session initializer , please try with that session = web.session.Session(app,store,initializer={'login': 0,'privilege': 0,'username':'Guest','logged_in':False}) Regards Rajesh On Thu, Sep 28, 2017 at 3:35 PM, peter wrote: > I am on chapter 10 of headfirst python second editi

Re: [Tutor] problem with python3.5 headfirst python 2nd ed chpt 10 test drive example decorator issues

2017-09-29 Thread Alan Gauld via Tutor
On 28/09/17 23:35, peter wrote: > I am on chapter 10 of headfirst python second edition. got most of the > prior codes to work but am stuck on this one. I don;t know the book and only vaguely know Flask, but I'd start by adding some debug print statements to the functions. Something like def ..

Re: [Tutor] problem with python3.5 headfirst python 2nd ed chpt 10 test drive example decorator issues

2017-09-29 Thread Peter Otten
peter wrote: > I am on chapter 10 of headfirst python second edition. got most of the > prior codes to work but am stuck on this one. I will add the > simple_webapp.py which is a decorator enabled and checker.py which is > the decorator. when I go into 127.0.0.1:5000 and enter I get the correct >

[Tutor] problem with python3.5 headfirst python 2nd ed chpt 10 test drive example decorator issues

2017-09-29 Thread peter
I am on chapter 10 of headfirst python second edition. got most of the prior codes to work but am stuck on this one. I will add the simple_webapp.py which is a decorator enabled  and checker.py which is the decorator. when I go into 127.0.0.1:5000 and enter I get the correct response. 127.0.0.1

[Tutor] Problem with Plot Legend

2017-06-13 Thread Stephen P. Molnar
I am using Python3.6 in the Spyder3IDE and have a problem with the legend for a plot. I have attached the pg file. The code (in part) is: import numpy as np from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA import matplotlib.pyplot as plt import matplotlib.pa

Re: [Tutor] Problem with if statements and else statements

2017-05-30 Thread Cameron Simpson
On 30May2017 12:06, Peter Otten <__pete...@web.de> wrote: Cameron Simpson wrote: As written it should be a bit slower: to construct a set each member get tested for presence. The cost is in making the set, not in searching it. No, CPython is a bit smarter than that: dis.dis('if m in {"1", "J

Re: [Tutor] Problem with if statements and else statements

2017-05-30 Thread Peter Otten
Cameron Simpson wrote: > On 29May2017 01:17, Alan Gauld wrote: >>On 29/05/17 00:12, Alex Kleider wrote: >>> Would >> if Month in {'January', '1'}: >>> >>> be even better? (regarding efficiency perhaps? Trivial point, I know, >>> but just wondering.) >> >>If in doubt try it out and profile/ti

Re: [Tutor] Problem with if statements and else statements

2017-05-29 Thread Alex Kleider
On 2017-05-29 16:08, Cameron Simpson wrote: snip BTW, in Python we tend to use named like "Fred" for classes (or factories), and "fred" for regular variables. And "FRED" for things that would be constants in other languages. Eg: MAX_THINGS = 16 class Foo: def FooBah(x): return

Re: [Tutor] Problem with if statements and else statements

2017-05-29 Thread Cameron Simpson
On 29May2017 01:17, Alan Gauld wrote: On 29/05/17 00:12, Alex Kleider wrote: Would if Month in {'January', '1'}: be even better? (regarding efficiency perhaps? Trivial point, I know, but just wondering.) If in doubt try it out and profile/time it. But I don't think it will make much diff

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Peter Otten
Alex Kleider wrote: > On 2017-05-28 13:13, Mats Wichmann wrote: > >> FWIW, if checking for multiples, you could also write: >> >> if Month in ['January', '1']: > > Would > if Month in {'January', '1'}: > > be even better? (regarding efficiency perhaps? Trivial point, I know, > but just

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Alan Gauld via Tutor
On 29/05/17 00:12, Alex Kleider wrote: > On 2017-05-28 13:13, Mats Wichmann wrote: > >> FWIW, if checking for multiples, you could also write: >> >> if Month in ['January', '1']: > > Would > if Month in {'January', '1'}: > > be even better? (regarding efficiency perhaps? Trivial point, I

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Alex Kleider
On 2017-05-28 13:13, Mats Wichmann wrote: FWIW, if checking for multiples, you could also write: if Month in ['January', '1']: Would if Month in {'January', '1'}: be even better? (regarding efficiency perhaps? Trivial point, I know, but just wondering.)

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Mats Wichmann
On 05/27/2017 06:14 PM, boB Stepp wrote: > Hello Jalen! > > On Sat, May 27, 2017 at 4:19 PM, Jalen Barr wrote: >> >> In this code it always changes the PlaceHolder to 0 no matter what Month is >> set to >> >> Month ="September" >> >> if Month == "January" or "1": >> PlaceHolder = 0 > > This

Re: [Tutor] Problem with if statements and else statements

2017-05-27 Thread boB Stepp
Hello Jalen! On Sat, May 27, 2017 at 4:19 PM, Jalen Barr wrote: > > In this code it always changes the PlaceHolder to 0 no matter what Month is > set to > > Month ="September" > > if Month == "January" or "1": > PlaceHolder = 0 This must be written as: if Month == "January" or Month == "1":

Re: [Tutor] Problem with if statements and else statements

2017-05-27 Thread Jalen Barr
I am in Python version 3.6.1 On Sat, May 27, 2017 at 4:19 PM, Jalen Barr wrote: > In this code it always changes the PlaceHolder to 0 no matter what Month > is set to > > Month ="September" > > if Month == "January" or "1": > PlaceHolder = 0 > else: > print("Information Error") > print(P

[Tutor] Problem with if statements and else statements

2017-05-27 Thread Jalen Barr
In this code it always changes the PlaceHolder to 0 no matter what Month is set to Month ="September" if Month == "January" or "1": PlaceHolder = 0 else: print("Information Error") print(PlaceHolder) ___ Tutor maillist - Tutor@python.org To un

Re: [Tutor] Problem on parsing data

2017-03-13 Thread David Rock
> On Mar 13, 2017, at 16:19, jarod_v6--- via Tutor wrote: > > > What can I do for parse better that file and Have only the comma outside the > string ? > I recommend using the cvs module rather than try to write your own. https://docs.python.org/2/library/csv.html — David Rock da...@gran

[Tutor] Problem on parsing data

2017-03-13 Thread jarod_v6--- via Tutor
I have a csv file with "," as separator. If I try to separate using ",": I have many different rows some with 30 columns some with 50 depend on many "," In [105]: dimension_columns = [] In [106]: with open(nomi) as f: for i in f: lines = i.rstrip

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Alan Gauld via Tutor
On 27/02/17 20:52, Stephen P. Molnar wrote: > To the best of my knowledge I am not running any anti-virus software. > This has always been a Linux computer and there has been no need. There are threats to Linux just fewer of them, plus you could be used as a host to pass on damaged files so you

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Stephen P. Molnar
On 02/27/2017 02:29 PM, Marc Tompkins wrote: On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar mailto:s.mol...@sbcglobal.net>> wrote: I had sent the following message to Anaconda Support: I have just installed anaconda3-4.3.0 and upgraded Spyder to v-3.1.3. When I open Spyder and

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Marc Tompkins
On Mon, Feb 27, 2017 at 12:52 PM, Stephen P. Molnar wrote: > On 02/27/2017 02:29 PM, Marc Tompkins wrote: > >> On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar >> mailto:s.mol...@sbcglobal.net>> wrote: >> >> I had sent the following message to Anaconda Support: >> >> I have just instal

Re: [Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Marc Tompkins
On Mon, Feb 27, 2017 at 10:46 AM, Stephen P. Molnar wrote: > I had sent the following message to Anaconda Support: > > I have just installed anaconda3-4.3.0 and upgraded Spyder to v-3.1.3. > > When I open Spyder and run a python script that has run perfectly in a > previous version of Spyder I g

[Tutor] Problem with Spyder IDE in Anaconda3

2017-02-27 Thread Stephen P. Molnar
I had sent the following message to Anaconda Support: I have just installed anaconda3-4.3.0 and upgraded Spyder to v-3.1.3. When I open Spyder and run a python script that has run perfectly in a previous version of Spyder I get the results that I expect,but with 'Kernel died, restarting' and

Re: [Tutor] problem with scroll in Tkinter

2017-01-13 Thread Peter Otten
Ali Moradi wrote: > https://paste.pound-python.org/show/CIKA8eOFbdq18r3nFUBv/ > > On Fri, Jan 13, 2017 at 10:25 AM, Ali Moradi > wrote: > >> hi. I've written this code and i can't fix the scrollbar error. i am a >> beginner in Python plz help. this is python3 code. According to http://infohos

Re: [Tutor] problem with scroll in Tkinter

2017-01-13 Thread Alan Gauld via Tutor
On 13/01/17 06:55, Ali Moradi wrote: > https://paste.pound-python.org/show/CIKA8eOFbdq18r3nFUBv/ > > On Fri, Jan 13, 2017 at 10:25 AM, Ali Moradi wrote: > >> hi. I've written this code and i can't fix the scrollbar error. i am a >> beginner in Python plz help. this is python3 code. You've poste

Re: [Tutor] problem with scroll in Tkinter

2017-01-13 Thread Ali Moradi
https://paste.pound-python.org/show/CIKA8eOFbdq18r3nFUBv/ On Fri, Jan 13, 2017 at 10:25 AM, Ali Moradi wrote: > hi. I've written this code and i can't fix the scrollbar error. i am a > beginner in Python plz help. this is python3 code. > ___ Tutor mail

[Tutor] problem with python3 Tkinter scroll bar

2017-01-13 Thread Ali Moradi
Hi. i can't fix this error in my code about scroll bar. what should i do? i'm a beginner in Python plz help. https://paste.pound-python.org/show/CIKA8eOFbdq18r3nFUBv/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: h

Re: [Tutor] Problem

2016-08-29 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
The following code should do. for a in range(1,10): for b in range(1,5): for c in range(1,5): for mc in range(50, 55): if mc ==(6*a)+(9*b)+(20*c): print "mc= ",mc,"a= ",a,"b= ",b,"c=",c regards, Sarma. On Mon, Aug 29, 2016 at 3:34 PM, A

Re: [Tutor] Problem

2016-08-29 Thread Alan Gauld via Tutor
On 28/08/16 23:53, shahan khan wrote: I changed the code a bit and this is the result: for a in range(1,11): for b in range(1,6): for c in range(1,6): mc=(6*a)+(9*b)+(20*c) if mc==50: print 'For 50 McNuggets:''a=',a,'b=',b,'c=',c if mc==51: print 'Fpr 51 McNuggets:''a=',a,'b=',b,'c=',c if mc==52:

Re: [Tutor] Problem

2016-08-29 Thread zakaria
The " {} " is the place holder of the values of a, b and c argument passed to format. this example maybe can help to understand print('I like the python {}'.format('mailing-list')) will output >>>  I like the python mailing-list The format methode will substitute the {} with the argument it takes

Re: [Tutor] Problem

2016-08-29 Thread zakaria
if you print the values of a, b ,c that satisfy and don't satisfy the condiction cm == 50 at the same time, you can't know what works and what did not work. here is the code that i wrote and worked well for a in range(1, 11):         # i replaced 10 by 11 to include the 10      for b in range(1,

Re: [Tutor] Problem

2016-08-29 Thread Shahan Khan
I understand your argument. You're saying M(50),M(51)and M(52) is basically a set of 6 9 and 20 packs and we should approach it by using lower values starting from 0 for one or two variables to simply the solution on paper. I think I have some idea now as to how to approach this problem. Sent f

Re: [Tutor] Problem

2016-08-29 Thread khalil zakaria Zemmoura
Can you please rewrite the python code using proper indentation, since, as you know, indentation matters in Python Le 28 août 2016 18:40, "shahan khan" a écrit : Hello I'm teching myself Python using MIT opencourse ware. I'm a beginner and have some what knowledge of c and c++. I'm using Python

Re: [Tutor] Problem

2016-08-29 Thread shahan khan
Yes i format my code but i can't figure out this new problem On Mon, Aug 29, 2016 at 3:20 AM, Joel Goldstick wrote: > On Sun, Aug 28, 2016 at 10:46 AM, shahan khan > wrote: > > Hello > > I'm teching myself Python using MIT opencourse ware. I'm a beginner and > > have some what knowledge of c an

Re: [Tutor] Problem

2016-08-29 Thread shahan khan
I changed the code a bit and this is the result: for a in range(1,11): for b in range(1,6): for c in range(1,6): mc=(6*a)+(9*b)+(20*c) if mc==50: print 'For 50 McNuggets:''a=',a,'b=',b,'c=',c if mc==51: print 'Fpr 51 McNuggets:''a=',a,'b=',b,'c=',c if mc==52: print 'For 52 McNuggets:''a=',a,'b=',b,

Re: [Tutor] Problem

2016-08-29 Thread Shahan Khan
Thankyou so much for taking the time it really means alot. I'll change the code and try again. I have just one question what purpose does " {} " serve here? Sent from my iPhone > On 29-Aug-2016, at 2:30 AM, zakaria wrote: > > if you print the values of a, b ,c that satisfy and don't satisfy th

Re: [Tutor] Problem

2016-08-28 Thread Danny Yoo
On Sun, Aug 28, 2016 at 7:46 AM, shahan khan wrote: > Hello > I'm teching myself Python using MIT opencourse ware. I'm a beginner and > have some what knowledge of c and c++. I'm using Python version > Here is my code: [code cut] Before showing code, try to express what you're trying to do in

Re: [Tutor] Problem

2016-08-28 Thread Alan Gauld via Tutor
On 28/08/16 15:46, shahan khan wrote: Theorem: If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, then it is possible to buy any number of McNuggets >= x, given that McNuggets come in 6, 9 and 20 packs. Here is my code: for a in range(1,10): for b in range(1,5): for c in ra

Re: [Tutor] Problem

2016-08-28 Thread Joel Goldstick
On Sun, Aug 28, 2016 at 10:46 AM, shahan khan wrote: > Hello > I'm teching myself Python using MIT opencourse ware. I'm a beginner and > have some what knowledge of c and c++. I'm using Python version > > Here is the problem: > McDiophantine: Selling McNuggets > In mathematics, a Diophantine equat

[Tutor] Problem

2016-08-28 Thread shahan khan
Hello I'm teching myself Python using MIT opencourse ware. I'm a beginner and have some what knowledge of c and c++. I'm using Python version Here is the problem: McDiophantine: Selling McNuggets In mathematics, a Diophantine equation (named for Diophantus of Alexandria, a third century Greek math

Re: [Tutor] Problem with graphics.py

2016-08-10 Thread Alan Gauld via Tutor
On 09/08/16 17:55, Michael Selik wrote: > Do you mind running the following commands from the python shell? > > py> import os > py> os.getcwd() > '/Users/mike' > py> sorted(os.listdir('.')) > ['.Trash', 'Applications', 'Desktop', ...] > > This will show us what location your python interpreter h

Re: [Tutor] Problem with graphics.py

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 12:51 PM Cyrus Parvereshi wrote: > Hi! I'm starting out with programming by self-studying python with a > textbook used at my university. I came to a chapter that introduced object > oriented programming with graphics tools like GraphWin and Point. However, > even though I

Re: [Tutor] Problem with graphics.py

2016-08-09 Thread Steven D'Aprano
On Tue, Aug 09, 2016 at 09:43:26AM -0700, Cyrus Parvereshi wrote: > Hi! I'm starting out with programming by self-studying python with a > textbook used at my university. I came to a chapter that introduced object > oriented programming with graphics tools like GraphWin and Point. However, > even t

[Tutor] Problem with graphics.py

2016-08-09 Thread Cyrus Parvereshi
Hi! I'm starting out with programming by self-studying python with a textbook used at my university. I came to a chapter that introduced object oriented programming with graphics tools like GraphWin and Point. However, even though I downloaded the author's graphics.py file from his website and put

Re: [Tutor] Problem with code interating thri a list

2016-08-03 Thread Peter Otten
Chris Clifton via Tutor wrote: > I have been practicing with strings. Splitting them, joining them, > changing case. All has been going well but came across a exercise in one > of the code practice sites that has you changing the case of different > characters in a string. Anything in upper cas

Re: [Tutor] Problem with code interating thri a list

2016-08-02 Thread Alan Gauld via Tutor
On 03/08/16 00:30, Alan Gauld via Tutor wrote: >> if item == item.lower(): I meant to add that the string islower() method is probably more readable: if item.islower() Also that you could use a list comprehension to do this without converting to a list initially: def conveert(text):

  1   2   3   4   5   6   7   >