Skip to content

Commit 153f741

Browse files
authored
Merge pull request metafy-social#383 from SiddheshKukade/master
Feature Request : Copy to Clipboard form file
2 parents 528b0fb + 7b6f28a commit 153f741

File tree

3 files changed

+75
-33
lines changed

3 files changed

+75
-33
lines changed

README.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,21 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
8080
<sub><b>Agnish Ghosh</b></sub>
8181
</a>
8282
</td>
83+
<td align="center">
84+
<a href="https://github.com/SiddheshKukade">
85+
<img src="https://avatars.githubusercontent.com/u/65951872?v=4" width="100;" alt="SiddheshKukade"/>
86+
<br />
87+
<sub><b>Siddhesh Bhupendra Kuakde</b></sub>
88+
</a>
89+
</td></tr>
90+
<tr>
8391
<td align="center">
8492
<a href="https://github.com/rahulkarda">
8593
<img src="https://avatars.githubusercontent.com/u/76204863?v=4" width="100;" alt="rahulkarda"/>
8694
<br />
8795
<sub><b>Rahul Karda</b></sub>
8896
</a>
89-
</td></tr>
90-
<tr>
97+
</td>
9198
<td align="center">
9299
<a href="https://github.com/muratonuryildirim">
93100
<img src="https://avatars.githubusercontent.com/u/77264793?v=4" width="100;" alt="muratonuryildirim"/>
@@ -122,15 +129,22 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
122129
<br />
123130
<sub><b>Abhishek Kushwaha</b></sub>
124131
</a>
132+
</td></tr>
133+
<tr>
134+
<td align="center">
135+
<a href="https://github.com/Khushi260">
136+
<img src="https://avatars.githubusercontent.com/u/94845508?v=4" width="100;" alt="Khushi260"/>
137+
<br />
138+
<sub><b>Khushi Jha</b></sub>
139+
</a>
125140
</td>
126141
<td align="center">
127142
<a href="https://github.com/yunghog">
128143
<img src="https://avatars.githubusercontent.com/u/41548444?v=4" width="100;" alt="yunghog"/>
129144
<br />
130145
<sub><b>YUNGH OG</b></sub>
131146
</a>
132-
</td></tr>
133-
<tr>
147+
</td>
134148
<td align="center">
135149
<a href="https://github.com/Farhan-2222">
136150
<img src="https://avatars.githubusercontent.com/u/87274221?v=4" width="100;" alt="Farhan-2222"/>
@@ -152,26 +166,12 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
152166
<sub><b>Raihan Khan</b></sub>
153167
</a>
154168
</td>
155-
<td align="center">
156-
<a href="https://github.com/SiddheshKukade">
157-
<img src="https://avatars.githubusercontent.com/u/65951872?v=4" width="100;" alt="SiddheshKukade"/>
158-
<br />
159-
<sub><b>Siddhesh Bhupendra Kuakde</b></sub>
160-
</a>
161-
</td>
162169
<td align="center">
163170
<a href="https://github.com/ArshErgon">
164171
<img src="https://avatars.githubusercontent.com/u/40994679?v=4" width="100;" alt="ArshErgon"/>
165172
<br />
166173
<sub><b>Mohd Arsh Ali </b></sub>
167174
</a>
168-
</td>
169-
<td align="center">
170-
<a href="https://github.com/Khushi260">
171-
<img src="https://avatars.githubusercontent.com/u/94845508?v=4" width="100;" alt="Khushi260"/>
172-
<br />
173-
<sub><b>Khushi Jha</b></sub>
174-
</a>
175175
</td></tr>
176176
<tr>
177177
<td align="center">
@@ -489,6 +489,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
489489
<sub><b>Arijit Ghosh</b></sub>
490490
</a>
491491
</td>
492+
<td align="center">
493+
<a href="https://github.com/Yaswanth820">
494+
<img src="https://avatars.githubusercontent.com/u/55750562?v=4" width="100;" alt="Yaswanth820"/>
495+
<br />
496+
<sub><b>Balaji Yaswanth Vankala</b></sub>
497+
</a>
498+
</td>
492499
<td align="center">
493500
<a href="https://github.com/Danuragtiwari">
494501
<img src="https://avatars.githubusercontent.com/u/86867000?v=4" width="100;" alt="Danuragtiwari"/>
@@ -509,15 +516,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
509516
<br />
510517
<sub><b>Heshanthaka</b></sub>
511518
</a>
512-
</td>
519+
</td></tr>
520+
<tr>
513521
<td align="center">
514522
<a href="https://github.com/Gokul-Ks">
515523
<img src="https://avatars.githubusercontent.com/u/73174047?v=4" width="100;" alt="Gokul-Ks"/>
516524
<br />
517525
<sub><b>Gokul_Zuzu</b></sub>
518526
</a>
519-
</td></tr>
520-
<tr>
527+
</td>
521528
<td align="center">
522529
<a href="https://github.com/KuSantosh100">
523530
<img src="https://avatars.githubusercontent.com/u/97560663?v=4" width="100;" alt="KuSantosh100"/>
@@ -552,15 +559,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
552559
<br />
553560
<sub><b>Raj Saha </b></sub>
554561
</a>
555-
</td>
562+
</td></tr>
563+
<tr>
556564
<td align="center">
557565
<a href="https://github.com/ramonsaraiva">
558566
<img src="https://avatars.githubusercontent.com/u/5559120?v=4" width="100;" alt="ramonsaraiva"/>
559567
<br />
560568
<sub><b>Ramon Saraiva</b></sub>
561569
</a>
562-
</td></tr>
563-
<tr>
570+
</td>
564571
<td align="center">
565572
<a href="https://github.com/riyajaiswal25">
566573
<img src="https://avatars.githubusercontent.com/u/84279900?v=4" width="100;" alt="riyajaiswal25"/>
@@ -595,15 +602,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
595602
<br />
596603
<sub><b>Anjali Chauhan</b></sub>
597604
</a>
598-
</td>
605+
</td></tr>
606+
<tr>
599607
<td align="center">
600608
<a href="https://github.com/anshrusia200">
601609
<img src="https://avatars.githubusercontent.com/u/85791796?v=4" width="100;" alt="anshrusia200"/>
602610
<br />
603611
<sub><b>Ansh Rusia</b></sub>
604612
</a>
605-
</td></tr>
606-
<tr>
613+
</td>
607614
<td align="center">
608615
<a href="https://github.com/arpitbhardwaj">
609616
<img src="https://avatars.githubusercontent.com/u/23013825?v=4" width="100;" alt="arpitbhardwaj"/>
@@ -638,15 +645,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
638645
<br />
639646
<sub><b>Null</b></sub>
640647
</a>
641-
</td>
648+
</td></tr>
649+
<tr>
642650
<td align="center">
643651
<a href="https://github.com/yashbrid03">
644652
<img src="https://avatars.githubusercontent.com/u/65955929?v=4" width="100;" alt="yashbrid03"/>
645653
<br />
646654
<sub><b>Yash Nilesh Brid</b></sub>
647655
</a>
648-
</td></tr>
649-
<tr>
656+
</td>
650657
<td align="center">
651658
<a href="https://github.com/mclmza">
652659
<img src="https://avatars.githubusercontent.com/u/7353871?v=4" width="100;" alt="mclmza"/>
@@ -681,15 +688,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
681688
<br />
682689
<sub><b>Prathamesh Nayak</b></sub>
683690
</a>
684-
</td>
691+
</td></tr>
692+
<tr>
685693
<td align="center">
686694
<a href="https://github.com/smit-sms">
687695
<img src="https://avatars.githubusercontent.com/u/52400400?v=4" width="100;" alt="smit-sms"/>
688696
<br />
689697
<sub><b>Smit Shah</b></sub>
690698
</a>
691-
</td></tr>
692-
<tr>
699+
</td>
693700
<td align="center">
694701
<a href="https://github.com/SameerSahu007">
695702
<img src="https://avatars.githubusercontent.com/u/29480670?v=4" width="100;" alt="SameerSahu007"/>

scripts/Copy to clipboard/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copy to Clipboard
2+
A tool that will help you to copy the contents of a file having any size without opening that file
3+
## Usage/Examples
4+
```sh
5+
$ clipboard.py <fileName>
6+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os
2+
import sys
3+
import platform
4+
import subprocess
5+
6+
# Seeing if the file exists
7+
if os.path.exists(sys.argv[1]):
8+
# Open Only if the file exists on the computer
9+
f = open(sys.argv[1], "r")
10+
# Storing the Content of the file in the f_contents variable
11+
f_contents = f.read()
12+
# closing the opened file
13+
f.close()
14+
else:
15+
# If the file Doesn't Exists
16+
print("File Not found : copy2clip <file_name>")
17+
exit(1)
18+
# Storing the current OS version
19+
whatos = platform.system()
20+
# If Darwin or Ubuntu
21+
if whatos == "Darwin":
22+
subprocess.run("pbcopy", universal_newlines=True, input=f_contents)
23+
print("success: copied to clipboard")
24+
# If Windows
25+
elif whatos == "Windows":
26+
subprocess.run("clip", universal_newlines=True, input=f_contents)
27+
print("success: copied to clipboard")
28+
else:
29+
print("failed: clipboard not supported")

0 commit comments

Comments
 (0)