[Tutor] Beginner's guessing game

2017-10-01 Thread Steve Lett
Can u please tell me why this program does not work in line 28? That is guessesTaken. It reads 0 when it should be a larger number. I am a beginner having another try to get it! Thank you, Steve ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Tutor Digest, Vol 148, Issue 20

2016-06-15 Thread Steve Tenbrink
I was 63 when I started. It's never too late. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Study Tips

2016-06-01 Thread Steve Lett
Gday! On 31/05/2016 8:52 AM, "Steve Lett" wrote: > Thank you for the reply. > On 30/05/2016 3:45 PM, "Steve Lett" wrote: > >> Hi folks, >> Just started learning python. I've been having a really hard time in >> getting started, and still am!

Re: [Tutor] Study Tips

2016-05-30 Thread Steve Lett
Thank you for the reply. On 30/05/2016 3:45 PM, "Steve Lett" wrote: > Hi folks, > Just started learning python. I've been having a really hard time in > getting started, and still am! I have a slight learning difficulty, > including a stroke in Jan.2010. You would

[Tutor] Study Tips

2016-05-30 Thread Steve Lett
ng to start with Python Programming for the Absolute Beginner, Michael Dawson. Any thoughts on these issues and especially the study tips already mentioned. Thank you, Steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Steve Rodriguez
Thank you guys! Works perfectly! :D Regards, Steve Rodriguez On Sat, Jul 12, 2014 at 1:21 AM, Peter Otten <__pete...@web.de> wrote: > Peter Otten wrote: > > > PS: You sometimes see > > > > message in "qQ" > > > > but this is buggy as it is

[Tutor] While loop issue, variable not equal to var or var

2014-07-11 Thread Steve Rodriguez
;: while message != ('q' or 'Q'): Any ideas would be much appreciated! Thanks! :D Regards, Steve Rodriguez ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regular expression - I

2014-02-18 Thread Steve Willoughby
Because the regular expression means “match an angle-bracket character, zero or more H characters, followed by a close angle-bracket character” and your string does not match that pattern. This is why it’s best to check that the match succeeded before going ahead to call group() on the result

Re: [Tutor] Regular expression - I

2014-02-18 Thread Steve Willoughby
number of other characters which would be H.* (the . matches any single character, so .* means zero or more of any characters). On the other hand, H\* means to match an H followed by a literal asterisk character. Does that help clarify why one matched and the other doesn’t? steve On 18-Feb-2014

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Steve Mayer
You might want to check out the '2to3' program to convert Python 2.x code to Python 3.x code. The following command worked to change your code to runnable Python 3.x code: 2to3 -w -- Steve Mayer smaye...@me.com On 8 Jan 2014, at 10:19, S Tareq wrote: need help how to

Re: [Tutor] Subprocess communications query

2013-12-10 Thread Steve Willoughby
Reuben wrote: >I want to implement a python script on machine A to do telnet/ssh into >machine B (this might be easy)and then run the Test.py (this is >challenging) >On 11-Dec-2013 1:05 AM, "Danny Yoo" wrote: > >> On Tue, Dec 10, 2013 at 11:28 AM, Reuben >wrote: >> > Hi, >> > >> > There exists t

Re: [Tutor] Removing Unnecessary Indentation and other problems

2013-11-15 Thread Steve Willoughby
hat if the keys don't fit within a single tab zone (8 characters usually). HTH HAND steve On 15-Nov-2013, at 14:44, harvey trasmontero wrote: > Good day, > > I have two problems. First one is, using and downloading tkinter. I have > searched about it and it led me to a downl

Re: [Tutor] Nested lists help

2013-10-18 Thread Steve Willoughby
On 18-Oct-2013, at 17:13, Corinne Landers wrote: > self.grid_x = x > self.grid_y = y > self.grid_z = z > > self.grid = [] > self.grid2D = [] > So here you create a list, self.grid2D. > for i in range(self.grid_y): > row = [0]*x > self.grid2D.append(row) > Here you a

Re: [Tutor] postgresql was: Re: Tutor Digest, Vol 115, Issue 6

2013-09-04 Thread Steve Willoughby
parately. Unlike using string-maniputation features of Python, the database API knows exactly how to properly include those data values into the SQL command for you: some_api_function_to_do_sql("UPDATE hotel SET path_picture = ? WHERE code LIKE ?", hot_url, '%' + hot_code + '%') --steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unix Environment variables

2013-06-23 Thread Steve Willoughby
Note, however, that changing environment variables only affects the environment of your script and it's child processes. Once your script exits, the original shell you called it from is NOT changed. Sent from my iPad On 2013/6/23, at 14:35, Amit Saha wrote: > Hello, > > On Tue, Jun 18, 2013

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steve Willoughby
On 16-Jun-2013, at 11:35, Steven D'Aprano wrote: > On 17/06/13 03:59, Steve Willoughby wrote: >> >> On 16-Jun-2013, at 10:49, Jim Mooney wrote: >> >>> On 16 June 2013 01:43, Roel Schroeven wrote: >>> >>>> Can't you disable tha

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steve Willoughby
On 16-Jun-2013, at 10:49, Jim Mooney wrote: > On 16 June 2013 01:43, Roel Schroeven wrote: > >> Can't you disable that behavior somewhere in the settings of your IDE? I >> know IDEs do that to be helpful, but I don't like it and so far I've been >> able to disable it in all IDEs I've used. >

Re: [Tutor] Hi, First question

2013-06-16 Thread Steve Willoughby
ample cited above). If that's the case, then "for line in fhand" will iterate over each line in the file, but you're only looking for lines which start with "X-Spam-.." which would only be the FIRST part of the header if it's split out like that. If your file i

Re: [Tutor] python web related scripts needed

2013-06-16 Thread Steve Willoughby
On 12-Jun-2013, at 05:48, Manigopal Vepati wrote: > Hi, > > I need scripts for the following . > > 1) check whether username and password fields are present in Gmail > 2) Code to access the system which doesn’t have ip address > And what have you found as you've started writing those scripts

Re: [Tutor] Value Error

2013-06-12 Thread Steve Willoughby
int('blah') is not a type error because the int() function is expecting to be given a string, and it was given a string. The 'blah' is of the correct type. The problem is that int() couldn't do anything useful with the value of that string. Steve On 12-Jun-2013, at

Re: [Tutor] Value Error

2013-06-12 Thread Steve Willoughby
or if you try to take the square root of a negative number, etc. On 12-Jun-2013, at 14:06, Sander Sweers wrote: > On 06/12/2013 10:49 PM, Jim Mooney wrote: >> Raised when a built-in operation or function receives an argument that has >> the right type but an inappropriate value, and the situatio

Re: [Tutor] why can you swap an immutable tuple?

2013-05-25 Thread Steve Willoughby
d tuple2 but that's beside the point of immutability. If you pass them to a function, they'll be known locally there under different names but they're still immutable tuples. Does that help? --steve ___ Tutor maillist - Tutor@python.org

Re: [Tutor] if/else option for making a choice

2013-02-18 Thread Steve Willoughby
For example, making a function that asks each question and handles all the different ways the user might answer other than typing precisely "yes". Or putting the choices in a list instead of repeating the choice-asking code over and over. -- Steve Willoughby| Using billion-dollar s

Re: [Tutor] following on

2013-02-18 Thread Steve Willoughby
None of these are C/C++ things. They are basic building-blocks of Computer Science and data structures you'll use regardless of language. I'd really recommend investing some time reading up on these and other fundamental data structures. -- Steve Willough

Re: [Tutor] Python Question

2013-01-09 Thread Steve Willoughby
On 2013-1月-7, at 下午3:31, Dylan Kaufman wrote: > Greetings, > > I take Computer Science in school and for a Python program, I have: > > from winsound import Beep > The first thing I notice is "from winsound import …" Could that be a WINDOWS library which might not work on a Macintosh? > Bee

Re: [Tutor] optparse.OptionParser options in alphabetical order in help display

2012-12-18 Thread Steve Willoughby
Although it is probably too obvious to be the answer you're looking for, why can't you just add them in order in the source code? This way, you can arrange them however you want them to appear, instead of python arbitrarily enforcing its own order. Python likes being explicit about things like

[Tutor] (no subject)

2012-11-07 Thread steve clarke
Hi, I am trying to write a programme to count how many times a random point lies within the positive sector of a circle. So far I can display if the point lies inside the area but I need something to allow me to count the total number of items that lie inside the area. My programme is:>>> impor

Re: [Tutor] help me decide

2012-09-05 Thread Steve Willoughby
ight. Although Java here doesn't necessarily mean the JVM is running on the embedded machine; it could be Java source code compiled down to something a compact runtime can execute. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for.&q

Re: [Tutor] understanding pydoc try

2012-08-30 Thread Steve Willoughby
d by something. Maybe it would help to start by describing your grammar to YACC, getting it to work, and then expressing that back out as BNF (or just leaving it in YACC code). -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for.&q

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
l!" factor when you first discover recursion. When it naturally applies to a problem, it's still a powerful thing, but yes, it's often misapplied by beginners. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for."

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
On 28-Aug-12 09:03, Mark Lawrence wrote: On 28/08/2012 16:51, Dharmit Shah wrote: @ Steve : Thank you. As suggested by Dave Angel, I am going to try the loop. And even before implementing it, I can feel that it's going to be more efficient than recursion. May I ask why you appear

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
rint word [/code] Sample output : $ python hangman.py How long word can you guess (number of alphabets) : 6 Should return inarch None $ The problem is that the last line "print word" always prints None. I know I am doing something wrong in the recursion part of the function "pick_ra

Re: [Tutor] finally without try or except

2012-07-30 Thread Steve Willoughby
interrupted in the middle of something? I think the block above will do what you're asking for, but I'm not sure what you're asking for is what will help you best. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for.&q

Re: [Tutor] Concatenating Strings

2012-05-28 Thread Steve Willoughby
ating other string values. a="hello" b="world" a+b# will yield "helloworld" but a b# is a syntax error Using + is arguably preferable when you have a choice to make, since it works in all cases, including constants. -- Steve Willoughby / st...@alchemy.com

Re: [Tutor] feedback on writing pipelines in python

2012-03-21 Thread Steve Willoughby
On 21-Mar-12 11:03, Abhishek Pratap wrote: Hi Guys I am in the process of perl to python transition for good. I wanted to Why? Perl is still a perfectly good tool. Just not, IMHO, good for exactly the same things Python is good for. 1. stitch pipelines : I want python to act as a glue

Re: [Tutor] question on self

2012-03-11 Thread Steve Willoughby
lling a function bound to a particular object, so by saying self.TakeTurns(), Python knows that the object "self" is invoking that method, not some other instance of the Play class. That method then can access all of that specific object's attributes as necessary. -- Steve Willough

Re: [Tutor] decimal precision in python

2012-02-07 Thread Steve Willoughby
On 07-Feb-12 03:15, Steven D'Aprano wrote: Steve Willoughby wrote: If you need lots of precision, you might consider using the decimal class. It'll cost you speed vs. the native floating-point type but won't cause you round-off errors. I'm afraid that's not correct.

Re: [Tutor] decimal precision in python

2012-02-06 Thread Steve Willoughby
python which can at least repeat previous command with a key stroke I use vim, which has that feature. I suspect any editor worth its salt does, or could be programmed to. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for."

Re: [Tutor] SEE THE QUESTION AT THE BOTTOM

2012-02-03 Thread Steve Willoughby
ge IN ALL CAPITAL LETTERS; it gives the impression you are shouting at your audience. HTH, HAND -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29

Re: [Tutor] Error Checking/Defensive Programming

2012-01-25 Thread Steve Willoughby
th integers like 0, it will either be >= 0 or < 0, so the condition will always be true. If "number" contains something that doesn't make sense to compare like that, then it just won't work (i.e., it'll likely throw an exception). (usually :) -- Steve Willoughby / st

Re: [Tutor] Weird Try..Except Error

2011-11-25 Thread Steve Willoughby
nterpreter, PATH notwithstanding. steve -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Question on List Comprehensions

2011-11-22 Thread Steve Willoughby
On 21-Nov-11 23:49, Charles Becker wrote: Alan, Steve, future readers, After some re-reading and hacking I was able to discover the solution. Since I raised the question here it is : [['{0}'.format(x+1), x+1] for x in range(size)] Just to fill out some other refinement

Re: [Tutor] \x00T\x00r\x00i\x00a\x00 ie I get \x00 breaking up every character ?

2011-11-20 Thread Steve Willoughby
r), you'll destroy them by killing the null bytes and won't handle the case of that high-order byte being something other than zero. Check out Python's Unicode handling, and character set encode/decode features for a robust way to translate the output you're getting. Ch

Re: [Tutor] \x00T\x00r\x00i\x00a\x00 ie I get \x00 breaking up every character ?

2011-11-20 Thread Steve Willoughby
hon.org <mailto:Tutor@python.org> To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] \x00T\x00r\x00i\x00a\x00 ie I get \x00 breaking up every character ?

2011-11-20 Thread Steve Willoughby
Where did the string come from? It looks at first glance like you have two bytes for each character instead of the one you expect. Is this perhaps a Unicode string instead of ASCII? Sent from my iPad On 2011/11/20, at 10:28, dave selby wrote: > Hi All, > > I have a long string which is an

Re: [Tutor] Question about GUI applications.

2011-11-08 Thread Steve Willoughby
ion window. To test, I made a "G" image and installed it. Here's a screenshot of the app window with and without that code. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29

Re: [Tutor] Beginning Python From Perl

2011-11-08 Thread Steve Willoughby
ords. (Substitute "Perl" and "Python" with arbitrary languages of your choice.) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C

Re: [Tutor] Question about GUI applications.

2011-11-08 Thread Steve Willoughby
e is: root = Tkinter.Tk() root.iconbitmap(default=ico_image_filename) (on Linux I use root.iconbitmap(bitmap='@'+xbm_filename)) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615

Re: [Tutor] GNU Emacs and Python

2011-11-01 Thread Steve Willoughby
On 01-Nov-11 13:24, Steve Willoughby wrote: On 01-Nov-11 13:19, Alexander Etter wrote: I like than .png image! It does appear vi biased though! Not quite, notice the initial steep climb. :) Yes, it's tongue-in-cheek, Oops, my mistake. If the y axis is productivity and x is time usin

Re: [Tutor] GNU Emacs and Python

2011-11-01 Thread Steve Willoughby
operations involving text files. You think emacs is bad, though? Try TECO. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C _

Re: [Tutor] login window using Tk

2011-11-01 Thread Steve Willoughby
r the duration. Everything else is handled by the application's logic. For example, you'd display the login toplevel window, and when it's satisfied, it can trigger the functionality which creates (or displays the pre-created but hidden) application window and dismisses the login t

Re: [Tutor] beginner question

2011-11-01 Thread Steve Willoughby
o respond to that by yielding up a line from the file for every iteration. You could, theoretically, write a variation of the file object class which iterated over characters, or logical blocks (records of some sort) within files, and so forth. -- Steve Willoughby / st...@alchemy.com "A sh

Re: [Tutor] changing dictionary to lowercase

2011-10-27 Thread Steve Willoughby
comprehensions. Does that nudge you in the right direction? If you're still stuck, let us know. --steve -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 69

Re: [Tutor] string immutability

2011-10-24 Thread Steve Willoughby
On 24-Oct-11 12:17, Johan Martinez wrote: Thanks for the replies everyone - Steve, Dave, Sander and Wayne. I realized my wrong understanding/interpretation after posting the message to the list, which usually happens most of the time with me! That happens to most of us all the time too

Re: [Tutor] string immutability

2011-10-24 Thread Steve Willoughby
g over a detail about how Python variables realy work, but that's another topic). > >>> s = "Second" > >>> print s > Second Now you created a new string object with the value "Second" and stored THAT into s, replacing the original

Re: [Tutor] password loop

2011-09-23 Thread Steve Willoughby
;re new to programming) to step through the instructions you've written for the computer, one at a time, and repeat to yourself what each step is accomplishing. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP F

Re: [Tutor] Confirmation if command worked

2011-08-25 Thread Steve Willoughby
On 25-Aug-11 01:37, Christian Witts wrote: Good catch, it should be `if child.exitstatus != None and child.exitstatus == 0:` It's better form to say if child.exitstatus is not None instead of comparing for equality to None with the != operator. -- Steve Willoughby / st...@alchem

Re: [Tutor] inserting degrees symbol in plot title

2011-08-09 Thread Steve Willoughby
he special character. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___ Tutor maillist - Tutor@pytho

Re: [Tutor] How to get the keys of a dict inside a dict. ValueError: too many values to unpack

2011-08-08 Thread Steve Willoughby
On Mon, Aug 8, 2011 at 9:41 AM, Steve Willoughby mailto:st...@alchemy.com>> wrote: Either way, once you have the list of the keys you want to display, print them out once as column headings -- Odeyemi 'Kayode O. http://www.sinati.com. t: @charyorde -- Steve Willoughby / st

Re: [Tutor] How to get the keys of a dict inside a dict. ValueError: too many values to unpack

2011-08-08 Thread Steve Willoughby
to a class. That way you can define the attributes of each object and even implement a print() method (or at least define __str__() and/or __repr__() methods) to print each object sensibly. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are bu

Re: [Tutor] How to get the keys of a dict inside a dict. ValueError: too many values to unpack

2011-08-07 Thread Steve Willoughby
On 07-Aug-11 09:17, Steve Willoughby wrote: First of all, that's not a dict. It's just a tuple of strings. so, when you say: #loop through and get the keys of each for k,v in x: You'll get one iteration, where k=the first string and v=the second. However, you ignore k and v

Re: [Tutor] How to get the keys of a dict inside a dict. ValueError: too many values to unpack

2011-08-07 Thread Steve Willoughby
but printing its last value after the loop exits. Is that what you intended? You're expecting Python to take a string that looks like Python source code and know that you want it to be interpreted as source code. Instead of using string values, use actual Python syntax directly, like:

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread Steve Willoughby
will take the extra step of printing the value of that expression for you. That's not otherwise how Python works. Normally you have to use a print command (or print() function in Python 3.x) to actually see the output. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is

Re: [Tutor] Basic question on spaces

2011-07-19 Thread Steve Willoughby
quot; Okay, based on that bill, a 15% tip would be ${0}, and a 20% tip would be ${1}. """.format(percent15, percent20) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA0

Re: [Tutor] compare and arrange file

2011-07-11 Thread Steve Willoughby
t does this for column 3's value. Now run through the column 2 data you saved, print that data row, then look up the value in the other dictionary and print that after it. On Mon, Jul 11, 2011 at 7:55 PM, Steve Willoughby wrote: On 11-Jul-11 16:50, Edgar Almonte wrote: Thanks for the

Re: [Tutor] compare and arrange file

2011-07-11 Thread Steve Willoughby
? Does it matter which ones you match up? If so, how do you decide? -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___

Re: [Tutor] problem reading script

2011-07-01 Thread Steve Willoughby
be weird I tried using an old OCR font and kind of got to like that too. A little weird but the glyphs are certainly distinct :) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01

Re: [Tutor] Weird tkFont behavior

2011-06-17 Thread Steve Willoughby
tting happier to see the improvements to what you can do with just plain Tkinter since the last time I used it seriously. Tkinter and ttk do have the advantage of already being right there in the standard library. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is

Re: [Tutor] Beginner puzzle with unpacking argv

2011-06-16 Thread Steve Willoughby
two values from it. For more sophisticated argument handling, you could look at the optparse or argparse modules (but that's beyond the beginner level--something to keep in mind for later). -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are b

Re: [Tutor] Weird tkFont behavior

2011-06-16 Thread Steve Willoughby
On 16-Jun-11 09:52, Steve Willoughby wrote: I'm probably just doing something stupid, but I can't spot the error. I hope someone here can see what I'm looking past, or knows of a known issue with these widgets. I think I solved it, actually.. as I was typing this up, I wonde

[Tutor] Weird tkFont behavior

2011-06-16 Thread Steve Willoughby
xt is inserted simply by: f.insert(END, text, 'rm') and yet some of the time, even though the 'rm' tag is there, I get one of the other fonts I configured for the other tags. Do I need to keep other references to the tkFont objects somewhere else or something? -- Steve W

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Steve Willoughby
ed and the output substituted back on the command line. The < bracket means to take what follows it as a file NAME (not a data stream). So unless writer.py outputs a filename, you really want something like python writer.py | python reader.py -- Steve Willoughby / st...@alchemy.com "

Re: [Tutor] Communicating Between Programs Using Raw Inputs

2011-06-14 Thread Steve Willoughby
ogram, and have a file-like object on which it can write data, which the child program will see as its standard input (and read in to raw_input). -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0

Re: [Tutor] trying to translate and ebcidic file

2011-06-14 Thread Steve Willoughby
e and the other. of course, if you are on a Unix-like system, there's already a command for that, to convert a file "E" from EBCDIC to a file "A" in ASCII: $ dd if=E of=A conv=ascii or the other way: $ dd if=A of=E conv=ebcdic -- Steve Willoughby / st...@alchemy.com

Re: [Tutor] Objects C++ vs Python

2011-06-09 Thread Steve Willoughby
On 08-Jun-11 23:33, Ashwini Oruganti wrote: On Thu, Jun 9, 2011 at 11:31 AM, Steve Willoughby mailto:st...@alchemy.com>> wrote: The value 5 is an integer-class object. But now what is "Integer-class"? Isn't integer a data type? I mean there is no concept of "c

Re: [Tutor] Objects C++ vs Python

2011-06-08 Thread Steve Willoughby
That has nothing to do with what an "object" means. So does the term *Object * change its meaning when we shift the context from C++ to python?? This is a little confusing, can someone clear it up?? Not really. I think your confusion was about variables. -- Steve Willoughby / st..

Re: [Tutor] create an xls file using data from a txt file

2011-05-12 Thread Steve Willoughby
he application. Where in the application, though, this is dealt with is not where I think we disagree. In my original response, I clarified that, although as a short parenthetical note: On 12-May-11 02:25, Peter Otten wrote: Steve Willoughby wrote: Actually, yes, that's exactly what Pyt

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Steve Willoughby
.py /temp/myfile That works because Windows hands ALL of the argument strings, as-is, with NO interpretation, to the application to deal with. In this case, the application is Python, and Python is going to the extra work to interpret the / characters as \ characters when you try to use them in open

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Steve Willoughby
ry separators). Core windows commands don't generally accept it, including native Windows applications (although sometimes they're lenient in what they accept). It'll work for command-line Python script usage because it's *python* that allows them, not *windows*. -- Steve W

Re: [Tutor] Reading elements in a file

2011-05-04 Thread Steve Willoughby
side "" quotes and ignore the commas. Or split on ',' then strip quotes, or... CSV is easiest if that's a match for your problem domain. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint

Re: [Tutor] Just started Python

2011-04-27 Thread Steve Willoughby
y...except block to do the typecast. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Run a few Python commands from a temporary filesystem when the rootfs is halted

2011-04-22 Thread Steve Willoughby
y. If your question has more to do with the particulars of managing chroot()ed mountpoints or preparing LiveOS images, you'd need to look to a forum devoted to that. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built f

Re: [Tutor] Run a few Python commands from a temporary filesystem when the rootfs is halted

2011-04-22 Thread Steve Willoughby
what you think they mean, or I'm missing what you're trying to do here. halting the root filesystem? pivot? code base? You're not trying to talk about jail/chroot, perhaps? -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are bu

Re: [Tutor] (no subject)

2011-04-22 Thread Steve Willoughby
On 22-Apr-11 16:03, Brad Desautels wrote: Hi Steve, I am getting my error on main() I think it is possibly be an indentation error It should be easy to check. Make sure "def main():" is all the way to the left, and all the lines under it are the same level as each other b

Re: [Tutor] Python trouble

2011-04-22 Thread Steve Willoughby
has the >>>s in it. How, exactly, does what I just described differ from what happened to you? -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C __

Re: [Tutor] (no subject)

2011-04-22 Thread Steve Willoughby
On 22-Apr-11 15:48, Brad Desautels wrote: Ya, I did try to run it and I am getting a syntax error before it runs. and the message said? Where did it point to as the syntax error? ___ Tutor maillist - Tutor@python.org To unsubscribe or change s

Re: [Tutor] (no subject)

2011-04-22 Thread Steve Willoughby
On 22-Apr-11 15:37, Brad Desautels wrote: Hello, I am just learning Python 3.0 and I am working on this problem. I need to know what the output would be.Can anybody help What is your question? If you want to see what its output would be... run it and see the output. Is there more to your que

Re: [Tutor] Problem with running Python

2011-04-22 Thread Steve Willoughby
ve things like "Python 2.7.1" or ">>>" showing up in your source code. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___

Re: [Tutor] adding to PYTHONPATH

2011-04-19 Thread Steve Willoughby
t you probably want this to be a permanent change, so you need to edit the start-up file for your shell (.cshrc, .bashrc, .profile, whatever) and add an instruction to set that variable everytime you open a shell. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not

Re: [Tutor] working with strings in python3

2011-04-19 Thread Steve Willoughby
a blending of "variables", "pointers" and "references" which just "do the right thing" most of the time due to how Python manages variable access. But they are not quite the same as any of those in other languages. -- Steve Willoughby / st...@alchemy.com

Re: [Tutor] working with strings in python3

2011-04-18 Thread Steve Willoughby
is impossible because that would be altering the string object named by "message" in-place, which is disallowed for strings. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for."

Re: [Tutor] os.chdir() will not accept string variable

2011-04-15 Thread Steve Willoughby
inputData = inputFile.readlines() inputFile.close() os.chdir( r'%s' % inputData[0] ) newNames = [] oldNames = glob.glob( '*.*' ) for index, item in enumerate( oldNames ): print index, item if __name__ == '__main__': mdf()

Re: [Tutor] Platform Independence in Python

2011-04-06 Thread Steve Willoughby
th platforms. Are you running the same code on both platforms? The correct name is "Tkinter" (capital T) for Python 2.x, and "tkinter" (lower-case) for Python 3.x, regardless of platform. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that

Re: [Tutor] RE

2011-04-06 Thread Steve Willoughby
On 06-Apr-11 02:03, JOHN KELLY wrote: I need help. Can you be a little more specific? :) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29

Re: [Tutor] String formatting question.

2011-03-31 Thread Steve Willoughby
onary step to take. Especially so if your formats are configurable or generated by code which may want to reorder the values. -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F

Re: [Tutor] Regex question

2011-03-30 Thread Steve Willoughby
On 30-Mar-11 08:21, "Andrés Chandía" wrote: Thanks Kushal and Steve. I think it works,a I say "I think" because at the results I got a strange character instead of the letter that should appear this is my regexp: contents = re.sub(r'(|)(l|L|n|N|t|T)(|)', '

Re: [Tutor] Regex question

2011-03-30 Thread Steve Willoughby
object: pattern = re.compile(r'(l|L|n|N)') and then substitute by calling its sub() method: text = pattern.sub('\1e', text) -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what s

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Steve Willoughby
g To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29 54F7 0F53 _

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steve Willoughby
On 25-Feb-11 20:26, Bill Allen wrote: On Fri, Feb 25, 2011 at 21:33, Steve Willoughby mailto:st...@alchemy.com>> wrote: On 25-Feb-11 19:27, Steve Willoughby wrote: Or are you saying you want to, from a remote Unix system, reach out to a Windows system and see that W

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steve Willoughby
On 25-Feb-11 19:27, Steve Willoughby wrote: Wait. Are you trying to figure out how, on a Unix system, to read Unix system environment variables as you're accustomed to doing on Windows? Or are you saying you want to, from a remote Unix system, reach out to a Windows system and see

  1   2   3   4   >