Re: [Tutor] characters

2010-03-30 Thread Shurui Liu (Aaron Liu)
yeah, thank you! On Wed, Mar 31, 2010 at 1:41 AM, Christian Witts wrote: > Shurui Liu (Aaron Liu) wrote: >> >> In Python, could space be counted as a character same as a letter? >> >> > > len(...) >   len(object) -> integer >     Return the number of items of a sequence or mapping. > > As a space

Re: [Tutor] characters

2010-03-30 Thread Christian Witts
Shurui Liu (Aaron Liu) wrote: In Python, could space be counted as a character same as a letter? len(...) len(object) -> integer Return the number of items of a sequence or mapping. As a space is an item it will be counted. -- Kind Regards, Christian Witts _

[Tutor] characters

2010-03-30 Thread Shurui Liu (Aaron Liu)
In Python, could space be counted as a character same as a letter? -- Shurui Liu (Aaron Liu) Computer Science & Engineering Technology University of Toledo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] Simple bank account oriented object

2010-03-30 Thread Lie Ryan
On 03/31/2010 01:26 PM, Marco Rompré wrote: > > Please help me i think im on the right track but i need some guidance in > the dark. lol And what's your question? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht

[Tutor] Simple bank account oriented object

2010-03-30 Thread Marco Rompré
Hi im doin a programmin course at university and in one on my exercise i have to do that I had to define a class CompteBancaire(CompteBancaire is bankaccount in french), that would allow me to create objects Compte1, Compte2,etc. The following methods need to be defined - depot(somme)

Re: [Tutor] Remote access from Windows PC to a Linux box

2010-03-30 Thread Lie Ryan
On 03/31/2010 03:29 AM, Mike Baker wrote: > Hi, > > I'm trying to connect to a Linux box from my Windows machine and execute > a series of commands - (ls, pwd, cat 'somefile', etc...). I'm using > Putty to do the ssh and have set up with Putty's Pagent agent to allow > me to enter a passphrase

Re: [Tutor] Need some help on "How to Think Like a Computer Scientist: Learning with Python" exercise

2010-03-30 Thread Lie Ryan
On 03/31/2010 04:00 AM, Yahoo Mail wrote: > Hello All, > > I am competely new in Python programming. When i reading Chapter 4 in > "How to Think Like a Computer Scientist: Learning with Python" , > I am stuck in the exercise 4. > > Here is the question: > > Enter the following expressions int

Re: [Tutor] Script Feedback

2010-03-30 Thread Damon Timm
Hello Denis & Steven - Thanks for your replies. I have taken another stab at things to try and bring it a little further up to snuff ... some more comments/thoughts follow ... On Tue, Mar 30, 2010 at 12:57 PM, Steven D'Aprano wrote: > I usually create a function "print_" or "pr", something like

Re: [Tutor] Script Feedback

2010-03-30 Thread spir ☣
On Tue, 30 Mar 2010 10:27:43 -0400 Damon Timm wrote: > As a self-taught Python user I am still looking for insight on the > most pythonic and programmatically-friendly way of accomplishing a > given task. In this case, I have written a script that will perform a > “clean bzip2″ of a directory (or

Re: [Tutor] Remote access from Windows PC to a Linux box

2010-03-30 Thread शंतनू
You can have a look @ paramiko library. http://www.lag.net/paramiko/ On 30-Mar-2010, at 9:59 PM, Mike Baker wrote: > Hi, > > I'm trying to connect to a Linux box from my Windows machine and execute a > series of commands - (ls, pwd, cat 'somefile', etc...). I'm using Putty to > do the ssh

Re: [Tutor] help (Oshan Modi) with command prompt

2010-03-30 Thread Culver, Hunt C
You didn't say what operating system, but in general terms, the python application has to know how to find your python module, say 'foo.py'. This means that the directory where foo.py is located must be on the system path or PYTHONPATH. One simple way to do this is to navigate at the command p

Re: [Tutor] help

2010-03-30 Thread bob gailer
On 3/28/2010 10:00 PM, Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? Please learn how to ask questions. In a situation like this we'd like to know what operating system you are us

[Tutor] Need some help on "How to Think Like a Computer Scientist: Learning with Python" exercise

2010-03-30 Thread Yahoo Mail
Hello All, I am competely new in Python programming. When i reading Chapter 4 in "How to Think Like a Computer Scientist: Learning with Python" , I am stuck in the exercise 4. Here is the question: Enter the following expressions into the Python shell: 1. True or False 2. True and False 3. not

Re: [Tutor] Script Feedback

2010-03-30 Thread Steven D'Aprano
On Wed, 31 Mar 2010 01:27:43 am Damon Timm wrote: [...] > My initial questions are: > > 1. Is there a better way to implement a --quiet flag? I usually create a function "print_" or "pr", something like this: def print_(obj, verbosity=1): if verbosity > 0: print obj and then have a

[Tutor] Remote access from Windows PC to a Linux box

2010-03-30 Thread Mike Baker
Hi, I'm trying to connect to a Linux box from my Windows machine and execute a series of commands - (ls, pwd, cat 'somefile', etc...). I'm using Putty to do the ssh and have set up with Putty's Pagent agent to allow me to enter a passphrase once per session to handle security keys between the tw

Re: [Tutor] How do I find information about a Python object.

2010-03-30 Thread Emile van Sebille
On 3/30/2010 8:23 AM Mike Baker said... Random Googling shows that there are things like process identification numbers available - such as proc.pid. How do I find the other options? try dir(proc) or help(proc) for starters... Emile ___ Tutor maill

Re: [Tutor] How do I find information about a Python object.

2010-03-30 Thread Albert-Jan Roskam
Hi, Are you looking for the inspect module?   import inspect help(inspect) cls = str inspect.classify_class_attrs(cls) Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess. ~~~

Re: [Tutor] How do I find information about a Python object.

2010-03-30 Thread Serdar Tumgoren
You might want to check out the below chapter from Dive Into Python: http://diveintopython.org/power_of_introspection/index.html ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinf

[Tutor] How do I find information about a Python object.

2010-03-30 Thread Mike Baker
Hi, I've downloaded IDLE python for windows. I've also downloaded Eclipse with the python addition. I have simple programs that will run on both IDLE and Eclipse. How do I get more information about a object/variable, such as proc in the example below. For example, if I execute the following:

Re: [Tutor] USB Access

2010-03-30 Thread Wayne Werner
On Tue, Mar 30, 2010 at 9:01 AM, Marc wrote: > Hi, > I was wondering if anyone could point me to Python modules or example code > for accessing USB connected devices. I would like to get as close to the > hardware as possible with Python. I would like to be able to monitor as > well as control

[Tutor] Script Feedback

2010-03-30 Thread Damon Timm
As a self-taught Python user I am still looking for insight on the most pythonic and programmatically-friendly way of accomplishing a given task. In this case, I have written a script that will perform a “clean bzip2″ of a directory (or directories). Mac OS X (via AFP and netatalk, in my case) tend

[Tutor] USB Access

2010-03-30 Thread Marc
Hi, I was wondering if anyone could point me to Python modules or example code for accessing USB connected devices. I would like to get as close to the hardware as possible with Python. I would like to be able to monitor as well as control USB connected devices. I've looked at the missile lau

Re: [Tutor] help

2010-03-30 Thread Martijn
Simple; just write python program.py in your command line :) On Tue, Mar 30, 2010 at 2:08 PM, Christian Witts wrote: > Oshan Modi wrote: > >> I have Windows 7 and am using python 2.6.. I added python.exe's address in >> the path option under enviromental variables.. i can run python in command >>

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Oshan Modi wrote: I have Windows 7 and am using python 2.6.. I added python.exe's address in the path option under enviromental variables.. i can run python in command prompt.. its just that i dont know to make it execute a file directly rather than typing the whole program again and again..

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Forwarding to the list. Martijn wrote: On Tue, Mar 30, 2010 at 12:15 PM, Christian Witts mailto:cwi...@compuscan.co.za>> wrote: Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if

Re: [Tutor] help

2010-03-30 Thread Steven D'Aprano
On Mon, 29 Mar 2010 01:00:45 pm Oshan Modi wrote: > i am only a novice and just started programming.. i am having trouble > running a .py file in the command prompt.. if anyone of you could > help? Are you running Linux or Mac? At the command prompt, run: python myfile.py and report any erro

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? ___ Tutor maillist

Re: [Tutor] help

2010-03-30 Thread vishwajeet singh
On Mon, Mar 29, 2010 at 7:30 AM, Oshan Modi wrote: > i am only a novice and just started programming.. i am having trouble > running a .py file in the command prompt.. if anyone of you could help? > How are you trying to run it ?? -- Vishwajeet Singh +91-9657702154 | dextrou...@gmail.com | h

[Tutor] help

2010-03-30 Thread Oshan Modi
i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mai