[Tutor] Ideas about global variables for accessing project's file

2011-01-12 Thread Kann Vearasilp
Dear all, I am new to python and now having a tiny problem about accessing files from python modules I have in my project.. Here is my situation: Below is the structure of my project /src /src/modules/mod1 /src/modules/mod2 /src/data/file1 /src/data/file2 I wrote some codes in mod1 to access d

Re: [Tutor] Ideas about global variables for accessing project's file

2011-01-12 Thread Kann Vearasilp
The ConfigParser works perfectly! Thanks a bunch! Kann On Wed, 2011-01-12 at 13:59 +, Alan Gauld wrote: > "Kann Vearasilp" wrote > > > Is there a way to make a global variable for the project to make my > > life > > easier? Sometime like... P

Re: [Tutor] defining functions and classes

2011-01-15 Thread Kann Vearasilp
Do you also have to define the class attributes? class Administrator(): name = "" os = "" def Skills(name,os): name = raw_input('What is your name') os = raw_input('What is your os') self.name = name self.os = os Skills(name,os) On Sat, Jan 15, 2011 at 11:10

[Tutor] To learn multithreading in Python

2011-01-25 Thread Kann Vearasilp
Dear all, I want to learn about threading, multithreading, and parallel programming. I have never done this kind of programming before. Would python be a good kick-starting? Do you have any suggestions for tutorials, books? Kann ___ Tutor maillist - T

[Tutor] Type error: must be string or read-only character buffer, not seq

2011-04-19 Thread Kann Vearasilp
Dear all, I tried concatenating string variables with multiple strings and have the file handle write the statement into a file. I don't know why I always get the type error: must be string or read-only character buffer, not seq error. I tried casting the whole new concatenated string using str(),

Re: [Tutor] Type error: must be string or read-only character buffer, not seq

2011-04-19 Thread Kann Vearasilp
Thanks Peter, That just fixes my problem. : ) Kann On Tue, Apr 19, 2011 at 5:29 PM, Peter Otten <__pete...@web.de> wrote: > Kann Vearasilp wrote: > >> I tried concatenating string variables with multiple strings and have the >> file handle write the statement into a

[Tutor] Finding error from os.system(cmd)

2011-05-30 Thread Kann Vearasilp
Dear all, I tried using python to execute some external java program in my code. My problem is the os.system(cmd) was not working properly while executing 'java' from terminal worked just fine. I am not sure what is wrong here. Is there a way to print out/detect error in my code for this case? >>

Re: [Tutor] Finding error from os.system(cmd)

2011-05-31 Thread Kann Vearasilp
x27;s going on here... Kann On Tue, May 31, 2011 at 12:38 AM, Steven D'Aprano wrote: > Kann Vearasilp wrote: >> >> Dear all, >> >> I tried using python to execute some external java program in my code. >> My problem is the os.system(cmd) was not working p