Re: [Tutor] Rate transition from 60hz to 1000hz

2016-05-10 Thread Alan Gauld via Tutor
On 10/05/16 04:08, David Wolfe wrote: > I'm collecting both video and force plate data, and I need to be able to > synchronize the two, so I can make some calculations. The video data is at > 60hz, and the force plate data is at 1000hz. I don't want to truncate the > force plate data. I have

Re: [Tutor] List of tuples

2016-04-20 Thread Alan Gauld via Tutor
On 19/04/16 21:56, isaac tetteh wrote: > I have a list like this > [ > ("name",2344,34, "boy"),("another",345,47,"boy", "last") > ] Assuming this is list_tuple... > for row in list_tuple: > for row2 in row: > return row This can't work because return needs to be inside a function.

Re: [Tutor] Fwd: List of tuples

2016-04-20 Thread Alan Gauld via Tutor
On 20/04/16 06:52, isaac tetteh wrote: >> Thanks things are working good now. The only problem is >> i want to print the for loop output on one line instead of on each line. >> Example [1,2,3,4,5] >> Output >> 1 2 3 4 5 >> I would to do this in Jinja I don;t know what Jinja is but... When

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-08 Thread Alan Gauld via Tutor
On 01/05/16 05:18, Steven D'Aprano wrote: > ...(And I think we should default to > individual emails, not daily digest.) It took me a little while to find this one, but I've checked and the default is to receive individual emails. You need to opt-in to get the digests and opt-out to stop

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-08 Thread Alan Gauld via Tutor
On 08/05/16 08:59, Alan Gauld via Tutor wrote: > This means you can get > - single emails (default) > - emails plus digest - digest and no emails > - neither (this is my choice because I read via gmane) Sorry, I missed an option... -- Alan G Author of the Learn to Program w

Re: [Tutor] Best Practices with JSON Data

2016-05-08 Thread Alan Gauld via Tutor
On 08/05/16 14:07, Hunter Jozwiak wrote: > I am intending to start work on a Python program that will allow me to > better manage my Digital Ocean droplets, due to the fact that the website > can be at times a bit overkill for some of the basic tasks I want to do. OK, but I have absolutely no

Re: [Tutor] Practice python

2016-05-08 Thread Alan Gauld via Tutor
On 08/05/16 18:14, monik...@netzero.net wrote: > Can you please recommend a free web class or site that offers > lots of coding exercises in python, Have you tried the Python Challenge web site? > ... intermediate and advanced AND provides solutions. The challenge site gets pretty advanced

Re: [Tutor] How to make object disappear?

2016-05-09 Thread Alan Gauld via Tutor
On 09/05/16 16:55, boB Stepp wrote: >> class dot: >> def __init__(self, canvas, color): >> self.canvas = canvas >> self.id = canvas.create_oval(15, 15, 30, 30, fill='Blue', >> tags='dot1') >> >> this = dot(canvas, 'blue') You create an

Re: [Tutor] is there a better way to do this?

2016-05-09 Thread Alan Gauld via Tutor
On 09/05/16 22:03, Ondřej Rusek wrote: > but for 'tuples in list'... simple: > > data = [] > for record in curs: >data += [record] Couldn't that be abbreviated to: date = list(curs) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/

Re: [Tutor] postgreSQL + psycopg2

2016-05-09 Thread Alan Gauld via Tutor
On 09/05/16 22:14, nitin chandra wrote: > for line1 in smallLIST1: > design1 = line1[3] > print design1 > nextRow=cursor1.execute("SELECT designation_name FROM designation > WHERE designation_id = %s;", (design1)) > print nextRow > print "" > for row in line1: >

Re: [Tutor] I've subscribed to your service, no confirmation yet. I'm looking for a tutor and I need help with some code.

2016-05-24 Thread Alan Gauld via Tutor
Re your subject... This is a mailing list. You subscribe and you should receive mails sent to the list. If you have a question send it to the list (like you did here) and one or more of the list members will hopefully respond. The more specific your question the more precise will be the response.

Re: [Tutor] Learning Regular Expressions

2016-05-24 Thread Alan Gauld via Tutor
On 23/05/16 23:08, Terry--gmail wrote: > scripted worked great without the notes! I'd like to know what it is in > the below Tripple-Quoted section that is causing me this problem...if > anyone recognizes. In IDLE's script file..._it's all colored green_, > which I thought meant Python was

Re: [Tutor] Fwd: Re: I've subscribed to your service, no confirmation yet. I'm looking for a tutor and I need help with some code.

2016-05-25 Thread Alan Gauld via Tutor
> I do get the >>> in the python IDLE but within my python script/file can > I telnet to my controller? Keep in mind when I do log into my controller > it's command line driven. One thing that occurred to me is that you may be better off using the subprocess module to start an interactive telnet

Re: [Tutor] Fwd: Re: I've subscribed to your service, no confirmation yet. I'm looking for a tutor and I need help with some code.

2016-05-25 Thread Alan Gauld via Tutor
On 25/05/16 14:11, Angelia Spencer wrote: > in your code below you're telnet-ing to a website, No, I'm telnetting to a server with the IP address mysite.com (which is obviously fictitious, but could be any valid IP address). There is nothing that says it's a web site. (And even some web sites

Re: [Tutor] Baffling problem with a list of objects sharing a property

2016-05-25 Thread Alan Gauld via Tutor
On 25/05/16 17:05, Alex Hall wrote: > Python for a while so eventually unsubscribed. Welcome back Alex :-) > Now I'm using Python for work, and have run into a problem that has me > baffled. It's as though a bunch of class instances in a list are sharing a > single property. They are. You've

Re: [Tutor] Fwd: Re: I've subscribed to your service, no confirmation yet. I'm looking for a tutor and I need help with some code.

2016-05-25 Thread Alan Gauld via Tutor
On 25/05/16 17:19, Alan Gauld via Tutor wrote: > Here is an actual session using a public telnet site: > >>>> import telnetlib >>>> tn = telnetlib.Telnet('telehack.com') >>>> response = tn.read_some() >>>> b'\r\nConnected to TELEH' Oops

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

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

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

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

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

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 =

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

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*]} > ); > > >

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

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

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

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] python programmin problem

2016-07-22 Thread Alan Gauld via Tutor
s[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 <tutor@python.org> >

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 >

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

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

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,

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

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

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

[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,

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] 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

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] 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.

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

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

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] 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

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 >>>

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

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

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/

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

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 > > > >

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

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 Save in a >>> dataframe 'ticker'. >>> ticker

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

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

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

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

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" >

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

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

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

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] 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

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

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

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] 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

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

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

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

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'm not s

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() >

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

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

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] 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

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] 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

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

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"

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

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

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): > ...

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. >

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] 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

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] 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

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

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] Basic Tutorial for Python

2017-02-06 Thread Alan Gauld via Tutor
On 06/02/17 16:13, Hüseyin Ertuğrul wrote: > Hello all, > I am a system engineer and I want to learn python language. > I don't know any program language That's a common request and the python.org site has a whole page dedicated to folks like you.

Re: [Tutor] Multiple tabs using tkinter

2017-02-06 Thread Alan Gauld via Tutor
On 06/02/17 16:40, Pooja Bhalode wrote: > I was wondering if someone could help me regarding multiple tabs in > tkinter. Look at the tabbed notebook in the Tix module. It should do what you want. I give a tutorial on its use in my recent book but you can also find online tutorials, especially

Re: [Tutor] Help with this work

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 04:08, Sasiliyu Adetunji wrote: > I have been working on yhis assignment You are asking for help but in what regard? There is no question or problem statement in your post? I've put some general comments below... > class ShoppingCart(object): > > def __init__(self): >

Re: [Tutor] Help Please on python

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 02:12, Laura Garcia wrote: > I need to create a python code that should simulate throwing darts by > random landing between (a random x and a random y)0 and 1. and the program > should print out number of darts that land within a rectangle. Look in the random module. There are a

Re: [Tutor] Multiple tabs using tkinter

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 03:56, Pooja Bhalode wrote: > you mentioned that there are multiple toolkits which can be used instead of > tkinter. I was also looking into wxpython for building a explorer bar. > Mainly, I have to build a software entirely using python and thus, needed > all these things put in

Re: [Tutor] Multiple tabs using tkinter

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 03:31, Zachary Ware wrote: > ttk rather than Tix; Tix is unmaintained and soft-deprecated in 3.6+. Really? Thats a pity. Tix was supposed to be the module with the extra widgets and ttk was purely the themed versions of same. Its a shame to confuse their purposes. OTOH it does mean

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