Re: [Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?

2019-07-31 Thread Chris Roy-Smith
On 31/7/19 2:21 am, boB Stepp wrote: I have been using various iterations of a solitaire scorekeeper program to explore different programming thoughts. In my latest musings I am wondering about -- in general -- whether it is best to store calculated data values in a file and reload these

Re: [Tutor] is there a graphics library for common tkinter Button functions?

2019-03-21 Thread Chris Roy-Smith
On 21/3/19 10:19 am, Alan Gauld via Tutor wrote: On 20/03/19 22:43, Chris Roy-Smith wrote: Is there a "graphics library" of common button uses? that is things like forward record, back record, 1st record, last record, printer, save and the likes. The short answer is no. But you

[Tutor] is there a graphics library for common tkinter Button functions?

2019-03-20 Thread Chris Roy-Smith
Hi, Is there a "graphics library" of common button uses? that is things like forward record, back record, 1st record, last record, printer, save and the likes. I don't have very artistic abilities, so would prefer to save making my own library. Thank you Chris

Re: [Tutor] Tkinter: Can's figure out how to put a frame in a second window

2019-03-09 Thread Chris Roy-Smith
On 9/3/19 10:13 pm, Alan Gauld via Tutor wrote: On 09/03/2019 02:53, Chris Roy-Smith wrote: What is happening is that the contents of the frame appear in the master window. I was expecting them to show in the second window. Also I expected the frame to be sunken, but there is no obvious signs

[Tutor] Tkinter: Can's figure out how to put a frame in a second window

2019-03-09 Thread Chris Roy-Smith
. Also I expected the frame to be sunken, but there is no obvious signs of the frame, not even a colored background. What am I doing wrong? Thank you, Chris Roy-Smith here is my code: #! /usr/bin/python3 from tkinter import * def NewWindow():     sw=Toplevel(master)     sw.title('New Window

Re: [Tutor] How to write a function which reads files

2018-08-07 Thread Chris Warrick
unction name, since the latter is typically used for classes, and perhaps call it read_file to better describe it? -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

[Tutor] why can use a widget assigned to a variable or just use it on it's own?

2018-07-02 Thread Chris Roy-Smith
) main.mainloop() === any explanation gratefully recieved Regards, Chris ROy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to change the command "string" on a tkinter Button?

2018-07-01 Thread Chris Roy-Smith
On 01/07/18 19:19, Steven D'Aprano wrote: On Sun, Jul 01, 2018 at 03:32:59PM +1000, Chris Roy-Smith wrote: Python is the first language I have attempted since macro assembler for CP/M. Python seems to be another world. Yes indeed, high-level languages like Python *are* a radically different

Re: [Tutor] how to change the command "string" on a tkinter Button?

2018-07-01 Thread Chris Roy-Smith
On 01/07/18 02:17, Alan Gauld via Tutor wrote: On 30/06/18 03:55, Chris Roy-Smith wrote: I am trying to change the command of a tkinter Button in my program. Eventually I want to be able to do this to many buttons. Since I'm not 100% sure if you mean the command or the label or both here

Re: [Tutor] how to change the command "string" on a tkinter Button?

2018-07-01 Thread Chris Roy-Smith
On 01/07/18 02:17, Alan Gauld via Tutor wrote: On 30/06/18 03:55, Chris Roy-Smith wrote: I am trying to change the command of a tkinter Button in my program. Eventually I want to be able to do this to many buttons. Since I'm not 100% sure if you mean the command or the label or both here

[Tutor] how to change the command "string" on a tkinter Button?

2018-06-30 Thread Chris Roy-Smith
rked around the problem by destroying  the window and building it again, but it was pointed out that I have an unusual coding style doing this. All hints appreciated! Regards, Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] tkinter code executes before function returned

2018-04-16 Thread Chris Roy-Smith
On 15/04/18 18:10, Alan Gauld via Tutor wrote: On 15/04/18 03:57, Chris Roy-Smith wrote: I am trying to get tkinter to return a number from a window, which then sets how many times to print a sign. I don;t jhave time to look at this in detail just now, maybe later. But first impressions

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Chris Roy-Smith
, Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] tkinter code executes before function returned

2018-04-15 Thread Chris Roy-Smith
de to wait till getcount() returns it's value? Any help greatly appreciated. Regards, Chris Roy-Smith chris@chris-X451MA:~/Scripts/python3/dvms$ ./debug1.py line 27 ###   required sign count for D is None   ### Exception in Tkinter callback Traceback (most recent call last):   File "/usr/lib/py

[Tutor] thinter: can't figure out how to update a window instead of creating a new on

2018-01-28 Thread Chris Roy-Smith
assistance, I'm hoping to learn something from this experience Regards, Chris Roy-Smith #!/usr/bin/python3 import mysql.connector from tkinter import * import pickle master = Tk() def getCfg():     fobj = open('members.pkl', 'rb')     cfg = pickle.load(fobj)     fobj.close()     return cfg

Re: [Tutor] trouble using tkinter CheckButton

2018-01-16 Thread Chris Roy-Smith
On 16/01/18 22:35, Alan Gauld via Tutor wrote: On 16/01/18 04:37, Chris Roy-Smith wrote:   File "./debugString.py", line 7, in SetFin     SetStatus[x] = var.get(x) AttributeError: 'list' object has no attribute 'get' var=[IntVar() for x in range(8)] Here you create a list

[Tutor] trouble using tkinter CheckButton

2018-01-16 Thread Chris Roy-Smith
en things down to what I think is as simple as I can get. Thank you for looking at this, Regards, Chris Roy-Smith Error message: ===== chris@chris-X451MA:~/Scripts/python3/dvms$ ./debugString.py Exception in Tkinter callback Traceback (most recent call last):   File "

[Tutor] problem with program in python in easy steps

2017-10-26 Thread Chris Coleman
py and get this error message: Traceback (most recent call last): File "scripts/override.py", line 1, in from Man import* File "/home/chris/scripts/Man.py", line 2 '''A derived class to define Man properties.''' ^ Inden

Re: [Tutor] problems using a listbox

2017-10-17 Thread Chris Roy-Smith
ks, I have difficulties with object oriented coding. Never used a language where I needed it. Regards, Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] problems using a listbox

2017-10-17 Thread Chris Roy-Smith
Hi, OS: Linux Chris-X451MA 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Python 3.5.2 (default, Sep 14 2017, 22:51:06) I am trying to learn how to use a tkinter listbox. When I execute my experimental code, an odd index is printed immediately

[Tutor] Tree again: iterator, yield, increase (treelib)

2017-10-14 Thread Chris
? Couldn't the __get_iter function iterate another list or dictionary? Which line says that you want to get every Node in self._nodes? Thank you in advance! - Chris [1] https://github.com/caesar0301/treelib/blob/master/treelib/tree.py [2] http://treelib.readthedocs.io/en/latest/examples.html#basic

[Tutor] problem with program

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

Re: [Tutor] Directory Structure

2017-09-30 Thread Chris
Thank you for your detailed reply! I've tried to explain in my mails to Alan and Mats what I'm trying to achieve. On Sat, 30 Sep 2017 11:32:57 +1000 Steven D'Aprano <st...@pearwood.info> wrote: > On Fri, Sep 29, 2017 at 07:02:07PM +0200, Chris wrote: > > > Background: Maildir

Re: [Tutor] Directory Structure

2017-09-29 Thread Chris
ve different meanings depending where they're in the tree. - Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] A Question Regarding the Documentation Format

2017-09-24 Thread Chris Warrick
planation > for this. This indicates the return type: input() returns a string. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] subprocess.getstatusoutput : UnicodeDecodeError

2017-09-22 Thread Chris Warrick
es. Instead of tail, you should use Python’s standard file operations (open()) to accomplish your task. [advertisement] Extra reading on security (shell=False) and the necessity of calling subprocesses: https://chriswarrick.com/blog/2017/09/02/spawning-subprocesses-smartly-and-securely/ [/advert

Re: [Tutor] How is database creation normally handled?

2017-09-10 Thread Chris Warrick
exist.) ¹ Progressive enhancement: adding more features that need extra columns I didn’t think of first. Or removing features that weren’t cool. Or restoring them the next day. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor

Re: [Tutor] Help

2017-09-06 Thread Chris Warrick
()) search_key = str(input("> ")) if search_key in data: print(search_key, ":", data[search_key]) else: print("Not in dictionary.") (I also cleaned it up a little) -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Chris Warrick
t; an hour, maybe forty five minutes later and my little project did what I was > trying to do. This was before I really knew any python; the language was > that clean and easy to learn. You can still do that with Python 3. (Although you’ll be better off using asyncio and some IRC li

Re: [Tutor] intro book for python

2017-09-01 Thread Chris Warrick
utorial/index.html [1] http://greenteapress.com/wp/think-python-2e/ [2] https://automatetheboringstuff.com/ [3] https://learnpythonthehardway.org/book/nopython3.html [4] https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/ -- Chris Warrick <https://ch

Re: [Tutor] Percentage of installations without setuptools (Was if __name__=='__main__' ...)

2017-08-11 Thread Chris Warrick
ip some unrelated stuff] dependency: python3-pip provider: python3-pip-9.0.1-9.fc26.noarch dependency: python3-setuptools provider: python3-setuptools-36.2.0-1.fc26.noarch On other distributions, it usually isn’t, although many users will eventually end up with a copy. -- Chris Warri

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-10 Thread Chris Warrick
On 9 August 2017 at 23:15, Steven D'Aprano <st...@pearwood.info> wrote: > On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > >> While setuptools is not officially part of the stdlib, > > This is the critical factor. How can you use *by default* something

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-08 Thread Chris Warrick
e top 360 packages on PyPI use wheels. It means that at least that many use setuptools; sometimes with a distutils fallback, but often without one. Moreover, many of the packages without wheels use setuptools as well. The sane default choice is entry_points.

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Chris Warrick
On 4 August 2017 at 12:15, Thomas Güttler <guettl...@thomas-guettler.de> wrote: > Chris wrote "Simple: `scripts` are legacy." > > You say it is the standard, and console_scripts is from a third party. > > For me "legacy" sound like "don't go this

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Chris Warrick
running your script by opening the created .exe files does not show a console window. Note that stdout/stderr do not work in that mode under Windows, which can lead to spurious application crashes. (GUI-only processes cannot use stdout/stderr because they don’t have a console attached) I’ll take the liberty to link my (better) blog post about this: https://chriswarrick.com/blog/2014/09/15/python-apps-the-right-way-entry_points-and-scripts/ -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-01 Thread Chris Warrick
’re making things more akin to shell scripts, using just entry_points makes stuff harder, because you need to install the code (and write a setup.py), as opposed to just putting the script somewhere in $PATH. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16

Re: [Tutor] Recommended Python Compiler

2017-07-31 Thread Chris Warrick
ature, and a necessity for debugging (tracebacks!) On the other hand, some of the better editors (eg. Visual Studio Code) provide .zip packages that do not require installation and can even run off a USB stick. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 _

Re: [Tutor] Can a virtual environment be renamed?

2017-04-16 Thread Chris Warrick
On 16 April 2017 at 18:16, Jim <jf_byr...@comcast.net> wrote: > On 04/16/2017 10:10 AM, Chris Warrick wrote: >> >> On 16 April 2017 at 16:45, Jim <jf_byr...@comcast.net> wrote: >>> >>> My system python is 2.7.12 so I created a virtual environment using

Re: [Tutor] Can a virtual environment be renamed?

2017-04-16 Thread Chris Warrick
r 3.5.2 without > breaking things? No. You need to delete your existing virtualenv and create a new one. You can just use `pip freeze > requirements.txt` in the old one and run `pip install -r requirements.txt` in the new one to ”move” all the packages you had. -- Chris Warrick <https:

[Tutor] Problem with code interating thri a list

2016-08-02 Thread Chris Clifton via Tutor
print(convert("This Is A Test!")) ----- Thanks,Chris Clifton ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Adding to a dict through a for loop confusion.

2016-05-17 Thread Chris Kavanagh
AM, <c...@zip.com.au> wrote: > On 17May2016 04:28, Chris Kavanagh <cka...@gmail.com> wrote: > >> Could someone tell me why this different behavior occurs between these 2 >> code snippets, please. The 1st example has quotes around it ['item'] only >> adds the last i

[Tutor] Adding to a dict through a for loop confusion.

2016-05-17 Thread Chris Kavanagh
Could someone tell me why this different behavior occurs between these 2 code snippets, please. The 1st example has quotes around it ['item'] only adds the last item to the dict (cart). In the 2nd example the item does not have quotes around it [item] and every entry is added to the dict. Why?

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

2016-05-10 Thread Chris Roy-Smith
On 10/05/16 07:03, Ondřej Rusek wrote: Dne 9.5.2016 v 10:13 Chris Roy-Smith napsal(a): Hi Python 3.4 Linux (ubuntu) This code does what I want. curs is the result of a mysql query data = [[" " for x in range(9)] for y in range(count)] for (ddate, mood, walk, lag, sleep) in curs:

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

2016-05-10 Thread Chris Roy-Smith
On 10/05/16 12:01, Steven D'Aprano wrote: On Mon, May 09, 2016 at 06:13:32PM +1000, Chris Roy-Smith wrote: data = [[" " for x in range(9)] for y in range(count)] for (ddate, mood, walk, lag, sleep) in curs: data[row][0]=ddate data[row][1]=mood data[ro

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

2016-05-09 Thread Chris Roy-Smith
ata[row][3]=lag data[row][4]=sleep row +=1 While I don't know a better way to do this, it seems a bit awkward, is there a better way? Thank you Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscripti

Re: [Tutor] Tutor Digest, Vol 146, Issue 22

2016-04-21 Thread Chris C via Tutor
ll show you any modules you have installed.   From there you should be able to follow the documentation and install any modules you need.  Good luck,  I hope this helps. Chris Clifton   Message: 3 Date: Tue, 19 Apr 2016 23:26:06 -0500 From: Gustavo Davis <gusdavi...@yahoo.com> To: tutor@py

Re: [Tutor] How to run a python script

2016-02-21 Thread Chris Warrick
Forwarding to mailing list, please use Reply All in the future. On 21 February 2016 at 09:48, Erol Gericke <woodw...@cybersmart.co.za> wrote: > Hi Chris, > > Thanks for your prompt reply, the problem has been solved! > I was using the 'python' terminal not the 'DOS' terminal. &

Re: [Tutor] How to run a python script

2016-02-20 Thread Chris Warrick
ion options: > https://mail.python.org/mailman/listinfo/tutor Please paste the full error message, and your complete source code. Also, make sure you are running the commands in the regular command prompt window, and not in a Python-specific one. Also, your scripts should not live in C:\Pyt

Re: [Tutor] AWS /Django/Apache/Python/Github

2016-02-13 Thread Chris Warrick
ensive tutorial on deploying a Python application on a Linux server: https://chriswarrick.com/blog/2016/02/10/deploying-python-web-apps-with-nginx-and-uwsgi-emperor/ -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist

Re: [Tutor] What is the square brackets about?

2016-01-16 Thread Chris Warrick
thing[loc[0]] means “check what the 0th element of `loc` (`loc[0]`) is, and use it as an index for `thing` (`thing[…]`). -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] idle??

2016-01-14 Thread Chris Warrick
On 13 January 2016 at 21:49, Mark Lawrence <breamore...@yahoo.co.uk> wrote: > On 09/01/2016 10:38, Chris Warrick wrote: >> >> On 8 January 2016 at 20:07, bruce <badoug...@gmail.com> wrote: >>> >>> So, where does IDLE fit into this >> >

Re: [Tutor] idle??

2016-01-09 Thread Chris Warrick
han the basic interpreter, and even have more features than IDLE. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] To FORMAT or not to

2016-01-03 Thread Chris Warrick
ng print() with commas adds spaces between all entries, which might look bad (and it does in this example); the only way to prevent that is by setting `sep=`, but then you need to remember about a space after "visited" and around the ampersand… * Easy to localize (translate into different languag

Re: [Tutor] Debugging in Python

2015-11-16 Thread Chris Warrick
the normal `python3` shell, ipython or bpython. The correct fix is to exit() from the python3 shell and start it again. Alternatively, add some main code at the end of your file and use `python3 hlibert.py`: if __name__ == '__main__': hilbert(3)

Re: [Tutor] Why does this function execute before being called?

2015-11-07 Thread Chris Roy-Smith
On 07/11/15 20:18, Alan Gauld wrote: On 07/11/15 04:34, Chris Roy-Smith wrote: def genF(ofield): ... for x in range(10): def second(): main=Toplevel(root) ofield=Text(main, height=15, width=15) ofield.pack() B3=Button(main, text='exit', command=main.destroy) B3

Re: [Tutor] command line list arguments

2015-11-07 Thread Chris Warrick
gument parsing solution, and implement it with two arguments. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Why does this function execute before being called?

2015-11-07 Thread Chris Roy-Smith
ack() b2=Button(root, text='exit', command=root.destroy) b2.pack() root.mainloop() Thanks, Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] generate a list/dict with a dynamic name..

2015-09-27 Thread Chris Warrick
it, just create a dict and use it — you can have arbitrary variable names just fine: things = {} a = "aabb" things[a] = [] PS. why are you creating a out of two strings? Why not just a = "aabb"? -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16

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

2015-08-24 Thread Chris Roy-Smith
On 23/08/15 23:52, Laura Creighton wrote: oooh. Seems that there is an undocumented feature we can use! Laura --- Forwarded Message Return-Path: tkinter-discuss-bounces+lac=openend...@python.org Date: Sun, 23 Aug 2015 12:40:02 +0200 From: Michael Lange klappn...@web.de To:

Re: [Tutor] filtering listed directories

2015-08-23 Thread Chris Roy-Smith
On 23/08/15 00:42, Laura Creighton wrote: 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

Re: [Tutor] filtering listed directories

2015-08-23 Thread Chris Roy-Smith
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 as it just shows **options, but doesn't show what these options might be. tix (tkinter extensions)

Re: [Tutor] filtering listed directories

2015-08-23 Thread Chris Roy-Smith
On 23/08/15 18:13, Laura Creighton wrote: 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 as it just shows

[Tutor] filtering listed directories

2015-08-22 Thread Chris Roy-Smith
to be for the user. #! /usr/bin/python import Tkinter, tkFileDialog root = Tkinter.Tk() root.withdraw() dirname = tkFileDialog.askdirectory(parent=root,initialdir=/home/chris/,title='Pick a directory') How can I filter out these hidden directories? Help(tkFileDialog) doesn't help me as it just shows

Re: [Tutor] Python application with same name as its corresponding project

2015-07-31 Thread Chris Warrick
/mailman/listinfo/tutor Don’t create custom bin/ scripts, use setuptools entry points. I described it on my blog: https://chriswarrick.com/blog/2014/09/15/python-apps-the-right-way-entry_points-and-scripts/ -- Chris Warrick https://chriswarrick.com/ PGP: 5EAAEA16

Re: [Tutor] Abs

2015-07-27 Thread Chris Roy-Smith
On 27/07/15 11:06, Job wrote: I want to be able to ask a user to input an integer and print out the root and power of the given integer. Why do you use abs(x) for this program? I don't understand or see the link between abs() and root and powers. This reminds me of this: By knowing that when

Re: [Tutor] tkinter window not showing max, min and close buttons

2015-07-21 Thread Chris Roy-Smith
On 21/07/15 21:52, Alan Gauld wrote: On 21/07/15 08:15, Chris Roy-Smith wrote: On 21/07/15 17:02, Alan Gauld wrote: On 21/07/15 06:05, Chris Roy-Smith wrote: I am working my way through Alan Gauld's tutorial and have just started the section on GUI. The windows that are created look odd

Re: [Tutor] tkinter window not showing max, min and close buttons

2015-07-21 Thread Chris Roy-Smith
On 22/07/15 08:07, Chris Roy-Smith wrote: On 21/07/15 21:52, Alan Gauld wrote: On 21/07/15 08:15, Chris Roy-Smith wrote: On 21/07/15 17:02, Alan Gauld wrote: On 21/07/15 06:05, Chris Roy-Smith wrote: I am working my way through Alan Gauld's tutorial and have just started the section on GUI

Re: [Tutor] tkinter window not showing max, min and close buttons

2015-07-21 Thread Chris Roy-Smith
On 21/07/15 17:02, Alan Gauld wrote: On 21/07/15 06:05, Chris Roy-Smith wrote: I am working my way through Alan Gauld's tutorial and have just started the section on GUI. The windows that are created look odd with no title bar or maximise, minimise or close window button. The simplest

[Tutor] tkinter window not showing max, min and close buttons

2015-07-20 Thread Chris Roy-Smith
? Thank you Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] dictionary of lists

2015-06-04 Thread Chris Stinemetz
On Thu, Jun 4, 2015 at 2:30 AM, Peter Otten __pete...@web.de wrote: Chris Stinemetz wrote: Although I am certain it is not very efficient I was able to accomplish what I wanted with the following code I wrote: import os import pprint import csv from collections import defaultdict

[Tutor] dictionary of lists

2015-06-03 Thread Chris Stinemetz
, Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] dictionary of lists

2015-06-03 Thread Chris Stinemetz
Resetting execution engine Running C:\Users\cs062x\Desktop\python\projects\PanHandle\PanHandle\PanHandle.py The Python REPL process has exited That's slightly unusual. How are you running this? I am running it with Microsoft Visual Studio Community 2013 using Python Tools for Visual

Re: [Tutor] trouble with stringio function in python 3.2

2015-05-04 Thread Chris Warrick
in this case, regular strings will do it equally well and are more readable. -- Chris Warrick https://chriswarrick.com/ PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo

[Tutor] Python and Django Web Engineering Class

2015-04-13 Thread Chris Calloway
inexpensive. But it's taught by the primary Python instructor at UNC. The school is also licensed by the State of North Carolina and sponsored by Caktus Group, the largest Django development firm. -- Sincerely, Chris Calloway, Applications Analyst UNC Renaissance Computing Institute 100 Europa

[Tutor] append value to dictionary key

2015-03-06 Thread Chris Stinemetz
I would like to append a value to a dictionary key where there is already a value. Something like the below: d = {'name': {'2': 0.0, '7': 10.0, '8': 0.0, '9': 0.0}} append 10 to d['name']['2'] d = {'name': {'2': 0.0,10, '7': 10.0, '8': 0.0, '9': 0.0}} When I try to this I get the following

Re: [Tutor] updating a dictionary

2015-02-20 Thread Chris Stinemetz
I am getting closer. I think I have figured out the logic. I just have a quick question. How do you access key:values in a nested dictionary? MOL02997_C': [{'2': '0', '7': '0', '8': '0', '9': '0'}]} say I want to access the key:value 8:0 print dict['MOL02997_C']['8'] doesn't seem to work.

Re: [Tutor] updating a dictionary

2015-02-20 Thread Chris Stinemetz
On Fri, Feb 20, 2015 at 4:51 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 20/02/2015 17:56, Chris Stinemetz wrote: Please don't top post as it makes long threads difficult if not impossible to follow, thanks. I am getting closer. I think I have figured out the logic. I just have

[Tutor] updating a dictionary

2015-02-19 Thread Chris Stinemetz
Hello List, I have a dictionary that I would like to update/add rows to it as I read a file line by line. The dictionary format looks like: format = {'Cell': '','7':'','8':'','9':'','2':''} For each line read in I would simply like to check to see if a Cell key;value exists and if it does

Re: [Tutor] updating a dictionary

2015-02-19 Thread Chris Stinemetz
Other than the minor tweaks I've suggested I'm not sure what your problem is? I think we need to see the data to understand the issue. ​Here is a sample of the input data, it is tab delimited and I chopped it down for example purposes: ​ KSL03502_7A_1 11.5921 KSL03502_7B_1 46.4997

Re: [Tutor] Decode and Encode

2015-01-28 Thread Chris Warrick
system locale is set correctly. If it isn’t, p = b你好.decode('utf-8') would do it. -- Chris Warrick https://chriswarrick.com/ PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Chris Warrick
subscription options: https://mail.python.org/mailman/listinfo/tutor In Python 3, raw_input() was renamed to input(). a = input(Write down your name: ) Note that input() is also a thing in Python 2, but you shouldn’t use that one for security reasons. Python 3’s is fine though. -- Chris Warrick

Re: [Tutor] Remove artca...@google.com from mailing list, PLEASE

2014-11-04 Thread Chris Warrick
Do it yourself at https://mail.python.org/mailman/listinfo/tutor . Besides, your email is @gmail.com, not @google.com. -- Chris Warrick http://chriswarrick.com/ PGP: 5EAAEA16 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
identifiers and values. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] how to express shift+enter in python

2014-09-28 Thread Chris “Kwpolska” Warrick
the key combination to an app? What is it, exactly, that you want to do? What app uses Shift+Enter in the way you want to use it? -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense

Re: [Tutor] This is driving my crazy! My file hasn't been corrupted

2014-08-31 Thread Chris “Kwpolska” Warrick
Python show the exceptions. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
() ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
there; the main drive is just /. Also, the path separator is a forward slash (/). This also lets you remove the r in front of the string, which is needed for backslashes unless you escape them. The corrected code is: infile = open('/Users/richarddillon/Desktop/my_file', 'r') -- Chris “Kwpolska” Warrick

Re: [Tutor] debug and execute python code in Mac

2014-08-28 Thread Chris “Kwpolska” Warrick
as an aside — Apple has stopped charging for OS-X. Sebastan probably meant “free” as in Stallman: http://www.gnu.org/philosophy/free-sw.html (most people believe free = $0. FSF people, however, want to steal that word for their concept. Not very successful at that, as you can see.) -- Chris “Kwpolska

Re: [Tutor] time vs. timeit

2014-08-26 Thread Chris “Kwpolska” Warrick
million. The main statement, the setup statement and | the timer function to be used are passed to the constructor. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-24 Thread Chris “Kwpolska” Warrick
Windows VMs). -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-23 Thread Chris “Kwpolska” Warrick
with Windows. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] Alert to all Experienced Python Software Object Oriented Programmers-Novice Needs Help In Understanding Textbook

2014-08-18 Thread Chris “Kwpolska” Warrick
On 18 August 2014 02:45 ALAN GAULD alan.ga...@btinternet.com wrote: At the Community College we used Python version 3.4.0 which I guess is up to date. Yes indeed, the latest and greatest. The “latest and greatest” is actually 3.4.1. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ Sent

Re: [Tutor] read cell phone's directory?

2014-08-14 Thread Chris “Kwpolska” Warrick
and do not behave like usual USB drives. You must use a module that implements MTP if you want to access your phone. import os; No need for a semicolon here. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ Sent from my SGS3. ___ Tutor maillist

Re: [Tutor] re module

2014-08-14 Thread Chris “Kwpolska” Warrick
not be used at all. -- Chris “Kwpolska” Warrick http://chriswarrick.com/ Sent from my SGS3. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] read cell phone's directory?

2014-08-14 Thread Chris “Kwpolska” Warrick
On 14 August 2014 17:48 = Clayton - Tang = c...@ctny.org wrote: Chris, thanks for the reply. I don't have newsgroup access, You don't need it. Use the official mailing list that is mirrored to Usenet. Main page with subscribe link: https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Python twitter errors:[{message:Could not authenticate you, code:32

2014-08-11 Thread Chris
On 08/08/2014 09:28 AM, Alan Gauld wrote: Example code often uses fictitious security keys. Are you sure these values are genuine values that work if you use them to access twitter directly? Do you mean you used the same keys as in the example? Or have you tested the keys work via some

[Tutor] Fwd: Printing multi-line variables horizontally

2014-08-09 Thread Chris “Kwpolska” Warrick
It looks ilke this WONDERFUL mailing list which does not do something as basic as a sane Reply-to header made me send a response to the OP only. Here it is again: -- Forwarded message -- From: Chris “Kwpolska” Warrick kwpol...@gmail.com Date: Fri, Aug 8, 2014 at 7:36 PM Subject

[Tutor] Python twitter errors:[{message:Could not authenticate you, code:32

2014-08-08 Thread Chris
Dear All, I'm trying to execute the examples from https://github.com/sixohsix/twitter with the current library version installed by pip install (1.14.3). #!/usr/bin/env python # -- coding: utf-8 -- from twitter import * con_secret='DACs' # Consumer Secret

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
to fail when a command exits with a non-zero status. You should always have a shebang line in your shell files, and execute them as ./shellTest.sh (after chmod +x shellTest.sh); moreover, one for Python files is recommended, like this: #!/usr/bin/env python -- Chris “Kwpolska” Warrick http

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
need is: python test.py python second.py However, you need to explicitly stack all the commands you want to execute this way — so, if there are more things, `set -e` might also be of use. (you would need an even uglier tree for `if`s.) -- Chris “Kwpolska” Warrick http://chriswarrick.com/ PGP

  1   2   3   4   5   6   7   8   >