plataform dependent code

Z

Zunbeltz Izaola

Hi

I am using wxPython and i want to have some code plataform dependent.
Is it possible? I can't find any information about this in the net.

TIA

Zunbeltz
 
R

Rene Pijlman

Zunbeltz Izaola:
I am using wxPython and i want to have some code plataform dependent.
Is it possible?

import sys
if sys.platform == 'win32':
pass
elif sys.platform == 'linux2':
pass
I can't find any information about this in the net.

You've got to be kidding.
 
Z

Zunbeltz Izaola

import sys
if sys.platform == 'win32':
pass
elif sys.platform == 'linux2':
pass

Thanks. (so odbious)
You've got to be kidding.
no I've googled (is it a verb? :) platform dependent python in (alson
in complang.python ) and i haven't been pointed to the library
referend.

I didn't search in the reference :( ,next time i'll not forgeto to
search there

Zunbeltz
 
P

Peter Hansen

Zunbeltz said:
no I've googled (is it a verb? :) platform dependent python in (alson
in complang.python ) and i haven't been pointed to the library
referend.

I didn't search in the reference :( ,next time i'll not forgeto to

Don't feel too bad. I remember learning about this particular piece
of Python as well, and being equally surprised.

Of course, at that point I realized the value of bringing up an
interactive session and typing "import amodule; dir(amodule)" and
then checking out all the little goodies that it suggested were
there. Reading the docs is one thing; actually typing the name
(e.g. sys.version_info) yourself is quite a different thing altogether:
if you type it yourself, it _might_ actually stick in your memory! :)

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,927
Members
47,469
Latest member
benny001

Latest Threads

Top