For what it's worth, the Python core developers have selected Mercurial.
I personally use git and love it. Most open-source people seem to use
one or the other of the two. They're pretty similar in most ways.
Look at the big two sites for open-source repositories -- github and
bitbucket. One's
Depends on the project, but I'd start with git the time I created the
first file in my project. If you're in the habit of committing then you
can easily rollback missteps. If you're in the habit of making branches
you can experiment without breaking the currently-working code.
--
http://mail.
On Oct 20, 2010, at 2:00 PM, Grant Edwards wrote:
> On 2010-10-20, Shawn Milochik wrote:
> ript and execute its code, passing the arguments in.
>
>> wxPython is just Python.
>
> No, it's not.
>
> You can't assume that any windows machine with Python in
Write a small GUI in the easy-to-use and cross-platform wxPython module. All
this GUI needs to do is allow them to input the arguments. The code can then
import your stand-alone version of the script and execute its code, passing the
arguments in.
wxPython is just Python.
--
http://mail.python
Just to be pedantic (or maybe even helpful), the use of the comma
after the exception is deprecated in favor of 'as.'
So:
except ValueError as ex:
not:
except ValueError, ex:
I don't know how far back in Python versions this syntax reaches, but
if yours supports it then it's probably a good id
When will Java be popular enough to replace other languages in their own
environments, the way Python has done to Java (Jython) and .NET (IronPython)?
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
Have a look at Paramiko. It lets you do secure transfers easily (scp/sftp)
http://www.lag.net/paramiko/
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
Search Google. You'll find it all.
Search this list's archives. This kind of thing has been discussed a thousand
times.
It also wouldn't hurt to brush up on this:
http://catb.org/~esr/faqs/smart-questions.html
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 4, 2010, at 5:59 PM, Nav wrote:
> On Jan 4, 4:54 pm, Chris Rebert wrote:
>> On Mon, Jan 4, 2010 at 1:32 PM, Shawn Milochik wrote:
>>> You could put them in a dictionary with the key being the name, instead of
>>> a list.
>>
>> To illust
You could put them in a dictionary with the key being the name, instead of a
list.
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 28, 2009, at 11:28 AM, Lie Ryan wrote:
>
> I agree fuzzy searches is indispensable in certain cases, but from the way
> you're describing the issue, it appears that half of your "unsolved" problems
> comes due to the poor design of the database. I agree, that the other halves
> (e.g. ty
On Dec 27, 2009, at 1:23 PM, Lie Ryan wrote:
>
> IMHO, that's a poor example. Rather than writing a fuzzy search algorithm,
> it's easier to write a normalizer before entering data to the index (or
> before comparing the search string with the corpus' string).
> --
>
It does seem like that a
It sounds like you're looking for SQLAlchemy.
http://www.sqlalchemy.org/
Enjoy!
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
A couple of notes:
Your code is too packed together. That makes it hard to read. Put in some
whitespace (and comments, where necessary), and put spaces around your equal
signs (x = 23 instead of x=23).
That said, here's something I threw together:
#!/usr/bin/env python
def chop_list(words, si
The special features of the Shrek DVD showed how the rendering took so much
processing power that everyone's workstation was used overnight as a rendering
farm. Some kind of video rendering would make a great example. However, it
might be a lot of overhead for you to set up, unless you can find
On Jun 26, 2009, at 12:08 PM, padfoot wrote:
Sir,
Is there any module in python to open https sites through a
proxy.I am connectyed to the net via a proxy server and i am unable to
crawl https sites.
--
http://mail.python.org/mailman/listinfo/python-list
Check out the "Scrape the Web" ser
On Mon, May 11, 2009 at 5:52 PM, wrote:
> Sam,
>
> In no specific order (I brought them all):
>
> Wesley Chun's "Core Python Programming"
> David Mertz's "Text Processing in Python" (older, but excellent)
> Mark Lutz's "Learning Python"
>
> All highly recommended.
>
> Best of luck on your Python
How is the form "written in JavaScript"? Is it dynamically generated?
In any case, can you just send a POST request if you know the values required?
--
http://mail.python.org/mailman/listinfo/python-list
It depends on what you want to do. If you still want to beef up on
general knowledge, maybe skim through "The Python Cookbook" or
something reference-like.
If you feel ready to start doing something with Python, look into one
of the recent titles that applies Python for a specific purpose.
Example
On Sun, May 10, 2009 at 1:04 PM, AllenLars wrote:
>
> Thanks Shawn. I went through the ftplib info and I was able to generate a
> list. I am needing to figure out parsing the list.
>
> AllenLars
Well, start by separating out the date and the file name. You'll want
the date for sorting, and the
Thanks for the review and the podcast. I ordered the book on Friday. I
look forward to playing with it. Also (assuming you're Ron Stephens),
thanks for the Python 411 podcast. It's a great resource, and I
recommend it to all list members.
Shawn
--
http://mail.python.org/mailman/listinfo/python-lis
On Fri, May 8, 2009 at 3:46 AM, Rustom Mody wrote:
> Can someone give me a heads up on xml parsing in python?
> The context is that I want to write a simple docbook to text converter.
> DOM is alright -- dont want to break my head with SAX just for performance
> when my documents are not likely to
I know you've probably all seen this 50 times, but just in case:
http://xkcd.com/353/
And here's the result:
http://icanhascheezburger.com/2009/05/06/funny-pictures-behavior-20/
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 7, 2009 at 2:19 PM, AllenLars wrote:
>
> I am trying to code a script that will allow me to go to ftp site and
> download files based on most recently modified file (date, time). I am
> brand new to programming. Any and all help is appreciated.
> --
I've actually written code to do
> Damn! I may just go back to using Python from the command prompt
> instead of using IDLE.
>
> On second thought, IDLE is way too useful for indenting, dedenting,
> commenting and uncommenting blocks of code. Can't go back to using
> Notepad.
>
You might want to check out iPython, then -- it's
On Wed, May 6, 2009 at 2:32 PM, iainemsley wrote:
> Hi,
> I'm trying to write a fairly basic text parser to split up scenes and
> acts in plays to put them into XML. I've managed to get the text split
> into the blocks of scenes and acts and returned correctly but I'm
> trying to refine this and g
On Wed, May 6, 2009 at 2:39 PM, Grant Edwards wrote:
> On 2009-05-06, Shawn Milochik wrote:
>
>> I know I'm coming to the conversation late, but here's what I do*:
>>
>> 1. Use Cygwin. (http://www.cygwin.com/)
>> 2. Use PuttyCYG (http://code.google.
On Wed, May 6, 2009 at 1:54 PM, Tim Chase wrote:
>> for windows this works:
>> (can't cut and paste from a dos box!###%*&!!!)
>
> Depending on how it was spawned, you can either right-click in the window
> and choose Mark/Paste (when marking, use to terminate the selection;
> and selections are b
Thanks for the tips, everybody.
I've cleaned it up, and learned some useful things from your comments
and the reading they led to.
http://shawnmilo.com/ships/
--
http://mail.python.org/mailman/listinfo/python-list
The regular expression syntax is basically exactly the same. The main
difference is that a regex can't just be written into a statement as
part of the syntax; you have to create a regular expression object and
use its methods.
So, instead of:
new_thing =~ s/pattern/replacement/
it's:
myPat
On Wed, Feb 25, 2009 at 3:15 PM, Diez B. Roggisch wrote:
> Not really. The point about properties is that you *can* make attribute
> access trigger getter or setter code.
>
> But not that you do unless there is an actual reason for that. The way you
> do it now is simply introducing clutter, with
Thanks. I wasn't aware of the property() function, but I read up on
it. I modified the Vessels.py file, but not the board file (except
where necessary to handle the changes made to Vessels. Is this better?
http://shawnmilo.com/ships/ships2/
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 25, 2009 at 11:38 AM, Marco Mariani wrote:
>
> Yes it's in Python alright, but it's not Pythonese yet. You could try
> avoiding the getter/setter stuff, and camelCase method naming, things like
> that, for a start.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
What d
I started learning Java for fun, and the first project assignment in
the book is to create a game like "Battleship." So, of course, I wrote
it in Python first, just for fun. I haven't had the time to look up
all the Java syntax.
So, here it is, fully functional. I thought I'd throw it out there an
>
> Book recommendation: _Mastering Regular Expressions_, Jeffrey Friedl
> --
> Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
I wholeheartedly second this! The third edition is out now.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Feb 1, 2009 at 1:14 AM, John Machin wrote:
> On Feb 1, 3:39 pm, Shawn Milochik wrote:
>
>> Not to discourage the use of Python, but it seems that fgrep with the
>> -f flag already does exactly what you want. If you're on Windows, you
>> can get the Window
On Sat, Jan 31, 2009 at 3:00 PM, Tim Chase
wrote:
>>> I'm fairly new with python and am trying to build a fairly simple
>>> search script. Ultimately, I'm wanting to search a directory of files
>>> for multiple user inputted keywords. I've already written a script
>>> that can search for a singl
On Tue, Nov 18, 2008 at 11:23 AM, <[EMAIL PROTECTED]> wrote:
> With some help from the python.org postmasters over the weekend I figured
> out why some seemingly obvious spam messages seem to be making it to the
> python-list@python.org mailing list. Messages gatewayed from Usenet don't
> pass th
On Sat, Nov 15, 2008 at 12:19 AM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Fri, 14 Nov 2008 20:39:53 -0800, len wrote:
>
>> hi
>>
>> Have this code in my program;
>>
>> filename = 'custfile'
>> codeline = filename + ' = [\n'
>> output.write(codeline)
>>
>> record written to file
On Thu, Nov 13, 2008 at 2:10 PM, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2008-11-13, Mirat Can Bayrak <[EMAIL PROTECTED]> wrote:
>
>> Hi, i'll try to write a editor in python, i want it run under
>> terminal (no qt or gtk) but i dont want to use urwid or curses
>> modules.
>>
>> Can i write m
On Wed, Nov 5, 2008 at 8:52 PM, Kurda Yon <[EMAIL PROTECTED]> wrote:
> By the where can I find a simle tutorial about the work with the
> "sqlite" from the Python?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Once you get the connection, you can pretty much just do whatever if
you
On Wed, Nov 5, 2008 at 1:55 PM, Thorsten Kampe
<[EMAIL PROTECTED]> wrote:
> * Shawn Milochik (Wed, 5 Nov 2008 12:28:46 -0500)
>> >> Thanks, but either I'm missing something or you're missing
>> >> something. I can't do any of what you descr
>> Thanks, but either I'm missing something or you're missing something.
>> I can't do any of what you describe on the machine I want to use
>> sqlite on.
>>
>> I have downloaded the binary sqlite3 file from sqlite's Web site, and
>
> The linux binary will not work. You need the headers and the
> l
On Wed, Nov 5, 2008 at 11:58 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> On Nov 5, 9:22 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
>> This is all useful and interesting stuff, but I don't think any of it
>> addresses the original poster's
I work with tab-delimited files for a living. Because of the same need
you have, I created a Python script to do this. It has usage
information that is easy to follow (just run it without any
arguments).
I hope someone else finds this useful. I have, and use it every month.
It can be easily modifi
This is all useful and interesting stuff, but I don't think any of it
addresses the original poster's problem, which is that he has no root
access to a Linux or Unix box, and wants to get pysqlite2 working in
his home directory. I have exactly the same problem. I have tried the
"python setup.py ins
This isn't really a Python question -- it's a Web development
question. The easy answer is to just password protect the directory
all the pages are stored in, and require a password. This can be set
up using Apache or IIS.
If what you really meant to ask was how to prevent anyone from
accessing ce
On Sat, Nov 1, 2008 at 11:15 AM, Nicola Larosa (tekNico)
<[EMAIL PROTECTED]> wrote:
> Pat <[EMAIL PROTECTED]> wrote:
>> After you learn Python, you'll come to despise Perl.
>
> Some of us came to despise Perl *before* learning Python (third to
> last paragraph):
For what it's worth, I thought I'd
On Fri, Oct 31, 2008 at 8:57 PM, Lawrence D'Oliveiro
<[EMAIL PROTECTED]> wrote:
> In message <[EMAIL PROTECTED]>, Rob
> Williscroft wrote:
>
>> Read (and bookmark) this:
>>
>> http://www.python.org/doc/2.5.2/lib/re-syntax.html
>
> Funny how you never get a thank-you when you tell people to RTFM.
>
On Fri, Oct 31, 2008 at 2:14 PM, Bill McClain
<[EMAIL PROTECTED]> wrote:
> On 2008-10-31, Stef Mientki <[EMAIL PROTECTED]> wrote:
>> Well I don't know any Windows users that still use DOS-boxes ;-)
>> cheers,
>
> What do they do when they want to run a cross-platform command-line script
> with para
Here's a more "English" version of what people are trying to explain:
When you log into a Unix session, certain files in your home directory
are read and add environment variables to your session. When you run a
cron job, it does not do this. It still runs as "you" as far as
permissions go, but it
Check out the built-in string.startswith() method.
--
http://mail.python.org/mailman/listinfo/python-list
>
> I would like to parse this file by extracting the field id, ra, dec and mjd
> for each line. It is
> not, however, certain that the width of each value of the field id, ra, dec
> or mjd is the same
> in each line. Is there a way to do this such that even if there was a line
Regular expressions
Can you be more specific? That will also help you write your
requirements, which will lead to your pseudo code and then your code.
Do you want to search for a a pre-defined string (or set of strings),
or just look for anything matching a pattern to appear in the first
file? Related question: Can t
My stab at it:
My stab at it:
#!/usr/bin/env python
import re
query = ' " some words" with and "withoutquotes " '
query = re.sub("\s+", " ", query)
words = []
while query.__len__():
query = query.strip()
print("Current query value: '%s'" % query)
print words
pri
How does one "plonk" stuff from Google Groups? Specifically, how
can this be done in Gmail?
Thanks,
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
I'm looping through a tab-delimited file to gather statistics on fill rates,
lengths, and uniqueness.
For the uniqueness, I made a dictionary with keys which correspond to the
field names. The values were originally lists, where I would store values
found in that field. Once I detected a duplicate
A better solution would surely be to get a Nokia S60 'phone, for which
there is a native Python implementation.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Steve:
Do you know if the Nokia E60i phone has this
On Jan 23, 2008, at 10:02 PM, Derek Marshall wrote:
> This is just for fun, in case someone would be interested and because
> I haven't had the pleasure of posting anything here in many years ...
>
> http://derek.marshall.googlepages.com/pythonsudokusolver
>
> Appreciate any feedback anyone w
On Nov 16, 2007 2:16 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Nov 16, 8:14 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote:
> > * Cope (Fri, 16 Nov 2007 06:09:31 -0800 (PST))
> >
> > > please tell me what is python.This group is so crowded.
> >
> > A Python is dangerous snake[1]. This gr
I completely support Wildemar. Lazy questions like that deserve absolutely
nothing.
I agree that cushioning the reply with a brief explanation of why that
question sucks would have helped the original poster, but he doesn't deserve
any effort from any of us until he has shown evidence of his own e
However, the python is not poisonous, so it is also edible if you can kill
one before it squeezes you to death. Despite this fact, it is not a major
food source for group members, due to our great respect for the mighty
python.
Shawn
On Nov 16, 2007 9:14 AM, Thorsten Kampe <[EMAIL PROTECTED]> w
On 10/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi!
> Am new to Python and am looking for a sample project that demonstrates
> how to connect to MySQL, save data in MySQL database using a form on a
> web page.
>
> Regards,
> Joseph
>
> --
> http://mail.python.org/mailman/listinfo/python
On 10/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to learn regular expressions, but I am having trouble with
> this. I want to search a document that has mixed data; however, the
> last line of every entry has something like C5H4N4O3 or CH5N3.ClH.
> All of the letters
On 10/4/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
> Christopher Spears wrote:
> > One of the exercises in Core Python Programming is to
> > create a regular expression that will match a street
> > address. Here is one of my attempts.
> >
> street = "1180 Bordeaux Drive"
> patt = "\d+
On 10/3/07, sacha rook <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> can anyone help with the best way to tackle this?
>
> I have a spreadsheet ms excel, that has a name column that I want to
> extract to csv and manipulate as follows.
>
> The name column has data in this format
>
> Name
>
> Surname F
On 10/1/07, Brandon McGinty <[EMAIL PROTECTED]> wrote:
>
>
> Hi All,
> I know that there is probably a great deal of literature on this on the net,
> but I don't have any time to go searching.
--
> Brandon McGinty
> McGinty Soft Ltd.
> Website design, configuration, and maintenance
> Python and
Since everyone else is replying to the list, I'll (top) post this:
No, not really. He had to give everyone the rule once. Otherwise, he'd
have to do it a hundred times a day, and monitor every single post to
find out who he had to inform. He'd end up doing not much else with
his life, and would fl
On 9/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Sep 19, 1:31 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
> > > If you'd just search the archives, you would have found this:
> >
> > >http://groups.google.com/group/comp.lang.py
> If you'd just search the archives, you would have found this:
>
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/b134b2235e9c19a6/34857fb0b0b2a4b5?lnk=gst&q=prime+number&rnum=1#34857fb0b0b2a4b5
Yeah, but that's no fun. ;o)
--
http://mail.python.org/mailman/listinfo/python
Okay, I caught one bug already myself:
for y in range(3,(math.sqrt(x) + 1)):
should be
for y in range(3,(int(math.sqrt(x)) + 1)):
--
http://mail.python.org/mailman/listinfo/python-list
Here's my attempt:
#!/usr/bin/env python
import math
for x in range(3,1000,2):
isPrime = True
for y in range(3,(math.sqrt(x) + 1)):
if x % y == 0:
isPrime = False
break
if isPrime:
print "%d is prime." % x
Notes: This doesn't bother with ev
On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Sep 18, 1:31 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
> > On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > > If I have a file name: AVC1030708.14. How do I s
On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> If I have a file name: AVC1030708.14. How do I strip out certain
> characters from the file name? I am so used to using MID, LEFT, and
> RIGHT functions, that I have no idea how to do this in python? I have
> had trouble as well with mos
On 9/17/07, dorje tarap <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Given some patterns such as "...t...s." I need to make all possible
> combinations given a separate list for each position. The length of the
> pattern is fixed to 9, so thankfully that reduces a bit of the complexity.
>
> For examp
When you use "print," it automatically adds a newline (\n).
You can avoid this by following the print line with a comma:
print j,
Or rstrip() the line before printing. Either way.
--
http://mail.python.org/mailman/listinfo/python-list
My best advice:
Skim it -- just flip the pages, glancing at each one without really
reading it -- maybe just read the bold type. You'll find that very
rewarding when you run into a problem in your coding and remember that
you saw *something* which could be related. You will probably notice
some bu
On 9/14/07, James Stroud <[EMAIL PROTECTED]> wrote:
>
> Here's your recipe:
>
>1. begin coding until you hit a wall
>2. read official tutorial until you figure out a solution
>3. experiment in interactive interpreter
>4. goto 1.
>
> I know this sounds obvious, but its the best way t
> Just to be picky - your function returns the number of days between
> two dates, but it's called isOld, which looks like it should return a
> boolean. i.e. it looks like it would be used as:
>
> if not isOld(auctionDate, currentTime):
> checkForBid()
>
> rather than how I assume it is used:
>
> I suppose really oneDay should be a global (i.e. outside the function
> definition). Apart from that it would be hard to improve on: obvious,
> easy to read, in short - pythonic.
>
> Are you concerned about daylight savings? That could certainly introduce
> a whole new level of complexity into
On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote:
>
> > I have done what I wanted, but I think there must be a much better way.
>
> See the strptime() function in either the time or the datetime
> module
I have done what I wanted, but I think there must be a much better way.
Given two timestamps in the following format, I just want to figure
out how far apart they are (in days, seconds, whatever).
Format:
-MM-DD_MM:SS
Example:
2007-09-11_16:41
It seems to me that to do what I want, I need
Any chance your import statements aren't coming in properly due to
something in your environment in Python that's not being inherited by
your cron job?
--
http://mail.python.org/mailman/listinfo/python-list
I wholeheartedly second the recommendation of this article:
http://www.linuxjournal.com/article/3882
--
http://mail.python.org/mailman/listinfo/python-list
Could you send the output of "crontab -l" and the script you're running?
It's probably an environment issue of some kind, but it's hard to say
what blindly.
--
http://mail.python.org/mailman/listinfo/python-list
Here's my solution, for what it's worth:
#!/usr/bin/env python
import os
input = open("test.txt", "r")
counter = 0
fileNum = 0
fileName = ""
def newFileName():
global fileNum, fileName
while os.path.exists(fileName) or fileName == "":
fileNum += 1
x = "%0.5d" % fileN
On 9/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have a text source file of about 20.000 lines.
> >From this file, I like to write the first 5 lines to a new file. Close
> that file, grab the next 5 lines write these to a new file... grabbing
> 5 lines and creating new files until proces
> Hi.. Thanks alot for finding time to help a beginner like me. What I
> am trying to do is validate the input i get. I just want to take
> numbers and numbers only. So if the input is 23+1 or 2/3 or 9-0 or
> 7/0 , I want to find it using reg exp. I know there are other ways to
> do this... but i t
On 9/5/07, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote:
> * Shawn Milochik <[EMAIL PROTECTED]> [2007-09-05 10:27:08]:
> > I bought the domain PythonAlley.com (and PerlAlley.com and
> >
> > Does anyone have any ideas as to what a wonderful use for
> > Pytho
I bought the domain PythonAlley.com (and PerlAlley.com and
RubyAlley.com) not too long ago. I had the inspiration to make some
kind of community site thing, but never did get around to it.
Does anyone have any ideas as to what a wonderful use for
PythonAlley.com would be? I'd really like to do som
I second the Python Cookbook recommendation.
--
http://mail.python.org/mailman/listinfo/python-list
On 8/27/07, Lamonte Harris <[EMAIL PROTECTED]> wrote:
> Okay, I know you've guys told me millions of times to read the manual I've
> read a lot of it. What do you recommend studying the most? Python is my
> goal for the next year in the half. :)
>
> --
> http://mail.python.org/mailman/listinfo/py
"Please enter John's heart rate."
"Please notify me immediately if John's heart rate drops below 60 or
exceeds 100."
--
http://mail.python.org/mailman/listinfo/python-list
Although you're technically correct, I think there's a knee-jerk
anti-regex reaction, citing the meaningless overhead. If you're
running many thousands of records or something then it becomes a small
issue compared to a replace statement or something. But in most cases
it makes no difference at all
Everybody hates regexes. Except me. Discrimination!
--
http://mail.python.org/mailman/listinfo/python-list
Hopefully this will help (using your input file)
#!/usr/bin/env python
import re
buildinfo = "input.txt"
input = open(buildinfo, 'r')
regex = re.compile(r"^\s*build.number=(\d+)\s*$")
for line in input:
if re.search(regex, line):
print line
buildNum = re.sub(r"^\s*build.numbe
Write some code, even if it doesn't quite work, and post it. We'll
help you fix it.
You can open a file with: input = open("file.txt", "r")
You can read a line with: someText = input.readline()
You can loop through an open file like this:
for line in input:
#do something with line
That s
On 8/20/07, Boris Ozegovic <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > The only sentence that comes to mind is:
> >
> > "I hope I never find myself in a hospital that uses your system."
>
> You are not funny. The system isn't for hospitals, it is for university
> purposes.
>
> --
>
On 8/20/07, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On Aug 20, 10:35 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
> > #!/usr/bin/env python
>
> > if __name__ == "__main__":
> >
> > print "The return for 'fr
> And Shawn, I didn't post any of my work because the network I work on
> isn't
> connected to the internet. So it didn't seem constructive to re-type
> all of my
> failed code just to satisfy your "standards" of proving that I've been
> trying to
> hack this myself for the past few days. All in a
1 - 100 of 116 matches
Mail list logo