Re: [Tutor] Fwd: Turtle

2016-06-19 Thread Alan Gauld via Tutor
On 19/06/16 04:46, Hershel Millman wrote: >> In pycharm, when I enter the following, it replies with the following error >> message: >> >> from turtle import * >> Change that to import turtle and it should work. >> def drawSquare(size=100): >>turtle.pendown() >>turtle.forward(size)

Re: [Tutor] My code isn't working properly

2016-06-20 Thread Alan Gauld via Tutor
On 20/06/16 08:16, Minhaj Ahmed via Tutor wrote: > Hi,I'm studying Michael Dawsons 'Python programming for absolute > beginners',in chapter 5,page 129,the author writes a program that records > high scores in a game. I have done exactly as the author has set out and > yet my code isn't doing what t

Re: [Tutor] My code isn't working properly

2016-06-20 Thread Alan Gauld via Tutor
On 20/06/16 09:25, Sopan Shewale wrote: > check it here - http://textsnip.com/6bd6jh Tried it and it worked fine in v2.7. To run in v3 I added a few parens after the prints and put the line raw_input = input at the top. I also removed the annoying prompt at the end of the loop. But basically

Re: [Tutor] Converting a sequence of dictionaries to a single dictionary

2016-06-22 Thread Alan Gauld via Tutor
On 22/06/16 01:41, Ek Esawi wrote: > I am trying to read a csv file via DictReader and produce a single > dictionary without fieldnames; that is, I just want a single dictionary > that contains tests as keys and grades as values as shown below in my > sample file. OK, As you've discovered that's

Re: [Tutor] : Turtle

2016-06-23 Thread Alan Gauld via Tutor
On 23/06/16 01:52, Hershel Millman wrote: > I found the turtle module on my computer. > import turtle print(turtle.__file__) > /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/turtle.py That's the right turtle module do not rename it. >>> I entered "import

Re: [Tutor] Fwd: : Turtle

2016-06-23 Thread Alan Gauld via Tutor
On 23/06/16 22:13, Hershel Millman wrote: > What I typed was: > > import turtle > turtle.pendown() > > (And pendown was highlighted in pycharm, indicating that it was not a valid > command.) Don't use pycharm. We need to eliminate as many variables as possible. Start python in a Terminal and ju

Re: [Tutor] Best way to use excepthook here?

2016-06-23 Thread Alan Gauld via Tutor
On 23/06/16 22:08, Alex Hall wrote: > setup I'm going to try first is one file per job, with utils.py and a > couple others shared between them all. > ... > Now, Python is running two scripts which each have their excepthook set to > something different. What happens when both try to log an excep

Re: [Tutor] Hi

2016-06-23 Thread Alan Gauld via Tutor
On 23/06/16 19:00, Bharath Swaminathan wrote: > Can I run my python code in multiple processors? I have a dual core... Your OS may run your python code on multiple processors but it's not something you can easily control in Python. Remember that your computer probably has hundreds of processes run

Re: [Tutor] Opening EOS-5 HDF file - help!

2016-06-23 Thread Alan Gauld via Tutor
On 23/06/16 15:02, Lennartson, Elizabeth M wrote: > I am trying to open a HDF file in python. I downloaded python 2.7.8 through > miniconda2. Given how many other modules you are loading I'd suggest installing a full anaconda distribution which has everything included as standard. > I also dow

Re: [Tutor] Fwd: Fwd: : Turtle

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 03:02, Hershel Millman wrote: > It tells me: > Trace back (most recent call last): > File "", line 1, in > NameError: name 'turtle' is not defined As I recall, the default install of Python on a Mac does not include Tkinter. Turtle uses Tkinter so I suspect turtle is not installed

Re: [Tutor] turtle on linux

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 01:21, Hershel Millman wrote: > This is from my terminal on Fedora 24: > > [hmillman@localhost ~]$ python > Python 2.7.10 (default, Sep 24 2015, 17:50:09) > [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. im

Re: [Tutor] turtle on linux

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 09:02, Hershel Millman wrote: > I tried to import Tkinter and I got this message: > > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named Tkinter > > > And since I am running Linux, you may be under the false impression that I > know what I am d

Re: [Tutor] turtle on linux

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 09:02, Hershel Millman wrote: > mean by "package manager", so if you could enlighten me, that would be > immensely appreciated. I meant to add that on Fedora the package manager seems to be called PackageKit... There are also command line tools (yum, DNF and rpm) but I'm guessing you'

Re: [Tutor] Fwd: Fwd: : Turtle

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 08:51, Hershel Millman wrote: > Python didn't come installed on my Mac, my dad had to install it. Nope, it definitely would have been on there because MacOS uses it. So you definitely have two versions of python installed and it looks like one of them (probably the default) is v2.5 an

Re: [Tutor] For-else... Any other handy constructs hiding in Python?

2016-06-24 Thread Alan Gauld via Tutor
On 24/06/16 14:07, Alex Hall wrote: > but I never knew for-else was available. for-else is useful although I don't like else for it, I would have preferred something like for-also as being more meaningful. > Are there other constructs that I may have missed Probably. :-) Are you aware of try-e

Re: [Tutor] Most efficient way to read large csv files with properly converted mixed data types.

2016-06-25 Thread Alan Gauld via Tutor
On 25/06/16 08:04, Ek Esawi wrote: > genfromtxt or (2) looping through each line in the file and split, strip, > and assign data type to each entry. > > I am wondering if there is a better and more efficient alternative, > especially to method 2 without using numpy or pandas. The csv module wil

Re: [Tutor] Coding help 1D diffusion equation

2016-06-26 Thread Alan Gauld via Tutor
On 26/06/16 13:16, Severin Langberg wrote: > I have a problem with solving the 1D diffusion equation for Gaussian > initial using odeint. Anyone care to help? You need to realize that most folks on this list have no idea what that means. You need to provide a bit more detail. What is the 1D diffu

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread Alan Gauld via Tutor
On 28/06/16 03:52, boB Stepp wrote: Steven has already repolied and my immediate responbse was almost word for word what he said, sop I'll start again and you can consider this an addendum to Steve's message :-) > 1) I am not ready at this time to take on the challenge of *really* > getting into

Re: [Tutor] Help

2016-06-28 Thread Alan Gauld via Tutor
On 28/06/16 06:54, Aaron Johnson wrote: > I have a program that is telling my i need your digital snake, but i dont > want a snake. Help I'm not sure what you expect us to do based on the information you've given. Can you be more specific? What OS are you running? On what platform (phone, tablet,

Re: [Tutor] Most efficient way to read large csv files with properly converted mixed data types.

2016-06-28 Thread Alan Gauld via Tutor
On 26/06/16 07:21, Ek Esawi wrote: > The first step of my plan is to do basic statistical analysis. The 2nd step > is to chose a sample from each file and do more advanced statistical > analysis for which i plan to use R. If you are just extracting data and repackaging it for R then the format do

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread Alan Gauld via Tutor
On 29/06/16 00:34, David Rock wrote: > If you value Alan’s opinion Just to be clear, I run mint because it works but I've used many distros in the past, starting with Slackware then Red Hat then Mandrake and Ubuntu with equally good results. I don't like Ubuntu's Unity UI so switched to Mint but

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread Alan Gauld via Tutor
On 29/06/16 17:20, boB Stepp wrote: > that Logitech does not support Linux for this product, but others who > have done a dual-boot setup with Windows installed before Linux seem > to have found that once the mouse is connected with Windows, it will > be seen by Linux. This remains to be seen!

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread Alan Gauld via Tutor
On 29/06/16 23:16, boB Stepp wrote: > No Git is pre-installed, but it immediately tells me the command to > type to get it! Cool!! If you really want to see what's on offer open the Menu->Administration->Software Manager tool And browse away... :-) -- Alan G Author of the Learn to Program we

Re: [Tutor] dont understand part of a code

2016-07-02 Thread Alan Gauld via Tutor
On 02/07/16 11:46, Minhaj Ahmed via Tutor wrote: > have underlined the part of code I do not understand and why it is there. The mailing list is plain text so formatting like underline doesn't show up. Fortunately you added a comment too... > so_far = "-" * len(word) so_far is whats printed as

Re: [Tutor] iterators

2016-07-04 Thread Alan Gauld via Tutor
On 04/07/16 21:38, Colby Christensen wrote: > File "/home/colby/Calculator/Calculator_betaV3.py", line 110, in OnKeyPress > elif keycode in (27): > TypeError: argument of type 'int' is not iterable The problem is that 'in' needs a collection to test. (27) is not a single element tuple but j

Re: [Tutor] iterators

2016-07-04 Thread Alan Gauld via Tutor
On 04/07/16 21:38, Colby Christensen wrote: > elif keycode in (47, 392): > self.div() > elif keycode in (27): > self.clear_all() I meant to say... > I then tried using > > elif keycode == 27: > > but this statement didn't work. I'm not sure why that didn't work. What exactly happened

Re: [Tutor] iterators

2016-07-05 Thread Alan Gauld via Tutor
On 05/07/16 01:42, Steven D'Aprano wrote: > On Tue, Jul 05, 2016 at 12:47:27AM +0100, Alan Gauld via Tutor wrote: > >>> I then tried using >>> >>> elif keycode == 27: >>> >>> but this statement didn't work. >> >> I

Re: [Tutor] Problem with code

2016-07-05 Thread Alan Gauld via Tutor
On 05/07/16 04:36, Frank Lawrence wrote: > Hello, I have a code here that I’m having a problem with. Unfortunately we can't see it. Now, I could see it among a bunch of HTML when I checked it in the moderator queue, so I'm guessing you sent it as some kind of attachment and the server has stripp

Re: [Tutor] Writing decorators?

2016-07-05 Thread Alan Gauld via Tutor
On 05/07/16 14:22, Alex Hall wrote: > To simplify things, what might be an example of a decorator that, say, > prints "decorated" before whatever string the decorated function prints? > My attempt would be: > > def prependDecorated(f): > def prepend(): > return "decorated"+f() > #somethi

Re: [Tutor] Writing decorators?

2016-07-05 Thread Alan Gauld via Tutor
On 05/07/16 18:31, Alex Hall wrote: > For decorators, do you never include parentheses except for passing > arguments? It seems a bit odd to drop them if they'd be empty, given that > anywhere else doing so would return the function object rather than call > it. Remember what the @ sign is doing

Re: [Tutor] isinstance versus 'is'?

2016-07-05 Thread Alan Gauld via Tutor
On 05/07/16 20:05, Alex Hall wrote: > I was double checking that I remembered the isinstance order of arguments > correctly by using the command line interpreter, and found something very > odd. > a = 5 isinstance(a, int) > True a is int > False > > What happened there? Don't thes

Re: [Tutor] Writing decorators?

2016-07-05 Thread Alan Gauld via Tutor
On 06/07/16 00:06, Alan Gauld via Tutor wrote: > func = decorator(func) > > If you write @decorator() > > That translates to > > @decorator()(func) Ooops, I meant to say func = decorator()(func) Sorry. -- Alan G Author of the Learn to Program web site http://w

Re: [Tutor] isinstance versus 'is'?

2016-07-05 Thread Alan Gauld via Tutor
On 06/07/16 00:22, Alan Gauld via Tutor wrote: >>>> type(c) is C > True >>>> type(d) is type(C) > False The last one should of course be >>> type(d) is C False Apologies. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-06 Thread Alan Gauld via Tutor
On 06/07/16 00:56, loh...@tuta.io wrote: > hey everyone. this is my first time trying this Welcome, but... > you probably know the book, Sorry, I don't and I suspect I'm not alone. It's probably a fine book, but we don't all know it. > so you know that zed always makes us write code > so tha

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-06 Thread Alan Gauld via Tutor
On 06/07/16 15:04, loh...@tuta.io wrote: > script, filename = argv > txt = open (filename) > > print "Here's your file %r: " % filename > print txt.read() > > print "Type the filename again: " > file_again = raw_input("> ") > > txt_again = open(file_again) > print txt_again.read() > why do I

Re: [Tutor] error

2016-07-06 Thread Alan Gauld via Tutor
On 06/07/16 18:27, Moses, Samuel wrote: > I am getting an error. I tired to run the script in wing IDE. > Without the accompanying code we can only guess. > I am getting this error, > > "Traceback (most recent call last): > File "C:\Program Files (x86)\Wing IDE 5.1\bin\wingdb.py", line 822,

Re: [Tutor] decorators -- treat me like i'm 6.. what are they.. why are they?

2016-07-06 Thread Alan Gauld via Tutor
On 06/07/16 20:35, bruce wrote: > Saw the decorator thread earlier.. didn't want to pollute it. I know, I > could google! > > But, what are decorators, why are decorators? who decided you needed them! decorators are things that modify functions in standard ways. Specifically they are functions t

Re: [Tutor] OS and Windows version

2016-07-06 Thread Alan Gauld via Tutor
On 06/07/16 19:34, Moses, Samuel wrote: > Mine > > OS: Windows > Windows version: 8.1 > > Python 3.2 > Wing IDE: 15.1 Thanks for the extra info but it doesn't help much with your problem since we still don't know what your code does nor how your environment is set up. BTW Can you connect to you

Re: [Tutor] decorators -- treat me like i'm 6.. what are they.. why are they?

2016-07-07 Thread Alan Gauld via Tutor
On 06/07/16 20:35, bruce wrote: > But, what are decorators, why are decorators? who decided you needed them! Thinking about this a little wider than Python. Decorators are a standard software design pattern and were first(?) formally documented in the famous book known as the "Gang of Four" (GoF

Re: [Tutor] Counting and grouping dictionary values in Python 2.7

2016-07-08 Thread Alan Gauld via Tutor
On 08/07/16 14:22, Bruce Dykes wrote: > with it is writing the list of dictionaries to a .csv file, and to date, > we've been able to get by doing some basic analysis by simply using grep > and wc, but I need to do more with it now. I'm a big fan of using the right tool for the job. If you got yo

Re: [Tutor] Python WATable & DB

2016-07-11 Thread Alan Gauld via Tutor
On 11/07/16 10:18, nitin chandra wrote: > Any body got experience in WATable + passing data from DB to JS / json > ... and if it is stretching it a bit .. has done it with python. Given that WATable is a (very impressive) JQuery table it's really pretty far off topic for this group(core Python la

Re: [Tutor] cx_Oracle Installation on windows

2016-07-12 Thread Alan Gauld via Tutor
On 12/07/16 04:56, srini s wrote: > Hi, > > While installation process, getting the below issue. Please suggest me. > > Sent from Mail for Windows > 10C:\Python34\Scripts>pip install cx_Oracle > Collecting cx_Oracle > Using cached cx_Oracle-5.2.1

Re: [Tutor] AF_BLUETOOTH with windows?

2016-07-12 Thread Alan Gauld via Tutor
On 12/07/16 15:32, ammar jallawi wrote: > # Simple TCP client and server that send and receive 16 octets > import socket, sys > s = socket.socket(socket.AF_BLUETOOTH, socket.SO_REUSEADDR, > socket.BTPROTO_RFCOMM) > > and getting this error: > > AttributeError: 'module' object has no attribute

Re: [Tutor] wiped file

2016-07-14 Thread Alan Gauld via Tutor
On 14/07/16 05:06, Noah Stickel wrote: > i open a python file in IDLE (python 3.5.1) and then my computer froze > after displaying an error 40 message (i have a DELL PC) and when i > restarted it i discovered that the file had been completely wiped clean. So > i still have the file but there is not

Re: [Tutor] wiped file

2016-07-14 Thread Alan Gauld via Tutor
On 14/07/16 23:19, John Wong wrote: > ... if you use editors like VIM, a temporary file is always created. But with vim once you close the file it deletes the temporary copy. So unless you realize the problem before it gets deleted it won't help. But since you are using IDLE I don;t think that's e

Re: [Tutor] learning path for python

2016-07-16 Thread Alan Gauld via Tutor
On 16/07/16 12:31, rahul sijwali wrote: > i started learning python previous week using "Automate the Boring > Stuff with Python" i am totally new to programming but had no problem > completing the first part now i am off second part which actually > involves "automating stuff" > > now i saw it in

Re: [Tutor] installing openpyxl

2016-07-17 Thread Alan Gauld via Tutor
On 17/07/16 12:18, marcus lütolf wrote: > could someone please tell me what exactly I have to type > I have used all kinds of commands with ‚pip install‘ at the end, all > unsuccessful. At an OS command prompt type C:\WINDOWS> pip install openpyxl You will need write permission to the site pac

Re: [Tutor] Python3: looping through web address

2016-07-18 Thread Alan Gauld via Tutor
On 18/07/16 03:00, Umed Saidov wrote: > import urllib.request, json > import csv > import pandas as pd > import itertools > > ticker = [] > ticker = pd.DataFrame(ticker) Caveat: I'm not a Pandas expert but... This looks odd. You first assign an empty list to ticker and pass that into pandas.Data

Re: [Tutor] Python3: looping through web address

2016-07-18 Thread Alan Gauld via Tutor
On 18/07/16 15:10, Umed Saidov wrote: > No. nothing clever I am afraid. I wanted to create a variable to store > data in pandas format. This seemed like a good way of doing it... but > perhaps not. >>> #open a cvs file with 100+ stock tickers from S&P500. Save in a >>> dataframe 'ticker'. >>> ti

Re: [Tutor] The Way

2016-07-18 Thread Alan Gauld via Tutor
On 18/07/16 22:32, Skapeven Punkboard wrote: > Hello I have programmed a lot but only basic stuff, I never got further > from a point in which I had to start looking for information in forums. > Since the tutorials wherent enogh. I would like to learn more by trying to > solve usefull stuff with o

Re: [Tutor] The Way

2016-07-19 Thread Alan Gauld via Tutor
On 19/07/16 06:36, monik...@netzero.net wrote: > How do you get involved in open source project? Generally you just visit the project homepage and there will be information there. For example for Python itself you can go to: https://wiki.python.org/moin/Community And for Blender https://www.ble

Re: [Tutor] Need Your help

2016-07-19 Thread Alan Gauld via Tutor
> I'm creating a mobile application [ http://e-aadhaarcard.in ] and I'm using > python for a desktop server. However, I don't have access to a static IP on > the desktop, but do have a website. Is it possible to connect from mobile > http website -> desktop server and back? That all depends on ho

Re: [Tutor] Help me out please

2016-07-19 Thread Alan Gauld via Tutor
On 19/07/16 12:31, Marc Sànchez Quibus wrote: > and now I need some help to finish my project. > I have two scripts, one of them in python (the main script) and the other > one written in html. Well, is just a brief javascript (an app) that I took > by Github. I need to change a variable inside th

Re: [Tutor] python cgi single double quotes

2016-07-19 Thread Alan Gauld via Tutor
On 19/07/16 19:43, nitin chandra wrote: > Now I have taken a VPS, using command line, I installed apache2.4, > python 2.7, but I am not able to use the same code with triple quotes > (""") to open and close the code block. > > I am forced to use > > print "Content-type:text/html\r\n\r\n" > print

Re: [Tutor] pyrouge

2016-07-19 Thread Alan Gauld via Tutor
On 19/07/16 23:14, zuhair ali via Tutor wrote: > I used pyrouge package for evaluation rouge package > and I have one problem that i don't know how to > create settings.ini file and what i put in this file. This list is for the Python language and its standard library so rouge() is a bit off topi

Re: [Tutor] Writing decorators?

2016-07-20 Thread Alan Gauld via Tutor
On 20/07/16 09:08, Michael Welle wrote: >> Don't be surprised, though, if the concept “replace the object >> referenced by ‘foo’ with a different object and discard the prior object >> at that reference“ is glossed to “change ‘foo’” in casual usage :-) > I'm a bit surprised to see that kind of slo

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread Alan Gauld via Tutor
On 20/07/16 09:23, nitin chandra wrote: > vimal@Ubuntu-1404-trusty-64-minimal:~$ python > Python 2.7.6 (default, Jun 22 2015, 17:58:13) > [GCC 4.8.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import sys print sys.version > 2.7.6 (default, Jun 22 2

Re: [Tutor] Writing decorators?

2016-07-20 Thread Alan Gauld via Tutor
On 20/07/16 14:30, Michael Welle wrote: > Now it gets interesting ;). Can you give me a hint on how to modify the > code of the function in a decorator or even give a small example, > please? Would I take the route with the bytecode attribute __code__ > (IIRC)? Or use the inspect module? Steven

Re: [Tutor] python programmin problem

2016-07-20 Thread Alan Gauld via Tutor
On 20/07/16 22:11, monik...@netzero.net wrote: > ... if not in python, then in pseudo code. The first question to ask is can you do it without a computer? In other words given input [1,7,2,3,5,4,6] Can you first of all produce a list of all valid runs? [1,2,3,5,6] and [1,2,3,4,6] both have leng

Re: [Tutor] python programmin problem

2016-07-20 Thread Alan Gauld via Tutor
On 21/07/16 00:14, monik...@netzero.net wrote: > IM not able to figure out algorithm to find the runs. > Here is the code I have: OK, Forget about code for now. just focus on what is being asked. > > The first question to ask is can you do it without a computer? > > In other words given > > > > i

Re: [Tutor] need help with socket / fuzzer not sure the while loop condition is wrong

2016-07-21 Thread Alan Gauld via Tutor
On 21/07/16 12:50, la Y wrote: > need help with socket / fuzzer UI've no idea what fuzzer means but... > not sure the while loop condition is wrong > def fuzzer(): > #fuzzer > #user attack coordinates and junk > currentEta = datetime.datetime.now() > targetIP = raw_input("hello

Re: [Tutor] Fwd: Re: Help me out please

2016-07-21 Thread Alan Gauld via Tutor
On 21/07/16 21:17, Danny Yoo wrote: > Well, I have two scripts. One in Python and the other one in html. > Inside the html's script you can find out these lines: > > > initLatencymon( > '#latencyMON', > {}, > { measurements:[*3679333, 3793762*]} > ); > > > I

Re: [Tutor] python programmin problem

2016-07-21 Thread Alan Gauld via Tutor
< items[i]: > run +=[ items[i]] > elif items[i - 1] > items[i]: > del run[-1] > run += [items[i]] > print run > > -- Original Message -- > From: Alan Gauld via Tutor > To: "m

Re: [Tutor] Variable in tkinter?

2016-07-24 Thread Alan Gauld via Tutor
On 23/07/16 16:38, Jim Byrnes wrote: > # the views > frame = tkinter.Frame(window) > frame.pack() > button = tkinter.Button(frame, text='Up', command=click_up) > button.pack() > button = tkinter.Button(frame, text='Down', command=click_down) > button.pack() > that is wrong because the program doe

Re: [Tutor] python programmin problem

2016-07-24 Thread Alan Gauld via Tutor
On 24/07/16 20:58, Danny Yoo wrote: > Please: I strongly encourage you to talk with your professor or study > group: it really does sound like this is the first time you've seen these > kinds of concepts. I agree with Danny, you should talk to your teacher. I suspect the teacher may have set th

Re: [Tutor] Help with error in paramiko

2016-07-24 Thread Alan Gauld via Tutor
On 23/07/16 09:12, José de Jesus Marquez Rangel wrote: > Hello. > > I have a problem because when I connect to the remote server via SSH gives > me an error with paramiko library, but I connect to the same server with > programs like putty, ssh and another there is no error. > > Here the screensh

Re: [Tutor] installing openpyxl, problem solved

2016-07-24 Thread Alan Gauld via Tutor
On 24/07/16 20:04, marcus lütolf wrote: > Dear Experts, problem solved, don’t bother, Marcus. For the sake of the archive can you post a short mail stating what the solution was? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld

Re: [Tutor] installing openpyxl, problem still n o t solved

2016-07-25 Thread Alan Gauld via Tutor
On 25/07/16 19:59, marcus lütolf wrote: > The command >pip install was rejected as SyntaxError : invalid syntax. > Thanks for any kind of help, Marcus. If you get a syntax error that suggests you are running it from the Python >>> prompt. That's wrong. You should run pip from the command prompt

Re: [Tutor] OOP help needed

2016-07-27 Thread Alan Gauld via Tutor
On 27/07/16 04:44, Jim Byrnes wrote: > OOP has always driven me crazy. I read the material and follow the > examples until I feel I understand them, but when I try to implement it > I end up with an error filled mess. That suggests that its not the OOP concept thats confusing you but the langua

Re: [Tutor] Python Programming for the absolute beginner 3e Ch3 Challenge 1

2016-07-27 Thread Alan Gauld via Tutor
On 27/07/16 02:39, kanishk srivastava wrote: > Hello, > > I am working through Michael Dawson's book - Python Programming for > absolute beginners 3e. > > Completed chapter 3, but unable to solve challenge 1. I don't know the book so don't know how much you know yet. So thee are some suggestions

Re: [Tutor] python programmin problem

2016-07-28 Thread Alan Gauld via Tutor
On 28/07/16 05:53, monik...@netzero.net wrote: > I have been looking for tutorials but could not find anything > at my level of understanding. You said to not focus on python > but I had a python teacher ... stressing on doing things in > "pythonic" way. When learning to program there are two as

Re: [Tutor] IDLE Subprocess Startup Error

2016-07-29 Thread Alan Gauld via Tutor
On 29/07/16 05:24, Darah via Tutor wrote: > I’ve been using Python’s IDLE for a couple of weeks now and > it has been working fine but a few days ago I started getting > this error message > "IDLE's subprocess didn't make connection. > Either IDLE can't start a subprocess or personal firewall > s

Re: [Tutor] Unable to download , using Beautifulsoup

2016-07-29 Thread Alan Gauld via Tutor
On 29/07/16 08:28, Crusier wrote: > When I use Google Chrome and use 'View Page Source', the data does not > show up at all. However, when I use 'Inspect', I can able to read the > data. > > '1453.IMC' > '98.28M' > '3.12' > '5.34' > > Please kindly explain to me if the data is hide in CSS Style

Re: [Tutor] Unable to download , using Beautifulsoup

2016-07-29 Thread Alan Gauld via Tutor
On 29/07/16 23:10, bruce wrote: > The most "complete" is the use of a headless browser. However, the > use/implementation of a headless browser has its' own share of issues. > Speed, complexity, etc... Walter and Bruce have jumped ahead a few steps from where I was heading but basically it's an i

Re: [Tutor] Help on Assginments

2016-07-30 Thread Alan Gauld via Tutor
On 30/07/16 05:31, Justin Korn via Tutor wrote: > ...I need someone to help me to develop programs for the following > assignments: That's not really how tutor list works. We will answer your questions and give you hints when you get stuck. But it is the whole list membership helping you, not a d

Re: [Tutor] Help on Assignments - Turtle

2016-07-30 Thread Alan Gauld via Tutor
On 30/07/16 16:28, Justin Korn via Tutor wrote: > I have been working on these assignments for a week and a half, > and I can't make any progress. I also been dealing with a > sick relative, so please help me out immediately. While I sympathise with your circumstances we are all volunteers here s

Re: [Tutor] Help on Assignments - trivia game

2016-07-30 Thread Alan Gauld via Tutor
On 30/07/16 16:28, Justin Korn via Tutor wrote: > trivia_game.py > import sys > import random > import Question.py You do not include the .py extension in an import statement. It should read import Question Also by convention modules use lowercase names. > questions = [ > Question("How ma

Re: [Tutor] Book recommendation

2016-08-01 Thread Alan Gauld via Tutor
On 01/08/16 00:14, D Wyatt wrote: > answers I could understand from you all. While I appreciate the time and > effort you put in helping us out, most of you do not remember what you > didn't used to know, and are often less than helpful because of this. That's a fair point. After 20, 30 or, as

[Tutor] Mail delivery failed: returning message to sender

2016-08-02 Thread Alan Gauld via Tutor
Several of my messages via gmane seem to be bouncing so I'm sending this direct to the tutor list. Apologies if it arrives twice! On 02/08/16 06:51, Justin Korn via Tutor wrote: > Create a new class, SMS_store. > This store can hold multiple SMS messages > (has_been_viewed, from_number, time_ar

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

2016-08-02 Thread Alan Gauld via Tutor
On 02/08/16 15:59, Chris Clifton via Tutor wrote: > My Logic: Since a string is immutable, I converted it to a list That is certainly one approach but your solution has some snags. In fact its probably not necessary unless you want to play with big strings. You could just build a new string from

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 conveer

Re: [Tutor] Python Assignment

2016-08-03 Thread Alan Gauld via Tutor
On 03/08/16 06:34, Justin Korn via Tutor wrote: > Data for Analysis is saved in this order on each line of the file: > [orderNumber, partNumber, quantyNumber, aisleNumber, shelfNumber, binNumber] > > > This is what I have so far: > > infile = open("warehouse_data.txt", "r") > > class Order():

Re: [Tutor] Django SQLite data as Pie chart

2016-08-03 Thread Alan Gauld via Tutor
On 03/08/16 12:25, Trevor H wrote: > I am trying to create a website that could dynamically get data > ... but I'm not sure about how I would go plotting the data > into a pie chart ... There are basically three ways to tackle this. 1) Create the chart as an image on the server and then upl

Re: [Tutor] Python Assignment

2016-08-03 Thread Alan Gauld via Tutor
On 03/08/16 18:58, Justin Korn via Tutor wrote: > This is what I have so far: OK, This is starting to look a bit random. You need to slow down and work through what is happening in each method and especially what data is being passed around where. At the moment it makes no sense whatsoever. > d

Re: [Tutor] Regex/Raw String confusion

2016-08-03 Thread Alan Gauld via Tutor
On 03/08/16 20:49, Jim Byrnes wrote: > Regular Expressions he talks about the python escape character being a > '\' and regex using alot of backslashes. In effect there are two levels of escape character, python and the regex processor. Unfortunately they both use backslash! Python applies its

Re: [Tutor] Regex/Raw String confusion

2016-08-04 Thread Alan Gauld via Tutor
On 04/08/16 02:54, Jim Byrnes wrote: > Is the second example a special case? > > phoneNumRegex = re.compile(r'(\(\d\d\d\)) (\d\d\d-\d\d\d\d)') > > I ask because it produces the same results with or without the ' r '. That's because in this specific case there are no conflicts between the regex

Re: [Tutor] SQLite Django

2016-08-04 Thread Alan Gauld via Tutor
Forwarding to list. Please use REplyAll when responding to tutor messages. On 04/08/16 09:19, Trevor H wrote: > Hi Alan, > > Thank you for the reply. I'll try show the graphic as a website. Would > I have to make the data entries as a model in Django? > I'm not a Django expert so don;t know where

Re: [Tutor] How to use function with default values ?

2016-08-07 Thread Alan Gauld via Tutor
On 07/08/16 04:22, rishabh mittal wrote: > I am new to python and come from C language background. I couldn't able to > understand this > > >>> def f(a, L=[]): > ... L.append(a) > ... return L > ... > print(f(1)) > [1] > print(f(2)) > [1, 2] def f(a, L=10): > ... L=

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] command to determine of python 32 or 64 bit?

2016-08-10 Thread Alan Gauld via Tutor
On 10/08/16 11:41, eryk sun wrote: >> 32 or 64 bit. Is there any reliable way to determine at run time whether a >> python distribution >> is 32 or 64 bit? > > Use platform.architecture()[0]. Currently the value will be either > "32bit" or "64bit". I assumed that was sys.platform? But on my L

Re: [Tutor] command to determine of python 32 or 64 bit?

2016-08-10 Thread Alan Gauld via Tutor
On 10/08/16 11:41, eryk sun wrote: > Use platform.architecture()[0]. Currently the value will be either > "32bit" or "64bit". Its OK, I just discovered there is a platform module! New one on me. That works :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www

Re: [Tutor] install issues - third party modules

2016-08-11 Thread Alan Gauld via Tutor
On 11/08/16 01:16, N Woodruff wrote: > I have downloaded python 3.5.2, and installed it without issues on windows > 7. > > Now I cannot get Third-party modules to install. I want to use openpyxl. How are you running pip? It should be run from a Windows CMD prompt, NOT from the Python >>> prompt

Re: [Tutor] Where is win32print in Windows 10 Pro [RESOLVED]

2016-08-11 Thread Alan Gauld via Tutor
On 11/08/16 17:14, Ken G. wrote: > Unfortunately, no printing is done yet. Still working on it. Your > reference to duckduckgo.com provided a list of useful pywin32 attibutes > but no examples was provided. Will keep looking. Thanks. PyWin32 is a very thin layer on top of the Win32/COM API. You

Re: [Tutor] Fwd: Re: need help

2016-08-12 Thread Alan Gauld via Tutor
> -- Forwarded message -- > From: "Pallab Amway" >> Respected sir,lots of thanks for your advice,but while i am compiling >> those programe with python 2.7 no output is coming only showing the >> masage "expected indented block" The first thing is to point out that you are gettin

Re: [Tutor] Downloading Slack Files

2016-08-16 Thread Alan Gauld via Tutor
On 16/08/16 21:25, Malcolm Boone wrote: > I'm trying to run a python script that will download all files uploaded to > my companies Slack account from the past 30 days. I've no idea what a slack account is but I'm assuming some kind of web server... I've made a few general observations, I don;t

Re: [Tutor] simple troubleshooting question

2016-08-17 Thread Alan Gauld via Tutor
On 17/08/16 23:15, Ken Mayer wrote: > I'm new to Python. I'm trying to do 3 things that are giving me invalid > syntax or other problems: > > 1) import numpy as np > > ImportError: No module named 'numpy' Numpy is not part of standard Python. You need to install it seperately or, my preferenc

Re: [Tutor] Invalid syntax error in my program

2016-08-19 Thread Alan Gauld via Tutor
On 19/08/16 15:36, Kalpesh Naik wrote: > #SIMPLE CALCULATOR > while True: > n=int(input("Enter your choice:")) > a=int(input("Enter 1st value:")) > print("1st value is:",a) > b=int(input("Enter 2nd value:")) > print("2nd value is:",b) > if n==1: > c=a+b > p

Re: [Tutor] Random time code

2016-08-19 Thread Alan Gauld via Tutor
On 18/08/16 12:41, Simon Le-Talbot wrote: > Hi , I have recently purchased a Raspberry pi3 and > I am wanting to turn a light on and then have it > turn off at a random time between 3 and 8 seconds. The time module will give you the current time in seconds. It also provides the sleep() function

Re: [Tutor] Problems install pymqi

2016-08-19 Thread Alan Gauld via Tutor
On 19/08/16 16:30, Ruby Student wrote: > Hello Team, > > I am having a bad day (actually second day) trying to get *pymqi *installed. > Any help is greatly appreciated. > Yesterday I installed Python on my desktop. I am trying to use the Python > WebSphere MQ API and learn Python at the same time.

Re: [Tutor] I Need Help

2016-08-24 Thread Alan Gauld via Tutor
On 24/08/16 11:26, Micheal Emeagi wrote: > forcast values. Ft is the forcast list whose length should be one element > greater than the Yt list. I want the elements of ft to increment by one > while I use it to generate the subsequent element. But for some reasons I > don't understand, it keeps ch

<    1   2   3   4   5   6   7   8   9   10   >