Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 36
    \$\begingroup\$ It's 6 bytes shorter without the as o part... (import os \n os.system("echo |xclip") \$\endgroup\$ Commented Feb 27, 2017 at 0:02
  • 4
    \$\begingroup\$ You can also replace echo with : for ":|xclip" \$\endgroup\$ Commented Feb 27, 2017 at 0:04
  • 24
    \$\begingroup\$ Or just one line at 37 bytes: __import__('os').system("echo|xclip") \$\endgroup\$ Commented Feb 27, 2017 at 0:23
  • 4
    \$\begingroup\$ There's also an alternative to xclip called xsel on Linux systems, which would save you another byte - and as already mentioned, remove the "as o" import part again, it just makes things longer: import os;os.system(":|xsel") (29 bytes). \$\endgroup\$ Commented Mar 1, 2017 at 16:01
  • 3
    \$\begingroup\$ Don't edit other people's code. If you have any suggestions leave them in the comments. \$\endgroup\$ Commented Mar 3, 2017 at 23:20