How to import python 7.x into python3 script

Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to import python 7.x into python3 script

Muhammad Fayed
Hi,
Hope my mail find you well,
First, I want to make use of some python magic commands in my python script. How I could do it?
Second, What if I’ll reuse the function in the script in ani python session, will it work or not? If not, what is the difference?
Thank you so much,
Sincerely,
Mohamed E. Fayed
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to import python 7.x into python3 script

Steve Holden-5
Hi there,

Thanks for your note. Unfortunately "Python 7.x" does not allow us to identify the component you are trying to install. As far as magic commands go, you msy get some assistance from the page at https://stackoverflow.com/questions/10361206/how-to-run-an-ipython-magic-from-a-script-or-timing-a-python-script, which details ways to make magics available inside scripting.

The auto-response message should also give you  many possible sources for further answers to your questions.

Kind regards,
Steve


On Mon, Jan 27, 2020 at 5:04 AM Muhammad Fayed <[hidden email]> wrote:
Hi,
Hope my mail find you well,
First, I want to make use of some python magic commands in my python script. How I could do it?
Second, What if I’ll reuse the function in the script in ani python session, will it work or not? If not, what is the difference?
Thank you so much,
Sincerely,
Mohamed E. Fayed
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev

_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to import python 7.x into python3 script

Muhammad Fayed
Sorry for my late reply,
I’ve tried “import IPython.ipapi”, but I get module not found error.  
I think I’ll try to hack around my needs.
Thank you so much,
Sincerely,
Mohamed E. Fayed 

On Jan 27, 2020, at 9:53 AM, Steve Holden <[hidden email]> wrote:

Hi there,

Thanks for your note. Unfortunately "Python 7.x" does not allow us to identify the component you are trying to install. As far as magic commands go, you msy get some assistance from the page at https://stackoverflow.com/questions/10361206/how-to-run-an-ipython-magic-from-a-script-or-timing-a-python-script, which details ways to make magics available inside scripting.

The auto-response message should also give you  many possible sources for further answers to your questions.

Kind regards,
Steve


On Mon, Jan 27, 2020 at 5:04 AM Muhammad Fayed <[hidden email]> wrote:
Hi,
Hope my mail find you well,
First, I want to make use of some python magic commands in my python script. How I could do it?
Second, What if I’ll reuse the function in the script in ani python session, will it work or not? If not, what is the difference?
Thank you so much,
Sincerely,
Mohamed E. Fayed
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev


_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to import python 7.x into python3 script

Chris Barker
I’m not sure I understand the question, but I don’t think you CAN use iPytjon magic commands in scripts, they are designed to be used in the interactive environment.

That being said, there may be some Particular commands’ functionality available through the iPython API.

I, for one, would love to be able to put something like %timeit in a script, if anyone knows how to do that.

-CHB

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            <a href="tel:(206)%20526-6959" dir="ltr">(206) 526-6959   voice
7600 Sand Point Way NE   <a href="tel:(206)%20526-6329" dir="ltr" style="text-decoration-color:rgba(88,86,214,0.258824)">(206) 526-6329   fax
<a href="x-apple-data-detectors://6/1" dir="ltr" style="text-decoration-color:rgba(88,86,214,0.258824)">Seattle, WA  98115       <a href="tel:(206)%20526-6317" dir="ltr" style="text-decoration-color:rgba(88,86,214,0.258824)">(206) 526-6317   main reception

On Jan 27, 2020, at 8:46 AM, Muhammad Fayed <[hidden email]> wrote:

Sorry for my late reply,
I’ve tried “import IPython.ipapi”, but I get module not found error.  
I think I’ll try to hack around my needs.
Thank you so much,
Sincerely,
Mohamed E. Fayed 

On Jan 27, 2020, at 9:53 AM, Steve Holden <[hidden email]> wrote:

Hi there,

Thanks for your note. Unfortunately "Python 7.x" does not allow us to identify the component you are trying to install. As far as magic commands go, you msy get some assistance from the page at https://stackoverflow.com/questions/10361206/how-to-run-an-ipython-magic-from-a-script-or-timing-a-python-script, which details ways to make magics available inside scripting.

The auto-response message should also give you  many possible sources for further answers to your questions.

Kind regards,
Steve


On Mon, Jan 27, 2020 at 5:04 AM Muhammad Fayed <[hidden email]> wrote:
Hi,
Hope my mail find you well,
First, I want to make use of some python magic commands in my python script. How I could do it?
Second, What if I’ll reuse the function in the script in ani python session, will it work or not? If not, what is the difference?
Thank you so much,
Sincerely,
Mohamed E. Fayed
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev
_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev

_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev

_______________________________________________
IPython-dev mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/ipython-dev