Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > What's the best way to write this regular expression?

Reply
Thread Tools

What's the best way to write this regular expression?

 
 
Ian Kelly
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 1:39 PM, John Salerno <(E-Mail Removed)> wrote:
> Ok, first major roadblock. I have no idea how to install Beautiful
> Soup or lxml on Windows! All I can find are .tar files. Based on what
> I've read, I can use the easy_setup module to install these types of
> files, but when I went to download the setuptools package, it only
> seemed to support Python 2.7. I'm using 3.2. Is 2.7 just the minimum
> version it requires? It didn't say something like "2.7+", so I wasn't
> sure, and I don't want to start installing a bunch of stuff that will
> clog up my directories and not even work.


There is a fork of setuptools called "distribute" that supports Python 3.

> What's the best way for me to install these two packages? I've also
> seen a reference to using setup.py...is that a separate package too,
> or is that something that comes with Python by default?


setup.py is a file that should be included at the top-level of the
..tar files you downloaded. Generally, to install something in that
manner, you would navigate to that top-level folder and run "python
setup.py install". If you have multiple Python versions installed and
want to install the package for a specific version, then you would use
that version of Python to run the setup.py file.
 
Reply With Quote
 
 
 
 
John Salerno
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly <(E-Mail Removed)> wrote:

> There is a fork of setuptools called "distribute" that supports Python 3.


Thanks, I guess I'll give this a try tonight!

> setup.py is a file that should be included at the top-level of the
> .tar files you downloaded. *Generally, to install something in that
> manner, you would navigate to that top-level folder and run "python
> setup.py install". *If you have multiple Python versions installed and
> want to install the package for a specific version, then you would use
> that version of Python to run the setup.py file.


The only files included in the .tar.gz file is a .tar file of the same
name. So I guess the setup option doesn't exist for these particular
packages. I'll try "distribute" tonight when I have some time to mess
with all of this.

So much work just to get a 3rd party module installed!
 
Reply With Quote
 
 
 
 
Benjamin Kaplan
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 4:11 PM, John Salerno <(E-Mail Removed)> wrote:
>
> On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly <(E-Mail Removed)> wrote:
>
> > There is a fork of setuptools called "distribute" that supports Python
> > 3.

>
> Thanks, I guess I'll give this a try tonight!
>
> > setup.py is a file that should be included at the top-level of the
> > .tar files you downloaded. *Generally, to install something in that
> > manner, you would navigate to that top-level folder and run "python
> > setup.py install". *If you have multiple Python versions installed and
> > want to install the package for a specific version, then you would use
> > that version of Python to run the setup.py file.

>
> The only files included in the .tar.gz file is a .tar file of the same
> name. So I guess the setup option doesn't exist for these particular
> packages. I'll try "distribute" tonight when I have some time to mess
> with all of this.
>
> So much work just to get a 3rd party module installed!
> --



It's because your extraction program is weird. Gzip is a compression
algorithm that operates on a single file. Tar is an archive format
that combines multiple files into a single file. When we say "extract
the .tar.gz", what we mean is both uncompress the tar file and then
extract everything out of that. A lot of programs will do that in one
step. If you look inside the tar file, you should find the setup.py.
 
Reply With Quote
 
Prasad, Ramit
Guest
Posts: n/a
 
      03-07-2012
> The only files included in the .tar.gz file is a .tar file of the same

> name.


gz stands for gzip and is a form of compression (like rar/zip ).
tar stands for a tape archive. It is basically a box that holds the
files. So you need to "unzip" and then "open the box".

Normally programs like WinZip / WinRar / 7-zip will do both in one step
so you do not need to. Not sure what program youare using...

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
Reply With Quote
 
Ian Kelly
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 2:11 PM, John Salerno <(E-Mail Removed)> wrote:
> The only files included in the .tar.gz file is a .tar file of the same
> name. So I guess the setup option doesn't exist for these particular
> packages.


The setup.py file (as well as the other files) would be inside the
..tar file. Unlike a Windows zip file, which does both archival and
compression, Unix files are typically archived and compressed in two
separate steps: "tar" denotes the archival format, and "gz" denotes
the compression format. Some decompression programs are smart enough
to recognize the .tar file and automatically extract it when
decompressing. Others require you to decompress the .gz and extract
the .tar separately -- it sounds like yours is one of the latter.
 
Reply With Quote
 
John Salerno
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 3:34 PM, Ian Kelly <(E-Mail Removed)> wrote:

> The setup.py file (as well as the other files) would be inside the
> .tar file. *Unlike a Windows zip file, which does both archival and
> compression, Unix files are typically archived and compressed in two
> separate steps: "tar" denotes the archival format, and "gz" denotes
> the compression format. *Some decompression programs are smart enough
> to recognize the .tar file and automatically extract it when
> decompressing. *Others require you to decompress the .gz and extract
> the .tar separately -- it sounds like yours is one of the latter.


Ah, I see now. After opening the gz file, there was a tar file inside,
and then I just opened that file (I use 7zip for these types) and
there was a whole host of stuff inside. I didn't realize the tar file
itself was an archive, I thought it was the module! ::blush::

Maybe I don't need to mess with the "distribute" utility then, if I
can just run the setup file. I'll try that first and see what happens.

Thanks.
 
Reply With Quote
 
Evan Driscoll
Guest
Posts: n/a
 
      03-07-2012
On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote:
> gz stands for gzip and is a form of compression (like rar/zip ).
> tar stands for a tape archive. It is basically a box that holds the
> files. So you need to "unzip" and then "open the box".
>
> Normally programs like WinZip / WinRar / 7-zip will do both in one step
> so you do not need to. Not sure what program you are using...


I'm not sure what 7-zip you're referring to, because I use 7-zip and
it's always been a two-step process for me...

(Though I can't say I've looked through the preferences dialog for a
"extract .tar.gz files in one go" setting.)

Evan

 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      03-08-2012
On Thu, Mar 8, 2012 at 7:39 AM, John Salerno <(E-Mail Removed)> wrote:
> it only
> seemed to support Python 2.7. I'm using 3.2. Is 2.7 just the minimum
> version it requires? It didn't say something like "2.7+", so I wasn't
> sure, and I don't want to start installing a bunch of stuff that will
> clog up my directories and not even work.


Just to clarify: Python 2 and Python 3 are quite different. If
something requires Python 2.7, you cannot assume that it will work
with Python 3.2; anything that supports both branches will usually
list the minimum version of each (eg "2.7 or 3.3").

ChrisA
 
Reply With Quote
 
John Salerno
Guest
Posts: n/a
 
      03-08-2012
On Mar 7, 11:03*pm, Chris Angelico <(E-Mail Removed)> wrote:
> On Thu, Mar 8, 2012 at 7:39 AM, John Salerno <(E-Mail Removed)> wrote:
> > it only
> > seemed to support Python 2.7. I'm using 3.2. Is 2.7 just the minimum
> > version it requires? It didn't say something like "2.7+", so I wasn't
> > sure, and I don't want to start installing a bunch of stuff that will
> > clog up my directories and not even work.

>
> Just to clarify: Python 2 and Python 3 are quite different. If
> something requires Python 2.7, you cannot assume that it will work
> with Python 3.2; anything that supports both branches will usually
> list the minimum version of each (eg "2.7 or 3.3").
>
> ChrisA


That's why I asked first, because I got the feeling it did NOT support
Python 3
 
Reply With Quote
 
John Salerno
Guest
Posts: n/a
 
      03-08-2012
On Mar 7, 4:02*pm, Evan Driscoll <(E-Mail Removed)> wrote:
> On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote:
>
> > gz stands for gzip and is a form of compression (like rar/zip ).
> > tar stands for a tape archive. It is basically a box that holds the
> > files. So you need to "unzip" and then "open the box".

>
> > Normally programs like WinZip / WinRar / 7-zip will do both in one step
> > so you do not need to. Not sure what program you are using...

>
> I'm not sure what 7-zip you're referring to, because I use 7-zip and
> it's always been a two-step process for me...
>
> (Though I can't say I've looked through the preferences dialog for a
> "extract .tar.gz files in one go" setting.)
>
> Evan


Same here, because that's what I used. I looked through the settings
but didn't see anything. What seems to happen is that 7-Zip recognizes
the .gz extension and opens that automatically. But then that simply
opens up another window with the .tar file in it, which you have to
then open again.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to write text content from servlet Bruce Lee Java 1 10-09-2005 08:41 AM
TURNING CRAZY, is there a way to write it in a different way? whats wrong francisco lopez Javascript 2 12-31-2004 11:15 PM
Best way to write log file Pablo Tola ASP .Net 2 05-27-2004 05:41 PM
Best way to write a file n-bytes long Tony C Python 6 08-30-2003 08:25 AM
RE: Best way to write a file n-bytes long Batista, Facundo Python 0 08-27-2003 12:31 PM



Advertisments