sys.platform?

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

sys.platform?

by william ratcliff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Another question:

In Cpython, I usually use sys.platform to test whether I'm running on windows, linux, or macos.  In jython, sys.platform 
returns the version of java that it is running under--is there an equivalent command to determine the operating system?


Thanks,
William

------------------------------------------------------------------------------
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

Re: sys.platform?

by Jeff Emanuel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

java.lang.System.getProperty('os.name')

william ratcliff wrote:

> Another question:
>
> In Cpython, I usually use sys.platform to test whether I'm running on
> windows, linux, or macos.  In jython, sys.platform
> returns the version of java that it is running under--is there an
> equivalent command to determine the operating system?
>
>
> Thanks,
> William
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> 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
>  

------------------------------------------------------------------------------
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

Re: sys.platform?

by william ratcliff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ahh,

I have to go to the java side--thanks!
Btw--just a quick check, are all strings which come from java unicode?


Thanks again,
William

On Thu, Aug 13, 2009 at 4:12 PM, Jeff Emanuel <jemanuel@...> wrote:
java.lang.System.getProperty('os.name')

william ratcliff wrote:
Another question:

In Cpython, I usually use sys.platform to test whether I'm running on windows, linux, or macos.  In jython, sys.platform returns the version of java that it is running under--is there an equivalent command to determine the operating system?


Thanks,
William
------------------------------------------------------------------------


------------------------------------------------------------------------------
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
 


------------------------------------------------------------------------------
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

Re: sys.platform?

by Jim Baker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, os._name - sorry about that!

On Thu, Aug 13, 2009 at 2:27 PM, william ratcliff <william.ratcliff@...> wrote:
Ahh,

I have to go to the java side--thanks!
Btw--just a quick check, are all strings which come from java unicode?


Thanks again,
William


On Thu, Aug 13, 2009 at 4:12 PM, Jeff Emanuel <jemanuel@...> wrote:
java.lang.System.getProperty('os.name')

william ratcliff wrote:
Another question:

In Cpython, I usually use sys.platform to test whether I'm running on windows, linux, or macos.  In jython, sys.platform returns the version of java that it is running under--is there an equivalent command to determine the operating system?


Thanks,
William
------------------------------------------------------------------------


------------------------------------------------------------------------------
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
 


------------------------------------------------------------------------------
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




--
Jim Baker
jbaker@...

------------------------------------------------------------------------------
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

Re: sys.platform?

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Aug 13, 2009 at 4:27 PM, william
ratcliff<william.ratcliff@...> wrote:
> Btw--just a quick check, are all strings which come from java unicode?

Since Jython 2.5, yes, they are.

--
Leo Soto M.
http://blog.leosoto.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

Parent Message unknown Re: sys.platform?

by william ratcliff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry to harp on this again, but if I use java.lang.System.getPropery("os.name"), it will return
u'Windows XP'

whereas sys.platform in CPython will return 
'win32'

In code which checks for platforms, this means that everything has to be rewritten for jython.  Would it be possible to have sys.platform to return the same value as Cpython?


Thanks,
William

On Thu, Aug 13, 2009 at 5:05 PM, Eric Widhalm <eric@...> wrote:
That's not cool.

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'win32'

-Eric


At 02:27 PM 8/13/2009, william ratcliff wrote:
Ahh,

I have to go to the java side--thanks!
Btw--just a quick check, are all strings which come from java unicode?


Thanks again,
William

On Thu, Aug 13, 2009 at 4:12 PM, Jeff Emanuel <jemanuel@...> wrote:
java.lang.System.getProperty('os.name ')

william ratcliff wrote:
Another question:

In Cpython, I usually use sys.platform to test whether I'm running on windows, linux, or macos.  In jython, sys.platform returns the version of java that it is running under--is there an equivalent command to determine the operating system?


Thanks,
William


------------------------------------------------------------------------------
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: sys.platform?

by Larry Riedel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> if I use java.lang.System.getPropery("os.name"), it
> will return u'Windows XP' whereas sys.platform in
> CPython will return 'win32'.
>
> In code which checks for platforms, this means
> that everything has to be rewritten for jython.
> Would it be possible to have sys.platform to
> return the same value as Cpython?

I think of Java as a different platform from win32,
if sys.platform is used "to append platform-specific
components to sys.path"

It seems to make like with Jython, platform.system()
would return "Java", in which case platform.java_ver()
could be used to get "osinfo" information, for
applications which care that it is Java on Windows.


Larry

------------------------------------------------------------------------------
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