Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-09 Thread David Hutto
On Sun, Aug 8, 2010 at 7:57 PM, Steven D'Aprano wrote: > On Mon, 9 Aug 2010 04:44:37 am David Hutto wrote: > >> Four words... Software is python's propaganda. > > Four more words: please trim unnecessary quoting. No problem buddy pal. > > > -- > Steven D'Aprano >

Re: [Tutor] Need a mentor

2010-08-09 Thread Ranjith Kumar
On Mon, Aug 9, 2010 at 12:23 PM, Steven D'Aprano wrote: > On Mon, 9 Aug 2010 12:16:11 pm Ranjith Kumar wrote: > > Hi all, > > I`m doing a python based project, I need a mentor who can guide > > me and help me to complete the project. > Sorry Mr. Steven I think u caught it wrong I`m not asking

Re: [Tutor] os.urandom()

2010-08-09 Thread Dave Angel
Richard D. Moores wrote: On Sun, Aug 8, 2010 at 08:11, bob gailer wrote: On 8/8/2010 1:57 AM, Richard D. Moores wrote: How were we supposed to know that all the hexes have 2 digits? In version 2.6.5 Language Reference 2.4.1 - String literals: \xhh Character with hex value

Re: [Tutor] Need a mentor

2010-08-09 Thread Steven D'Aprano
On Mon, 9 Aug 2010 07:21:03 pm Ranjith Kumar wrote: > On Mon, Aug 9, 2010 at 12:23 PM, Steven D'Aprano wrote: > > On Mon, 9 Aug 2010 12:16:11 pm Ranjith Kumar wrote: > > > Hi all, > > > I`m doing a python based project, I need a mentor who can > > > guide me and help me to complete the project

Re: [Tutor] Reading every 5th line

2010-08-09 Thread Dave Angel
nitin chandra wrote: This may help you get started. FileNames ="FileName01", "FileName02", ..., "FileName24"] for File in FileNames: List =pen(File, 'r').readlines() for Start in [[14, "%s-1" % File], [15,"%s-2" % File]]: OutList =] for Line in range(Start[0]-1, 3024, 5):

Re: [Tutor] Need a mentor

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:28 PM, Steven D'Aprano wrote: > On Mon, 9 Aug 2010 07:21:03 pm Ranjith Kumar wrote: > > On Mon, Aug 9, 2010 at 12:23 PM, Steven D'Aprano > wrote: > > > On Mon, 9 Aug 2010 12:16:11 pm Ranjith Kumar wrote: > > > > Hi all, > > > > I`m doing a python based project, I need

Re: [Tutor] os.urandom()

2010-08-09 Thread Steven D'Aprano
On Mon, 9 Aug 2010 07:23:56 pm Dave Angel wrote: > Big difference between 2.x and 3.x. In 3.x, strings are Unicode, and > may be stored either in 16bit or 32bit form (Windows usually compiled > using the former, and Linux the latter). That's an internal storage that you (generic you) the Python

Re: [Tutor] os.urandom()

2010-08-09 Thread Dave Angel
Steven D'Aprano wrote: On Mon, 9 Aug 2010 07:23:56 pm Dave Angel wrote: Big difference between 2.x and 3.x. In 3.x, strings are Unicode, and may be stored either in 16bit or 32bit form (Windows usually compiled using the former, and Linux the latter). That's an internal storage that

Re: [Tutor] Fwd: Need mentor

2010-08-09 Thread Luke Paireepinart
On Mon, Aug 9, 2010 at 1:32 AM, Ranjith Kumar wrote: > Hi all, > > I have described the theme of my project here, > Cheers > Ranjith, > This sounds kind of like homework. Is it homework? If not, where did you get this spec from? Thanks, -Luke ___ Tutor

[Tutor] Question about strings

2010-08-09 Thread Daniel
Hi, I'm trying to solve an exercise, a beginners one but I have a question. So the exercise sounds like this: Define a string s = ’colorless’. Write a Python statement that changes this to ’colour- less’, using only the slice and concatenation operations. So I did wrote this: *1)s = 'colorless'

Re: [Tutor] Question about strings

2010-08-09 Thread Luke Paireepinart
Hey email in plain text in the future, HTML is not kind to mobile screens and in general you should plaintext reply to tech lists. All list indices start from 0. But you don't get the last value. So slice[1:5] would skip the first char and then include the next 3. It's the same as range. Range(

Re: [Tutor] Question about strings

2010-08-09 Thread Alan Gauld
"Daniel" wrote *1)s = 'colorless' 2)ss = s[:4] + 'u' + s[4:] *I do not understand something. So on the second line, the slicing lasts from the start of the s string to the forth character. Correct, slices include the first index but not the last. does the counting start? 0 or 1? It start

[Tutor] Weekly Python Tips mailing list is ready to join

2010-08-09 Thread Ian Ozsvald
I asked a few days ago if there'd be interest in a Python Tips list that sends out Python tips to your inbox each week - I've had a lovely response over the weekend so I'll proceed with creating the list. Thanks for the replies! As I mentioned I have a whole set of tips planned. They'll cover usef

Re: [Tutor] Fwd: Need mentor

2010-08-09 Thread bob gailer
Exactly what do you want your mentor to do? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] os.urandom()

2010-08-09 Thread Steven D'Aprano
On Mon, 9 Aug 2010 11:51:34 pm you wrote: > Steven D'Aprano wrote: > > On Mon, 9 Aug 2010 07:23:56 pm Dave Angel wrote: > >> Big difference between 2.x and 3.x. In 3.x, strings are Unicode, > >> and may be stored either in 16bit or 32bit form (Windows usually > >> compiled using the former, and Li

Re: [Tutor] Questions regarding strings

2010-08-09 Thread Jerry Hill
On Sun, Aug 8, 2010 at 1:04 PM, Daniel wrote: > > Can someone please explain this to me? Thank you so much and I wish everyone > a great day! Beyond what Hugo mentioned in his message, take a look at the tutorial: http://docs.python.org/tutorial/introduction.html#strings I don't see a way to di

[Tutor] problem loading and array from an external file

2010-08-09 Thread Bill Allen
Hi, my name is Bill and I am completely stuck. I have a little bit of code I am working with for the sole purpose of coding in order to learn Python. In order to learn a programming language, I very often use a little text based map of rooms traversal game. So far, so good. However, this time I

Re: [Tutor] problem loading and array from an external file

2010-08-09 Thread bob gailer
On 8/9/2010 10:55 PM, Bill Allen wrote: Hi, my name is Bill and I am completely stuck. I have a little bit of code I am working with for the sole purpose of coding in order to learn Python. In order to learn a programming language, I very often use a little text based map of rooms traversal gam

[Tutor] extending a VS python with cygwin

2010-08-09 Thread Tom Roche
summary: how to fix ... m...@cygwinbox ~/bin/duplicity-0.6.09$ python setup.py install ... > error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate > compatible binaries. Visual Studio 2003 was not found on this > system. If you have Cygwin i

Re: [Tutor] os.urandom()

2010-08-09 Thread Dave Angel
Steven D'Aprano wrote: On Mon, 9 Aug 2010 11:51:34 pm you wrote: (Context: Python 3.x, where strings are unicode.) repr() returns the string representation, not the byte representation. Try this: That's what I was missing. Somehow I assumed it was converting to byte strings. I