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
>> prompt.. its just that i dont know to make it execute a file directly rather
>> than typing the whole program again and again..
>>
>>
>> On Tue, Mar 30, 2010 at 4:55 PM, Christian Witts 
>> > cwi...@compuscan.co.za>> wrote:
>>
>>Forwarding to the list.
>>
>>Martijn wrote:
>>
>>
>>On Tue, Mar 30, 2010 at 12:15 PM, Christian Witts
>>mailto:cwi...@compuscan.co.za>
>><mailto:cwi...@compuscan.co.za
>><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
>>anyone
>>   of you could help?
>>
>> 
>>
>>___
>>   Tutor maillist  -  Tutor@python.org
>><mailto:Tutor@python.org> <mailto:Tutor@python.org
>>
>><mailto:Tutor@python.org>>
>>
>>   To unsubscribe or change subscription options:
>>   http://mail.python.org/mailman/listinfo/tutor
>>If you are using Windows and just
>> installed Python and then
>>tried
>>   to execute your script with "python script_name.py" and it
>>tells
>>   you it cannot find the program to execute then it is likely
>>your
>>   environment settings as the Python installer never seems to
>>set up
>>   your path properly.
>>Go to My Computer -> Advanced Settings -> Environment
>>Settings ->
>>   Double-Click on path -> Add your python path eg. c:\python26 at
>>   the end
>>
>> I think it should be capitalized, but I'm not sure, so:
>>    For Python 2.6:
>>C:\Python26
>>For Python 3.1:
>>C:\Python31
>>If you didn't install it on the C: drive, change C: to the
>>drive letter you installed it on.
>> Also, check if there's a semicolon ( ; ) at the end of the
>>path before you add the python path, if there isn't, add it
>>first. Now you can continue :)
>> Martijn
>>
>>-> Restart and it should work.
>>-- Kind Regards,
>>   Christian Witts
>> ___
>>   Tutor maillist  -  Tutor@python.org
>><mailto:Tutor@python.org> <mailto:Tutor@python.org
>>
>><mailto:Tutor@python.org>>
>>
>>   To unsubscribe or change subscription options:
>>   http://mail.python.org/mailman/listinfo/tutor
>>
>>
>>Windows is case insensitive when it comes to paths and executables
>>names so it shouldn't matter.  The semi-colon I forgot to mention
>>though. :)
>>
>>-- Kind Regards,
>>Christian Witts
>>
>>
>>
>>___
>>Tutor maillist  -  Tutor@python.org <mailto:Tutor@python.org>
>>To unsubscribe or change subscription options:
>>http://mail.python.org/mailman/listinfo/tutor
>>
>>
>>
> Is this perhaps what you want to do ?
>
> http://www.python.org/doc/faq/windows/#how-do-i-make-python-scripts-executable
>
>
> --
> Kind Regards,
> Christian Witts
>
>
> ___
> 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] What I do wrong

2009-12-13 Thread Martijn Arts
What doesn't work, does it have errors, etc.!

On Sun, Dec 13, 2009 at 12:25 PM, Grigor Kolev wrote:

> class MyList ():
>def __init__(self, value):
>self.value = []
>for x in value:
>self.value.append(x)
>def __add__(self , other):
>return MyList(self.value+other)
>def __mul__(self , other):
>return MyList(self.value*other)
>def __getitem__(self , item):
>return MyList(self.value+item)
>def __len__(self ):
>return len(self.value)
>def __getlice__(self , low, high):
>return MyList(self.value[low:high]
>def append(self , other):
>self.list=self.list.append(other)
>return self.list
>def __getattr__(self , name):
>return getattr(self.value, name)
>def __repr__(self  ):
>return 'self.value'
> --
> Grigor Kolev 
>
> ___
> 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