> On Mon, Mar 2, 2009 at 2:31 PM, Chris Rebert <c...@rebertia.com> wrote: >> > On Mon, Mar 2, 2009 at 2:17 PM, Chris Rebert <c...@rebertia.com> wrote: >> >> > On Mon, Mar 2, 2009 at 1:59 PM, Chris Rebert <c...@rebertia.com> >> >> > wrote: >> >> >> On Mon, Mar 2, 2009 at 12:26 AM, M Kumar <tomanis...@gmail.com> >> >> >> wrote: >> >> >> > >> >> >> > Hi, >> >> >> > >> >> >> > I am writing a server side program, clients can be any machine but >> >> >> > the >> >> >> > server machine is Linux. In program I want to use the OS module >> >> >> > based >> >> >> > on >> >> >> > the >> >> >> > client's operating system. But when I do "import os" m only able >> >> >> > to >> >> >> > get >> >> >> > the >> >> >> > module with the property of Linux. ANy idea how to import the >> >> >> > module >> >> >> > with >> >> >> > the property of clients OS. >> >> >> >> >> >> You want sys.platform; see >> >> >> http://docs.python.org/library/sys.html#sys.platform >> >> On Mon, Mar 2, 2009 at 12:43 AM, M Kumar <tomanis...@gmail.com> wrote: >> >> > Hi Chris, >> >> > Thanks for quick and kind reply, but the python program runs on the >> >> > server, >> >> > sys.platform is linux only. What I want is I need to get a module, >> >> > which >> >> > shud be exactly same as if I import os module on the client machine >> >> >> >> Um, you're not phrasing your request very clearly, so perhaps I'm not >> >> understanding what you're looking for, but I can tell you that >> >> sys.platform is certainly not Linux-only. If you'll read the docs I >> >> pointed you to, you'll see a table: >> >> System platform value >> >> Windows 'win32' >> >> <other entries snipped> >> >> >> >> Cheers, >> >> Chris >> >> On Mon, Mar 2, 2009 at 12:57 AM, M Kumar <tomanis...@gmail.com> wrote: >> > Oh that might be the problem, I m new to this and new to this kind of >> > conversations. What you said was correct. But what I am looking for is, >> > if >> > one client reqst comes I need to process the data which I got from the >> > client, so I need to use the os module. But since my program executes on >> > the >> > server os.sys.platform has the value "linux2". What I want is a module >> > having clients platform value for os.sys.platform. Any way to get that?> >> > -- >> >> How are you getting the request? HTTP? XML-RPC? SOAP? Something else >> altogether? >> If you have control of both the client and the server, it'd be easiest >> just to have the client include a parameter specifying what platform >> it is in its request to the server. >> >> Cheers, >> Chris
On Mon, Mar 2, 2009 at 1:12 AM, M Kumar <tomanis...@gmail.com> wrote: > Its just http, I am using pylons. Right now I am doing tht with extra > parameter. But even if I get to know about the platform of the client > machine, I need to use the other properties of the corresponding machine's > os module. for example I need to use "os.path". So even if I know about the > platform name how to use that information to get os module with the property > of tht particular platform. Then send os.path and whatever else you need along too. Alternatively, you might want to switch to something better suited to your purposes than a web app framework, such as pyro (http://pyro.sourceforge.net/), ICE (http://www.zeroc.com/ice.html), or PB (http://twistedmatrix.com/projects/core/documentation/howto/pb-intro.html). Cheers, Chris -- Shameless self-promotion: http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list