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

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

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 W

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
'hello' :print(a)).grid(row=0, column=0) 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 diff

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
I do this, I had worked 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 is

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Chris Roy-Smith
ons after that. Regards, 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
gn code 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 "/

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

2018-01-28 Thread Chris Roy-Smith
r any 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)  

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

[Tutor] trouble using tkinter CheckButton

2018-01-16 Thread Chris Roy-Smith
broken 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
7;It\'s a beautiful evening.\n') guy_2.speak('Es una tarde hermosa.\n') Person.speak(guy_1) Person.speak(guy_2) i ran the program override.py and get this error message: Traceback (most recent call last): File "scripts/over

Re: [Tutor] problems using a listbox

2017-10-17 Thread Chris Roy-Smith
log.list.insert(END, item) mainloop() Thank you, that works, 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
defined in Line 106? 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/l

[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.''' c

Re: [Tutor] Directory Structure

2017-09-29 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 wrote: > On Fri, Sep 29, 2017 at 07:02:07PM +0200, Chris wrote: > > > Background: Maildirs with

Re: [Tutor] Directory Structure

2017-09-29 Thread Chris
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
s 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
end on tail being available (it’s not on Windows), and there may also be version differences. 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:/

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

2017-09-10 Thread Chris Warrick
ressive 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 maillist - Tutor@

Re: [Tutor] Help

2017-09-06 Thread Chris Warrick
.keys()) 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
started playing. Half > 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

Re: [Tutor] intro book for python

2017-09-01 Thread Chris Warrick
teapress.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://chriswarrick.com/> PGP: 5EAAEA16 _

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

2017-08-11 Thread Chris Warrick
[snip 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 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 that > is *NOT* supplied

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
ns 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. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 __

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 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 old way". > > For me &q

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
cript" vs "console_scripts entry-point"? Simple: `scripts` are legacy. `entry_points` are the new thing. There’s also a third approach: gui_scripts entry_points, which work the same way on Linux/*nix, but on Windows, it means that running your script by opening the created .exe fi

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

2017-08-01 Thread Chris Warrick
e 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
ging (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 wrote: > On 04/16/2017 10:10 AM, Chris Warrick wrote: >> >> On 16 April 2017 at 16:45, Jim wrote: >>> >>> My system python is 2.7.12 so I created a virtual environment using venu >>> to >>> run 3.5.2. I put it in

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

2017-04-16 Thread Chris Warrick
gs? 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://chriswarrick.c

[Tutor] Problem with code interating thri a list

2016-08-02 Thread Chris Clifton via Tutor
ction 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
, May 17, 2016 at 5:01 AM, wrote: > On 17May2016 04:28, Chris Kavanagh 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 item to the dict (car

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

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

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 To: tutor@python.org Subject: [Tutor] Fw

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 wrote: > Hi Chris, > > Thanks for your prompt reply, the problem has been solved! > I was using the 'python' terminal not the 'DOS' terminal. > > I ha

Re: [Tutor] How to run a python script

2016-02-20 Thread Chris Warrick
ail.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:\Python27, because they might conflict wit

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

2016-02-13 Thread Chris Warrick
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 - Tutor@python.org To unsubs

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

2016-01-16 Thread Chris Warrick
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 change subscription options: http

Re: [Tutor] idle??

2016-01-14 Thread Chris Warrick
On 13 January 2016 at 21:49, Mark Lawrence wrote: > On 09/01/2016 10:38, Chris Warrick wrote: >> >> On 8 January 2016 at 20:07, bruce wrote: >>> >>> So, where does IDLE fit into this >> >> >> IDLE is a sad little “IDE”, which is really ugl

Re: [Tutor] idle??

2016-01-09 Thread Chris Warrick
nterpreter, 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
nt() 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

Re: [Tutor] Debugging in Python

2015-11-16 Thread Chris Warrick
thon 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) -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 _

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

Re: [Tutor] command line list arguments

2015-11-07 Thread Chris Warrick
t; seen an example of this on the web). 1. NEVER use eval(). 2. Trying to pass Python code as arguments looks bad. Don’t do that. 3. Your issues with '' are caused by your shell. You would need to wrap your entire thing in quotes first, or use escaping. But instead, 4. Use argpa

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

2015-11-07 Thread Chris Roy-Smith
econd window', command=second) b1.pack() 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
ct 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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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: Date: Sun, 23 Aug 2015 12:40:02 +0200 From: Michael Lange To: tkinter-disc...@python.org Message-Id: <20150823124002.7391f37e21f9b5cfaa917...@

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

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 ask

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) https://wiki.python.org/moin/Tix

[Tutor] filtering listed directories

2015-08-22 Thread Chris Roy-Smith
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

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

2015-07-31 Thread Chris Warrick
_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor Don’t create custom bin/ scripts, use setuptools entry points. I described it on my blog: https://chriswarrick.com/blog/2014/0

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

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

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

2015-07-20 Thread Chris Roy-Smith
orial? 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 pprin

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

[Tutor] dictionary of lists

2015-06-03 Thread Chris Stinemetz
IMEI] += Elapsed_Mins ## this is where the error occurs. Thanks in advance, Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

2015-05-04 Thread Chris Warrick
his line — in that case, you can even drop the if/else and just use the same dictionary assignment for both Pythons. Just be warned that it applies to the entire file and can lead to problems. PS. There is no reason to use """multi-line strings""" in this case, regular "

[Tutor] Python and Django Web Engineering Class

2015-04-13 Thread Chris Calloway
ren't 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 Insti

[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 error:

Re: [Tutor] updating a dictionary

2015-02-20 Thread Chris Stinemetz
On Fri, Feb 20, 2015 at 4:51 PM, Mark Lawrence 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 h

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

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 K

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

Re: [Tutor] Decode and Encode

2015-01-28 Thread Chris Warrick
gt;>> p = "你好".decode('utf-8') >>> p u'\u4f60\u597d' However, this does not apply in Python 3. Python 3 defaults to Unicode strings, so you can do: >>> p = "你好" and have proper Unicode handling, assuming your system locale is set

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Chris Warrick
_ > Tutor maillist - Tutor@python.org > To unsubscribe or change 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 Pyt

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

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
Text = MIMEText('…rest of your HTML here, complete with {time} and {date} tags…'.format(time=t, date=d), 'html') msgAlternative.attach(msgText) -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
x27;html') > msgAlternative.attach(msgText) > > for image in l: > with open(image, 'rb') as fh: > msgImage = MIMEImage(fh.read()) > msgImage.add_header('Content-ID', '<{0}>'.format(image)) > msgRoot.attach(msgI

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

2014-09-28 Thread Chris “Kwpolska” Warrick
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
;) It’s better to let 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 s

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
here; 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

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
ile_contents = infile.read() > > infile.close() > > print(file.contents) > > > > main() > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.or

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

2014-08-28 Thread Chris “Kwpolska” Warrick
t; Just 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 se

Re: [Tutor] time vs. timeit

2014-08-26 Thread Chris “Kwpolska” Warrick
r of times through the loop, defaulting | to one 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: 5EAAE

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-24 Thread Chris “Kwpolska” Warrick
n both OSes (and even in some 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 op

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-23 Thread Chris “Kwpolska” Warrick
opment). I personally recommend you just get a virtual machine running some Linux instead of playing with Windows. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___

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

2014-08-17 Thread Chris “Kwpolska” Warrick
On 18 August 2014 02:45 "ALAN GAULD" 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://chriswarric

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

2014-08-14 Thread Chris “Kwpolska” Warrick
On 14 August 2014 17:48 "= Clayton - Tang =" 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/

Re: [Tutor] re module

2014-08-14 Thread Chris “Kwpolska” Warrick
ilman/listinfo/tutor > Don't use regular expressions for HTML. Use lxml instead. Also, why would you need that exact thing? It's useless. Also, this code is very ugly, with too many s and — worse — s which should not be used at all. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/

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

2014-08-14 Thread Chris “Kwpolska” Warrick
ang.python). Long story short, modern Android phones are using the MTP protocol 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.co

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 s

[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 Date: Fri, Aug 8, 2014 at 7:36 PM Subject: Re: [Tutor

[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" con_secret_key=

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:23 PM, Wolfgang Maier wrote: > On 24.07.2014 14:19, Chris “Kwpolska” Warrick wrote: >> >> >>>>> python test.py >>>>> if [ $? = 0 ]; then >>>>> python second.py >>>>> fi >>&g

  1   2   3   4   5   6   7   8   9   >