towerniom.blogg.se

Python 64 bit
Python 64 bit




python 64 bit

Again using the system Python on OS X 10.6: $ arch -x86_64 /usr/bin/python2.6 -c 'import sys,platform print platform.architecture(), sys.maxsize > 2**32' On one Linux system: /usr/bin/python: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, strippedīTW, here's an example of why platform is not reliable for this purpose. usr/bin/python (for architecture ppc7400): Mach-O executable ppc usr/bin/python (for architecture i386): Mach-O executable i386

python 64 bit

usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 Using the default system Python on OS X 10.6, the output is: /usr/bin/python: Mach-O universal binary with 3 architectures Here's how to do it in one line from a shell command line on most systems: file -L $(python -c 'import sys print(sys.executable)') On most systems it will report the supported architectures of an executable file. One way to answer that question is to use the operating system file command. As was noted in the question, this is important for example with Mac OS X universal executables where one executable file may contain code for multiple architectures. While the above test does accurately tell you whether the interpreter is running in a 32-bit or a 64-bit architecture, it doesn't and can't answer the question of what is the complete set of architectures that this interpreter was built for and could run in. UPDATE: I notice that I didn't really answer the question posed. Enjoy your day.For Python 2.6 and above, you can use sys.maxsize as documented here: import sys Text = "Hello John, how are you working? The last deal was great, and the team worked well. Similarly, we can tokenize the word using word_tokenize() method- from nltk.tokenize import sent_tokenize, word_tokenize When we execute the above code, it returns the following. The above code tokenizes sentences using sent_tokenize() method. from nltk.tokenize import sent_tokenize, word_tokenize First, create a Python file ' first_nltk.py' and open it in your code editor and paste the following code. We are going to discuss how to execute the NLTK script on the local machine.






Python 64 bit