473,597 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Relative imports and "import X as Y"

So, will relative imports in Python 3.0 allow things like "import
..relative.impo rting.path as prettyname"? If not, why not?
Download the latest beta for your system and give it a try.

Aug 30 '08 #1
4 953
Terry Reedy wrote:
>
> So, will relative imports in Python 3.0 allow things like
"import
..relative.impo rting.path as prettyname"? If not, why not?

Download the latest beta for your system and give it a try.
Thanks for the advice, but I'd really rather not deal with
installing the entire thing alongside my existing version, possibly
causing conflicts in who knows what ways.

--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Aug 31 '08 #2
On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote:
>Download the latest beta for your system and give it a try.

Thanks for the advice, but I'd really rather not deal with
installing the entire thing alongside my existing version, possibly
causing conflicts in who knows what ways.
Then you can download tar.gz package, compile it, and try it
without installing :-)

--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
Aug 31 '08 #3
En Sun, 31 Aug 2008 07:27:12 -0300, Wojtek Walczak <gm*****@bzt.bz tescribió:
On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote:
>>Download the latest beta for your system and give it a try.

Thanks for the advice, but I'd really rather not deal with
installing the entire thing alongside my existing version, possibly
causing conflicts in who knows what ways.

Then you can download tar.gz package, compile it, and try it
without installing :-)
Or use a virtual machine, or a live CD.

--
Gabriel Genellina

Sep 2 '08 #4
Gabriel Genellina wrote:
En Sun, 31 Aug 2008 07:27:12 -0300, Wojtek Walczak
<gm*****@bzt.bz tescribió:
>On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote:
>>>Download the latest beta for your system and give it a try.

Thanks for the advice, but I'd really rather not deal
with
installing the entire thing alongside my existing version,
possibly causing conflicts in who knows what ways.

Then you can download tar.gz package, compile it, and try it
without installing :-)

Or use a virtual machine, or a live CD.
Gosh, thanks, everyone, for being so helpful!

--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Sep 2 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1422
by: peter | last post by:
Hello all, I've read all the posts concerning relative imports of modules and I am glad I saw some consensus on a syntax. At this moment I am however bound to python 2.3. Does anyone know a good workaround (or a library) which can achieve a relative import for this python version kind regards
2
3706
by: LesleyW | last post by:
I'm using a public set of schemas for GML, avaiable at www.opengis.net/gml. They all include or import each other but live in a folder hierarchy, so the import statement includes schemaLocation="../xlink/xlinks.xsd". I've written a schema that imports the top level one using schemaLocation="http://schemas.opengis.net/gml/3.1.0/base/feature.xsd". I've also tried downloading it and putting it in the schema cache but in both cases the build...
0
1449
by: Anders J. Munch | last post by:
Now 2.5 is out, and we have a syntax for explicit relative imports (PEP 328, http://www.python.org/dev/peps/pep-0328/, in case anyone wasn't paying attention). The long-term plan is that the classical import syntax becomes absolute import only, so that all imports are explicitly one or the other. You can only use relative import from within packages. Trying to import a top-level module relatively from within same directory, produces...
1
5685
by: Alexey Borzenkov | last post by:
After reading PEP-0328 I wanted to give relative imports a try: # somepkg/__init__.py <empty> # somepkg/test1.py from __future__ import absolute_import from . import test2 if __name__ == "__main__":
0
1053
by: Alan Isaac | last post by:
I'm new to relative imports and having a problem. (ValueError: Attempted relative import in non-package) I noticed this: http://www.thescripts.com/forum/thread549516.html Is this behavior intentional? I'm seeing it in Python 2.5.1. Thanks, Alan Isaac
12
2725
by: Alan Isaac | last post by:
Are relative imports broken in 2.5? Directory ``temp`` contains:: __init__.py test1.py test2.py File contents: __init__.py and test2.py are empty test1.py contains a single line::
0
1333
by: Alan Isaac | last post by:
What is the recommended packaging of demo scripts or test scripts for a package that has modules that use relative imports? Example: Suppose I have the package structure: package/ __init__.py subpackage1/
0
1206
by: Stef Mientki | last post by:
hello, I'm running Python 2.5 and want my programs to run at least under Windows and Linux (preferable also Mac). So I guess I should always use relative paths. From most modules I can call a global function, that should import a dictionary from path deeper than the module itself. The import is done in the global function. In that global function, I get the modules path by
0
1484
by: Gabriel Genellina | last post by:
En Sat, 18 Oct 2008 05:52:04 -0300, Stef Mientki <stef.mientki@gmail.com> escribió: Why don't you let the caller tell you its own location, using __file__? The above code is too much magic for me. Yes.
0
7971
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7893
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8259
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3932
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2408
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1243
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.