Re: [Tutor] Is the Python 3.2.1 documentation available as a .chm file?

2011-07-21 Thread Michael M Mason
Richard D. Moores wrote on 20 July 2011 at 18:11
> On Wed, Jul 20, 2011 at 09:04, xDog Walker  wrote:
> > On Wednesday 2011 July 20 06:41, Richard D. Moores wrote:
> > > Is the Python 3.2.1 documentation available as a .chm file from 
> > > Python.org?
> >
> > http://www.python.org/ftp/python/3.2.1/python321.chm
> Did that work for you? It got me a chm file that says everywhere,
> "Navigation to the web page was cancelled".

The CHM file you downloaded is being blocked by Windows because it knows you 
downloaded it from the Internet and you haven't told Windows that it's safe yet.

You need to right-click the CHM file, select 'Properties', and then click the 
'Unblock' button.

-- 
Michael


This mail was sent via Mail-SeCure System.



 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer 
viruses.




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Steven D'Aprano

Dave Angel wrote:

Little-endian is the method used by the Intel processor (such as the 
Pentium).  Big-endian is the system used by most network protocols, as 
well as the 68000 and many other processors.


There used to be mainframes with various forms of middle-endian layouts. 
Fortunately they are no longer around.


http://www.retrologic.com/jargon/M/middle-endian.html


For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
number.  Little-endian puts the least significant byte first, while 
big-endian puts the most significant byte first.


In this context, least significant and most significant may need explaining.

In decimal numbers, we write one hundred and twenty-three as 123. The 1 
is most significant, because it represents 1 HUNDRED rather than 1 UNIT. 
And similarly the 3 is least significant. So numbers using Arabic 
numerals are big-endian.


The same applies for computer integers. 123 written in hexadecimal is 
7B, which of course is big-endian just like decimal. But when storing 
this number in memory, we have a choice: we can store it in big-endian 
format, just like we write it: 7B, where the 7 is the "left-most" 
(lowest address) number. Or we can store it in little-endian format, B7, 
where the 7 has the higher address, and read from right-to-left.


And of course, bytes themselves can be either little-endian or 
big-endian, *independently* of byte ordering within larger units.


http://en.wikipedia.org/wiki/Endianness
http://en.wikipedia.org/wiki/Bit_numbering



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Lisi
On Tuesday 19 July 2011 22:43:40 Alan Gauld wrote:
> Growing to hate my Netbook keyboard more by the day!

Attach another keyboard?  (To keep life simple it would have to be usb, but 
you can even get a keyboard that will roll up for carrying.  I have neither 
seen nor tried one, so it may be no good!)

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python editor for Ipad

2011-07-21 Thread James Reynolds
I might have to discuss some routines I've written in Python (and possibly
C). It would be easier to whip out the Ipad and show them some of the things
I've done, rather than a bulky laptop.

I could of course PDF everything with highlighting off of eclipse, but
ideally Ideally I would prefer a way for the user to interact with the text,
rather than an image.

So basically, an IDE or text editor with syntax highlighting for python.

If you have any thoughts, I would greatly appreciate it!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Is the Python 3.2.1 documentation available as a .chm file?

2011-07-21 Thread Richard D. Moores
On Thu, Jul 21, 2011 at 04:59, Michael M Mason  wrote:
> Richard D. Moores wrote on 20 July 2011 at 18:11
>> On Wed, Jul 20, 2011 at 09:04, xDog Walker  wrote:
>> > On Wednesday 2011 July 20 06:41, Richard D. Moores wrote:
>> > > Is the Python 3.2.1 documentation available as a .chm file from 
>> > > Python.org?
>> >
>> > http://www.python.org/ftp/python/3.2.1/python321.chm
>> Did that work for you? It got me a chm file that says everywhere,
>> "Navigation to the web page was cancelled".
>
> The CHM file you downloaded is being blocked by Windows because it knows you 
> downloaded it from the Internet and you haven't told Windows that it's safe 
> yet.
>
> You need to right-click the CHM file, select 'Properties', and then click the 
> 'Unblock' button.

Yes! Thank you, Michael.

Dick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Avoiding reauthentication to web services?

2011-07-21 Thread Ryan on the Beach


Hello.
I am trying to write a python program to control a  lighting controller through 
it's rest interface.  It requires ssl and basic authentication.  I have been 
successful using urllib2.  However, the authentication takes a very long time 
on the controller so multiple http gets are slow.  I believe this is because of 
the controller itself.
In a web browser after I authenticate each request is very fast, presumably 
because the browser is not re-authenticating again and again.In an attempt 
to fix this I tried httplib2 after some googling thinking it might give me the 
desired result, but it does not either.  
Can anyone suggest how this would be accomplished?  I want to keep the 
connection "open".  At least so it does not re-authenticate over and over 
again, similar to how it works within a web browser.  Is this possible?
Thanks.Si.___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread Corey Richardson
Excerpts from James Reynolds's message of Thu Jul 21 10:40:53 -0400 2011:
> I might have to discuss some routines I've written in Python (and possibly
> C). It would be easier to whip out the Ipad and show them some of the things
> I've done, rather than a bulky laptop.
> 
> I could of course PDF everything with highlighting off of eclipse, but
> ideally Ideally I would prefer a way for the user to interact with the text,
> rather than an image.
> 
> So basically, an IDE or text editor with syntax highlighting for python.
> 
> If you have any thoughts, I would greatly appreciate it!

If you have a browser, Cloud9 IDE might be able to do it. Or you could use
pygments to render the text to HTML and ... do you even have filesystem
access on an ipad? (This is assuming you don't want your code out public
for the whole world to see). So your best bet would probably be Cloud9 or 
a similar product. 
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
 -- Abraham Lincoln


signature.asc
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Editor por iPad

2011-07-21 Thread Fernando Salamero
For an editor, 'Textastic' have syntax highlighting. It's Great!. 'Koder' is
nice, too.
For run (basic) python scripts, try 'PythonMath' and 'PyPad'

Fernando Salamero.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Removing characters in a string using format()

2011-07-21 Thread Ryan Porter

Hi there,

In one part of a program I'm writing, I want a list to be printed to the 
string. Here's my code:


# Begin snippet
listString = input('Please enter a single item: >').strip();

/print();
itemList.append(listString);
/

/...
/

/print('And here it is in alphabetical order:', itemList)
# End Snippet
/

However, when I print the list, I get something like this: ['Python', 
'best', 'ever', 'is', 'language', 'programming', 'the'] with brackets. 
Is there a way to use format() to remove the brackets before the list is 
printed?


Thanks for the help!
//

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Removing characters in a string using format()

2011-07-21 Thread Dave Angel

On 07/21/2011 01:53 PM, Ryan Porter wrote:

Hi there,

In one part of a program I'm writing, I want a list to be printed to 
the string. Here's my code:


# Begin snippet
listString = input('Please enter a single item: >').strip();

/print();
itemList.append(listString);
/

/...
/

/print('And here it is in alphabetical order:', itemList)
# End Snippet
/

However, when I print the list, I get something like this: ['Python', 
'best', 'ever', 'is', 'language', 'programming', 'the'] with brackets. 
Is there a way to use format() to remove the brackets before the list 
is printed?


Thanks for the help!
//


itemlist isn't a string, it's presumably a list.   If you pass a list to 
string, it'll turn it into a string, using approximately the following 
rules:


Put brackets on the end, and between them call repr() on each item of 
the list, separating the items with commas.


If all you like the rest of it, but don't want the brackets, try (untested)

   print('And here it is in alphabetical order:', 
str(itemList).strip('[]'))


This explicitly converts the list to a string, then strips both ends of 
the specified characters.


DaveA


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Removing characters in a string using format()

2011-07-21 Thread James Reynolds
Since you're using python 3, you can just use a star to unpack the list

like so:

>>> print(*x)
a b
>>> print(*x, sep = ', ')
a, b

You can use sep to change the separator if you want the commas still.


On Thu, Jul 21, 2011 at 1:53 PM, Ryan Porter wrote:

> Hi there,
>
> In one part of a program I'm writing, I want a list to be printed to the
> string. Here's my code:
>
> # Begin snippet
> listString = input('Please enter a single item: >').strip();
>
> /print();
>itemList.append(listString);
> /
>
> /...
> /
>
> /print('And here it is in alphabetical order:', itemList)
> # End Snippet
> /
>
> However, when I print the list, I get something like this: ['Python',
> 'best', 'ever', 'is', 'language', 'programming', 'the'] with brackets. Is
> there a way to use format() to remove the brackets before the list is
> printed?
>
> Thanks for the help!
> //
>
> __**_
> Tutor maillist  -  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/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Prasad, Ramit
>Attach another keyboard?  (To keep life simple it would have to be usb, but 
>you can even get a keyboard that will roll up for carrying.  I have neither 
>seen nor tried one, so it may be no good!)

On the plus side, roll-up keyboards tend to be sealed and proof against 
liquids. Plus, they are usually fairly quiet. 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Removing characters in a string using format()

2011-07-21 Thread Prasad, Ramit
-Original Message-
From: tutor-bounces+ramit.prasad=jpmchase@python.org 
[mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Ryan 
Porter
Sent: Thursday, July 21, 2011 12:54 PM
To: tutor@python.org
Subject: [Tutor] Removing characters in a string using format()

Hi there,

In one part of a program I'm writing, I want a list to be printed to the 
string. Here's my code:

# Begin snippet
listString = input('Please enter a single item: >').strip();

/print();
 itemList.append(listString);
/

/...
/

/print('And here it is in alphabetical order:', itemList)
# End Snippet
/

However, when I print the list, I get something like this: ['Python', 
'best', 'ever', 'is', 'language', 'programming', 'the'] with brackets. 
Is there a way to use format() to remove the brackets before the list is 
printed?

Thanks for the help!
//

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

That is because you are printing a list and not a string. ['Python', 'best', 
'ever', 'is', 'language', 'programming', 'the'] is a list where the first 
element is 'Python', the second element is 'best', and etc. To print a string 
instead of a list you can use a string's join function to convert a list into a 
string.

>>> ' '.join( itemlist )
'Python is the best programming language'
>>> ' '.join( sorted( itemlist ) )
'Python best is language programming the'


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Albert-Jan Roskam
Thanks a lot for your explanations, that was most helpful! I never realized my 
mother tongue (Dutch) is Little Endian, whereas English is Big Endian, e.g.:
dutch: negen-en-twintig (nine-and-twenty)
english: twenty-nine

I will improve my program based on what you all have said. I will let the 
program:
-find out the encoding of the input file
-find out the encoding of the terminal
-if necessary: find out if there are any other, compatible encodings on the 
terminal

Thanks again!

Cheers!!

Albert-Jan



~~

All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a fresh water system, and public health, what have 
the Romans ever done for us?

~~

--- On Thu, 7/21/11, Steven D'Aprano  wrote:

From: Steven D'Aprano 
Subject: Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?
To: tutor@python.org
Date: Thursday, July 21, 2011, 2:56 PM

Dave Angel wrote:

> Little-endian is the method used by the Intel processor (such as the 
> Pentium).  Big-endian is the system used by most network protocols, as well 
> as the 68000 and many other processors.

There used to be mainframes with various forms of middle-endian layouts. 
Fortunately they are no longer around.

http://www.retrologic.com/jargon/M/middle-endian.html


> For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
> number.  Little-endian puts the least significant byte first, while 
> big-endian puts the most significant byte first.

In this context, least significant and most significant may need explaining.

In decimal numbers, we write one hundred and twenty-three as 123. The 1 is most 
significant, because it represents 1 HUNDRED rather than 1 UNIT. And similarly 
the 3 is least significant. So numbers using Arabic numerals are big-endian.

The same applies for computer integers. 123 written in hexadecimal is 7B, which 
of course is big-endian just like decimal. But when storing this number in 
memory, we have a choice: we can store it in big-endian format, just like we 
write it: 7B, where the 7 is the "left-most" (lowest address) number. Or we can 
store it in little-endian format, B7, where the 7 has the higher address, and 
read from right-to-left.

And of course, bytes themselves can be either little-endian or big-endian, 
*independently* of byte ordering within larger units.

http://en.wikipedia.org/wiki/Endianness
http://en.wikipedia.org/wiki/Bit_numbering



-- Steven
___
Tutor maillist  -  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/listinfo/tutor


Re: [Tutor] Avoiding reauthentication to web services?

2011-07-21 Thread Steven D'Aprano

Ryan on the Beach wrote:


Hello.
I am trying to write a python program to control a  lighting controller through 
it's rest interface.  It requires ssl and basic authentication.  I have been 
successful using urllib2.  However, the authentication takes a very long time 
on the controller so multiple http gets are slow.  I believe this is because of 
the controller itself.
In a web browser after I authenticate each request is very fast, presumably because the browser is not re-authenticating again and again.In an attempt to fix this I tried httplib2 after some googling thinking it might give me the desired result, but it does not either.  
Can anyone suggest how this would be accomplished?  I want to keep the connection "open".  At least so it does not re-authenticate over and over again, similar to how it works within a web browser.  Is this possible?


My guess is that it may use cookies to stay authenticated. See the 
cookielib. What happens if you tell the browser to reject cookies?




--
Steven

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread Tahir Hafiz
Cloud9 seems interesting as a browser based IDE. Do you know if there is a
way to run Python code as well create/edit it?

Thanks,
Tahir

On Thu, Jul 21, 2011 at 5:30 PM, Corey Richardson  wrote:

> Excerpts from James Reynolds's message of Thu Jul 21 10:40:53 -0400 2011:
> > I might have to discuss some routines I've written in Python (and
> possibly
> > C). It would be easier to whip out the Ipad and show them some of the
> things
> > I've done, rather than a bulky laptop.
> >
> > I could of course PDF everything with highlighting off of eclipse, but
> > ideally Ideally I would prefer a way for the user to interact with the
> text,
> > rather than an image.
> >
> > So basically, an IDE or text editor with syntax highlighting for python.
> >
> > If you have any thoughts, I would greatly appreciate it!
>
> If you have a browser, Cloud9 IDE might be able to do it. Or you could use
> pygments to render the text to HTML and ... do you even have filesystem
> access on an ipad? (This is assuming you don't want your code out public
> for the whole world to see). So your best bet would probably be Cloud9 or
> a similar product.
> --
> Corey Richardson
>  "Those who deny freedom to others, deserve it not for themselves"
> -- Abraham Lincoln
>
> ___
> Tutor maillist  -  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/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread ian douglas
Yes, Cloud9 supports running/debugging/testing. They've also got github 
support for pulling in your projects. It's a pretty clever tool.



On 07/21/2011 01:24 PM, Tahir Hafiz wrote:
Cloud9 seems interesting as a browser based IDE. Do you know if there 
is a way to run Python code as well create/edit it?


Thanks,
Tahir

On Thu, Jul 21, 2011 at 5:30 PM, Corey Richardson > wrote:


Excerpts from James Reynolds's message of Thu Jul 21 10:40:53
-0400 2011:
> I might have to discuss some routines I've written in Python
(and possibly
> C). It would be easier to whip out the Ipad and show them some
of the things
> I've done, rather than a bulky laptop.
>
> I could of course PDF everything with highlighting off of
eclipse, but
> ideally Ideally I would prefer a way for the user to interact
with the text,
> rather than an image.
>
> So basically, an IDE or text editor with syntax highlighting for
python.
>
> If you have any thoughts, I would greatly appreciate it!

If you have a browser, Cloud9 IDE might be able to do it. Or you
could use
pygments to render the text to HTML and ... do you even have
filesystem
access on an ipad? (This is assuming you don't want your code out
public
for the whole world to see). So your best bet would probably be
Cloud9 or
a similar product.
--
Corey Richardson
 "Those who deny freedom to others, deserve it not for themselves"
-- Abraham Lincoln

___
Tutor maillist  - 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/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread Corey Richardson
Excerpts from Tahir Hafiz's message of Thu Jul 21 16:24:22 -0400 2011:
> Cloud9 seems interesting as a browser based IDE. Do you know if there is a
> way to run Python code as well create/edit it?
> 

Not as far as I know.
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
 -- Abraham Lincoln


signature.asc
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread Corey Richardson
Excerpts from ian douglas's message of Thu Jul 21 16:44:17 -0400 2011:
> Yes, Cloud9 supports running/debugging/testing. They've also got github 
> support for pulling in your projects. It's a pretty clever tool.
> 

Could you share your secret? I didn't dig enough to figure it out. I saw the
"Run" button and its configuration, but it looks like it wants a JS file and
args? Or...maybe not?
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
 -- Abraham Lincoln


signature.asc
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] (no subject)

2011-07-21 Thread Ryan Strunk

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Viability of Python

2011-07-21 Thread Ryan Strunk
Hello everyone,
I have been reading a lot of different articles recently, and I have
found a divergence of opinions on the viability of Python as a viable
language for high-end programs. At the same time, even sites that
recommend Python seem to recommend it as a good first language.
This email is not written to stir up controversy. I am a fan of Python
myself and use it for all of my programming. But therein lies the crux
of my question. If Python has limitations, what are they? What sorts
of things is Python useful for and what things is it not? And finally,
if there is code after Python, what’s a good second language, and when
should someone start learning it?
Thanks for any help you can give.
Best,
Ryan
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread ian douglas

On 07/21/2011 01:46 PM, Corey Richardson wrote:

Excerpts from ian douglas's message of Thu Jul 21 16:44:17 -0400 2011:

Yes, Cloud9 supports running/debugging/testing. They've also got github
support for pulling in your projects. It's a pretty clever tool.


Could you share your secret? I didn't dig enough to figure it out. I saw the
"Run" button and its configuration, but it looks like it wants a JS file and
args? Or...maybe not?


Ah, my bad. Creating files should be allowed, but running *Python* files 
seems to still be on their TODO list as of March 23rd. Sorry for the 
misinformation.


As soon as they Email me a password recovery message, (I signed up in 
May at Google IO), I can get more information to the list.


-id

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread James Reynolds
Thanks for the input.

I received another email off list and I think i'm going to look into "
Textastic".

The Cloud9 seems interesting, but I'm not assured to have internet access
all the time (even if I do live in NYC).

Thanks for all the replies!


On Thu, Jul 21, 2011 at 5:09 PM, ian douglas wrote:

> On 07/21/2011 01:46 PM, Corey Richardson wrote:
>
>> Excerpts from ian douglas's message of Thu Jul 21 16:44:17 -0400 2011:
>>
>>> Yes, Cloud9 supports running/debugging/testing. They've also got github
>>> support for pulling in your projects. It's a pretty clever tool.
>>>
>>>  Could you share your secret? I didn't dig enough to figure it out. I saw
>> the
>> "Run" button and its configuration, but it looks like it wants a JS file
>> and
>> args? Or...maybe not?
>>
>
> Ah, my bad. Creating files should be allowed, but running *Python* files
> seems to still be on their TODO list as of March 23rd. Sorry for the
> misinformation.
>
> As soon as they Email me a password recovery message, (I signed up in May
> at Google IO), I can get more information to the list.
>
> -id
>
>
> __**_
> Tutor maillist  -  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/listinfo/tutor


[Tutor] Stack problem usind Python2.6

2011-07-21 Thread David Merrick
##from stack import Stack

class Stack:
def __init__(self):
self.items =[]

def isEmpty(self):
return self.items ==[]

def push(self,item):
self.items.append(item)

def pop(self,item):
self.items.pop()

def peek(self):
return  self.items[len(self.items)-1]

def size(self):
return len(self.items)

def parChecker(symbolString):
s = Stack()

balanced = True
index = 0
while index < len(symbolString) and balanced:
symbol = symbolString[index]
if symbol in "([{":
s.push(symbol)
else:
if s.isEmpty():
balanced = False
else:
top = s.pop()
if not matches(top,symbol):
balanced = False
index+=1
if balanced and  s.isEmpty():
return True
else:
return False

def matches(open,close):
opens = "([{"
closers = ")]}"

opens.index(open) == closers.index(close)

symbolString = "()"
print(parChecker(symbolString))

*Output*

() returns False should be true
(() returns False which is correct

I can't find the error please help me

-- 
Dave Merrick

merrick...@gmail.com

Ph   03 3423 121
Cell 027 3089 169
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread bob gailer

On 7/21/2011 12:30 PM, Corey Richardson wrote:

If you have a browser, Cloud9 IDE might be able to do it.

I just tried Cloud9 and gave up in frustration.

Unintuitive interfacre. No help. Finally edited a program. Tried to run 
it. No results. Sigh.


Also appears to be a free TRIAL only.

--
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] Stack problem usind Python2.6

2011-07-21 Thread bob gailer

On 7/21/2011 5:16 PM, David Merrick wrote:

##from stack import Stack

class Stack:
def __init__(self):
self.items =[]

def isEmpty(self):
return self.items ==[]

def push(self,item):
self.items.append(item)

def pop(self,item):
self.items.pop()

def peek(self):
return  self.items[len(self.items)-1]

def size(self):
return len(self.items)

def parChecker(symbolString):
s = Stack()

balanced = True
index = 0
while index < len(symbolString) and balanced:
symbol = symbolString[index]
if symbol in "([{":
s.push(symbol)
else:
if s.isEmpty():
balanced = False
else:
top = s.pop()
if not matches(top,symbol):
balanced = False
index+=1
if balanced and  s.isEmpty():
return True
else:
return False

def matches(open,close):
opens = "([{"
closers = ")]}"

opens.index(open) == closers.index(close)

symbolString = "()"
print(parChecker(symbolString))

_*Output*_

() returns False should be true
(() returns False which is correct

I can't find the error please help me


What do you tkink matches returns, and why?

Therein is the problem.

Also FWIW you import Stack them redefine it. Why?


--
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] Stack problem usind Python2.6

2011-07-21 Thread James Reynolds
On Thu, Jul 21, 2011 at 5:16 PM, David Merrick  wrote:

> ##from stack import Stack
>
> class Stack:
> def __init__(self):
> self.items =[]
>
> def isEmpty(self):
> return self.items ==[]
>
> def push(self,item):
> self.items.append(item)
>
> def pop(self,item):
> self.items.pop()
>
> def peek(self):
> return  self.items[len(self.items)-1]
>
> def size(self):
> return len(self.items)
>
> def parChecker(symbolString):
> s = Stack()
>
> balanced = True
> index = 0
> while index < len(symbolString) and balanced:
> symbol = symbolString[index]
> if symbol in "([{":
> s.push(symbol)
> else:
> if s.isEmpty():
> balanced = False
> else:
> top = s.pop()
> if not matches(top,symbol):
> balanced = False
> index+=1
> if balanced and  s.isEmpty():
> return True
> else:
> return False
>
> def matches(open,close):
> opens = "([{"
> closers = ")]}"
>
> opens.index(open) == closers.index(close)
>
> symbolString = "()"
> print(parChecker(symbolString))
>
> *Output*
>
> () returns False should be true
> (() returns False which is correct
>
> I can't find the error please help me
>
> --
> Dave Merrick
>
> merrick...@gmail.com
>
> Ph   03 3423 121
> Cell 027 3089 169
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
























The class stack seems to basically be a list. Why not just use a list (which
is already an object) to do the things that you want it to do? All of the
methods of the class are already methods of a list, so it seems like your
creating code that is already in python (unless there is more to it than I'm
missing)


In your ParChecker function, instead of setting a variable to false, why not
add a "break" statement? This will allow you to do things like "if
s.isEmpty():" instead of "if balanced and  s.isEmpty():"



Basically, what's going on here,

if balanced and  s.isEmpty():
return True
else:
return False

so long as this s.isEmpty() evaluates to false (which it is in the first few
loops) you will get the "else" part, which is "return false".

If you throw in some print statements, like dummy prints (print index, or
print "a" or whatever) you will see how many loops it's making.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python editor for Ipad

2011-07-21 Thread Corey Richardson
Excerpts from bob gailer's message of Thu Jul 21 17:21:01 -0400 2011:
> On 7/21/2011 12:30 PM, Corey Richardson wrote:
> > If you have a browser, Cloud9 IDE might be able to do it.
> I just tried Cloud9 and gave up in frustration.
> 
> Unintuitive interfacre. No help. Finally edited a program. Tried to run 
> it. No results. Sigh.
> 
> Also appears to be a free TRIAL only.
> 

It says "Free for open source" on the homepage. I agree that the interface
is not intuitive. You cannot run any programs, to my knowledge, but I don't
hold that against them (I don't want my browser to become an operating 
environment/system, any more than I want my emacs to be one). It's certainly
not enough to replace my own setup but maybe someone likes this sort of
thing. It's also in Beta, I'd be willing to be that more stuff will happen
to it.
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
 -- Abraham Lincoln


signature.asc
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Stack problem usind Python2.6

2011-07-21 Thread James Reynolds
On Thu, Jul 21, 2011 at 5:16 PM, David Merrick  wrote:

> ##from stack import Stack
>
> class Stack:
> def __init__(self):
> self.items =[]
>
> def isEmpty(self):
> return self.items ==[]
>
> def push(self,item):
> self.items.append(item)
>
> def pop(self,item):
> self.items.pop()
>
> def peek(self):
> return  self.items[len(self.items)-1]
>
> def size(self):
> return len(self.items)
>
> def parChecker(symbolString):
> s = Stack()
>
> balanced = True
> index = 0
> while index < len(symbolString) and balanced:
> symbol = symbolString[index]
> if symbol in "([{":
> s.push(symbol)
> else:
> if s.isEmpty():
> balanced = False
> else:
> top = s.pop()
> if not matches(top,symbol):
> balanced = False
> index+=1
> if balanced and  s.isEmpty():
> return True
> else:
> return False
>
> def matches(open,close):
> opens = "([{"
> closers = ")]}"
>
> opens.index(open) == closers.index(close)
>
> symbolString = "()"
> print(parChecker(symbolString))
>
> *Output*
>
> () returns False should be true
> (() returns False which is correct
>
> I can't find the error please help me
>
> --
> Dave Merrick
>
> merrick...@gmail.com
>
> Ph   03 3423 121
> Cell 027 3089 169
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>




A couple more points:

* I did just run it with the break statements where you have 'balanced =
False'
* the method Stack needs a return statement (otherwise, it will return
None), as all functions without a return statement do.
* you should either get rid of the argument for pop in Stack or make it an
optional argument (item = None) if you intended to do something with item.
* You of course need to tab in this block if you decide to go the 'break'
route:

if s.isEmpty():
return True
else:
return False
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] OT: Drag and Drop GUI IDE ideas

2011-07-21 Thread Rance Hall
I know this is OT and I am sorry, but the readers of the list are some
of the best to judge my problem.  And it is about learning to code,
just not python specifically.


The MIS department at UNK is looking to create a course in business
app development.

The course will be about the app life cycle and discuss problem
statement, testing, maintenance and disposal/decommissioning, etc.

We want the students to develop a small app in the process, It could
be a firefox extension, mobile phone app, or any other type simple
structure.

The catch is that the class is for non-programmers to try to get them
introduced to the field.  We would like to use a gui ide that can
essentially hide the code from the programmer and connect widgets with
the gui.

We want them to be able to look at the code and analyze it.

We would prefer open source (read: free as in beer) tools.

Does anyone have any ideas of tools that can do this?

we are open to any idea, android sdk and gui, ipad sdk and some gui tool, etc.

Thanks for your time.

Rance
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Viability of Python

2011-07-21 Thread Emile van Sebille

On 7/21/2011 1:49 PM Ryan Strunk said...

Hello everyone,
I have been reading a lot of different articles recently, and I have
found a divergence of opinions on the viability of Python as a viable
language for high-end programs. At the same time, even sites that
recommend Python seem to recommend it as a good first language.
This email is not written to stir up controversy. I am a fan of Python
myself and use it for all of my programming. But therein lies the crux
of my question. If Python has limitations, what are they?


Programming is a big field.  If so far you've used python for all your 
programming, then it's good enough for you so far.  If you need real 
time responsiveness, want to write OSs or device drivers, or inherit a 
legacy environment it's probably not the right tool.  But everyone who 
programs will have a different take on this.  I use it unless there's a 
better answer I can deploy quicker.



What sorts
of things is Python useful for and what things is it not? And finally,
if there is code after Python, what’s a good second language, and when
should someone start learning it?


I'd say C, and I'd start by browsing the python code base.


Emile

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Viability of Python

2011-07-21 Thread David Schouten

Op 22 jul. 2011 om 00:18 heeft Emile van Sebille  het volgende 
geschreven:

> On 7/21/2011 1:49 PM Ryan Strunk said...
>> Hello everyone,
>> I have been reading a lot of different articles recently, and I have
>> found a divergence of opinions on the viability of Python as a viable
>> language for high-end programs. At the same time, even sites that
>> recommend Python seem to recommend it as a good first language.
>> This email is not written to stir up controversy. I am a fan of Python
>> myself and use it for all of my programming. But therein lies the crux
>> of my question. If Python has limitations, what are they?
> 
> Programming is a big field.  If so far you've used python for all your 
> programming, then it's good enough for you so far.  If you need real time 
> responsiveness, want to write OSs or device drivers, or inherit a legacy 
> environment it's probably not the right tool.  But everyone who programs will 
> have a different take on this.  I use it unless there's a better answer I can 
> deploy quicker.
> 
>> What sorts
>> of things is Python useful for and what things is it not? And finally,
>> if there is code after Python, what’s a good second language, and when
>> should someone start learning it?
> 
> I'd say C, and I'd start by browsing the python code base.
> 
> 
> Emile
> 
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

How would one acces the code base? Some time ago, someone responded to a 
question on this list by reccomending to study the built-in modules, where are 
those stored?

I'm using Mac OS X 10.7 with python 3, in case this is relevant. 

David Schouten. 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Viability of Python

2011-07-21 Thread Prasad, Ramit
>How would one acces the code base? Some time ago, someone responded to a 
>question on this list by reccomending to study the built-in modules, where are 
>those stored?
>I'm using Mac OS X 10.7 with python 3, in case this is relevant. 

General documentation is located http://docs.python.org/py3k/ , but I think you 
want http://docs.python.org/py3k/library/index.html . The full list of modules 
is located http://docs.python.org/py3k/py-modindex.html .  


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Viability of Python

2011-07-21 Thread James Reynolds
Source files for the 3.2 branch are located here:

http://hg.python.org/cpython/file/f0475f78d45c

the modules and objects directory has a lot of c files. there some
elsewhere. In modules theres some that start with XX. those are
demonstration i believe.

On Thu, Jul 21, 2011 at 6:46 PM, Prasad, Ramit wrote:

> >How would one acces the code base? Some time ago, someone responded to a
> question on this list by reccomending to study the built-in modules, where
> are those stored?
> >I'm using Mac OS X 10.7 with python 3, in case this is relevant.
>
> General documentation is located http://docs.python.org/py3k/ , but I
> think you want http://docs.python.org/py3k/library/index.html . The full
> list of modules is located http://docs.python.org/py3k/py-modindex.html .
>
>
> Ramit
>
>
> Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
> 712 Main Street | Houston, TX 77002
> work phone: 713 - 216 - 5423
>
>
> This communication is for informational purposes only. It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction. All market prices, data and other information are not
> warranted as to completeness or accuracy and are subject to change
> without notice. Any comments or statements made herein do not
> necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
> and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
>
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to European legal entities.
> ___
> Tutor maillist  -  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/listinfo/tutor


Re: [Tutor] Removing characters in a string using format()

2011-07-21 Thread Ryan Porter

Thanks for help, James! It works perfectly.

Ryan

On 7/21/2011 11:13 AM, James Reynolds wrote:

Since you're using python 3, you can just use a star to unpack the list

like so:

>>> print(*x)
a b
>>> print(*x, sep = ', ')
a, b

You can use sep to change the separator if you want the commas still.


On Thu, Jul 21, 2011 at 1:53 PM, Ryan Porter 
mailto:websterhams...@felton4h.net>> wrote:


Hi there,

In one part of a program I'm writing, I want a list to be printed
to the string. Here's my code:

# Begin snippet
listString = input('Please enter a single item: >').strip();

/print();
   itemList.append(listString);
/

/...
/

/print('And here it is in alphabetical order:', itemList)
# End Snippet
/

However, when I print the list, I get something like this:
['Python', 'best', 'ever', 'is', 'language', 'programming', 'the']
with brackets. Is there a way to use format() to remove the
brackets before the list is printed?

Thanks for the help!
//

___
Tutor maillist  - Tutor@python.org 
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor





--

Ryan Porter Web Design & Piano Lessons

/"For my soul delighteth in the song of the heart; yea, the song of the 
righteous is a prayer unto me, and it shall be answered with a blessing 
upon their heads." ~D&C 25:12/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Wayne Werner
On Jul 21, 2011 9:23 AM, "Lisi"  wrote:
>
> On Tuesday 19 July 2011 22:43:40 Alan Gauld wrote:
> > Growing to hate my Netbook keyboard more by the day!
>
> Attach another keyboard?  (To keep life simple it would have to be usb,
but
> you can even get a keyboard that will roll up for carrying.  I have
neither
> seen nor tried one, so it may be no good!)
>
> Lisi

Having used and owning the roll up kind, they're not very good. It's very
similar to typing on a bad keyboard with the keys off. I bought a smaller
keyboard for $10 on amazon that had full size keys and was quite nice, until
the stress of sticking it in my backpack shorted the cord. That's what I'd
recommend if you still want something portable, though it's easily the size
of my wife's netbook.

If you want a good keyboard, I'm addicted to mechanical switched keyboards,
despite the price tag.

-Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor