Re: python3 - Import python file as module

2020-05-20 Thread Shivani Shinde
Hi Peter, Thank you for your inputs. This really helped me. Thanks! -- CONFIDENTIALITY. This email and any attachments are confidential to Alef Edge Inc., and may also be privileged, except where the email states it can be disclosed. If this email is received in error, please do not disclos

Re: python3 - Import python file as module

2020-05-18 Thread Peter Otten
shivani.shi...@alefedge.com wrote: > Hi, > I am a beginner to Python. I want to achieve the following: > > My directory structure: > > a > └── b > └── c > ├── p > │ └── q > │ └── test.py > └── x > └── y > └── run.py > > In

python3 - Import python file as module

2020-05-18 Thread shivani . shinde
Hi, I am a beginner to Python. I want to achieve the following: My directory structure: a └── b └── c ├── p │   └── q │   └── test.py └── x └── y └── run.py In my run.py file, I want to import everything from test.py(contains me

Re: Python3 : import

2017-07-07 Thread Andrew Z
On Friday, July 7, 2017 at 4:16:38 PM UTC-4, Ian wrote: > On Fri, Jul 7, 2017 at 2:00 PM, Andrew Z wrote: > > [az@hp tst1]$ python3 ./uno.py > > Traceback (most recent call last): > > File "./uno.py", line 1, in > > from . import db > > SystemError: Parent module '' not loaded, cannot perfo

Re: Python3 : import

2017-07-07 Thread Ian Kelly
On Fri, Jul 7, 2017 at 2:00 PM, Andrew Z wrote: > [az@hp tst1]$ python3 ./uno.py > Traceback (most recent call last): > File "./uno.py", line 1, in > from . import db > SystemError: Parent module '' not loaded, cannot perform relative import That error message is a bit confusing, but relat

Re: Python3 : import

2017-07-07 Thread Andrew Z
On Friday, July 7, 2017 at 4:00:51 PM UTC-4, Andrew Z wrote: > this has bee driving me nutz for the past few hours. > 2 modules are in the same directory. I want to be able to use them both: > > [code] > > [az@hp tst1]$ pwd > /home/az/Dropbox/work/Prjs/tst1 > > [az@hp tst1]$ ls -l > total 16 > -

Re: Python3 : import

2017-07-07 Thread Andrew Z
On Friday, July 7, 2017 at 4:00:51 PM UTC-4, Andrew Z wrote: > this has bee driving me nutz for the past few hours. > 2 modules are in the same directory. I want to be able to use them both: > > [code] > > [az@hp tst1]$ pwd > /home/az/Dropbox/work/Prjs/tst1 > > [az@hp tst1]$ ls -l > total 16 > -

Python3 : import

2017-07-07 Thread Andrew Z
this has bee driving me nutz for the past few hours. 2 modules are in the same directory. I want to be able to use them both: [code] [az@hp tst1]$ pwd /home/az/Dropbox/work/Prjs/tst1 [az@hp tst1]$ ls -l total 16 -rw-rw-r--. 1 az az 66 Jul 7 12:58 db.py -rw-rw-r--. 1 az az 182 Jul 7 15:54 uno.

Re: python3 import idlelib.PyShell fails

2013-06-30 Thread Helmut Jarausch
On Sun, 30 Jun 2013 13:20:24 +0200, Peter Otten wrote: Thanks a lot! Helmut. -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 import idlelib.PyShell fails

2013-06-30 Thread Peter Otten
ading from %s, line %d' \ > ^ > SyntaxError: invalid syntax > > > Looking at shlex.py from /usr/lib64/python3.3 there is no print > statement in line 56. > > But, looking at /usr/lib/python2.7/shlex.py there is this pr

python3 import idlelib.PyShell fails

2013-06-30 Thread Helmut Jarausch
hlex.py from /usr/lib64/python3.3 there is no print statement in line 56. But, looking at /usr/lib/python2.7/shlex.py there is this print statement in line 56. Why does idlelib.PyShell when imported from Python3 import shlex from Python2 ? What's going on here? Many thanks for a hint, Helmut. -- http://mail.python.org/mailman/listinfo/python-list