Тёмный
No video :(

How to call one Python File from Another Pytthon File (Vice versa) Bash Scripting using subprocess 

Soumil Shah
Подписаться 43 тыс.
Просмотров 98 тыс.
50% 1

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 84   
@nooblogs2408
@nooblogs2408 3 года назад
This is it finally, I found it ❤️
@qpraphromoo3865
@qpraphromoo3865 3 года назад
Always the one indian guy who safes ma life !
@TirthTheDev
@TirthTheDev 3 года назад
For me Mostly
@TirthTheDev
@TirthTheDev 3 года назад
@QPR Aphromoo You Indian ??
@a.d.7888
@a.d.7888 2 года назад
You Australian?
@qpraphromoo3865
@qpraphromoo3865 2 года назад
Ive got Indish roots, but born in Australia.
@arctictimberwolf
@arctictimberwolf 2 года назад
I Give you a Thumbs Up on your Video because YOU have the common courtesy to make CERTAIN that you do everything within your Power to ensure that your Viewers and Students can See your Chalk Board by increasing the Size of your Font. And also for showing you really do care in your heart by mentioning "Eye Strain" you have just gain a New Sub Bud. Thank You so much for caring^!!^
@SoumilShah
@SoumilShah 2 года назад
Thanks love you 😍
@Ayiamus7
@Ayiamus7 3 года назад
Requirement satisfied 🤗😅 Thank you very much sir😀
@bennguyen1313
@bennguyen1313 4 года назад
In the other python file, it has a __main__ and expects command-line arguments... how can you call that python file's "main", passing it arguments, and wait until it returns before continuing?
@bahanebaaz3232
@bahanebaaz3232 2 года назад
did you got your answer if yes please let me know
@ahmedshawki8303
@ahmedshawki8303 2 года назад
hey i want to ask about when i'm trying ti import cv2 or any Func. the script is not working is showing ni such a file or directory can someone help
@arvinddowlut5836
@arvinddowlut5836 2 года назад
in visual studio codes i tried 1 import (filename without py extension) 2 (filename).run() and it worked surprisingly
@vaibhavagarwal1479
@vaibhavagarwal1479 2 года назад
Damn! it did worked i was not expecting it to work comment section sure is good place thanks to you the lines of code even got shorter kudos
@unhealthyburrito6589
@unhealthyburrito6589 Год назад
Works in Idle as well thanks.
@Ajay-tz3jk
@Ajay-tz3jk 3 года назад
Thanx for this video ✅ And a request that I am beginner and little bit noob in web automation.. I need help to bypass recaptcha with some api token (2captcha,anticaptcha etc.) Please bro suggest or just make a short video 🙏🙏 .I have seen many guys looking for that topic ✅
@KarishmaKumari-pe4rj
@KarishmaKumari-pe4rj 3 года назад
Hoye hoye i really need it in my project.
@DistantKingdom
@DistantKingdom 3 года назад
thanks brother!
@norskelars5966
@norskelars5966 2 года назад
Good job! Helped me a lot!
@degeneratetech1045
@degeneratetech1045 4 года назад
import os os.system("python3 main.py") 😂😂😂
@spinx5582
@spinx5582 4 года назад
Degenerate Tech it doesnt run the file it just opens it :/
@l.r-s1431
@l.r-s1431 4 года назад
@@spinx5582 it runs it
@spinx5582
@spinx5582 4 года назад
l.r -s hmmm lemme check again maybe i did smthng wrong
@spinx5582
@spinx5582 4 года назад
l.r -s i tried it again say Python was not found...
@spinx5582
@spinx5582 4 года назад
wait nvm it works now i tried python instead of python3
@thasnia775
@thasnia775 4 года назад
How to call a python script from another python program by passing parameters
@eduardocepeda2194
@eduardocepeda2194 4 года назад
And how can I call python script using a button that was made in PyQt5 designer?
@tinablack7470
@tinablack7470 4 года назад
how i can do the same thing but when a button is pressed from first script runing using tkinter GUI the other/second .py script will be executed?
@alirezavosough4616
@alirezavosough4616 4 года назад
Tina Black Hi Dear Tina, i have same question, do you find any solutions for it?! Thank you so much
@tinablack7470
@tinablack7470 4 года назад
@@alirezavosough4616i ended up using some commands that when ever i run the .py file a window will pop up for me and let me choose the file to run the python code on it .
@ademketfi7508
@ademketfi7508 3 года назад
@@tinablack7470 hi tina I have the same Q do you have an answer for that I have an assignment and I have to figure out how to do that pls let me know If you have an answer
@UsamaChishti
@UsamaChishti 4 года назад
not done in my case? anyone can give reason......Not show any error?
@dagdbot83
@dagdbot83 2 года назад
1:20 thank you
@jairoandresriosrios6772
@jairoandresriosrios6772 3 года назад
I also need the way to terminate the thread that was executed, Example after 5 seconds ends or stops the file that was opened
@madhuribagade7172
@madhuribagade7172 4 года назад
Nice video sir but when I click login button it will open my file how I can open it
@johnvivas7480
@johnvivas7480 Год назад
Thanks!!!
@mihirkhurde3866
@mihirkhurde3866 3 месяца назад
thanks brother
@wingit7602
@wingit7602 Год назад
you should have put your picture in the bottom right. Its covering the bloody code.
@doddashekar1982
@doddashekar1982 3 года назад
Hello I want to trigger python file from outlook as soon as mail is received from specific sender.
@adnanmahmud8691
@adnanmahmud8691 Год назад
Hey Soumil, I am getting "Error 13: Permission Denied..." error message. Any idea? Thanks for the video :)
@am-vy1fb
@am-vy1fb 2 года назад
what console are you using?
@rishikasinha7795
@rishikasinha7795 3 года назад
Hi Can we kill a running file using this as well. for example in a python file we take a user input. If it is 1 run a python file if user enters 2 then kill the python file running in the background.
@actraveler8309
@actraveler8309 Год назад
Awesome!!!
@janime6327
@janime6327 Год назад
See the title there is written Pytthon
@chakithpatil3478
@chakithpatil3478 4 года назад
sir not working in my case ..even is not showing errrooorrrr.. please say what is wrong
@farooqaziz3738
@farooqaziz3738 2 года назад
Hi I am from India i have one query I want generat header files from python script so can help me?
@erikandribudiman8713
@erikandribudiman8713 4 года назад
How to import other class/def in other python file in same and different Path using import??
@SoumilShah
@SoumilShah 4 года назад
Erik Andri Budiman you would do something like from .filename import className
@manishdaga
@manishdaga 3 года назад
bro can we cannot import directly like import call
@demonplay1266
@demonplay1266 3 года назад
nice bro i finally can do this. thanks you :)
@dijjidog
@dijjidog 3 года назад
why so many dislikes?
@mrperfect503
@mrperfect503 3 года назад
can we compile directory by shell script
@MaxStudioCG2023
@MaxStudioCG2023 2 года назад
we didnt understad nothing ....
@mikolajmen7942
@mikolajmen7942 3 года назад
it does not work i got this: "SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape" HELP
@geniusleemons2103
@geniusleemons2103 3 года назад
Me too bro..Help
@darshan5945
@darshan5945 2 года назад
Thank you so much!!!!
@crusaderofpeace9863
@crusaderofpeace9863 3 года назад
How do you add arguments of the python script to the call() function? For example: I want to call python3 my_script.py "my_name" "my_address" How do I add the my_name and my_address fields to the call() function?
@bhavanajoshi6911
@bhavanajoshi6911 3 года назад
Same doubt! Did you find any solution for that? If yes please share..
@lolife1981
@lolife1981 4 года назад
Thank you.
@dtg3055
@dtg3055 2 года назад
Thank you, god
@holycow4889
@holycow4889 4 года назад
Hi Guys :) i have a question. so i made a Discord Bot, but i have 2 scripts, my Main script is the one that Runs the Bot itsels and the second one is just a scipt with a few Commands. So can i Run like bot of them using Subprocess or by Importing the Second Script?
@kutpat
@kutpat 4 года назад
did u find a solution ?
@holycow4889
@holycow4889 4 года назад
@@kutpat Not really :/ i hope you will find one
@dzbro1194
@dzbro1194 3 года назад
@@holycow4889 subprocess should work
@holycow4889
@holycow4889 3 года назад
@@dzbro1194 I kinda gave it up after not being able to find a soloution, But thanks😀
@alirezavosough4616
@alirezavosough4616 4 года назад
Hello , thank you for your video How can do this in tkinter?
@ricky5870
@ricky5870 4 года назад
same process involved
@kingclutch101_yt-_-2
@kingclutch101_yt-_-2 4 года назад
just link a function to a button in tkinter
@10ysf
@10ysf 4 года назад
You could've simple done this: import mytest
@taze9092
@taze9092 4 года назад
do you know how i can call a def in the sub script (mytest)
@jassu9917
@jassu9917 4 года назад
@@taze9092 You will have to write: mytest.methodname()
@taze9092
@taze9092 4 года назад
@@jassu9917 Oh thank you, i was still looking for that answer and now i can finally do what i want
@abubakarmeraj8040
@abubakarmeraj8040 2 года назад
please could you guide in hindi?
@noodlecruncher5493
@noodlecruncher5493 4 года назад
There is better ways to call another python file Python 3 - exec(open("file.py").read()) Python 2 - execfile("file.py") test1.py - def some_func(): print 'in test 1, unproductive' if __name__ == '__main__': # test1.py executed as script # do something some_func() Service.py - import test1 def service_func(): print 'service func' if __name__ == '__main__': # service.py executed as script # do something service_func() test1.some_func()
@SoumilShah
@SoumilShah 4 года назад
Thanks for sharing
@noodlecruncher5493
@noodlecruncher5493 4 года назад
@@SoumilShah No problem very good video tho and helpful for people looking for other ways to do it other than mine
@ayushseth1422
@ayushseth1422 2 года назад
Clear your douts first thn teach, it's irritating
@16.pranavsnair14
@16.pranavsnair14 3 года назад
Really overcomplicated
@rajkushwahar
@rajkushwahar 3 года назад
faltu timewaste
Далее
5 Tips To Organize Python Code
12:16
Просмотров 231 тыс.
5 Amazing Ways to Automate Your Life using Python
18:40
Wheel Files: Packaging Python Applications & Modules
21:10
How To Make ANY Function Asynchronous In Python 3.12
5:52
microsoft doubles down on recording your screen
10:00
It's time for change, it's time for Linux.
10:53
Просмотров 211 тыс.
Automate your job with Python
6:07
Просмотров 397 тыс.
What Can You Do with Python? - The 3 Main Applications
11:30
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,1 млн
Importing Your Own Python Modules Properly
9:56
Просмотров 221 тыс.