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

[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

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
/listbox.py selection is .140537834621024 Thank you for any help Regards, Chris Roy-Smith ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

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

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

2015-11-07 Thread Chris Roy-Smith
Hi, Environment: Python 2.7 Linux (Ubuntu 15.10) I am experiencing a problem with the code below running the "genF" function on opening the second window. I expected that function to be executed on clicking the 'fill text' button. The text widget gets filled on opening the window. This is my f

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
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 listed in the interface making things harder than they need to be for the use

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] Anti-Patterns in Python Programming

2014-07-13 Thread Audrey M Roy
On Fri, Jul 11, 2014 at 10:43 PM, Steven D'Aprano wrote: > On Fri, Jul 11, 2014 at 01:04:59PM -0700, Audrey M Roy wrote: >> Steven, any chance you could clarify how to interpret that section? I'm >> assuming it refers to not importing objects that share state across modul

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-11 Thread Audrey M Roy
Steven, any chance you could clarify how to interpret that section? I'm assuming it refers to not importing objects that share state across modules? Not being passive-aggressive here, just genuinely seek clarification and want to learn to be a smarter Python user. I'm on this list to learn stuff a

[Tutor] Web Harvesting & AJAX/Javascript

2010-11-29 Thread Roy Hinkelman
pen a browser instance, and PAMIE is quite slow, and I expect Selenium to be quite slow as well. How are you navigating around these Javascript based pages? Is there a library or plugin that I am missing? Thanks in advance. -- Roy Hinkelman **Few people are capable of expressing with equan

Re: [Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
27;images/weather/' ) #write to txt file TEST _temp = 'D:\\Inetpub\\AtoZ\\hometown\\include\\weatherFeed_TEMP.txt' temp = open( _temp, 'w' ) temp.write( _thumb ) temp.close() return _thumb city = 'Establish

Re: [Tutor] Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
cript was writing to. Now, exec() and passthru() are both working, as in, passing the argument to python and executing the script. Output Buffer (ob), however, is not. I still need to write to a temp file. Thanks for everyone's help. Roy ___

Re: [Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
#write to txt file TEST _temp = 'D:\\Inetpub\\AtoZ\\hometown\\include\\weatherFeed_TEMP.txt' temp = open( _temp, 'w' ) temp.write( _thumb ) temp.close() return _thumb city = 'Establish' state = '

[Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-22 Thread Roy Hinkelman
#x27;w' ) temp.write( _thumb ) temp.close() #print _thumb [/code] And my PHP: [code] Python Weather Feed for ' . $city . ', ' . $state . ''; ob_start(); $command = "include/weatherFeed.py -c " . $city . "-s " . $state; exec($com

[Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-22 Thread Roy Hinkelman
My script doesn't want to recognize the variables from the exec() command in PHP. Plus, it won't capture the results of the script. This Python script works in IDLE, and I've got some testing code in there. One Known Unsolved Issue: I put Python in C:\Program Files\Python26\python.exe and have tr

Re: [Tutor] Help with Import Error problems

2010-08-01 Thread Roy Khristopher Bayot
Evert, Thank you very much. I do hope it goes on working. :D Roy On Mon, Aug 2, 2010 at 2:09 AM, Evert Rol wrote: > > I got it back working. But it was with some stroke of luck. And I dont > know the explanation. > > > > I installed the latest source of GEOS (as suggeste

Re: [Tutor] Help with Import Error problems

2010-08-01 Thread Roy Khristopher Bayot
shared object file: No such file or directory I uninstalled the thing. And then tried the script again and it worked. :| I answered some of your questions below. Again, thanks. Roy On Sun, Aug 1, 2010 at 10:39 PM, Evert Rol wrote: > > Hi. Good day. > > > > I am having an import e

[Tutor] Help with Import Error problems

2010-08-01 Thread Roy Khristopher Bayot
nstalled something that "broke" it but I dont know how to trace it back. Could I ask for some pointers on how to fix this? Thank you. Roy P.S. I dont know if this is the right list to post this. If it isnt, I'm sorry for the inconvenience. Kindly direct me to the right one. ___

[Tutor] Scraping gov site: site looking for Flash player

2010-04-05 Thread Roy Hinkelman
Interesting. I am using urllib2 to open some government pages, and they have some js checking for Flash on my computer. Is there a way to show them that I have flash? Or possibly another solution? My code: user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = {'User-Agent' : us

Re: [Tutor] File renaming using os.rename problem (spir)

2009-12-08 Thread Roy Hinkelman
I got it. Switched to shutil and made to paths complete paths. The added benefit is that it didn't trash the original file. shutil.copy2(_files_to_mod + "\\" + fname, _files_to_mod + "\\" + new_name) Thanks. -- Forwarded message -- From: Roy Hinkelman

Re: [Tutor] File renaming using os.rename problem (spir)

2009-12-08 Thread Roy Hinkelman
Why don't you simply print out fname? This should point you to the error. Denis I did here: > if fname == old_name: > print fname # test and it looks correct. On an WinXP, should I use shutil instead? Roy ___ Tut

[Tutor] File renaming using os.rename problem

2009-12-08 Thread Roy Hinkelman
I can't find anything on this error I am getting when renaming some files. I'm pulling info from a csv file and parsing it to build new file names. Any pointers appreciated Roy My code: # RENAME FILES using META file - new name = [place]_[state]_[sku].tif import re, os, csv

Re: [Tutor] Can't loop thru file and don't see the problem

2009-12-03 Thread Roy Hinkelman
t depend on the file format? I will eventually be working with Excel and possibly mssql tables. Thanks again for your help. Roy On Thu, Dec 3, 2009 at 3:46 AM, Christian Witts wrote: > Roy Hinkelman wrote: > >> >> Your list is great. I've been lurking for the past t

[Tutor] Can't loop thru file and don't see the problem

2009-12-03 Thread Roy Hinkelman
nt me in the right direction, I'd appreciate it. I would also like to know the difference between open() and csv.reader(). I had similar issues with csv.reader() when opening these files. Any help greatly appreciated. Roy Code: Select all # DOWNLOAD USGS MISSING FILES import

Re: [Tutor] Inspiration/examples

2009-03-23 Thread H.G. le Roy
2009/3/22 Mathias Andersson > Im currently trying to learn how to use python. But my only problem seems to > be at what to make? So anyone have a nifty list or some ideas on things to > program, school tasks or algorithms to try and implement. Beginner- to > mid-skill level. Thanks in advance.

[Tutor] improving the speed of prime number code

2009-02-06 Thread H.G. le Roy
Hi, I'm stuck with Problem 10 ( http://projecteuler.net/index.php?section=problems&id=10) :-) A part of my code deals with the calculation of prime numbers. However it is really slow. Hopefully you have some ideas how to make it faster. pz = [2] # only iterate over odd numbers for i in xrange(3,

[Tutor] transforming an integer to a list of integers

2009-02-03 Thread H.G. le Roy
Hi, recently I learned about Project Euler (http://projecteuler.net/) and now I'm trying to work me through. At the moment I'm thinking about http://projecteuler.net/index.php?section=problems&id=8 One step for my solution should be transforming this big integer to a list of integers. I did: imp

Re: [Tutor] Need help with using methods in a base class

2008-09-08 Thread Roy Khristopher Bayot
Thank you very much. On Mon, Sep 8, 2008 at 2:35 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Sun, Sep 7, 2008 at 11:07 AM, Roy Khristopher Bayot > <[EMAIL PROTECTED]> wrote: > > Hi. I added self to parts of the code. But after making an instance and >

Re: [Tutor] Need help with using methods in a base class

2008-09-07 Thread Roy Khristopher Bayot
self, x) ... Parallel.setAutoFeed(self, y) ... Parallel.setInitOut(self, z) ... def generateClockPulse(self): ... Parallel.setSelect(self,0) ... Parallel.setSelect(self,1) ... >>> a = LightsHandle() >>> a.setData(0xF0) >>> a.se

[Tutor] Need help with using methods in a base class

2008-09-06 Thread Roy Khristopher Bayot
Hi. I am having some difficulty using methods from a base class. I have 2 classes. The first one is Parallel which is inside the module parallel. The methods useful to me from this class are setDataStrobe(), setAutoFeed(), setInitOut(), setSelect(), and setData(). The second one is derived from t

Re: [Tutor] how do you make this a better code?

2008-09-06 Thread Roy Khristopher Bayot
Hi. I tried it. It worked. Thank you. On Fri, Sep 5, 2008 at 9:42 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 9:00 PM, Roy Khristopher Bayot > <[EMAIL PROTECTED]> wrote: > > > class CamHandle(object): > > def __init__(self): &g

[Tutor] how do you make this a better code?

2008-09-04 Thread Roy Khristopher Bayot
Hi. Good day. I am new to Python but I have had experience with C/C++ and Matlab. I've been reading How to Think Like a Computer Scientist and skimmed Core Python to learn. Now I havent done the exercises because I wanted to get down to the project I'm doing in my spare time. The project involves t

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread Roy Chen
I go with wxPython for now. Best regards, Roy On Jan 3, 2008 2:58 AM, johnf <[EMAIL PROTECTED]> wrote: > On Wednesday 02 January 2008 09:41:46 am Alan Gauld wrote: > > > I tried to fined a decent GUI builder for wxPython but failed. > > There are two or three available b

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread Roy Chen
Thanks, that certainly looks interesting and I'll give it a try. Perhaps it's a little too much work for what I have in mind, but definitely something useful to learn in the long run. Best regards, Roy On Jan 2, 2008 11:56 PM, Michael Langford <[EMAIL PROTECTED]> wrote: > Wh

[Tutor] Choice of GUI builders

2008-01-02 Thread Roy Chen
ly) GUI builder. I'm leaning towards wxPython so far (it's had a recent release just a month or so ago), but if anyone has any suggestions, that'd be great. Thanks in advance, Roy Chen ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] PythonCard error checking

2007-12-24 Thread Roy Chen
Hello everyone, I've just started trying PythonCard to build a simple GUI for a little application I'm writing. Just wondering if anyone knows the "proper" way to do some simple error checking: for example, I have a textField, and I wish to check that only integers within a certain range are enter

[Tutor] Obtaining image date of creation

2007-11-14 Thread Roy Chen
, Roy Chen ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Question about default values for arguments

2007-10-11 Thread Roy Chen
Hi everyone, been looking at the following functions, but can't figure out how they work. def f(a, L=[]): L.append(a) return L def g(a, L=None): if L == None: L = [] L.append(a) return L print f(1) print f(2) print f(3) print g(1) print g

[Tutor] Location of modules in Mac OS X

2007-10-01 Thread Roy Chen
Hello all, I'm using MacPython 2.5 on OS X 10.4. I was just wondering if all the Python modules are contained in this directory: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ Also, I've installed the Python Image Library (PIL), and it seems to be installed in this folder:

Re: [Tutor] Is there any logic in this?

2007-09-01 Thread Righard/Riku van Roy
> model of a variable name representing an area in > memory where assignment copies data to a new area > in memory with the other variable name will get caught > on this until they catch on. > > I'll be very grateful for any criticism of the above. > > > > O

[Tutor] Is there any logic in this?

2007-09-01 Thread Righard/Riku van Roy
If you copy a list into another variable, and then change the second one, the first gets changed aswell, for example: >>> a = [10, 40, 30, 20] >>> b = a >>> b.sort() >>> a [10, 20, 30, 40] >>> b [10, 20, 30, 40] or: >>> a = [10, 40, 30, 20] >>> b = a >>> b[0] = 99 >>> a [99, 40, 30, 20] >>> b [

Re: [Tutor] date matching with python and sqlite3

2007-09-01 Thread Righard/Riku van Roy
I sorry, maybe I am stupid at the moment but I cannot follow your question, 1) User can select a date, or a range of dates. 2) At the moment you are only able to let the user select a date that has entered the database today. 3) A value from a table called duratation will be returned for the

Re: [Tutor] connect to a remote machine - Linux

2006-06-11 Thread Roy Mac
Try looking at PyDO - This provides an interface between Python and your database. This allows you to change your database at a later time and not have to change any Python. The excerpt below is from: http://skunkweb.sourceforge.net/PyDO2/api/html/public/pydo-module.html PyDO (Python Data Object

Re: [Tutor] Converting a List/Tuple to delimited string

2005-11-14 Thread Roy Bleasdale
s is the string providing this method. "   Fortunately my new Python instinct suggested what I was doing was not quite right, and thank you for correcting my misunderstanding. This Tutor service is an invaluable help for us lonely new to Python programmers. Thanks, Roy PS Despite this glitch I

[Tutor] Converting a List/Tuple to delimited string

2005-11-13 Thread Roy Bleasdale
I have a list of strings and wanted to output them as a single delimited string. Eg ('ab','cd','ef') becomes "ab:cd:ef" My first attempt was to do it as a function: def Addsomething(a): y = [] for x in a: y.append( x + ':') return "".join(y) I then conv

[Tutor] Problem appending to a list using a property within a class

2005-11-08 Thread Roy Bleasdale
I have created a List within a class. If I try and append to the list using the set function using the property value my variable stops being a list. Can anyone explain why the set function called by the class property does not append to the list? Here is some sample code: class ShoppingBag:

[Tutor] Exit from program early

2005-11-03 Thread Roy Bleasdale
Hi In the example below I would like the program to stop if I forgot to provide an argument . Though I could do all my processing indented under the else statement, I was wondering if there was a command that would allow me to halt the program execution early. Regards, Roy # Example

[Tutor] question regarding python exception handling

2005-01-29 Thread Roy
tion order might be ambiguous. I don't understand the reason why except and finally clauses cannot be together. I know they can be together in java. how does it cause ambiguous execution order? An example may help me understand. Thank you very much! -- Roy **May I open-s