Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Bill Campbell
return str(f.read().strip())* This command should get the gateway IP. Linux: cmd = "ip route list | awk '/^default/{print $3}'" or perhaps Linux: cmd = "netstat -rn | awk '/^0.0.0.0/{print $2}'" OSX: cmd = "netstat -rn | awk '/^default/{print $2}&#x

[Tutor] tar a directory

2016-11-03 Thread Bill Nolf
python version 2.6.6 I'm trying to tar/gzip a directory, the directory is defined as an variable I want to tar and gzip the directory archive in the example below: import tarfile dirarchive = /a/b/c/archive Test 1 tar.add(dirarchive) Error: name 'tar' not defined Test 2 tarfile.add(dirarch

[Tutor] compress directory

2016-11-03 Thread Bill Nolf
How do I compress (gzip and/or tar) a directory in python? I found examples of compressing a file using gzip or tar but not a directory. thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.o

Re: [Tutor] python smtplib 'Message denied - From address spoofing attempt detected via SMTP

2016-03-25 Thread Bill Campbell
ting that it thinks the 'From:' address, is bogus. There's no MX record for jss.hs.org, and no IP address for jss.hs.org either. The From: address should be legitimate and deliverable. It might also accept a legitimate 'Reply-To:' address. Bill -- INTERNET: b...@cele

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

2015-08-15 Thread Bill Allen
> > > On Sat, Aug 15, 2015 Bill Allen wrote: > > Yes, I see. I will start working on reorganizing the code with that in > mind. One other thing that I have found that is quite interesting is that > with my current code the use of after() works as expect with the message to

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

2015-08-15 Thread Bill Allen
On Sat, Aug 15, 2015 at 2:21 AM, Alan Gauld wrote: That works for getting the message printed but it still leaves > > the problem that your UI locks up during the long process. > If its only for a couple of seconds it might be a mild hiccup > but if your processing took, say 5s or longer, the user

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

2015-08-14 Thread Bill Allen
y case, as simple as this: def processing(*args): #my initial button click calls this ''' display messages in the information message_frame while the data is processed ''' info.set('PROCESSING, PLEASE WAIT...') #the label message I was wanting

[Tutor] cannot get a label message to display immediately

2015-08-14 Thread Bill Allen
y to go on this. Thanks, --Bill Allen ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] lists, name semantics

2015-04-18 Thread Bill Allen
On Apr 18, 2015 4:11 PM, "boB Stepp" wrote: > > On Sat, Apr 18, 2015 at 3:28 PM, Bill Allen wrote: > > On Apr 18, 2015 7:50 AM, "Peter Otten" <__pete...@web.de> wrote: > > > >> Bill Allen wrote: > >> > >> > Everyone tha

Re: [Tutor] lists, name semantics

2015-04-18 Thread Bill Allen
print(b) will print the original copy of a which b now references which is [1, ["x", "y"], 3] On Apr 18, 2015 7:50 AM, "Peter Otten" <__pete...@web.de> wrote: > Bill Allen wrote: > > > Everyone that responded, > > > > Thanks very much fo

Re: [Tutor] lists, name semantics

2015-04-18 Thread Bill Allen
Everyone that responded, Thanks very much for the excellent explanations! The distinction between a reference to an object and a seperate copy of the object is quite clear now. --Bill On Apr 18, 2015 1:44 AM, "Alan Gauld" wrote: > On 18/04/15 04:16, Bill Allen wrote: > >

[Tutor] lists, name semantics

2015-04-17 Thread Bill Allen
If I have a list defined as my_list = ['a','b','c'], what is the is differnce between refering to it as my_list or my_list[:]? These seem equivalent to me. Is that the case? Is there any nuance I am missing here? Situations where one form should be used as oppos

[Tutor] cx_Oracle and Pyinstaller

2014-12-10 Thread Bill Allen
Configuration File = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = <1521>)) ) (CONNECT_DATA = (SERVICE_NAME = ) ) ) -- --Bill Allen ___ Tutor maillist - Tutor@python.org To unsu

[Tutor] Python GPIO Code Help Needed

2014-10-26 Thread Bill Bright
Thanks to all for the help. The code below seems to work. My question is why does oldstates need to be multiplied by 32? Does this means the code will only read 32 switch changes? That would be a problem. Code: #!/usr/bin/env python from time import sleep import os import RPi.GPIO as GPIO GPIO

Re: [Tutor] Python GPIO Code Help Needed

2014-10-26 Thread Bill Bright
Thanks to everyone for the help. The code below seems to work. My question is why does oldstates need to multiplied by 32? Does this mean that the code will only work for 32 switches before I have to reset the Pi? Code: #!/usr/bin/env python from time import sleep import os import RPi.GPIO as G

[Tutor] Python GPIO Code Help Needed

2014-10-26 Thread Bill Bright
I have been working on a piece of code that I got from another tutorial. The code polls the GPIO pins on a Raspberry Pi. When it detects a switch being flipped, it plays a corresponding audio file. My problem is, if the switch remains flipped, the audio repeats again and again. What I would like

Re: [Tutor] Using Python and Regex

2014-08-11 Thread Bill
Thanks for yoru reply. This was my first attempt,when running through idleid get the following error:- Traceback (most recent call last): File "C:\Users\Bill\Desktop\TXT_Output\email_extraction_script.py", line 27, in traverse_dirs(working_dir) File "C:\Users\Bill\Des

[Tutor] Using Python and Regex

2014-08-10 Thread Bill
o got as far as creating a CSV using python but, being new to this, I'm looking for some pointers on how to traverse through the folder and open each file in turn to check the content for matches using Regex. Any advice would be gratefully rece

Re: [Tutor] imaplib and mutt flags

2014-01-30 Thread Bill Campbell
On Thu, Jan 30, 2014, Alan Gauld wrote: > On 30/01/14 02:45, Bill Campbell wrote: >> I'm writing a python script which uses imaplib > > We don't get many messages about imaplib so I'm > not sure how many folks here know about it. I've used it off and on for

[Tutor] imaplib and mutt flags

2014-01-29 Thread Bill Campbell
7;N' which is uses for new messages. I would like to have the script restore the 'N' status flag that mutt uses instead of 'O'. The mail server is using courier-imap with Maildir stores on CentOS Linux. Mutt access is direct on the file system, not via IMAP. Bill -- INTER

Re: [Tutor] keyboard interrupt

2013-10-17 Thread Bill
I know, way late to the party... Did you try Ctrl-Break? In Windows that is usually how you interrupt a program... ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Processing Linux command line output

2013-04-24 Thread Bill Campbell
ses os.popen import os fh = os.popen('ifconfig') for line in fh: # scan line here The more modern way to handle this is using the subprocess module with something like: from subprocess import PIPE, Popen fh = Popen('ifconfig', stdout=PIPE).stdout ... Bill -- INTER

Re: [Tutor] simon says

2012-09-10 Thread William R. Wing (Bill Wing)
eded in matching the longest sequence was the winner of that round. I'll bet ebay still has them for sale, and Google would get you a description that would be better than mine. -Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] running more than one python program at the same time

2012-09-03 Thread William R. Wing (Bill Wing)
t;Yes Master?" in the terminal window and then sit there waiting for you to type something terminated by a key. For future reference, what you've typed goes into the variable junk. This is a dead easy way to get interactive data into ANY future python script you write. -Bill PS

Re: [Tutor] Running a script in the background (this time Cc'd to the list)

2012-09-02 Thread William R. Wing (Bill Wing)
On Sep 2, 2012, at 6:15 PM, Alan Gauld wrote: > On 02/09/12 21:30, William R. Wing (Bill Wing) wrote: > >> My suggestion would be to take the script and run it through py2app, >> which will turn it into a stand-alone application which can then >> be added to your

Re: [Tutor] Running a script in the background

2012-09-02 Thread William R. Wing (Bill Wing)
a minimal application tends to run close to 9-10 Mbytes, but > if it spends most of its time sleeping, it will use very little in the way of > system resources. > > Good luck, > Bill > > Thanks, Bill. That is definitely more of what I am looking for and actually > f

Re: [Tutor] Running a script in the background

2012-09-02 Thread William R. Wing (Bill Wing)
ay of system resources. If you want it to run even when you aren't logged in, you will have to go to a bit more trouble. You will have to make up an installer plist file and use launchctl to add it to the list of stuff under control of the launchd daemon. Good luck, Bill

Re: [Tutor] Tutor Digest, Vol 102, Issue 98

2012-08-31 Thread William R. Wing (Bill Wing)
On Aug 31, 2012, at 4:31 AM, Mark Lawrence wrote: > On 31/08/2012 04:27, William R. Wing (Bill Wing) wrote: >> >> How about - >> >>>>> for item in iter(list): >>>>> ….print item > > Overengineering? :) A list is an iterator. > Ri

Re: [Tutor] Tutor Digest, Vol 102, Issue 98

2012-08-30 Thread William R. Wing (Bill Wing)
: >> >> <6962c976ae76ac4298cbf6fd6d0c63561f37c...@bl2prd0710mb363.namprd07.prod.outlook.com> >> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Does anyone know how to print a list in a form of a column instead of a row? > How about

Re: [Tutor] running more than one python program at the same time

2012-08-29 Thread William R. Wing (Bill Wing)
to some particular event (like mounting a disk) or at a particular time of day, you can create a launchd plist file and use launchctl to create an entry in the launchd daemon list. (This is a very much more complex subject than this one-liner might imply, and needs to be taken up on a diff

Re: [Tutor] What are all those letters after terminal commands?

2012-08-23 Thread William R. Wing (Bill Wing)
ibly edit it. Finally, there are at least a few things that can be done most expeditiously, even in python, by spawning a python subtask and running a UNIX command there. I agree that she may never need to do shell programming (OS-X uses bash), but knowing the basics WILL be needed. -Bill >

Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-10 Thread William R. Wing (Bill Wing)
finitely does work on Mac OS-X as well. -Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread William R. Wing (Bill Wing)
ent device (one that has just been scrubbed and reformatted), then copy them back and get different results with your application, you've found your problem. -Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-18 Thread William R. Wing (Bill Wing)
iated. > > Thanks [Data and program snipped] With apologies - I'm a Mac/UNIX user, not Windows, but those numbers (4GB and 64M lines) look suspiciously close to the file and record pointer limits to a 32-bit file system. Are you sure you aren't bumping into wrap around issues of

[Tutor] Newbe problem with wxPython on Mac OS X (need a work-around)

2012-06-05 Thread William R. Wing (Bill Wing)
so I assume there must be a work around for this until Adobe gets 64 bit support compiled in. Does anyone know what it might be? Thanks, Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] question on self

2012-03-13 Thread Bill Allen
This little thread on the usage of self references when calling class instance methods and attributes was excellent, one of the best I have seen. Thanks, Bill Allen Sent from my iPhone On Mar 12, 2012, at 3:56, Alan Gauld wrote: > On 12/03/12 02:02, Michael Lewis wrote: > >> I

[Tutor] list comprehension efficiency

2012-02-18 Thread Bill Allen
Generally speaking, are list comprehensions more efficient that the equivalent for loop with interior conditionals for a given task? Do they compile down to the same Python byte code? Thanks, Bill Allen ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Setting Up Emacs

2011-10-30 Thread Bill Allen
hon for Windows and is easily available for Python on Linux. It will do most of what you really, really need. --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [python-win32] Good Book

2011-07-25 Thread Bill Allen
gn, two editions of this book for Python and Java: http://homepage.mac.com/s_lott/books/oodesign.html#book-oodesign --Bill Allen ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alternate credentials

2011-05-04 Thread Bill Allen
you have given me a good place to start on this and I really appreciate the help. --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alternate credentials

2011-05-03 Thread Bill Allen
I am running on MS Windows XP & Server 2003. Sent from my iPhone On May 3, 2011, at 12:02, Tim Golden wrote: > On 03/05/2011 5:35 PM, Bill Allen wrote: >> I am needing to run a Python networked application with a specific >> set of credentials, Windows AD, rather than the

[Tutor] Alternate credentials

2011-05-03 Thread Bill Allen
I am needing to run a Python networked application with a specific set of credentials, Windows AD, rather than the user's own so that the app can access the needed CIFS shares. Where should I start? --Bill Sent from my iPhone ___ Tutor mai

[Tutor] distutils site.cfg variable expansion

2011-04-28 Thread Bill Campbell
install-scripts=%(prefix)s/sbin Better yet would be for the prefix to be available from the command line or taken from sys.prefix if not specified. Is there a way to do this other than fiddling the site.cfg file? Bill -- INTERNET: b...@celestial.com Bill Campbell; Celestial Softwar

Re: [Tutor] os.rename vs. shutil.move

2011-04-16 Thread Bill Allen
Ok, thanks. --Bill On Sat, Apr 16, 2011 at 18:15, Steven D'Aprano wrote: > Bill Allen wrote: > >> What are the particular advantages or disadvantages concerning using >> either >> os.rename or shutil.move to rename a file. I have tried both and for >> s

[Tutor] os.rename vs. shutil.move

2011-04-16 Thread Bill Allen
What are the particular advantages or disadvantages concerning using either os.rename or shutil.move to rename a file. I have tried both and for simple renaming they seem equivalent. Thanks, Bill Allen ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Python on TV

2011-04-14 Thread Bill Allen
access. > > Seriously, I was only joking!:-) --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to develop a python exe file in windows using python3.1

2011-04-14 Thread Bill Allen
lone or if installing the interpreter is more appropriate. I have found that not every program is best served by being converted to stand-alone. http://cx-freeze.sourceforge.net/ Good Luck, Bill Allen ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Python on TV

2011-04-14 Thread Bill Allen
Same here. I did not realize I was living in an internet censored country here in Texas! On Mon, Apr 11, 2011 at 16:04, bob gailer wrote: > On 4/11/2011 4:20 PM, Alan Gauld wrote: > >> I've just watched the Channel 5 programme "The Gadget Show" >> where the presenters set a new Guinness worl

Re: [Tutor] Linux library for getch() and kbhit()?

2011-03-17 Thread Bill Allen
Alan, Ah ha, ungetch(), that is what I was needing. I had be trying to simulate kbhit() with getch() and keep being left with unhandled data in the buffer. I had resorted to a trash=raw_input() to clear it. Many thanks, Bill On Thu, Mar 17, 2011 at 04:01, Alan Gauld wrote: > >

[Tutor] Linux library for getch() and kbhit()?

2011-03-16 Thread Bill Allen
library. Being able to do a non-blocking character get or simply check for a keyboard hit is so useful, so many times, that I wonder about there not being something like the msvcrt library for Linux. I am hoping there is and I have just missed it somewhere. --Bill

Re: [Tutor] Resources

2011-03-12 Thread Bill Allen
These are quite good, The Building Skills Books, these are online. http://homepage.mac.com/s_lott/books/index.html Tarleton Area Amateur Radio Club On Fri, Mar 11, 2011 at 20:19, s s

Re: [Tutor] numpy import failure

2011-02-27 Thread Bill Allen
However, how and which numpy package to install depends on the answers to the questions that Alan posed. --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python module to search a website

2011-02-26 Thread Bill Allen
a from the page into a variable and then parse through it looking for urls mylines = urllib.urlopen(mypath).readlines() for item in mylines: if "http://"; in item: ...do something with the url that was found in the page html... ...etc... --Bill ___

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Bill Allen
library resources for that for Python, so I think I am on my way. It is just a matter of finding the right win32 api calls to do what I am wanting to do. Thanks again everyone, this was a great help to me. -Bill On Wed, Feb 23, 2011 at 21:53, Bill Allen wrote: > > I know that I c

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
it to the value C:\UGII --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
am trying to explore the possibility of managing these from a system I am using in a platform independent way and figure that I ought to be able to do this with Python. Perhaps there are third party Python modules I need to help accomplish this? --Bill ___

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
I apologize for not have been clear previously. What I am trying to access are the Windows system environment variables. The same ones that are listed out if you type the set command at a command prompt in Windows. --Bill On Fri, Feb 25, 2011 at 03:11, Alan Gauld wrote: > >

Re: [Tutor] accessing another system's environment

2011-02-24 Thread Bill Allen
workstation (which is joined to the domain, etc.). I cannot find a native facility to duplicate the computer management functions, so I thought I would write a program to fill the need. Not to mention, I thought it might be a good learning opportunity. --Bill On Thu, Feb 24, 2011 at 03:00

[Tutor] accessing another system's environment

2011-02-23 Thread Bill Allen
I know that I can use the following to get a listing of the environment of my own system. How can I do similar for another system on my network. This is for administrative purposes. >>> import os >>> for param in os.environ.keys(): print(param, os.envir

Re: [Tutor] creating classes while coding

2011-02-20 Thread Bill Allen
On Sun, Feb 20, 2011 at 19:59, Alan Gauld wrote: > > "Bill Allen" wrote > > > However, I do wonder a bit about the practice I have seen of some >> Python programmers to implement relatively short bits of code, that would >> be >> quite simple using

Re: [Tutor] creating classes while coding

2011-02-20 Thread Bill Allen
That raises my next question. Under what sort of programming circumstances does it make sense? --Bill On Sun, Feb 20, 2011 at 19:01, R. Alan Monroe wrote: > > I'll freely admit that I do not come from an OOP programming > > background, so designing classes is not my f

[Tutor] creating classes while coding

2011-02-20 Thread Bill Allen
is it necessary? When is it best practice? I'll freely admit that I do not come from an OOP programming background, so designing classes is not my first impulse when writing code. Am I missing something? --Bill ___ Tutor maillist - Tutor@python.o

Re: [Tutor] remote code execution

2011-02-15 Thread Bill Allen
running would both be right on your desktop at that point. --Bill On Tue, Feb 15, 2011 at 12:50, S de Haan wrote: > Hi guys, > > I was wondering if there is a IDE or another environment that allows me to > execute python code from my desktop computer on remote servers within my L

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Bill Allen
As a followup, I have done some more searching and found some terrific information on this subject of Python printing on the Windows platform. The following link shows variations using some modules from the pywin32 package. http://timgolden.me.uk/python/win32_how_do_i/print.html --Bill

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Bill Allen
Ken, Thanks for the great info on doing this on a Linux platform. I am sure I will be trying this with Linux sometime and I'll refer back to this. --Bill On Sat, Feb 12, 2011 at 18:33, Ken G. wrote: > On 02/12/2011 10:14 AM, Bill Allen wrote: > >> >>

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Bill Allen
Allan, Ok, that encourages me to try it both ways and see which works out better. Thanks, --Bill On Sat, Feb 12, 2011 at 15:34, ALAN GAULD wrote: > > to print some plain text to a dot matrix printer that the printer can > handle > > with its own internal fonts witho

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Bill Allen
metallic parts. I am guessing there may be a 3rd party module that allows for what I am doing, but have not yet identified it. As always, I am very open to any suggestions and appreciative of the help. --Bill On Sat, Feb 12, 2011 at 13:06, Alan Gauld wrote: > > "Bill Allen" wr

[Tutor] Python printing to LPT

2011-02-12 Thread Bill Allen
Is is possible to print directly to an LPT port printer from Python? --Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python packaging systems

2011-02-10 Thread Bill Allen
distribution folder cx_freeze creates. The error messages produced from the code when run with missing files are mostly sufficient to work out what files are missing. Good information everyone. Thanks very much. --Bill On Thu, Feb 10, 2011 at 12:21, ALAN GAULD wrote: > Yes, but a g

[Tutor] python packaging systems

2011-02-09 Thread Bill Allen
I have found there are a few systems available to package Python programs as standalone programs for distribution. Do the folks here have any recommendation or comment on any of these? Thanks, --Bill ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] best practice: throw exception or set a flag?

2011-02-04 Thread Bill Felton
not a language level feature, it becomes a convention that one can only rely on in ones own code. regards, Bill On Feb 4, 2011, at 11:56 AM, Alex Hall wrote: > On 2/4/11, Bill Felton wrote: >> Um, yes, emphatically yes. You missed the context, which was Smalltalk, and >> it is te

Re: [Tutor] best practice: throw exception or set a flag?

2011-02-04 Thread Bill Felton
Um, yes, emphatically yes. You missed the context, which was Smalltalk, and it is terms of Smalltalk that my reply is couched. Yes, Python returns None. Smalltalk returns self by default. Given the dropped context, you are correct. Given the context meant, I am. regards, Bill On Feb 4, 2011

Re: [Tutor] best practice: throw exception or set a flag?

2011-02-04 Thread Bill Felton
me other object. However, it can be a source of error, as many methods which modify return self, but many common collection protocols return the argument rather than the modified collection. Just one of those things you need to learn, which all languages have ;-) cheers, Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Changing Python icon - 2.6 and 3.2

2011-02-03 Thread Bill Felton
ndows. regards, Bill On Feb 3, 2011, at 12:18 PM, Patty wrote: > Hello Folks - I have Python 2.6.6 on my Windows 7 system and installed Python > 3.2. Now I want to be able to differentiate between the versions and the > icon for each version of Python is the same. I figured I would cha

[Tutor] byte array conversion question

2011-02-02 Thread Bill Allen
I have found that there are a couple of ways to convert a byte array to a string in Python. Is there any advantage or disadvantage to either method? my_bytes = b'this is a test' str(my_bytes,'utf-8') yields 'this is a test' my_bytes.decode('utf-8&#x

Re: [Tutor] ideas for a simple program

2011-01-25 Thread Bill Allen
For a simple programming project that probably has just enough complexity to be interesting, google for Conway's Game of Life. You'll find an algorithm to use. --Bill On Tue, Jan 25, 2011 at 11:25, walter weston wrote: > > can I have some good ideas for simple programs

Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Bill Allen
That's exactly right! Never heard it called that before, but that is basically what happened. I appreciate the help. --Bill On Tue, Jan 25, 2011 at 06:38, Wayne Werner wrote: > On Tue, Jan 25, 2011 at 1:42 AM, Alan Gauld wrote: > >> >> "Bill Allen"

Re: [Tutor] Not understanding a bit of code behavior

2011-01-25 Thread Bill Allen
Steven, Thanks! That is quite helpful to know the nuts and bolts of how that works. --Bill On Tue, Jan 25, 2011 at 07:45, Steven D'Aprano wrote: > Bill Allen wrote: > >> Ok, I have definately verified this to myself. The following works >> perfectly and is a litt

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
part=>\']"') BOM_List.append(xstring) for bom_item in BOM_List: if bom_item not in part_list: part_list.append(bom_item) pass_num += 1 return(part_list) On Tue, Jan 25, 2011 at 00:05, Bill Allen wrote:

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
, if that is true, then it has worked out well for me, giving me a feedback loop through the data. However, I can see that it could also be a pitfall if this behavior is not clearly understood. Am I right? Am I way off base? Either way, I could use some elaboration about it. --Bill On Mon

[Tutor] Not understanding a bit of code behavior

2011-01-24 Thread Bill Allen
This is a bit embarrassing, but I have crafted a bit of code that does EXACTLY what I what, but I am now a bit baffled as to precisely why. I have written a function to do a bit of webscraping by following links for a project at work. If I leave the code as is, it behaves like it is recursively p

Re: [Tutor] not understanding a recursion example

2011-01-21 Thread Bill Allen
Peter, Thank you very much for the explanation. I understand this much better now. You are correct, the implementation you show is easier for me to understand. --Bill On Fri, Jan 21, 2011 at 03:43, Peter Otten <__pete...@web.de> wrote: > Bill Allen wrote: >

[Tutor] not understanding a recursion example

2011-01-20 Thread Bill Allen
orking and the principles? I would like understand recursive calls in Python better as I have not used the technique previously. Thanks, Bill data = {'count': 2, 'text': '1', 'kids': [{'count': 3,

Re: [Tutor] Writing Python Script to read battery level

2011-01-17 Thread Bill Allen
Tim, Thanks for posting this. I have several uses for this WMI module at my work. --Bill On Mon, Jan 17, 2011 at 04:07, Tim Golden wrote: > On 17/01/2011 03:01, FT wrote: > >> Is there a way to read the battery level using Python? >> >> I am totally blind and w

[Tutor] end parameter in 2.7.1?

2011-01-15 Thread Bill DeBroglie
Twice in two days...! Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which is using Python 3.1. The author uses the end parameter in numerous programs but this doesn't seem to translate to 2.7. Any advice as to how I can specify the final string of the print function? Than

Re: [Tutor] color of "print" function

2011-01-14 Thread Bill DeBroglie
On Jan 14, 2011, at 8:03 PM, bob gailer wrote: On 1/14/2011 7:48 PM, Bill DeBroglie wrote: Hello all, I don't have a problem per se, but have noticed something that I'd like to figure out... Sometimes the "print" function appears orange for me, sometimes it appe

[Tutor] color of "print" function

2011-01-14 Thread Bill DeBroglie
Hello all, I don't have a problem per se, but have noticed something that I'd like to figure out... Sometimes the "print" function appears orange for me, sometimes it appears purple. Why does this happen and what's the difference anyway? This seems to be the only function that varies like

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-14 Thread Bill Allen
; or "license" for more information. >>> print("hello world") hello world >>> x = input("how many?") how many?5 >>> x 5 >>> On Thu, Jan 13, 2011 at 9:31 PM, Corey Richardson wrote: > On 01/13/2011 10:29 PM, Bill Allen wrote: >

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
Vern, Quite right! I see what you mean. I quite inadvertently stumbled into examples that would work without realizing it. I typically program in Python 3, so not as familiar with the limitations on Python 2x. I've had quite a chuckle over this! Thanks, Bill On Thu, Jan 13, 2011

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
; or "license" for more information. >>> print("hello world") hello world >>> x = input("how many?") how many?5 >>> x 5 On Thu, Jan 13, 2011 at 9:31 PM, Corey Richardson wrote: > On 01/13/2011 10:29 PM, Bill Allen wrote: > > That is

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
. I would have expected the same for 2.7.1. --Bill On Thu, Jan 13, 2011 at 7:55 PM, Corey Richardson wrote: > On 01/13/2011 08:50 PM, Elwin Estle wrote: > > I am going through the book mentioned in the subject line, and I have > found a couple of things that don't seem to work t

Re: [Tutor] Sorting a List

2011-01-12 Thread Bill Allen
for file in dir_list: count = count + 1 if count < 5: pass else: basename = os.path.basename(file) if basename.endswith('.png'): file_list = file_list + basename+'\n' os.remove("/localhost/html/pics/"+dir_li

Re: [Tutor] Sorting a List

2011-01-12 Thread Bill Campbell
sions. import re _digits = re.compile(r'(\d+)') def ver(s): r = _digits.split(s) r[1::2] = map(lambda x: int(x), r[1::2]) return(tuple(r)) class FileInfo(object): def __init__(self, fname) self.fname = fname self.cmp = ver(fname) def __cmp__(s

Re: [Tutor] variabel from raw input into re.search?

2011-01-07 Thread Bill Felton
tring you want. (Again, you test this expression before use to verify that it does what you want, just assign a string variable to 'name' before testing.) regards, Bill ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Writing to the terminal?

2010-12-14 Thread Bill Allen
Still looking on this one, but I will be sure to post back to the list if I find anything. Thanks, Bill Allen On Tue, Dec 14, 2010 at 5:23 AM, Steven D'Aprano wrote: > Bill Allen wrote: > >> Anyone know how to get WConio.putch() to properly put out a box drawing >> cha

Re: [Tutor] Writing to the terminal?

2010-12-13 Thread Bill Allen
§"cª«¬-r_°±²3'µ¶·,1º»¼½_¿ÄÅÆÇEÉEEDÑÖxOUUUÜY_ßàáâaäåæçèéêëìíîïdñòóôoö÷oùúûüy_ÿA However if at the cmd prompt, out side of Python, I give it an Alt-188 I get the correct ╝ Where am I going wrong? Thanks, Bill Allen On Mon, Dec 13, 2010 at 12:53 PM, Bill Allen wrote: > Al

Re: [Tutor] Writing to the terminal?

2010-12-13 Thread Bill Allen
Alan, Oh wow! I was not aware of the WConio module. That is exactly what I have been needing! Thanks, Bill Allen On Sun, Dec 12, 2010 at 6:49 PM, Alan Gauld wrote: > > "Modulok" wrote > > For more complex stuff, (think blue screens with little white boxes &g

Re: [Tutor] using a networked data file

2010-12-12 Thread Bill Allen
Wayne, Yes, you have characterized it pretty well. Additionally, it will be accessed typically by maybe a dozen individuals, typically only reading information from the database and infrequently writing to it. --Bill On Sun, Dec 12, 2010 at 7:36 AM, Wayne Werner wrote: > > > I

Re: [Tutor] using a networked data file

2010-12-11 Thread Bill Allen
from what I have read here and other places. Just wanting to confirm that I have understood this correctly. Also, any other suggestions are welcome. Thanks, Bill Allen On Sat, Dec 11, 2010 at 6:32 AM, David Hutto wrote: > On Fri, Dec 10, 2010 at 10:23 PM, Bill Allen wrote: > >

[Tutor] using a networked data file

2010-12-10 Thread Bill Allen
to keep managed infrastructure down to a minimum so I am considering using sqlite instead. Since there is not a database service running to handle requests to the sqlite database, how can I allow for multiple people trying to use this database at the same time? Is this practical? Thanks, Bill

  1   2   3   4   >