pwd module on Windows

View: New views
3 Messages — Rating Filter:   Alert me  

pwd module on Windows

by john.m.baker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

pwd module on Windows

Hi,

Whats the best way to cope with these errors:

ImportError: pwd module not supported on Windows

If its not supported, what should I do to do something like this:

  currentuser= pwd.getpwuid(os.geteuid())[0]

I appreciate this isnt really Jython specific, but I suspect someone has some thoughts on writing cross OS Python!

Thanks,

John



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: pwd module on Windows

by john.m.baker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
pwd module on Windows

And now I’m looking about for a solution, where by I need to check the operating system (I have other requirements to avoid running code that is platform specific – it makes calls to rsync etc.!), platform.system() returns ‘Java’, so it’s difficult to tell what is the underlying operating system.

 

Any thoughts?

 

From: Baker, John (IT/UK)
Sent: 02 November 2009 09:35
To: jython-users@...
Subject: [Jython-users] pwd module on Windows

 

Hi,

What’s the best way to cope with these errors:

ImportError: pwd module not supported on Windows

If it’s not supported, what should I do to do something like this:

  currentuser= pwd.getpwuid(os.geteuid())[0]

I appreciate this isn’t really Jython specific, but I suspect someone has some thoughts on writing cross OS Python!

Thanks,

John

 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: pwd module on Windows

by Daniel Baktiar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi john,


--- code-snippet ---
from java.lang import System

for pname in System.getProperties():
  print('%s=%s' % (pname, System.getProperty(pname)))

--- /code-snippet ---

look at properties such as:
os.name
os.arch

and some others.

regards,
daniel

2009/11/2 <john.m.baker@...>

And now I’m looking about for a solution, where by I need to check the operating system (I have other requirements to avoid running code that is platform specific – it makes calls to rsync etc.!), platform.system() returns ‘Java’, so it’s difficult to tell what is the underlying operating system.

 

Any thoughts?

 

From: Baker, John (IT/UK)
Sent: 02 November 2009 09:35
To: jython-users@...
Subject: [Jython-users] pwd module on Windows

 

Hi,

What’s the best way to cope with these errors:

ImportError: pwd module not supported on Windows

If it’s not supported, what should I do to do something like this:

  currentuser= pwd.getpwuid(os.geteuid())[0]

I appreciate this isn’t really Jython specific, but I suspect someone has some thoughts on writing cross OS Python!

Thanks,

John

 



This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users




--
Daniel Baktiar - JEEwish & Pythoneer
(http://dbaktiar.wordpress.com)

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users