Python Forum
can I run python code from python 3 ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can I run python code from python 3 ?
#1
I will explain

I have main code running on python3
I want to use also anoter code I wrote on python2 and import it as a "function"

can I do this?

the import code is base on "pynmea2" - if it's matter (get gps data from modem)

Thanks ,
Reply
#2
take a look at: https://docs.python.org/3/howto/pyporting.html
run your code through the converter, and all should be ok
Reply
#3
I will try it
Thank you!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python multiple try except block in my code -- can we shorten code mg24 10 6,170 Nov-10-2022, 12:48 PM
Last Post: DeaD_EyE
  Converting SQL Code To Python Code Query eddywinch82 13 30,078 Feb-15-2020, 06:42 PM
Last Post: buran
  how to get some values from js on python console by python code vivekagrey 1 1,888 Feb-13-2020, 09:26 PM
Last Post: micseydel
  Can someone please help me convert this simple C ROT cipher code to Python code? boohoo9 5 3,458 Jun-14-2019, 03:02 PM
Last Post: DeaD_EyE
  If Python 2.x source code and applies a transform it into valid Python 3.x code. vivekm 1 2,175 May-20-2019, 05:12 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020