MCPcopy
hub / github.com/pandas-dev/pandas / init_osx_pbcopy_clipboard

Function init_osx_pbcopy_clipboard

pandas/io/clipboard/__init__.py:99–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97
98
99def init_osx_pbcopy_clipboard():
100 def copy_osx_pbcopy(text):
101 text = _stringifyText(text) # Converts non-str values to str.
102 with subprocess.Popen(
103 ["pbcopy", "w"], stdin=subprocess.PIPE, close_fds=True
104 ) as p:
105 p.communicate(input=text.encode(ENCODING))
106
107 def paste_osx_pbcopy():
108 with subprocess.Popen(
109 ["pbpaste", "r"], stdout=subprocess.PIPE, close_fds=True
110 ) as p:
111 stdout = p.communicate()[0]
112 return stdout.decode(ENCODING)
113
114 return copy_osx_pbcopy, paste_osx_pbcopy
115
116
117def init_osx_pyobjc_clipboard():

Callers 1

determine_clipboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected