Re: [Tutor] Hello!

2016-09-09 Thread Alan Gauld via Tutor
On 09/09/16 17:21, Eric Gardner wrote: > I don't know if i'm sending the email to the right address but here it > goes!. Would Python be a suitable language for first time learners like me? Yes, this is the right address, welcome. And yes, Python is an excellent language with which to learn progr

Re: [Tutor] crashes

2016-09-07 Thread Alan Gauld via Tutor
On 07/09/16 13:21, Rosalie de Klerk Bambara wrote: > Im trying to install python on my macbook air, I’ve installed these 3 > versions and deinstalled too. Python 2.7 should be installed by default since MacOS uses it. > By typing a ‘ the IDLE crash every time… > after the first ( the idle stops

Re: [Tutor] cannot find html file, in the same dir as python file

2016-09-06 Thread Alan Gauld via Tutor
On 06/09/16 03:18, monik...@netzero.net wrote: > I put > > print( os.getcwd() ) > > into my script, and got > > C:\Users\Monika\Documents\PythonWeb\class3code\class3code Is that the directory you expected? Is it where your html file lives? > So I put into my script: > > base_url = > 'C:\Users\

Re: [Tutor] cannot find html file, in the same dir as python file

2016-09-05 Thread Alan Gauld via Tutor
On 05/09/16 21:59, monik...@netzero.net wrote: > chromedriver = "resources/chromedriver" > os.environ["webdriver.chrome.driver"] = chromedriver > self.driver = webdriver.Chrome(chromedriver) > base_url = 'button.html' > self.driver.get(base_url) > > FileNot

Re: [Tutor] python memory management

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 23:20, zakaria wrote: > Is there any practical usage of using reference cycling? There are a (very) few cases where data structures require the creation of cyclic references. One example I've used is in managing comms networks where nodes are multiply and/or cyclically linked and you n

Re: [Tutor] python memory management

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 22:16, monik...@netzero.net wrote: > So what does [...] mean? Its Python's way of telling you that you have a self referential data structure. Its just a representational thing but without it Python would end up printing an infinite sequence of values. HTH -- Alan G Author of the Le

Re: [Tutor] What's the correct way to define/access methods of a member variable in a class pointing to an object?

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 18:17, Steven D'Aprano wrote: > One classic example of the Law Of Demeter is: > > "If you want your dog to come to you, don't talk to your dog's legs, > talk to the dog." I love that, I've never seen it before but a great example. > But sometimes the Law Of Demeter should not apply

Re: [Tutor] python memory management

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 04:25, monik...@netzero.net wrote: > Is this what you mean? > a = 5 > b = a > a = b No, you are confusing variable names with objects. Here you only have one object - the number 5. For a cycle you need at least 2 objects and those objects must be able to reference another object. In

Re: [Tutor] What's the correct way to define/access methods of a member variable in a class pointing to an object?

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 06:55, Sharad Singla wrote: > What's the correct way to define/access methods of a member variable in a > class pointing to an object? Steven has already given you a long and comprehensive answer based on pragmatic python programming. But since you use the term "correct" I'll give you

Re: [Tutor] Issue while using the python library

2016-09-02 Thread Alan Gauld via Tutor
On 02/09/16 15:07, Girish Grover wrote: > I am trying to use a python package from github and struggling to make it > work. Looking for experts to help me out. Technically its off topic for this list which is for core language and standard library issues. But if you were to tell us what package a

Re: [Tutor] python memory management

2016-09-01 Thread Alan Gauld via Tutor
On 01/09/16 15:12, monik...@netzero.net wrote: > Can somebody please explain how memory is managed by python? > What kind of memory it uses? What structures use what kind of memory? I'm not sure what you have in mind? Do you want to know the internal structure of the various data types? Do you wa

Re: [Tutor] Inheritance vs Assignment

2016-09-01 Thread Alan Gauld via Tutor
On 01/09/16 04:18, kay Cee wrote: > Class a(): > def__init__(self, var): > pass > > Class b(a): > def__init__(self): > super().__init__(self, var) > pass > Is it better to do > > b = a() > > Instead of making b its own class? > Also, what would be the ben

Re: [Tutor] Help with NameError

2016-09-01 Thread Alan Gauld via Tutor
On 01/09/16 02:29, Bryan Callow wrote: > Could someone help me with a NameError that I can't seem to figure out. It is hard for us to figure out without seeing the error message. It should tell you which name is in error and where. Please repost with the full error message included. -- Alan G A

Re: [Tutor] generator object

2016-08-31 Thread Alan Gauld via Tutor
On 31/08/16 23:24, Alan Gauld via Tutor wrote: > Then I tried > ... > x = list(2) Should be list(gen(2)) I hope that was obvious... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr

Re: [Tutor] generator object

2016-08-31 Thread Alan Gauld via Tutor
On 31/08/16 08:56, Alan Gauld via Tutor wrote: > A generator function can return any kind of object including > basic types like numbers, bool etc.In addition, a generator > function yields values which can also be of any type. Hmmm. After reading Steven's response I played around

Re: [Tutor] generator object

2016-08-31 Thread Alan Gauld via Tutor
On 31/08/16 05:12, monik...@netzero.net wrote: So generator function returns generator object according to Aaron Maxwell. I don't believe that's correct. A generator function can return any kind of object including basic types like numbers, bool etc.In addition, a generator function yields va

Re: [Tutor] __init__

2016-08-30 Thread Alan Gauld via Tutor
On 30/08/16 22:08, monik...@netzero.net wrote: OK so somebodys remark that there is a default __init__ provided was not correct. It depends on how you interpret default. In so far as object is the default superclass (in v3) and it provides an init then there is a default, but its not part of

Re: [Tutor] __init__

2016-08-30 Thread Alan Gauld via Tutor
On 30/08/16 17:59, monik...@netzero.net wrote: Assume you have a child class with no init, but it has empty, > default __init__ provided by pathon It inherits the empty init from object. and the same for its parent class. When instantiating child class, > child class's __new__ calls its __

Re: [Tutor] ImportError: cannot import name

2016-08-30 Thread Alan Gauld via Tutor
On 30/08/16 10:25, fa306...@skynet.be wrote: Hello, I use python 3.5.1 and try to import sompy and get the following error: File "C:\Anaconda3\lib\site-packages\sompy-1.0-py3.5.egg\sompy\__init__.py", line 30, in from sompy import SOMFactory ImportError: cannot import name 'SOMFactory' Wh

Re: [Tutor] __init__

2016-08-30 Thread Alan Gauld via Tutor
On 30/08/16 12:50, eryksun wrote: On Tue, Aug 30, 2016 at 9:09 AM, Alan Gauld via Tutor wrote: new() that sets up the memory then calls init(). So init is only used to initialise the object after it has been constructed. __new__ and __init__ are called by the metaclass __call__ method

Re: [Tutor] __init__

2016-08-30 Thread Alan Gauld via Tutor
On 29/08/16 23:52, monik...@netzero.net wrote: I cannot really try it. If I have a class without __init__ and the class does not > inherit from a class that has init there is really no place > for me to put print statement. Fair enough but in that case there is no __init__ to call. The top l

Re: [Tutor] Error help

2016-08-30 Thread Alan Gauld via Tutor
On 30/08/16 03:22, Matthew Lehmberg wrote: I've been getting this error over and over and was wondering if someone could help me fix it. [image: Inline image 1] This is a text mailing list so attachments dont get through. Plese repost with your error message cut n paste into the message. Alan

Re: [Tutor] __init__

2016-08-29 Thread Alan Gauld via Tutor
On 29/08/16 20:03, monik...@netzero.net wrote: If __init__ is not defined in a class, will it be called when creating an instance? What in a case if this class inherits from parent with __init__ and without __init__? The easiest way to find out is try it and see what happens! Just put appro

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-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] Running Python code without python installed

2016-08-27 Thread Alan Gauld via Tutor
On 27/08/16 07:26, Jade Beckmann wrote: > I'm just wondering how someone who doesn't have the python software > installed on their PC or mac would be able to run the program? They can't. You need the interpreter to be able to run Python code. The good news is that Macs come with Python installed

Re: [Tutor] syntax error help

2016-08-26 Thread Alan Gauld via Tutor
On 30/03/16 19:05, Awais Mamoon wrote: > Hi my code should be working however keeps coming up with invalid syntax but > I know there isn’t one. You are wrong. There is. I suspect the error message tells you where it is. In future please include the full error message with your code. Look closely

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Alan Gauld via Tutor
On 26/08/16 02:34, Jim Byrnes wrote: > Exception in Tkinter callback > Traceback (most recent call last): ... >File "tk_pwds.py", line 56, in fill_accounts_lb > cur.execute('''SELECT Account FROM pwds WHERE Category=? ORDER BY > Account COLLATE NOCASE''', category) > sqlite3.ProgrammingE

Re: [Tutor] I Need Help

2016-08-24 Thread Alan Gauld via Tutor
On 24/08/16 19:12, Micheal Emeagi wrote: > This is what it is suppose to be > [1, 1, 1.5, 2.25, 3.125, 4.06, 5.03] Oh good, it looks like my wild guess was right. :-) enjoy, -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow

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

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

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

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

<    8   9   10   11   12   13   14   15   16   17   >