Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
On Thu, Oct 18, 2012 at 9:41 PM, eryksun wrote: > On Thu, Oct 18, 2012 at 11:55 PM, Steven D'Aprano wrote: >> >> Have you tried running `date` at the Windows command.com (or cmd.exe, >> or something, I never remember which)? What does it print? >> >> My guess is that it probably prints something

Re: [Tutor] IDLE shell indentation?

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 11:23 PM, boB Stepp wrote: > > This does keep the alignment I desire; however, IDLE shell's > autoindent feature goes away inside the exec function. Further, my > tab, which is set to 4 spaces, becomes 8 spaces at the indent; > apparently the tab takes effect after where ">

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 11:55 PM, Steven D'Aprano wrote: > > Have you tried running `date` at the Windows command.com (or cmd.exe, > or something, I never remember which)? What does it print? > > My guess is that it probably prints something like: > > "Command not found" > > which clearly cannot b

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Steven D'Aprano
On 19/10/12 14:30, Richard D. Moores wrote: [quote] you want to get today's date out of the "date" unix system command. [end quote] I missed that. It's the first clue I could find anywhere that the download for 3.x (x> 0) is only for a "Unix or a Unix-compatible system like Linux". No, you

Re: [Tutor] IDLE shell indentation?

2012-10-18 Thread Steven D'Aprano
On 19/10/12 14:23, boB Stepp wrote: This does keep the alignment I desire; however, IDLE shell's autoindent feature goes away inside the exec function. Further, my tab, which is set to 4 spaces, becomes 8 spaces at the indent; apparently the tab takes effect after where ">>> " would normally oc

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
On Thu, Oct 18, 2012 at 7:17 PM, Steven D'Aprano wrote: > On 19/10/12 12:16, Richard D. Moores wrote: >> >> Running the example at >> >> , >> with Python 2.3.2 64-bit, > > > Python TWO POINT THREE??? :-) > > That's lik

Re: [Tutor] IDLE shell indentation?

2012-10-18 Thread boB Stepp
On Thu, Oct 18, 2012 at 9:46 PM, eryksun wrote: > You're right that the alignment changed because of the font rendering > of the tab character. In Firefox I use the following to get a > monospace font in Gmail: > > http://userstyles.org/styles/15618/gmail-monospace-font-for-body-messages-textare

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 8:01 PM, Richard D. Moores wrote: > > Python 3.2.3 64 bit > MS Windows 7 Home Premium 64-bit SP1 > > have forgotten how to unpack a .tar.gz file. Please remind me. shutil.unpack_archive(filename, extract_dir, 'gztar') http://docs.python.org/release/3.2.3/library/

Re: [Tutor] IDLE shell indentation?

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 10:11 PM, boB Stepp wrote: if zero: > print(zero) > else: > print(phrase) > > Is there some special way for typing in multiline blocks of code into > the shell in IDLE? The above works, but it bothers me that "else" does > not line up with "if". Also, i

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 9:55 PM, Richard D. Moores wrote: > On Thu, Oct 18, 2012 at 6:08 PM, Mark Lawrence > wrote: > >> Could you please take a training course on how to use a search engine. First >> hit on google for "python dateutils install windows" is >> http://stackoverflow.com/questions/8

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Steven D'Aprano
On 19/10/12 12:16, Richard D. Moores wrote: Running the example at , with Python 2.3.2 64-bit, Python TWO POINT THREE??? :-) That's like, a million years old. I think you mean three point two. The importing goes

[Tutor] IDLE shell indentation?

2012-10-18 Thread boB Stepp
>>> if zero: print(zero) else: print(phrase) Wild Swans by Jung Chang >>> Is there some special way for typing in multiline blocks of code into the shell in IDLE? The above works, but it bothers me that "else" does not line up with "if". Also, in the IDLE shell the "p" in

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
On Thu, Oct 18, 2012 at 6:08 PM, Mark Lawrence wrote: > Could you please take a training course on how to use a search engine. First > hit on google for "python dateutils install windows" is > http://stackoverflow.com/questions/879156/how-to-install-python-dateutil-on-windows You're assuming I h

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
Running the example at , with Python 2.3.2 64-bit, The importing goes OK, it seems, but: Python 3.2.3 (default, Apr 11 2012, 07:12:16) [MSC v.1500 64 bit (AMD64)] Type "help", "copyright", "credits" or "license" for m

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Mark Lawrence
On 19/10/2012 01:42, Richard D. Moores wrote: On Thu, Oct 18, 2012 at 5:27 PM, Alan Gauld wrote: On 19/10/12 01:01, Richard D. Moores wrote: Python 3.2.3 64 bit MS Windows 7 Home Premium 64-bit SP1 ... unpack a .tar.gz file. Please remind me. Winzip or similar should cope in Windows. But

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
On Thu, Oct 18, 2012 at 5:27 PM, Alan Gauld wrote: > On 19/10/12 01:01, Richard D. Moores wrote: >> >> Python 3.2.3 64 bit >> MS Windows 7 Home Premium 64-bit SP1 >> ... >> >> unpack a .tar.gz file. Please remind me. By trying with Peazip I got it unpacked. Here's what the PKG-INFO file says, whe

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
On Thu, Oct 18, 2012 at 5:27 PM, Alan Gauld wrote: > On 19/10/12 01:01, Richard D. Moores wrote: >> >> Python 3.2.3 64 bit >> MS Windows 7 Home Premium 64-bit SP1 >> ... >> >> unpack a .tar.gz file. Please remind me. > > > Winzip or similar should cope in Windows. But a tar.gz is usually intended

Re: [Tutor] good coding habits/practices

2012-10-18 Thread Mark Lawrence
On 18/10/2012 23:30, Andre' Walker-Loud wrote: Hi All, I have a general question. I have never taken a formal programming course. I have learned everything I know from office mates (earlier on) and now mostly Google, as I need it. Most everything I write is only for my own consumption. I

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Alan Gauld
On 19/10/12 01:01, Richard D. Moores wrote: Python 3.2.3 64 bit MS Windows 7 Home Premium 64-bit SP1 ... unpack a .tar.gz file. Please remind me. Winzip or similar should cope in Windows. But a tar.gz is usually intended for *nix so unless its pure python it may not work in Windows. You might

Re: [Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Mark Lawrence
On 19/10/2012 01:01, Richard D. Moores wrote: Python 3.2.3 64 bit MS Windows 7 Home Premium 64-bit SP1 I see python-dateutil recommended here from time to time, so I thought I'd try it out. I downloaded python-dateutil-2.1.tar.gz from http://pypi.python.org/pypi/python-dateutil but have forgotte

[Tutor] How to unpack python-dateutil-2.0.tar.gz

2012-10-18 Thread Richard D. Moores
Python 3.2.3 64 bit MS Windows 7 Home Premium 64-bit SP1 I see python-dateutil recommended here from time to time, so I thought I'd try it out. I downloaded python-dateutil-2.1.tar.gz from http://pypi.python.org/pypi/python-dateutil but have forgotten how to unpack a .tar.gz file. Please remind me

Re: [Tutor] good coding habits/practices

2012-10-18 Thread Alan Gauld
On 18/10/12 23:30, Andre' Walker-Loud wrote: So finally the question: is there a good SUCCINCT guide to things > like the POSIX standards, and other programming standards {IEEE ... I believe) The problem is there are so many of these, and some of them are hundreds of pages long in their ow

[Tutor] good coding habits/practices

2012-10-18 Thread Andre' Walker-Loud
Hi All, I have a general question. I have never taken a formal programming course. I have learned everything I know from office mates (earlier on) and now mostly Google, as I need it. Most everything I write is only for my own consumption. I write scripts/programs to do science research, an

Re: [Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-18 Thread Prasad, Ramit
David Hutto wrote: > If your app has a standard usage of phrases, you can place a file in > that translates a tag into a particular language phrase. > > > > if submit_tag_selection == 'english': > submit = 'Submit' > if submit_tag_selection == 'english': > submit = 'Soumettre' > > Of

Re: [Tutor] Using the set.difference method with an unknown number of input iterables

2012-10-18 Thread Ryan Waples
cheers, much appreciated -ryan On Thu, Oct 18, 2012 at 10:52 PM, Emile van Sebille wrote: > On 10/18/2012 10:38 AM, Ryan Waples wrote:> I'm struggling to understand > how to understand/accomplish the following: > > > > > I have an set ("a" below) and a list of sets ("not_a"), how can I pass > >

Re: [Tutor] Using the set.difference method with an unknown number of input iterables

2012-10-18 Thread Emile van Sebille
On 10/18/2012 10:38 AM, Ryan Waples wrote:> I'm struggling to understand how to understand/accomplish the following: > > I have an set ("a" below) and a list of sets ("not_a"), how can I pass > the elements of "not_a" to set.difference() so that it it understands I > want the difference between s

[Tutor] Using the set.difference method with an unknown number of input iterables

2012-10-18 Thread Ryan Waples
I'm struggling to understand how to understand/accomplish the following: I have an set ("a" below) and a list of sets ("not_a"), how can I pass the elements of "not_a" to set.difference() so that it it understands I want the difference between set "a" and all the rest set.difference says "Changed

Re: [Tutor] indexing a list

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 8:01 AM, Spyros Charonis wrote: > > x = 21 # WINDOW LENGTH > > In [70]: SEQ[0:x] > Out[70]: 'MKAAVLTLAVLFLTGSQARHF' > > In [71]: SEQ[x:2*x] > Out[71]: 'WQQDEPPQSPWDRVKDLATVY' > > In [72]: SEQ[2*x:3*x] > Out[72]: 'VDVLKDSGRDYVSQFEGSALG' > > How could I write a function to

[Tutor] indexing a list

2012-10-18 Thread Spyros Charonis
Hello pythoners, I have a string that I want to read in fixed-length windows. In [68]: SEQ Out[68]: 'MKAAVLTLAVLFLTGSQARHFWQQDEPPQSPWDRVKDLATVYVDVLKDSGRDYVSQFEGSALGKQLNLKLLDNWDSVTSTFSKLREQLGPVTQEFWDNLEKETEGLRQEMSKDLEEVKAKVQPYLDDFQKKWQEEMELYRQKVEPLRAELQEGARQKLHELQEKLSPLGEEMRDRARAHVDALRTHLAPYSDELRQ

Re: [Tutor] Help Passing Variables

2012-10-18 Thread Dave Angel
On 10/18/2012 03:08 AM, Daniel Gulko wrote: > > > > Hi Python Tutor, I have a write a simple function named > "SwapCaseAndCenter(a_string, width). So why did you define it with only one formal parameter? > The idea is to use the function swapcase and center so that when the > userenters a stri

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-18 Thread eryksun
On Thu, Oct 18, 2012 at 1:16 AM, Dave Angel wrote: > > may decide to reuse existing objects. This includes, ints, floats, > strings, byte strings, tuples, etc. In the particular case of CPython, > small integers are cached in this way, and so are short strings with no > whitespace. How small, a

Re: [Tutor] Help Passing Variables

2012-10-18 Thread Alan Gauld
On 18/10/12 08:08, Daniel Gulko wrote: The function calls for passing in two variables "a_string, width" but I am still confused on this concept. You just provide the list of input parameters when you define the function: >>> def add(x,y): ... return x+y ... >>> add(4,5) 9 I define add to t

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-18 Thread Alan Gauld
On 18/10/12 04:41, boB Stepp wrote: From Programming in Python 3, 2nd edition (p. 22-23): a = ["Retention", 3, None] b = ["Retention", 3, None] a is b False b = a a is b True My current understanding is as follows: On the first two lines, two separate objects are defined, stored in two sep

[Tutor] Help Passing Variables

2012-10-18 Thread Daniel Gulko
Hi Python Tutor, I have a write a simple function named "SwapCaseAndCenter(a_string, width). The idea is to use the function swapcase and center so that when the userenters a string it centers it and swaps the case (e.g. upper to lower and vice versa). The function calls for passing in two