History

[py] add helper to check if we are on a 32bit system

Paul Brossier committed 7 years ago

Commit f912e901 parent 50392441 file · +4 −0Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/utils.py+4−0
@@ -3,11 +3,15 @@ · 2 unmodified lines
33 import os
44 import re
55 import glob
6+import struct
67 import numpy as np
78 from tempfile import mkstemp
89
910 DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'
1011
12+def is32bit():
13+ return struct.calcsize("P") * 8 == 32
14+
1115 def array_from_text_file(filename, dtype = 'float'):
1216 realpathname = os.path.join(os.path.dirname(__file__), filename)
1317 return np.loadtxt(realpathname, dtype = dtype)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t