[Tutor] me, my arm, my availability ...

2016-01-13 Thread Laura Creighton
I fell recently. Ought to be nothing, but a small chip of bone, either an existing one or one I just made is nicely wedged in the joint taking away a whole lot of the ability of my arm to rotate in the elbow joint. Or hold my arm in a position that is usual for typing. Plus, now that the sprai

Re: [Tutor] interface

2015-12-15 Thread Laura Creighton
A question for Alex Kleider: Do you want this thing to eventually run on mobile? -- android and IOS? If so, tkinter isn't the place to start, but kivy (which also runs on desktops) is. http://kivy.org/#home re: full stack frameworks The thing about full stack frameworks such as Django is that the

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Laura Creighton
I haven't verified this, but you are probably up against some problem caused by using floating point to store money. The problem is that, when people see something like the floating point number, 3.15 they think, aha, this is a decimal number just like I learned in school when I was 10 years old.

Re: [Tutor] Image MAnipulation Help

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 02:39:41 -0500, Ilesha Wise writes: >Hello, I wasnt sure if this is the email address I should be sending this >to. > >I really need help creating codes that will do the following: > > Scanned photos and slides often have dust specs, water marks, scratches >etc. Au

Re: [Tutor] Python 3.5 console logging

2015-12-01 Thread Laura Creighton
He may be looking for something like the logging facility of Gnu screen. 'Please capture all the output of my python program and show it to me later'. Of course this will be of little or no use if his program has a GUI. Laura ___ Tutor maillist - Tuto

Re: [Tutor] assignment sign definition

2015-12-01 Thread Laura Creighton
In a message of Tue, 01 Dec 2015 05:04:15 +, jo stone via Tutor writes: >Hello, >I am trying to teach myself Python, and got hung up on the definition of >Assignment signs...The explination I have is: >"A good way to understand the statement userAge = 0 is to think of it as >userAge <- 0." >

Re: [Tutor] Help with returning a list object from a C extension.

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:46:11 +, Alan Gauld writes: >On 28/11/15 12:29, Laura Creighton wrote: >> Most people I know have abandoned ctypes. They are using cffi instead. > >Really? Why? >I'd never heard of cffi before, but looking at the docs it seems like a

Re: [Tutor] Help with returning a list object from a C extension.

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:22:12 +, Alan Gauld writes: >On 28/11/15 06:04, James Oren wrote: > >> I'm trying to learn how to use C to extend my code, and have already worked >> out how to use ctypes. I'm now trying to learn the full C extension module >> approach with Python.h and have

Re: [Tutor] Help with returning a list object from a C extension.

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:22:12 +, Alan Gauld writes: >On 28/11/15 06:04, James Oren wrote: > >> I'm trying to learn how to use C to extend my code, and have already worked >> out how to use ctypes. I'm now trying to learn the full C extension module >> approach with Python.h and have

Re: [Tutor] Read lines opening with a particular set of characters from a file

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 16:52:07 +0530, "Br. Sayan" writes: >I am doing the following : > >with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile: >for line in infile: >if line.startswith(('R')): >outfile.write(line) > >It is executing without erro

Re: [Tutor] Read lines opening with a particular set of characters from a file

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 17:05:21 +0530, "Br. Sayan" writes: >How can we read specific lines from a text files using python. File >attached. > >Suppose we want to read lines starting with 'R|1|^^^' and 'O|1|' > >Should we use: > >line.startswith(("..", "..", "")) that matches lines tha

Re: [Tutor] underscores

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 01:43:36 +, Kayla Phelps writes: >Hi, >When I go to type underscores in my program it doesn't work, they just turn >into spaces. I can use references from other programs I downloaded just fine >but I even tried copying and pasting underscores and they disappe

Re: [Tutor] PDF Scrapping

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 12:43:51 -0500, Francois Dion writes: >This is well beyond the scope of Tutor, but let me mention the following: > >The code to pdftables disappeared from github some time back. What is on >sourceforge is old, same with pypi. I wouldn't create a project using >pdfta

Re: [Tutor] Help

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 03:29:38 +, chantie sunday via Tutor write s: >Hello!,Can I kindly get someone to help me with my assignment? Thank you!Best >Regards,Chantelle Hi, and welcome. We don't do people's assignments, but we do help them write them. Post the assignment and the code

Re: [Tutor] Problem on handling if statement

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 17:28:24 +0800, Crusier writes: >Dear All, > >I am trying to do some web scraping. Attached below is my code: > > >from bs4 import BeautifulSoup >import requests > >#string = str(0175, 0005, 1177) >url = "https://www.etnet.com.hk/www/eng/stocks/realtime/quote.php?co

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Laura Creighton
Welcome Evan. In a message of Tue, 24 Nov 2015 18:19:22 +, Alan Gauld writes: >def update_display() >display_period = target_time - time.time() >min,sec = divmod(display_period,60) >if min < 2: set color to yellow >elif: min < 1: set color to red >else: set color to green >

Re: [Tutor] How to kill a thread

2015-11-23 Thread Laura Creighton
Yes, in Thunderbird disabling the flowing is separate from setting plain text. http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Flowed_format see: 'Completely plain email' right down on the bottom of the page. That is what you want. Laura ___

Re: [Tutor] how to invert tuples

2015-11-22 Thread Laura Creighton
In a message of Sun, 22 Nov 2015 21:58:35 +0100, marcus lütolf writes: >dear pythonistas > >i have written the code below for identifying tuples occurring twice or more >times in the list of tuples called "flights". >1. Question: How can i modify this code so it does not matter which string is >f

Re: [Tutor] How to kill a thread

2015-11-22 Thread Laura Creighton
In a message of Sun, 22 Nov 2015 21:40:13 +0530, CMG Thrissur writes: > > > >On Sunday 22 November 2015 05:24 PM, Laura Creighton wrote: >> In a message of Sun, 22 Nov 2015 11:23:58 +0530, CMG Thrissur writes: >>> Hello, I have seen some examples of terminating a threa

Re: [Tutor] How to kill a thread

2015-11-22 Thread Laura Creighton
In a message of Sun, 22 Nov 2015 11:23:58 +0530, CMG Thrissur writes: >Hello, > >I have seen some examples of terminating a thread the safe way. But is >there a way to kill a thread without worrying about what happens next. >Like thread.stop() or something > >George import sys sys.exit(1) This

Re: [Tutor] Squaring every digit in number

2015-11-21 Thread Laura Creighton
In a message of Sat, 21 Nov 2015 17:50:49 +0545, Aadesh Shrestha writes: >I am currently taking challenges on codewars. >Problem: Square Every Digit > >is there a better solution than this which requires less code? > >def square_digits(num): >arr = [] >list = [] >while(num !=0): >

Re: [Tutor] Python ASTM Implementation

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 12:03:41 +0530, "Br. Sayan" writes: >Well, doing > >$ python setup.py install > >did the installation. It can now import astm. > >Should I try with PySerial first, as the communication is through RS232 >serial cable? > >Sayan Are you on ubuntu? Be warned about this

Re: [Tutor] Python ASTM Implementation

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 10:07:49 +0530, "Br. Sayan" writes: >Maybe it's setuptools that is too old? Or perhaps pip? >> sudo apt-get update >> sudo apt-get install --only-upgrade python-setuptools python-pip >> >> I believe it's safer to install Python packages via apt-get if you are >> us

Re: [Tutor] Tutor Digest, Vol 141, Issue 11

2015-11-12 Thread Laura Creighton
In a message of Wed, 11 Nov 2015 17:18:06 +0500, Burhan ul haq writes: >Continuing "Run Python 2.7 on Android Tablet" > >Hi, > >I am constrained to install anything on my official laptop, therefore I >need to have an "online life saver" for Python Learning. > >I have already tried "pythonanywhere"

Re: [Tutor] Run Python 2.7 on Android Tablet

2015-11-10 Thread Laura Creighton
In a message of Tue, 10 Nov 2015 12:38:27 -0500, "Ken Hammer" writes: > > >My MIT OCW 6.00SC course is installed on a Windows 8.1 desktop machine. > >I'd like to study and explore away from my office and desk on my tablet >running Android 4.2.2. Possible? > >thanks, Ken Yes. use Python Anywhe

Re: [Tutor] Regarding to kivy installation

2015-11-07 Thread Laura Creighton
In a message of Sat, 07 Nov 2015 09:09:28 +0530, shubham sharma writes: >Respected sir/madam, >hello to all members of python.org . I had successfully downloaded kivy on >window7 64-bit version.but when i try to install it then it show me error >like: > Traceback (most recent call last): > File "

Re: [Tutor] Plotting with python

2015-10-30 Thread Laura Creighton
I'd use matplotlib, unless the ultimate goal is to render onto a webpage. Then I would use bokeh. http://bokeh.pydata.org/en/latest/ Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/m

Re: [Tutor] ncurses question

2015-10-30 Thread Laura Creighton
In a message of Fri, 30 Oct 2015 16:06:44 -0400, bruce writes: >Hi. > >Looking over various sites on ncurses. Curious. I see various chunks >of code for creating multiple windows.. But I haven't seen any kind of >example that shows how to 'move' or switch between multiple windows. > >Anyone have an

Re: [Tutor] Are there any Python-based GUI builders for tkinter

2015-10-28 Thread Laura Creighton
In a message of Wed, 28 Oct 2015 17:31:35 +, Mark Lawrence writes: >On 28/10/2015 08:39, Laura Creighton wrote: >> In a message of Tue, 27 Oct 2015 15:20:56 -0500, boB Stepp writes: >>> I have a friend at work and he is trying to develop GUI applications >>> in Pyth

Re: [Tutor] Are there any Python-based GUI builders for tkinter (fwd)

2015-10-28 Thread Laura Creighton
Ooops, didn't send this to the list. sorry. Laura --- Forwarded Message >Laura, > >I checked out QtCreator but see zero sign of it supporting python - even tried >a search and the only hit was a job opening. Am I missing something? > > >Jon Paris The Qt Creator announcment for the 2.8.0

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Laura Creighton
In a message of Tue, 27 Oct 2015 21:04:45 -0400, "Hunter Jozwiak" writes: >Hello, > > > >I am not sure exactly why there would be a practical use for a lambda >function, other than the fact that you can make one-liner functions that >take parameters in to a variable. Or at least that is how things

Re: [Tutor] Are there any Python-based GUI builders for tkinter

2015-10-28 Thread Laura Creighton
In a message of Tue, 27 Oct 2015 15:20:56 -0500, boB Stepp writes: >I have a friend at work and he is trying to develop GUI applications >in Python, but he does not want to hand-code them. Are there any >commercial or non-commercial products that would do this for him? He >tried his own online se

Re: [Tutor] Probability Density Function

2015-10-19 Thread Laura Creighton
In a message of Mon, 19 Oct 2015 20:23:27 +0200, Sashen Singh writes: >Hi, >I have an array of chi square values for different values of redshift >between 0 and 3. I know that the min-chi square value refers to the maximum >likelihood. I need to plot a probability density function using the chi >sq

tutor@python.org

2015-10-14 Thread Laura Creighton
In a message of Wed, 14 Oct 2015 19:29:47 -0400, Joel Goldstick writes: >& is a bitwise operator, so any odd number and 1 will be one (true), and >any even number will be zero (false) You and Ben seem to have missed the problem in the answer. I think that Ni needs to understand _how bitwise operat

Re: [Tutor] How to read all integers from a binary file?

2015-10-09 Thread Laura Creighton
In a message of Fri, 09 Oct 2015 15:02:20 -, David Aldrich writes: >Hi > >I have a binary file of 32-bit unsigned integers. I want to read all those >integers into a list. > >I have: > >ulData = [] >with open(ulBinFileName, "rb") as inf: >ulData.append(struct.unpack('i', inf.re

Re: [Tutor] general exception questions

2015-10-05 Thread Laura Creighton
In a message of Mon, 05 Oct 2015 22:39:13 +0100, Mark Lawrence writes: >On 05/10/2015 18:46, richard kappler wrote: >> I'm reading up on exception handling, and am a little confused. If you have >> an exception that just has 'pass' in it, for example in a 'for line in >> file:' iteration, what happ

Re: [Tutor] Mutable data type in python

2015-10-03 Thread Laura Creighton
One thing you can do is to make your variable live in another module. This is a common way to make config files, for instance. say you have a file called config.py which contains the single line my_int = 0 then in your main program you can do: import config and start using config.my_int wherev

Re: [Tutor] Mutable data type in python

2015-10-03 Thread Laura Creighton
>it works fine with global variable or a list type parameter for depth but i >am looking for a way where i would be able to use a parameter which will be >shared across all invocation and it should certainly not be a list coz i >don't need a list > >Thanks and appreciate your help, >Anshu I am not

Re: [Tutor] Which header to use in python

2015-10-01 Thread Laura Creighton
In a message of Thu, 01 Oct 2015 15:42:25 +0300, Michel Guirguis writes: >Good afternoon, > >What is the name of the header that I can use in Python 3.4 to convert the >cumulative distribution function number 0.10606601717798211 to >0.54223501331161406 > >from scipy.stats import norm > >norm.cdf(

Re: [Tutor] Cumulative distribution function

2015-10-01 Thread Laura Creighton
In a message of Thu, 01 Oct 2015 10:57:18 +0200, Peter Otten writes: >$ python cumulative.py >d1 = 0.106066017178 >d2 = -0.0353553390593 >call = 2.9087784079 > >Not exactly 2.9081, but closer :) And sort of in the 'this is a float not a decimal' range I consider usual for such errors, not the hu

Re: [Tutor] Cumulative distribution function

2015-10-01 Thread Laura Creighton
In a message of Thu, 01 Oct 2015 10:48:57 +0300, Michel Guirguis writes: >Good morning, > >I have a problem with the cumulative distribution function in calculating >derivatives. I am getting a call option figure of 2.5961 while it should be >2.9081. Could you please help. > > >>>S=50 K=50 >

Re: [Tutor] How to calculate the cumulative normal distribution

2015-09-30 Thread Laura Creighton
In a message of Wed, 30 Sep 2015 09:12:20 +0300, Michel Guirguis writes: >Good afternoon, > >How to calculate the cumulative normal distribution function CND in order to >use this figure to calculate the call option based on the Black and Scholes >model. The easy way is to install scipy. Then y

Re: [Tutor] Beautiful Soup

2015-09-29 Thread Laura Creighton
>> Hi >> >> I have recently finished reading "Starting out with Python" and I >> really want to do some web scraping. Please kindly advise where I can >> get more information about BeautifulSoup. It seems that Documentation >> is too hard for me. >> >> Furthermore, I have tried to scrap this site b

Re: [Tutor] Regarding installing a python package

2015-09-29 Thread Laura Creighton
In a message of Mon, 28 Sep 2015 19:28:47 -0700, Chirag Shahani writes: >Hi, > >Could any one please help me understand the following: > >Suppose I install a python package using python setup.py install provided >by the developer of a package. I need to track that changes in my file >system.. meani

Re: [Tutor] mathematical and statistical functions in Python

2015-09-27 Thread Laura Creighton
In a message of Sun, 27 Sep 2015 11:48:28 -0700, "Martin A. Brown" writes: > > >Greetings Michel, > >> Thanks for your e-mail. I did not receive e-mail from Mr >> Otten. > >Nobody in their right mind wants to receive an email from Mr. Otten. ;) > >> Basically, the problem that I am facing is that

Re: [Tutor] Need help with python

2015-09-14 Thread Laura Creighton
In a message of Mon, 14 Sep 2015 19:48:01 +0100, Alan Gauld writes: >On 14/09/15 18:02, vijayram wrote: >> Hi, >> >> I need help with python nose tests and test-suite… can I request help >> with a tutor.. > >You can try asking basic questions here, but as nose is not >part of the standard libra

Re: [Tutor] Python 3.5 32-bit installer not creating standard registry key

2015-09-14 Thread Laura Creighton
In a message of Mon, 14 Sep 2015 18:19:47 +0100, Pete writes: > > >Thanks Laura. > >In the end I posted the bug to Python for Windows Extensions >(http://sourceforge.net/p/pywin32/bugs/702/) because I suspect that the >fault may well lie with the PWE installer. > >If I don't get any resolution th

Re: [Tutor] Python 3.5 32-bit installer not creating standard registry key

2015-09-14 Thread Laura Creighton
In a message of Mon, 14 Sep 2015 15:53:16 +0100, Pete writes: > > >Sorry, I've just realised that my previous message was wrong - please >delete it. I now see that the key in question is actually a Python for >Windows Extensions key. The problem appears to lie in the Python for >Windows Extensio

Re: [Tutor] A further question about opening and closing files

2015-09-10 Thread Laura Creighton
In a message of Wed, 09 Sep 2015 23:19:43 +0100, Alan Gauld writes: >..., if your game engine is running on a server shared by other users and >some of them are running critical apps (think a businesses billing or >accounting suite that must complete its run within a 1 hour window say) >then >you

Re: [Tutor] A further question about opening and closing files

2015-09-09 Thread Laura Creighton
In a message of Wed, 09 Sep 2015 20:25:06 +0100, Alan Gauld writes: >On 09/09/15 19:20, Laura Creighton wrote: >If you are working on a small platform - think mobile device - and it has >a single channel bus to the storage area then one of the worst things >you can do is write lots of

Re: [Tutor] A further question about opening and closing files

2015-09-09 Thread Laura Creighton
In a message of Wed, 09 Sep 2015 17:42:05 +0100, Alan Gauld writes: >You can force the writes (I see Laura has shown how) but >mostly you should just let the OS do it's thing. Otherwise >you risk cluttering up the IO bus and preventing other >programs from writing their files. Is this something we

Re: [Tutor] A further question about opening and closing files

2015-09-09 Thread Laura Creighton
>I did a little experiment: > f1 = open("output/test.log", 'a') f1.write("this is a test") f1.write("this is a test") f1.write('why isn\'t this writing') f1.close() If you want the thing written out, use f1.flush() whenever you want to make sure this happens. If you w

Re: [Tutor] Fwd: find second occurance of string in line

2015-09-09 Thread Laura Creighton
Peter Otten >Those who regularly need different configurations probably use virtualenv, >or virtual machines when the differences are not limited to Python. Use tox for this. https://testrun.org/tox/latest/ However for development purposes it often helps to have a --force the_one_that_I_want opt

Re: [Tutor] 2 vs 3

2015-09-07 Thread Laura Creighton
In a message of Mon, 07 Sep 2015 10:16:16 +0100, Alan Gauld writes: >And of course if you are really moving to the v3 way of >doing things you should move to using the new string >formatting style. I don't think there is any great push to prefer the new style over the old style 'just because' whe

Re: [Tutor] 2 vs 3

2015-09-07 Thread Laura Creighton
In a message of Sun, 06 Sep 2015 21:15:52 -0400, Grady Martin writes: >On 2015年09月05日 23時33分, Alan Gauld wrote: >>Once you get used to it - and it is a big jump, don't >>underestimate the learning time - v3 is superior. > >This is the first I've heard someone describe the learning curve from 2 to 3

Re: [Tutor] Query regarding loop problem

2015-08-31 Thread Laura Creighton
I have been told that in gmail it is simple, but far from obvious to get your mail to open so you add to the bottom. There are three tiny dots which conceal the previous text. Click on that, and then add below. I am also told that if you open your mail message with 'control A' (hold the contro

Re: [Tutor] Query regarding loop problem

2015-08-30 Thread Laura Creighton
Alan has pointed out the string/int problem with your code. Your code has a different problem, as well. ># User enters a number between 1 - 5 ># Computer generates random number until an equivalent number is achieved > >import random >computerNumber = 0 Ok, now you have set computerNumber to 0

Re: [Tutor] aws/cloud questions..

2015-08-28 Thread Laura Creighton
In a message of Fri, 28 Aug 2015 20:24:29 -0400, bruce writes: >Evening group! > >Hope wee'all doing well, having fun. yada yada..!! > >I'm considering taking a dive into the "cloud" with an app that would >be comprised of distributed machines, running py apps, talking to db >on different server(s)

Re: [Tutor] PyQt4 Draggable button

2015-08-25 Thread Laura Creighton
Turns out this has been answered several times on Stack Overflow, nobody mentioned using Designer, but there is plenty of code to crib from. Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.

Re: [Tutor] Help error 504

2015-08-25 Thread Laura Creighton
Thanks Timo! I never heard of this one before! Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help error 504

2015-08-25 Thread Laura Creighton
I use mock for this. See this blog post which explains it much clearer than I could. http://engineroom.trackmaven.com/blog/real-life-mocking/ Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyt

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-24 Thread Laura Creighton
One other thing -- if you read bugs.python.org about tix issues you will get the strong idea that as far as python-dev is concerned, tix is on its way out, and ttk ttk is the way to go, so if you want your better widget to be part of the new python distribution, making it a ttk widget seems a good

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-24 Thread Laura Creighton
Maybe a tkinter bug? https://bugs.python.org/issue11077 There was a mismatch between the tkinter tests and the tkinter shipped with python 3.4, which I reported here: https://bugs.python.org/issue24858 -- this is a debian packaging problem and maybe more things are wrong with it. lac@smartwheels

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-23 Thread Laura Creighton
In a message of Sun, 23 Aug 2015 16:45:11 +0200, Laura Creighton writes: >segfaults debian sid, too. > >Laura Updating to Python 2.7.10 (default, Jul 1 2015, 10:54:53) and installing the tix-dev debian package, instead of just tix ... and I am not sure which of these fixed the problem

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-23 Thread Laura Creighton
But, aha, it works for Python3.5 I wrote this minimal program, to see what needed doing to solve the OP's problem, and, surprise, it solves it right out of the box. # -*- coding: utf-8 -*- from tkinter import * import tkinter.tix as tix root = tix.Tk() def print_selected(args): print('sel

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-23 Thread Laura Creighton
In a message of Sun, 23 Aug 2015 15:39:07 +0100, Alan Gauld writes: >On 23/08/15 15:00, Laura Creighton wrote: > >> You might also want to try the Tix.ExFileSelectDialog, it is rather >> dated, but actually has a switch to toggle hidden files on/off and >> wildcar

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-23 Thread Laura Creighton
More goodies from Michael Lange --- Forwarded Message From: Michael Lange To: tkinter-disc...@python.org if you only need to hide hidden files, please see my other post. If you need a more versatile file dialog widget, you might want to consider wrapping an existing tcl widget for tkinter, t

Re: [Tutor] [Tkinter-discuss] tkinter file dialog pattern matching (fwd)

2015-08-23 Thread Laura Creighton
oooh. Seems that there is an undocumented feature we can use! Laura --- Forwarded Message Return-Path: Date: Sun, 23 Aug 2015 12:40:02 +0200 From: Michael Lange To: tkinter-disc...@python.org Message-Id: <20150823124002.7391f37e21f9b5cfaa917...@web.de> In-Reply-To: <20150822210424.321b826

Re: [Tutor] filtering listed directories

2015-08-23 Thread Laura Creighton
wxPython has a SHOWHIDDEN checkbox for turning exactly this on and off, but if you wanted to exclude all .pyc files while leaving the rest alone, I don't see a way to do that, either, right now. QT has a ton of options including showing hidden files. The common problem we seem to be up against is

Re: [Tutor] filtering listed directories

2015-08-23 Thread Laura Creighton
In a message of Sun, 23 Aug 2015 13:09:41 +1000, Chris Roy-Smith writes: >On 22/08/15 23:32, Alan Gauld wrote: >> On 22/08/15 11:43, Laura Creighton wrote: >> >>>> How can I filter out these hidden directories? >>>> Help(tkFileDialog) doesn't help me

Re: [Tutor] filtering listed directories

2015-08-22 Thread Laura Creighton
In a message of Sat, 22 Aug 2015 14:32:56 +0100, Alan Gauld writes: >But maybe some questions on a Tix (or Tk) forum might >get more help? Once you know how to do it in native >Tcl/Tk/Tix you can usually figure out how to do it >in Python. > >-- >Alan G I asked the question on tkinter-discuss, bu

Re: [Tutor] filtering listed directories

2015-08-22 Thread Laura Creighton
In a message of Sat, 22 Aug 2015 12:20:31 +1000, Chris Roy-Smith writes: >Hi, >environment: Python 2.7, Ubuntu 12.4 Linux > >I am trying to get the list of directories shown by >tkFileDialog.askdirectory to not show hidden files (starting with .) > >this code results in lots of hidden directories

Re: [Tutor] Complications Take Two (Long) Frustrations.

2015-08-22 Thread Laura Creighton
In a message of Sat, 22 Aug 2015 17:00:55 +1000, "Steven D'Aprano" writes: >On Fri, Aug 21, 2015 at 11:29:52PM +0200, Roel Schroeven wrote: >> Joel Goldstick schreef op 2015-08-21 23:22: >> >so: >> >print -max(-A, -B) >> >> That's what I mean, yes. I haven't tried it, but I don't see why it >

Re: [Tutor] Can someone explain this to me please

2015-08-21 Thread Laura Creighton
In a message of Fri, 21 Aug 2015 14:04:18 -0400, Jon Paris writes: >This code: > >import sys >x = sys.maxsize >print ("Max size is: ", x) >y = (x + 1) >print ("y is", type(y), "with a value of", y) > >Produces this result: > >Max size is: 9223372036854775807 >y is with a value of 9223372036854775

Re: [Tutor] Do not understand why test is running.

2015-08-21 Thread Laura Creighton
In a message of Fri, 21 Aug 2015 06:26:11 -0700, Alex Kleider writes: >On 2015-08-20 23:16, Peter Otten wrote: > > >> Yea, breaking things is an art form ;) > > >> $ python3 -m unittest -h >> usage: python3 -m unittest [-h] [-v] [-q] [-f] [-c] [-b] [tests [tests >> ...]] >> >. >> >> For test

Re: [Tutor] Request for help with os.walk() combining os.path.ismount() in Linux

2015-08-20 Thread Laura Creighton
In a message of Thu, 20 Aug 2015 09:25:29 +0100, Alan Gauld writes: > >It always amazes me how often the same issues come up in >rapid succession. We must have had 4 or 5 of these types >of errors in the last couple of months, and other times >we go for 6 months or more without it being raised! :-)

Re: [Tutor] About using list in a function

2015-08-19 Thread Laura Creighton
In a message of Thu, 20 Aug 2015 00:37:17 +0100, Alan Gauld writes: >On 19/08/15 18:25, Alan Gauld wrote: >> On 19/08/15 17:09, Michelle Meiduo Wu wrote: >>> Hi there, >>> I'm trying to use List in a function. But it doesn't work. Here are >>> sample code not work: -

Re: [Tutor] About using list in a function

2015-08-19 Thread Laura Creighton
Scrambled in the archives, too https://mail.python.org/pipermail/tutor/2015-August/106528.html And looks like something thought it would be best as only one line of text. Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] About using list in a function

2015-08-19 Thread Laura Creighton
In a message of Wed, 19 Aug 2015 18:25:56 +0100, Alan Gauld writes: >On 19/08/15 17:09, Michelle Meiduo Wu wrote: >> Hi there, >> I'm trying to use List in a function. But it doesn't work. Here are sample >> code not work: ---def getResult():ls >> = []l

Re: [Tutor] pip install in a virtualenv *without* internet?

2015-08-18 Thread Laura Creighton
In a message of Tue, 18 Aug 2015 20:10:15 -, Albert-Jan Roskam writes: >So I would like to pip install a openpyxl AND its specific dependencies in a >virtualenv. >The problem is that I can't use pip to download the packages from Pypi because >I do not have a regular internet connection. Is t

Re: [Tutor] Where should unit test files go in a project directory structure and some related questions?

2015-08-16 Thread Laura Creighton
In a message of Sun, 16 Aug 2015 12:46:59 -0700, Alex Kleider writes: >On 2015-08-16 10:45, Alan Gauld wrote: > >> Thee are several options. >> 1) create links from, main to the test files needed >> 2) alter sys.path so imports can see the test folder >> 3) alter the PYTHONPATH environment var > >>

Re: [Tutor] Where should unit test files go in a project directory structure and some related questions?

2015-08-16 Thread Laura Creighton
In a message of Sun, 16 Aug 2015 18:45:31 +0100, Alan Gauld writes: >On 16/08/15 16:41, Alex Kleider wrote: > >>> - src the code >>> -- lang folder per language used - sql, python, C, bash, etc >>> --- lib modules/packages - subfolder per package >>> --- test test code - sub-tree

Re: [Tutor] try and file existence

2015-08-16 Thread Laura Creighton
In a message of Sat, 15 Aug 2015 15:20:19 -0700, "Clayton Kirkwood" writes: >> If you want to locate dangling symlinks, os.path.exists will return >False, so >> the symlink is there, but the file it pointed to is long gone. > >Can't you do that with os.path.open() and get a value in os.path.status

Re: [Tutor] variable naming conventions

2015-08-16 Thread Laura Creighton
In a message of Sat, 15 Aug 2015 18:24:53 -0700, D Wyatt writes: >It seems every book I read these days uses camel case for variable names in >Python. I was once told that using underscores is preferred. Is there a >preference in the Python community or does it really matter? I'd like to >instil

Re: [Tutor] try and file existence

2015-08-15 Thread Laura Creighton
In a message of Sat, 15 Aug 2015 14:24:21 -0500, boB Stepp writes: >I understand your points, but wonder then what is the intended use for >os.path.exists()? That is, in what types of circumstances would it be >both appropriate and safe to use? > >boB If you want to locate dangling symlinks, os.

Re: [Tutor] cannot get a label message to display immediately

2015-08-14 Thread Laura Creighton
In a message of Fri, 14 Aug 2015 11:32:59 -0500, Bill Allen writes: >I am working in Tkinter. The scenario is that I click a button that >starts a function running. No problem there. However, the function may >take some time to run and I do not want the user to be worried. I am >wanting to

Re: [Tutor] How to effectively use a Student class with SQLite [Was Re: How to design object interactions with an SQLite db?]

2015-08-14 Thread Laura Creighton
In a message of Thu, 13 Aug 2015 23:42:33 -0500, boB Stepp writes: >Many of my wife's students do have their own email accounts, but, >alas, not all of them. I have not totally thought this through yet, >but the student data will include their parents' names and some of >their data. But it will b

Re: [Tutor] How to effectively use a Student class with SQLite [Was Re: How to design object interactions with an SQLite db?]

2015-08-13 Thread Laura Creighton
If your students need to provide a unique email address, then that is a possibility to use to distinguish between ones with the same name. In Sweden, where this is known as the 'Anders Andersson' problem (that being the most common name in Sweden, and any organisation with more than a handful of me

Re: [Tutor] Need advise on protein sequence alignment code in python 2.7 giving wrong output

2015-08-11 Thread Laura Creighton
I wrote: >>> nwalign.global_align("PLEASANTLY", "MEANLY", gap_open=-5, gap_extend=-5, matrix='./BLOSUM62.txt') >>> ('PLEASANTLY', '-MEA--N-LY') I forgot to mention that I got my BLOSUM62.txt from http://www.ncbi.nlm.nih.gov/Class/FieldGuide/BLOSUM62.txt in case that matters. Laur

Re: [Tutor] Need advise on protein sequence alignment code in python 2.7 giving wrong output

2015-08-11 Thread Laura Creighton
You posted incomplete code -- at any rate I cannot get it to work. However, I think the problem is here: for i in xrange(len(v)): for j in xrange(len(w)): if max(S[i][j-1],S[i-1][j],S[i-1][j-1]) == S[i-1][j]: When j is 0, j-1 refers to the end of the list, which makes no

Re: [Tutor] Refresh library imported

2015-08-11 Thread Laura Creighton
If you have an .ipython config file, and these lists aren't empty, just add '%autoreload 2' and 'autoreload' to whatever already is there. Hope this helps, Laura Creighton ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Speech Recognition (was Help)

2015-08-10 Thread Laura Creighton
Shannon Callahan, I found this blog post: https://wolfpaulus.com/jounal/embedded/raspberrypi2-sr/ Looks like this person is using CMUs Sphinx to do the speech recognition stuff. Maybe this is what you are looking for? Laura ___ Tutor maillist - Tuto

Re: [Tutor] Python Certifications

2015-08-08 Thread Laura Creighton
This page is relevant: https://wiki.python.org/moin/PythonTraining Laura ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to define constant width errorbars on log-log plot

2015-08-06 Thread Laura Creighton
In a message of Thu, 06 Aug 2015 12:41:22 -0300, Colin Ross writes: >Does anyone have an example code that shows how to plot errorbars with a >constant line width for a dataset on a log log plot? Thank you. Assuming you want to use matplotlib (there are other python programs that do this) see: h

Re: [Tutor] How can this code be made even better ?

2015-08-06 Thread Laura Creighton
In a message of Thu, 06 Aug 2015 11:24:21 +0545, Aadesh Shrestha writes: >import re > >text = input('Enter your text with phone number using xx-xxx format \n') >contact = re.compile(r'\d\d-\d\d\d\d\d\d\d') > >for i in range(len(text)): >chunk = text[i:i+10] >mo = contact.search(chunk) >

Re: [Tutor] question / decision tree

2015-08-05 Thread Laura Creighton
In a message of Mon, 03 Aug 2015 10:38:40 +0100, matej taferner writes: >Or maybe should I go with the tkinter? You have to decide whether what you want is a Stand Alone GUI Application (in which case tkinter could be a fine idea) or a web app. It sounds to me as if you want your customers to nav

Re: [Tutor] scratching my head

2015-08-05 Thread Laura Creighton
In a message of Wed, 05 Aug 2015 08:43:45 +0200, Peter Otten writes: >Laura Creighton wrote: >but I don't think that's simpler. Can you enlighten me? When I got here, I landed in the middle of a discussion on how to use regexps for solving this. Plus a slew of string handling fu

Re: [Tutor] scratching my head

2015-08-03 Thread Laura Creighton
In a message of Mon, 03 Aug 2015 18:22:32 +1000, Cameron Simpson writes: >That depends. This is the tutor list; we're helping Clayton debug his code as >an aid to learning. While it's good to know about the facilities in the >standard library, pointing him directly at fnmatch (which I'd entirely

Re: [Tutor] question / decision tree

2015-08-03 Thread Laura Creighton
est them yourself, and we can help with getting the code to work, if you need help with that. If, on the other hand, machine learning is new to you, you will need to understand more about that first, and will probably need a textbook. The Russell and Norvig book is very good, but there are other

Re: [Tutor] infix to postfix eval

2015-08-03 Thread Laura Creighton
Hi Anish. I wanted to let you know something I found out last week. Even when you select plain text email, gmail will mangle any lines of text starting with one or more '>' marks. So when you write: >>> import string >>> string.uppercase 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> string.digits

  1   2   >