[Tutor] IDLE

2017-12-29 Thread Jay Kelman
I’m a beginner. I downloaded Python and when I look at IDLE it tells me to update TCL. I downloaded updated Active TCL and installed it but can’t figure how to use update to get IDLE corrected. Any help? ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] New blog that has solution for python programs

2017-06-03 Thread Jay Lozier
On 06/02/2017 09:07 PM, Mats Wichmann wrote: I don't think "what the authors might want" is the only factor here. Personally, I think these programming challenge sites probably do more harm than good, discouraging people that they're not good enough to be a programmer because they can't solve t

Re: [Tutor] PyctvhccTV TtV v.:vgvon v3 Tkinter GgUI program

2016-10-24 Thread Jay Talbot
Qk. vv"::.: On Oct 24, 2016 6:08 PM, "Elliott Andrews" wrote: Hi there, I am making a program in python based on a Subway operation. All descriptions and comments codes are provided in the attached program. I've been using IDLE to run the program and it seems to work the way I want it too. Ho

Re: [Tutor] Read, Write, Split and Append lines from a text file

2014-07-19 Thread Jay Lozier
Please include the complete stack trace error message It will help in determining what the error is. Jay On 07/19/2014 05:27 PM, LN A-go-go wrote: I have given it all I got: a week trying to open

Re: [Tutor] Strange issue output not showing up as floats

2014-06-21 Thread Jay Lozier
Deb, Can you show us your full code listing or if it is lengthy the relevant section showing the print statement. My guess is your print formating is not specified correctly and it is rounding to the nearest whole number. Jay -- Jay Lozier jsloz...@gmail.com _

Re: [Tutor] (no subject) - (added) Number guessing game

2014-05-08 Thread Jay Lozier
ly against a person. Then write the "do stuff" to replicate that. Hint: you do not need to generate random guesses within the while loop. -- Jay Lozier jsloz...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] while loop

2014-03-28 Thread Jay Lozier
tes over the range from 0 to n-1 (5 times). I included the index variable in the print to show the increase of the index. The results for both: 0 some string 1 some string 2 some string 3 some string 4 some string -- Jay Lozier jsloz...@gmail.com _

Re: [Tutor] Convert os.random output to a string

2014-03-06 Thread Jay Lozier
Alan I am planning to store the passwords encrypted. This part is allow a user to generate and view the generated password. Ben got me pointed to a snippet I can use. I was trying to do something the hard way. Jay On 03/06/2014 07:34 PM, Alan Gauld wrote: On 06/03/14 23:32, Jay Lozier

[Tutor] Convert os.random output to a string

2014-03-06 Thread Jay Lozier
"", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 0: invalid start byte >>> I am probably missing something very obvious. Thanks in advance! -- Jay Lozier jsloz...@gmail.com ___ Tuto

Re: [Tutor] Beginner - understanding randint arguments

2014-02-15 Thread Jay Lozier
, Marc* * The variables low_range and high_range are not modified. The arguments to random.randint do not change the initial values of the variables, only the actual values passed. -- Jay Lozier jsloz...@gmail.com ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Python 3.3 on OpenSUSE 12.3

2013-10-24 Thread Jay Lozier
ally able to help > me, so I was wondering I give it a try here. > Thanks, > Rafael Rafael, I have both Python 2.7.3 and 3.3.0 installed on openSUSE 12.3. To use 3.3 I enter python3.3 at the prompt. If I enter python it defaults to 2.7.3 In the shebang #!/usr/bin/env pyt

Re: [Tutor] Won't run. Syntax Error.

2013-09-08 Thread Jay Lozier
e runs correctly as written. There are no error messages. I was able to run the code without any errors. I copied and pasted the code into a text editor (Notepad on Windows or idle3) and removed the extraneous prompts, echoed output, and spaces. When saving the file the extension should be *.py.as in pizza.py -- Jay Lozier jsloz...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How did this decimal error pop up?

2013-04-16 Thread Jay Lozier
d occur. Often it is suitable error because one does not spot that an intermediate calculation is incorrectly implemented. -- Jay Lozier jsloz...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] concatenating files

2009-02-27 Thread Jay Deiman
set "totalFile" to your main output file and then call the script as "scriptname.py /path/to/datfile/directory". -- Jay Deiman \033:wq! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] passig parameter with CGI...

2009-02-26 Thread Jay Deiman
?%s' % \ urllib.urlencode(options) u = urllib.urlopen(url) # Here you can read the response if needs be response = u.read() u.close() = That's about it. -- Jay Deiman \033:wq! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] cgi script to start another process in background

2009-02-26 Thread Jay Deiman
os.getpid() time.sleep(30) os._exit(0) You should be able to verify that you have that process still running after the main process exits. -- Jay Deiman \033:wq! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] url parsing

2009-02-15 Thread Jay Jesus Amorin
Thanks this is much more simple and is what i need. On Sun, Feb 15, 2009 at 9:29 PM, Lie Ryan wrote: > On Sun, 15 Feb 2009 14:22:09 +0100, Andre Engels wrote: > > What is 'new' in your solution? Apart from that, the following looks > > simpler: > > > url = "http://this/is/my/url/to/parse";

[Tutor] url parsing

2009-02-15 Thread Jay Jesus Amorin
nk it wont work as i dont know how long my url would be in my real application. Thanks, Newbie, Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] string fomatting

2009-01-31 Thread Jay Jesus Amorin
Thanks bob. I want to search any characters in test after https://www.localhost.org/<https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql>and the search will end after it finds another / and when i print it will display *testmodule*. Newbie, Jay On Sun, Feb 1, 2009 at 2

[Tutor] string fomatting

2009-01-31 Thread Jay Jesus Amorin
Hi, I'm a newbie trying to learn python. Kindly help me on string formatting. test = https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql what will i use to print this output? 1, https://www.localhost.org/ 2. testmodule 3. /dev/trunk/admin/sql/mytest.sql Thanks,

Re: [Tutor] rrdtool examples.

2008-12-08 Thread Jay Deiman
CENT' , 'LINE1:mph#FF:My Speed' , r'GPRINT:msmax:Max\: %6.1lf mph' , r'GPRINT:msavg:Avg\: %6.1lf mph' , r'GPRINT:msmin:Min\: %6.1lf mph\l' , r'GPRINT:mspct:95th Perc\: %6.1lf mph\l' ) - -

Re: [Tutor] Learning Python from books

2008-06-19 Thread jay
Me personally, both "Learning Python" and "Core Python Programming". I am by no means an expert, but both of these books are excellent and were quite helpful. jay On Thu, Jun 19, 2008 at 1:56 PM, Zameer Manji <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNE

Re: [Tutor] Getting started with Python

2008-05-16 Thread jay
rom:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On > Behalf Of *jay > *Sent:* Friday, May 16, 2008 9:44 AM > *To:* tutor@python.org > *Subject:* Re: [Tutor] Getting started with Python > > Have you tried this ? > > import sys > sys.path.append('/directory1/d

Re: [Tutor] Getting started with Python

2008-05-16 Thread jay
Have you tried this ? import sys sys.path.append('/directory1/directory2') import file.py j On Fri, May 16, 2008 at 10:20 AM, Moishy Gluck <[EMAIL PROTECTED]> wrote: > > > On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck <[EMAIL PROTECTED]> > wrote: > >> You need to place a "__init__.py" file in

Re: [Tutor] Regular expressions...

2008-05-02 Thread jay
dir = '/xen/domains2/machinename/disk.img' a = dir.split('/')[3] is what I would use... On Fri, May 2, 2008 at 12:38 PM, Spencer Parker <[EMAIL PROTECTED]> wrote: > Well...it gives me the entire path...I am not running this script from the > actual directory...I am running it from a secure user

Re: [Tutor] Setting the PC Clock to Correct Time

2008-04-19 Thread jay
Wayne, Is this a Linux box? If so, you might consider setting up NTP to sync to an outside time source. We do that here and it works quite well, even accounting for drifting. If this is a Windows machine, I believe those are already synced with the PDC, if joined to a Domain, but I might be wro

Re: [Tutor] MySQLdb for Python 2.5? (Debian related) (was: csv.reader: bad argument type)

2008-01-23 Thread jay
I run MySQLdb with Python 2.5.1, but I had to build it manually. It was not part of any prebuilt package on my RedHat box. You should be able to do the same. J On Jan 23, 2008 10:01 AM, <[EMAIL PROTECTED]> wrote: > I decided to install Python2.5 on the server machine to save me the time > for

Re: [Tutor] ssh script

2008-01-23 Thread jay
Have you looked into Paramiko? http://www.lag.net/paramiko/ Its a port of the ssh2 protocol for python. It might be easier to do this using that that subprocess calls. Paramiko is quite nice, I use it a lot at work. Just a suggestion J On Jan 23, 2008 3:42 AM, washakie <[EMAIL PROTECTED]

Re: [Tutor] Reading Input Data

2008-01-15 Thread jay
Python has a cvs module that will make this slightly more elegant http://docs.python.org/lib/module-csv.html j On Jan 15, 2008 2:26 PM, lechtlr <[EMAIL PROTECTED]> wrote: > I want to read an input file (file.csv) that has two columns. I want to > read 2nd column and assign variables that are st

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
Well that is what I normally use, but I always have my hostname setup properly. In your case, that socket call won't work. You could try this link I found on google http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439094 jay On Jan 2, 2008 9:00 AM, shawn bright <[EMAIL P

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
wrote: > Thanks, Jay, > in IDLE, this gave me 127.0.0.1 > is there a way to get my assigned ip instead of the localhost one? > thanks > > > On Jan 2, 2008 8:31 AM, jay < [EMAIL PROTECTED]> wrote: > > > You could perhaps use this method > > &

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
You could perhaps use this method import socket myIP = socket.gethostbyaddr(socket.gethostname())[2] Jay On Jan 2, 2008 8:25 AM, shawn bright <[EMAIL PROTECTED]> wrote: > Greetings, > > i am looking for an easy way to get my own ip address as a string from > python. > I

Re: [Tutor] Q2: logging not working as expected

2007-11-16 Thread jay
using the qualified name 'hkd1'. It works for me after that... Although I agree with others, simplification does wonders for debugging. Jay On Nov 16, 2007 3:09 PM, dave selby <[EMAIL PROTECTED]> wrote: > I am trying to use the python logging module. At first glance it looks >

Re: [Tutor] New Introductory Book

2007-11-06 Thread jay
I agree as well. Its not like there is a flood of these books coming out, or emails slamming the list announcing them. Jay On Nov 6, 2007 1:38 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Rikard Bosnjakovic wrote: > > On 06/11/2007, Michael H. Goldwasser <[EMAIL

Re: [Tutor] Turning multiple Popen calls into a function

2007-11-01 Thread jay
again! Jay On 11/1/07, Eric Brunson <[EMAIL PROTECTED]> wrote: > > jay wrote: > > Hello, > > > > If I have multiple Popen calls I need to make, how can I turn these > > into a function? > > Since you're only interested in the output of the last command o

[Tutor] Turning multiple Popen calls into a function

2007-11-01 Thread jay
I would be sending an arbitrary number of PIPES with each function call. I'm a little stumped as to how to handle the variables. If I have an arbitrary number of PIPES, how do I declare my variables (p1, p2, p3, etc...) ahead of time in the function?? Thanks for any suggestions! Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Extending logging module

2007-08-09 Thread jay
Nice! I will have to test this On 8/9/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > jay wrote: > > I have a working solution for this, based largely on what Kent posted. > > Thought I would post it for others in case your either curious, or need > > to do

Re: [Tutor] Extending logging module

2007-08-09 Thread jay
CE'] = 'notice' >From there you can create your new logger and do a myLog.notice('test notice message'). It works quite nicely, though its a lot of repeated code if you have to define several new levels. Thanks for your suggestion Kent. Will wait and see if

Re: [Tutor] Extending logging module

2007-08-09 Thread jay
Kent, Thanks for the suggestion. If will look more into your suggestions, and also shoot a post over to comp.lang.python. Jay On 8/9/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > jay wrote: > > Hello, > > > > I've been using the python logging module a lot

[Tutor] Extending logging module

2007-08-09 Thread jay
en possible? I don't like changing the standard libraries, what happens if I have to upgrade python? My changes get overwritten. Can anyone offer some help or suggestions? Thanks Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Finding the caller

2007-07-26 Thread jay
Thanks Kent and Andreas That is exactly what I needed! Very nice indeed... jay On 7/26/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > jay wrote: > > Hello all, > > > > If I import a module, which has a bunch of simple functions in it, is > > there an eas

[Tutor] Finding the caller

2007-07-26 Thread jay
Hello all, If I import a module, which has a bunch of simple functions in it, is there an easy way to find the direct caller from inside one of those functions? I'm looking to know which script has imported and thus called the library function. Thanks!

Re: [Tutor] Logging module

2007-07-25 Thread jay
Thanks for the reply Kent. I found the problem. It was rather simple actually. I didn't have remote logging enabled for syslog. Even though I was logging to localhost, for some reason, it wouldn't work until I gave syslogd a -r at startup. Thanks jay On 7/25/07, Kent Johns

[Tutor] Logging module

2007-07-24 Thread jay
handler_syslog] class: handlers.SysLogHandler args: [('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_LOCAL6 ] formatter: detailed [logger_root] level: INFO handlers: syslog end logging.conf --- Thanks for any help! jay _

Re: [Tutor] Tutor Digest, Vol 38, Issue 10

2007-04-06 Thread Jay Mutter III
> > > "Jay Mutter III" <[EMAIL PROTECTED]> wrote > > >> Whether I attempt to just strip the string or attempt to >> >> if line.endswith('No.\r'): >> line = line.rstrip() >> >> It doesn't work. > > Ca

Re: [Tutor] Tutor Digest, Vol 38, Issue 2

2007-04-05 Thread Jay Mutter III
- > > Message: 4 > Date: Sun, 1 Apr 2007 16:46:05 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Tutor Digest, Vol 38, Issue 1 > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain;

Re: [Tutor] Tutor Digest, Vol 38, Issue 1

2007-04-01 Thread Jay Mutter III
t/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > > "Jay Mutter III" <[EMAIL PROTECTED]> wrote > >> for line in s: >> jay = patno.findall(line) >> jay2 = "".join(jay[0]) >> print jay2 >>

Re: [Tutor] Another parsing question

2007-03-31 Thread Jay Mutter III
Kent; Again thanks for the help. i am not sure if this is what you menat but i put for line in s: jay = patno.findall(line) jay2 = "".join(jay[0]) print jay2 and it prints fine up until line 111 which is a line that had previously returned [ ] since a number didn'

Re: [Tutor] Another parsing question

2007-03-31 Thread Jay Mutter III
Ok after a minute of thought I did solve my second question by simply changing my RE to (r'(\d{1}[\s,.]+\d{3}[\s,.]+\d{3})') but still haven't gotten he first one. On Mar 31, 2007, at 1:39 PM, Jay Mutter III wrote: > I have the following that I am using to extract &qu

[Tutor] Another parsing question

2007-03-31 Thread Jay Mutter III
e to which you would like to save the list of patent numbers? ') p2 = open(prompt2,'aU') patno = re.compile(r'(\d{1})[\s,.]+(\d{3})[\s,.]+(\d{3})') for line in s: jay = patno.findall(line) print jay which yields the following [('1', '3

Re: [Tutor] Tutor Digest, Vol 37, Issue 63

2007-03-25 Thread Jay Mutter III
ot; > > Message: 2 > Date: Sat, 24 Mar 2007 19:25:10 -0400 > From: Jay Mutter III > Subject: [Tutor] parsing text > [...] > 1.) when i do readlines and create a list and then print the list it > adds a blank line between every line of text > [...] > ideas? >

[Tutor] parsing text

2007-03-24 Thread Jay Mutter III
place(s,'p.','\n') in an attempt to put a CR in but it just put the characters\n in the string. ideas? Thanks again jay Jay Mutter III wrote: > Thanks for the response > Actually the number of lines this returns is the same number of lines > given when i put it

[Tutor] Parsing text file with Python

2007-03-23 Thread Jay Mutter III
Script i have to date is below and Thanks to your help i can see some daylight but I still have a few questions 1.) Are there better ways to write this? 2.) As it writes out the one group to the new file for companies it is as if it leaves blank lines behind for if I don't have the elif len

Re: [Tutor] Why is it...

2007-03-23 Thread Jay Mutter III
gt; f.close() >>> Note the differing placement of the f.close() statement, it's not part of the while. On 3/22/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Jay Mutter III wrote: > Why is it that when I run the following interactively > > f = open('Patents-1920.txt

Re: [Tutor] Another string question

2007-03-23 Thread Jay Mutter III
Andre; Thanks again for the assistance. I have corrected the splitlines error and it works ( well that part of anyway) correctly now. On Mar 23, 2007, at 5:30 AM, Andre Engels wrote: 2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>: I wanted the following to check each line and if it e

Re: [Tutor] Should I use python for parsing text?

2007-03-23 Thread Jay Mutter III
First thanks for all of the help I am actually starting to see the light. On Mar 22, 2007, at 7:51 AM, Kent Johnson wrote: > Jay Mutter III wrote: >> Kent; >> Thanks for the reply on tutor-python. >> My data file which is just a .txt file created under WinXP by an >>

Re: [Tutor] Another string question

2007-03-23 Thread Jay Mutter III
On Mar 23, 2007, at 5:30 AM, Andre Engels wrote: 2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>: I wanted the following to check each line and if it ends in a right parentheses then write the entire line to one file and if not then write the line to anther. It wrote all of the ) to one fi

[Tutor] Another string question

2007-03-22 Thread Jay Mutter III
') for line in text: if line[-1] in ')': companies.write(line) else: patentdata.write(line) in_file.close() companies.close() patentdata.close() Thanks jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Why is it...

2007-03-22 Thread Jay Mutter III
in a script there is no error? Thanks Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Should I use python for parsing text

2007-03-20 Thread Jay Mutter III
"Jay Mutter III" wrote > See example next: > A.-C. Manufacturing Company. (See Sebastian, A. A., > and Capes, assignors.) >... >Aaron, Solomon E., Boston, Mass. Pliers. No. 1,329,155 ; >Jan. 27 ; v. 270 ; p. 554. > > For instance, I would like to go to end of

[Tutor] Should I use python for parsing text

2007-03-11 Thread Jay Mutter III
e I am wondering if Python would be a good tool and if so where can I find information on how to accomplish this or would I be better off using something like the unix tool awk or something else?? Thanks Jay ___ Tutor maillist - Tu

Re: [Tutor] hand-holding for web development

2005-10-24 Thread Jay Loden
re's someplace online you can get Django help such a specific mailing list. -Jay On Tuesday 18 October 2005 04:23 pm, nitin chandra wrote: > Thanks Jay > > i guess the can be added only in one of the conf > file. Which one should i add in? > > Thaks you. could you ple

Re: [Tutor] hand-holding for web development

2005-10-17 Thread Jay Loden
make sense of all this, because it's not really intuitive and it works differently than traditional cgi programming. Take a look at: http://modpython.org/live/current/doc-html/ to get you started, it's a lot more detailed and will probably answer your questions better. -Jay On Th

[Tutor] Mod_python greedy url matching

2005-10-04 Thread Jay Loden
t the handler to the directory and NOT include subdirectories? -Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python equiv to PHP "include" ?

2005-09-29 Thread Jay Loden
uts CGI programming examples online for Python that might make this clearer so I can bug the list less and just read some example code? -Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python equiv to PHP "include" ?

2005-09-29 Thread Jay Loden
a form that processes its input but maintains my template code wrapped around it, so feel free to point out a "Pythonic" method. I just don't want to duplicate the template code, and I can't find a nice neat solution like what I've got in PHP. -Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Invoking bash from within a python program

2005-09-02 Thread Jay Loden
similar mistakes in the past ;) -Jay On Sunday 14 August 2005 6:33 am, joe_schmoe wrote: > The basic idea I was toying around with is to create a delete/uninstall > program that would take the output of slocate and iterate through that > deleting all o

Re: [Tutor] while loops

2005-08-08 Thread Jay Loden
le loop before the if statement, you'll get the result you want. -Jay On Monday 08 August 2005 5:41 pm, Will Harris wrote: > I am working my way through "python programming for the absolute beginner" > and one of the challenges is to create a program that will flip a coin 100 &g

[Tutor] Zope/Python web devel

2005-08-03 Thread Jay Loden
mparing the two for web development I'd be grateful for those as well. -Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I add an argument too...

2005-08-03 Thread Jay Loden
I think it was just a typo for "the python distro" that came out as "the epython distro"... On Thursday 21 July 2005 9:15 pm, Danny Yoo wrote: > On Thu, 21 Jul 2005, Joseph Quigley wrote: > > optparse.. Can I download that as a module or do I have to download > > epython? > > Hi Joseph, > > optpa

Re: [Tutor] Deleting an entry from a dictionary

2005-08-03 Thread Jay Loden
se list.insert() at the zero index, or use list.reverse() with list.append() to flip the list around, add an item, then reverse it back to the original order with one new item at the beginning. -Jay On Wednesday 03 August 2005 2:21 pm, Smith, Jeff wrote: > Ummm...that doesn't d

[Tutor] getopt matching incorrect options

2005-07-11 Thread Jay Loden
and if so, is there any way to avoid this? I just want it to match "--list" to "--list", not "--l" and "--li" and "--lis" etc. -Jay ## Code chunk below ## try: options,args = getopt.getopt(sys.argv[1:], "Rf

[Tutor] getopt matching incorrect options

2005-07-11 Thread Jay Loden
and if so, is there any way to avoid this? I just want it to match "--list" to "--list", not "--l" and "--li" and "--lis" etc. -Jay ## Code chunk below ## try: options,args = getopt.getopt(sys.argv[1:], "Rf

Re: [Tutor] Python and Web Pages?

2005-04-23 Thread Jay Loden
PHP for a lot of things, but PHP works better with dynamic content within html, so I use each one where it's easiest. However, if you're not familiar with PHP, then I definitely wouldn't go out and learn PHP for this; just stick with Python because you'll get it done faster w

Re: [Tutor] Installation Routines (Joseph Quigley)

2005-04-21 Thread Jay Loden
stall dependencies. If you use the raw "rpm" command, even that will tell you "missing dependecy foo". That being said, apt-get on debian is still my favorite (for sheer number of available packages), but urpmi on mandrake or Yast on Suse are quite excellent. -Jay On Wedn

Re: [Tutor] how to display an image using python

2005-04-14 Thread Jay Loden
If you don't mind using an external program, you could use the 'display' command from ImageMagick. -Jay On Thursday 14 April 2005 07:59 pm, Ertl, John wrote: > All, > > I have asked this question before, but one more time most have commented > about manipulation b

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Jay Loden
Ok, it's a logic error in the while loop. Starting at the beginning: you can't compare the value of "password" until the user inputs the value, which is why it's requiring you to put password = "foobar" at the top. Otherwise, password has no value, and as far as the interpreter is concerned, i

Re: [Tutor] Re: random import errors

2005-04-05 Thread Jay Loden
Only one version installed, and I could copy it over from elsewhere, but I wouldn't be inclined to do so since it works right now. -Jay On Tuesday 05 April 2005 10:22 pm, Lee Harr wrote: > >I have a python script that runs on my webserver every fifteen minutes. > > It ha

[Tutor] random import errors?

2005-04-01 Thread Jay Loden
d and ran the script, and it ran fine with no errors. I got another such email from cron at 2:30am today ... anyone have any idea what would cause such a seemingly random problem after months of working fine? (sample traceback is below) -Jay 'import site' failed; use -v for traceback Tr

[Tutor] Prepend to a list?

2005-03-19 Thread Jay Loden
How can I prepend something to a list? I thought that I could do list.prepend() since you can do list.append() but apparently not. Any way to add something to a list at the beginning, or do I just have to make a new list? -Jay ___ Tutor maillist

Re: [Tutor] Newbie simple question

2005-02-25 Thread Jay Loden
You want readlines() not readline() and it should work something like this: remailfile = open("remail2.txt", r) remails = remailfile.readlines() for line in remails: #do something -Jay On Friday 25 February 2005 05:14 pm, Valone, Toren W. wrote: > I need to know how to read

Re: [Tutor] sys.argv[1: ] help

2005-02-25 Thread Jay Loden
Should be: import sys def main(): '''prints out the first command line argument''' print sys.argv[1] main() On Friday 25 February 2005 04:35 pm, Richard gelling wrote: > Hi, > > I am reading ' Learning Python second edition' by Mark Lutz and David > Ascher, and I trying the code examples

Re: [Tutor] files in a directory

2005-01-30 Thread Jay Loden
ing into a function, then create a list of files, and perform the parsing on each file. glob() lets you grab a whole list of files matching the wildcard just like if you typed "ls *.dml" or whatever into a command prompt. There wasn't too much info about specifically how you needed

Re: [Tutor] New to Python

2005-01-26 Thread Jay Loden
nice way of leaping right into code so that if you have any prior knowledge, you can use it to learn faster. -Jay On Wednesday 26 January 2005 09:09 pm, Jason White wrote: > > Greetings all, I'm new to python and thought I'd pop in here for > advice. I've done object

Re: [Tutor] read line x from a file

2005-01-21 Thread Jay Loden
One simple solution is to do: fle = open(file) contents = file.readlines() file.close() print contents[x] #or store this in a variable, whatever -Jay On Friday 21 January 2005 11:22, J. M. Strother wrote: > I have a text file containing 336 records. > I can read and print out the whol

[Tutor] glob or filter help

2005-01-21 Thread Jay Loden
etter way to use this with filter(), how can i make filter use "if islink()!=true" as its condition? The script is working now, (I know, I know, if it ain't broke, don't fix it...) but I want to be a better programmer so more elegant solutions are accepted gratefully. -Jay

Re: [Tutor] need help planning website updates

2005-01-20 Thread Jay Loden
. Thanks! -Jay On Thursday 20 January 2005 12:45, Kent Johnson wrote: > It seems to me that if you want the five most recent changes, you don't > have to keep a list of modified dates. Just get the modified date for all > the files of interest and sort by date, then pick the top five.

[Tutor] need help planning website updates

2005-01-20 Thread Jay Loden
ipt that a file has been modified, rather than run a crontab a couple times an hour. Is there maybe a better way to store and check dates, etc. Thanks! -Jay ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor