> I have a tab-delim file:
>
> col1 col2 col3
> andrew 1987 1990
> jake 1974 1980
> jim 1964 1970
> lance 1984 1992
>
> how can I sort column 2 and get :
> jim 1964 1970
> jake 1974 1980
> lance 1984 1992
> andrew 198
> I have a file generated from a webpage.
> I want to search that file for a specific keyword, in my case 'NEW'.
> Once I have found that keyword I want to retrieve information below it, e.g.
> web link, size of file etc.
> When I have this information I move off until I find another 'NEW' and the
On Sun, Jan 17, 2010 at 12:10 PM, Robert wrote:
> In the Python tutorial (highlighted here http://awurl.com/N1XvzIo2Q)
>
> What exactly is "dynamic name resolution" ? specifically what is
> "dynamic" about it ?
what this means is that as your code is executing and the interpreter
encounters an i
> while True:
> name = raw_input("what is the name ")
> age = raw_input("what is the age ")
>
> out_file = open("persons.txt", "w")
> out_file.write("name: ")
> out_file.write(name)
> out_file.write("\n")
> out_file.write("age: ")
> out_file.w
On Sun, Jan 17, 2010 at 5:19 PM, Alan Gauld wrote:
>
> "Magnus Kriel" wrote
>
>> It might be that when you create a file for the first time with 'a', that
>> it
>> will through an exception. So you will have to try with 'w', and if there
>> is
>> an exception, you know the file does not exist and
for future reference, you can go sign up for the courses at
http://foothill.edu ... i'll be delivering the intermediate Python
course next year FWIW.
cheers,
-wesley
On Fri, Jan 29, 2010 at 10:45 AM, Scott Pritchard wrote:
> Oh, sorry about that.
>
> Rich Lovely wrote:
>>
>> I think you've got
as well?
>
> On Fri, Jan 29, 2010 at 3:15 PM, David Abbott wrote:
>>
>> A group of beginners and intermediate Pythonerrs and getting together to
>> study the book Core Python Programming by Wesley Chun. We are starting
>> on chapter one on Feb first. We are hoping to
> I just wrote this message, but after restarting ipython all worked fine.
> How is it to be explained that I first had a namespace error which, after a
> restart (and not merely a new "run Sande_celsius-main.py"), went away? I
> mean, surely the namespace should not be impacted by ipython at all!?
> what text-editor do you use for python?
as an FYI Guido himself uses both emacs and vi/m... he mentioned this
during his PyCon 2010 keynote last week, to which someone tweeted:
http://twitter.com/bradallen137/status/9337630806
i primarily use vi/m and emacs as necessary,
-- wesley
- - - - - -
similarly, you get an error if:
"print int(reply) ** 2
print 'Bye'"
... is all a single line and/or if you mixed spaces and TABs.
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall,
i worked on another well-received Django book with a pair of great
co-authors called "Python Web Development with Django", Addison Wesley
(2009).
rather than taking the existing Django docs, which are great BTW, and
expanding on them, we wanted to have a more comprehensive look at
Django developme
t a copy of Python Web Development with Django
> last month, and I can't recommend it enough.
>
> On Wed, Apr 7, 2010 at 8:46 PM, wesley chun wrote:
>>
>> i worked on another well-received Django book with a pair of great
>> co-authors called "Pytho
> When sets were introduced to Python in version 2.3. they came as a separate
> "sets" module.
>
> In version 2.6 built-in set/frozenset types replaced this module.
2.4
> So either way is OK for now, but the sets module might go away in a newer
> version.
agreed
cheers,
-- wesley
- - - - - -
> guys can i use python's win32com module to do the same tasks that i do with
> visual basic for applications (vba). I mean automating tasks for excel e.t.c
> and accessing Access databases. If win32com doesnt which module can i use?
that's definitely the right one, and yes, you can use VB/VBA
correct, it is a floating point issue regardless of language.. it's
not just Python. you cannot accurately represent repeating fractions
with binary digits (bits). more info specific to Python here:
http://docs.python.org/tutorial/floatingpoint.html
also, keep in mind that '%f' is not a rounding o
greetings and welcome (back) to Python! i have a few comments for you:
1. The syntax for Python 3.x has changed from 2.x, so please be aware
of the differences as you are learning. Most books and code out there
is still 2.x. 3.x is being adopted but because of the differences, it
is slower than mo
On Wed, Feb 11, 2009 at 12:16 PM, "Shantanoo Mahajan (शंतनू महाजन)"
wrote:
> On 12-Feb-09, at 1:31 AM, Andres Sanchez wrote:
>
>> I am trying to extract information from a spreadsheet to use it in Python.
>
> For reading .xls: http://pypi.python.org/pypi/xlrd/0.5.2
> For writing .xls: http://sourc
>>> I am trying to extract information from a spreadsheet to use it in Python.
>> For reading .xls: http://pypi.python.org/pypi/xlrd/0.5.2
i forgot to mention that xlrd is on version 0.6.1 now:
http://pypi.python.org/pypi/xlrd
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
On Fri, Feb 13, 2009 at 3:50 PM, Wayne Watson
wrote:
> That's pretty much the question in Subject. I've got a date time variable
> with, for example, 15:00:00 in hh:mm:ss format, and I'd like to make it a
> string.
>>> import datetime
>>> d = datetime.time(15,0)
datetime.time(15, 0)
>>> d
dateti
On Mon, Feb 16, 2009 at 8:24 PM, Wayne Watson
wrote:
> I suspect I'm in need of setattr for this in a GUI program I'm modifying.
>
> Initally, a variable. self.stop_time is created as type datetime.time, with
> the default value 06:00:00, a time stamp, during entry into the mainloop.
> self.stop_t
>> Initally, a variable. self.stop_time is created as type datetime.time,
>> with the default value 06:00:00, a time stamp, during entry into the
>> mainloop. self.stop_time = datetime.time(10,10,10). The user reads his
>> configuration file with the time stamp value of 08:00:00. self.time_stop
>>
> # Date vars should be type datetime.time
> config_value = str(stime)
this is pretty much the offending code right here... in fact, the
comment contradicts the assignment. it says that date vars should be
of type datetime.time, yet it assigns a *string* to config_value
> when i call a method foo from another method func. can i access func context
> variables or locals() from foo
> so
> def func():
> i=10
> foo()
>
> in foo, can i access func's local variables
A. python has statically-nested scoping, so you can do it as long as you:
1. define foo() as an in
> There is a text file that looks like this:
>
> text text text Joseph
> text text text text text text text text text text text
> text text text text text text text text text text text
> text text text text text text text text text text text
> text text text text text text text text text text text
>> I am looking for a good tutorial to walk through that really explains class
>> definition.
>
> I assume from that you have been through the basic tutors like mine?
>:
> OK, I explain self in my OOP tutor topic ( a sub heading under
> "Using Classes"), but again if thats not sufficient th
> I have started learning phyton today!
> I was playing around with some large numbers (fibonacci series)
> and noticed that in some large calculations results have an "L" at the end
> of a number.
> Does this L stands for Large? Is there any way to disable this feature, so
> that all numbers are s
On Mon, Mar 9, 2009 at 10:38 AM, jessica cruz wrote:
> I made this program but it says that there is an error and I have a hard
> time trying to solve the problem with program.
> :
> I don't know how to figure out the error since the only message that I get
> is that "there's an error: inva
> I would like to change it so that it can be run under both Python 3 and
> Python 2.x.
everyone who has responded so far are telling about converting your
piece of code from Python 2 to Python 3, for example, using the "2to3"
tool that comes with Python 2.6+:
http://docs.python.org/library/2to3.
On Tue, Mar 17, 2009 at 2:34 PM, PyProg PyProg wrote:
>
> I want to use an equivalent of sets module with Python 2.6 ... but
> sets module is deprecated on 2.6 version.
it is deprecated only because sets have been rolled into Python proper
starting in 2.4. replace sets.Set() with set(), and there
> I think the intent of 2to3 is that you maintain the
> Python 2.6 version and automatically create the Python 3 version from
> it. So there is only one source file. At least one person found this
> practical, for a large codebase (well, he says it "mostly works"):
> http://wiki.python.org/moin/Por
> import listen
>
> You can use the __import__ function if you want, but generally you
> want the import statement as above. The equivalent to 'import listen'
> is:
>
> listen = __import__('listen')
>
> See the tutorial here: http://docs.python.org/tutorial/modules.html
you also have to ma
> I am a total newbie. I have a very large file > 4GB that I need to
> convert from Unicode to plain text. I used to just use dos when the file
> was < 4GB but it no longer seems to work. Can anyone point me to some
> python code that might perform this function?
can you elaborate on your convers
> Previously I was able to convert just by using:
> Type Unicode_filename.txt > new_text_file.txt
> That's it.
wow, if that's all you had to do, i'm not sure it's worthwhile to
learning a new programming language just to process it with an
application when your original solution was so dead simpl
hi, and welcome to Python! my comments below...
> I made a class with the name student that prints simply name of the student
> as well as his roll_no also, pasting code here .
sounds pretty straightforward
> class student:
> def __init__(self,name,roll_no):
> self.name=name
>
>> I am new in python , so need a good books , previously read python Bible and
>> swaroop but not satisfied .
>>
>>
>> so tell me good books in pdf format those contents good problems also
if you like a conversational style and know at least one programming
language, i've written a pretty popul
> How can I sort the following list in a way that takes care of the right
> order of numbers? The sorted function compares strings here as far as I can
> see, but I want to have filepath2 follow filepath1. Your help is
> appreciated.
myList
> ['filepath54', 'filepath25', 'filepath49', 'filepat
> 1. Python is not Java
although i agree with all 4 points that paul makes, this 1st one
stands out the most. when i saw the code the first time, the immediate
thought that came to my mind was, "This looks like Java code written
with Python syntax." i thing the same functionality can be
accomplish
>> i think it's a common style guideline in multiple
>> languages i'm familiar with (other than Python) to Capitalize class
>> names but keep variables, functions, and methods all lowered.
>
> In most cases I know, class names are capitalized, while func and method
> names are camel-cased:
> Thi
hey all,
i'm trying to collate a complete newbie-to-programming list of
resources and was wondering if you could help me fill in the holes...
thx in advance!
BOOKS
Python Programming for the Absolute Beginner (Dawson, 2005)
Python For Dummies (Maruch, Maruch, 2006)
Python Programming: An Introduc
def f(x):
>
> '''f(x) -> x+5'''
> return x+5
>
help(f)
>
> Help on function f in module __main__:
>
> f(x)
> f(x) -> x+5
another thing that has not been mentioned is that if you put
docstrings everywhere, you can use tools like Epydoc, doxygen, or
sphinx to generate full documentation
> It seems that open(filename, 'r') and file(filename, 'r') are
> used interchangeably, and I wonder what this is all about.
as alan and others have pointed out, file() was added in 2.2. this was
part of the unification of types and classes. every object now has a
factory function, i.e., list() c
> I've been told numerous times that using __del__ is not the way to handle
> clean-up because it is finicky.
matthew,
welcome to Python and this Tutor mailing list!
and yes, i'll echo everyone else in saqying that using __del__ should
be avoided. the most critical issues regarding this is becau
On Thu, May 28, 2009 at 10:22 AM, Gregory Morton wrote:
> I've been reading this Python 3.0.1
> tutorial(http://docs.python.org/3.0/tutorial/controlflow.html), and now I'm
> stuck at the second example in 4.3. This is what the example says the output
> should look like:
>
> range(5, 10)
>5 t
>> But, I still get this error:
>> Traceback (most recent call last):
>> ...
>> UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
>> position 76: ordinal not in range(128)
>> What am I missing?
>
> Take a read through http://evanjones.ca/python-utf8.html which will give you
>
>> Hello, I thought I understood **kwargs until I stumbled with this
>> function:
>>
>> def changeflexion(myword, mytag, **dicty):
>>:
>>
>> but when I import the module and call:
>> a = conjugate.changeflexion('estaban', 'VLFin', conjugate.mydict)
>> I get this error:
>> TypeError: changef
hi eddie, a few more nits to tweak...
> factorialNum = 1L
change to "1" instead of "1L" -- "L" numbers are going away and will
be permanently not available starting in 3.0.
> print "Factorial finder"
> number = int(input("Please enter a non-negative integer: "))
change "input" to "raw_input".
> A 'python3' command is not recognized. I'd like to
> know what I need to change to access V3.0.1 from a Terminal window.
try python3.0
if that doesn't work, then you may have to add the directory where
it's installed to your PATH.
hope this helps, and welcome to Python!
-- wesley
- - - - - - -
On Sat, Jun 20, 2009 at 10:25 PM, Pete Froslie wrote:
> Thank you so much.. I will start looking into twill and I just finished
> installing Mechanize.
those are very well-known individual tools that will meet your needs.
for larger web testing frameworks, you may also consider Windmill and
Selen
> However, it seems that I can't put the function definition in a file
> and import it because I can't find a way to refer to an object in the
> main program file from within a module file. I understand that it's a
> good thing to contol which namespaces are referenced by which code but
> isn't the
On Mon, Jun 29, 2009 at 3:59 AM, Christian Witts wrote:
> l...@ithstech.com wrote:
>>
>> Have I installed something incorrectly in Python 3.1 for Mac if I get a
>> syntax error on
>>
>> print "hello world"
>>
>> My Python 2.3.5 executes this just fine. What have I missed?
>
> Please take a read th
>> from showmodule import show
>>
>> then everything else will work.
>
> I don't think so. The exec in show() must be run in the namespace in
> which the symbols being displayed are defined.
yep, you're right. i didn't see the exec. it will only work if the
called function somehow had access to t
n = "colourless"
o = "colourless"
n == o
> True
n is o
> True
p = "green ideas"
q = "green ideas"
p == q
> True
p is q
> False
>
> Why the difference?
angus,
welcome to Python! you're definitely doing your homework when it comes
to trying to understand how
>> >I'm having trouble finding good tutorials on creating standalone
>> > executable
>> >files for mac os x.. I've been looking at 'py2app', [...]
pete,
welcome to Python! in order for all to answer your question more
appropriately, you'll have to describe the problem in slightly more
detail.
>>> After all with Python 2.3 pre installed on MacOS X
>> Is Python 2.3 really the most recent version of Python distributed with
>> new Macs?
> I think *new* Macs come with 2.5. My 2-year-old MacBook Pro has 2.3.
i got a new MBP from work about half a year ago with leopard 10.5.6
installed, and
On Sun, Jul 5, 2009 at 11:48 PM, Luis Galvan wrote:
> Hello all, this is my first time using a mailing list, so I'm not sure if
> I'm doing this right! Anyway, I have a wee bit of a problem. I've recently
> completed watching a Youtube video series on Python 2.6 by thenewboston
> which helped me
Robert, Emile, Malcolm,
wow, you guys are making me blush while hijacking this thread!
people are gonna start thinking i paid you off somehow LOL! :-)
seriously, thanks for the kudos. since i'm a technical instructor,
i wrote it not only from the software engineer's perspective, but
also a teache
Safari Books (you may have to signup for a free
> account to see the video).
>
> What is Python by CPP (Core Python Programming) by author Wesley Chun
> http://www.safaribooksonline.com/Corporate/DownloadAndResources/webcasts.php
ah, i wasn't aware that they finished editing it and pu
luis,
thanks for the kind words... i am glad that i am able to help you with
developing your Python programming skills. you are indeed "taking it
to the next level" by adding more to the problem without me asking you
to. i think that's great!
i am a software engineer by profession, which doesn't
> Can you run for loops in while loops and if yes, why did my if condition not
> break the loop?
>
> I read that loops sort of have an order of precedence, does that have
> anything to do with this problem?
todd,
welcome to Python! you're right in that your questions are related to
each other
>> So how would you break out from this situation?
>
> finished = False
> while not finished:
>
> for i in items:
> if i > 10:
> finished = True # Do not do the next while-iteration
> break # and break out of the for loop
> else:
>
> The other day I needed to pack a dictionary, the value of each key was a
> list. In the code I was packing the list and the dictionary at the same time.
> First I tried something like this:
>
> list = []
> dict = {}
> x = 1
>
> dict['int'] = list.append(x)
>
> The result was {'int': None}. Why
> So how would you break out from this situation?
as i mentioned in my other msg, you need another break statement that
is *not* in another loop. in your case, not in the for-loop. you need
a break statement somewhere within your while block (again, that's not
in any other loop). IOW, it should be
> I'm not sure if this is good practice, but I could assign a variable within
> the while loop, that is assigned something that will then break the outer
> loop.
>
> while True:
> breakout = True
>
> for i in items:
> if i > 10:
> breakout = False
> else:
>
On Wed, Jul 15, 2009 at 8:29 AM, Rich Lovely wrote:
> 2009/7/15 vince spicer :
>>:
>> import re
>>:
>> values = re.split("\s+", line) # split values on spaces EX: ['47', '8',
>
> That isn't what they're after at all.
> Something more like
> :
> n, pos, ala, at, sy
>>> > Can some one give, or point to some good examples of how @decorators
>>> > work, and __call__ (able) objects?
>
> simple example of calling a class
>
> class myKlass(object):
>
> def __call__(self, *args, **kws):
> print "i was called"
>
> >>> test = myKlass()
> >>> test()
> i wa
> Maybe you could break that up a bit? This is the tutor list, not a
> one-liner competition!
rather than one-liners, we can try to create the most "Pythonic"
solution. below's my entry. :-)
cheers,
-wesley
myMac$ cat parafiles.py
#!/usr/bin/env python
from itertools import izip
from os.path im
>> Thankyou sir it is working.but one more thing i want to ask that if my
>> file will have entries like:---
>>
>> fileA and fileB
>> 12 10
>> 13 12
>> 14
>> 15
>>
>> means if their no. of entries will not match then how to combine them(both
>> input files have more than one col
on a related note, there is a module called fileinput that doesn't do
what you (the OP) need for this particular problem, but it is one to
keep in mind for the future as there may be a situation for which it
is the right tool. it doesn't get a lot of buzz but can come in handy
-- for me, it was in
On Fri, Jul 24, 2009 at 2:34 PM, Jesse Harris wrote:
> for d in Decks.all(): #loop thru all available decks
> self.response.out.write(''+d.name)
> self.response.out.write(''+d.description)
> self.response.out.write('')
> self.response.out.write('')
>
> : invalid syntax (main.py,
On Fri, Jul 24, 2009 at 11:40 PM, Chris Castillo wrote:
> Okay I really need help with the program I am writing. I've can't seem to
> figure out what I need to do and have tried several different methods.
hi chris, and welcome to Python! the tutors here are very helpful to
those who are new to pr
in addition to the good advice from vince (watch out for greediness
regardless of what you're looking for) and bill (use raw strings...
regexes are one of their primary use cases!), another thing that may
help with the greediness issue are the character sets you're using
inside to match with.
for
> could this be done in a more elegant fashion?
in addition to alan's obvious solution, if you wanted to roll your
own, you have a good start. my comments below.
> def Unite(set1, set2): # evaluate 2 lists, join both into 1 new list
> newList = []
> for item in set1:
>
> - you probably don't want to call set1.remove(). lists are immutable,
> and you would've change the contents of set1.
sorry, make that "mutable." sets, dicts, and lists are standard Python
types that are mutable.
-wesley
___
Tutor maillist - Tutor@p
>> Maybe you could break that up a bit? This is the tutor list, not a
>> one-liner competition!
>
> rather than one-liners, we can try to create the most "Pythonic" solution.
> below's my entry. :-)
>
> myMac$ cat parafiles.py
> #!/usr/bin/env python
>
> from itertools import izip
> from os.path i
On Thu, Jul 30, 2009 at 11:18 AM, Che M wrote:
> Did you actually look at what happens when you click that
> link? (i.e. where you are brought to?).
>
> Because upon viewing this I achieved enlightenment! :D
lucky you... i achieved recursion. :-)
___
> I'm wondering what people consider the most efficient and brain-damage free
> way to automate the creation of presentation slides with Python. Scripting
> Powerpoint via COM?
this is how i'm doing it. i'm working on a Python script that takes
plain text with minimal markup that then uses COM t
On Wed, Aug 12, 2009 at 1:07 PM, David Kim wrote:
> Unfortunately I live on the East Coast, otherwise I'd definitely attend! I
> am attracted to the declarative nature of reStructuredText, but I also
> recognize that A LOT of people use Powerpoint and are comfortable with it.
> Going with something
hi Giorgio,
welcome to Python (whether directly or from GAE!) :-) my comments below.
> with import i can import modules or single functions. And this is ok.
not quite true. regardless of whether you use import or from-import,
you're *always* importing (and loading) modules or packages in their
>> Just think: 4 players left means that this is the semi final.
>
> What a brilliant answer! It tells him how to do it if he just stops and
> thinks but gives nothing away. I love it. :-)
i agree with alan on this. in fact, i can just picture the brackets in
my head already. :-)
another thing f
>> an expression is something ... that evaluates to *some* Python object
>>:
>> in contrast, a statement is something that has no intrinsic value
>
> Umm.you just completely confused me. What does it do?
ok, now *i*'m the one confused... what does *what* do?
both expression
On Mon, Sep 21, 2009 at 2:06 PM, Wayne wrote:
> On Mon, Sep 21, 2009 at 4:00 PM, kreglet wrote:
>>
>> I keep getting the following error and don't uderstand why:
>>
>> Traceback (most recent call last):
>> File "/home/kreglet/bin/test.py", line 15, in btnStatclick
>> btnStat.set_label("Presse
>> I tried this:
>> win32net.NetUseDel(None, 1,{'local':'k:'})
>>
>> but I got this error:
>> Traceback (most recent call last):
>> File "test.py", line 33, in
>> win32net.NetUseDel(None, 1,{'local':'k:'})
>> TypeError: an integer is required
>
> You have the wrong sequence for NetUseDel().
> I need help writting a program.
> 1) Random string generation
> 2) no repeating letters
> Can anyone help me,please? I am so confused. The only problem is I have to
> use the code that is written there but add on to it.
>
> import random
>
> alphabet = "abcdefghijklmnopqrstuvwxyz"
> myNewString =
On Fri, Oct 2, 2009 at 11:14 PM, Oxymoron wrote:
> Hello,
>
> On Sat, Oct 3, 2009 at 3:56 PM, Didar Hossain
> wrote:
>>
>> homedir = os.environ.get('HOME')
>>
>> if homedir:
>> print "My home directory is %s" % homedir
>>
>>
>> I do this in Perl -
>>
>> my $home;
>>
>> if ($home = $ENV{'HOME'}
> I would like to create a program which
> should repeat a simply string several times with list number before.
> Like "1. Wanna more. 2. Wanna more. ..."
> Suppose to a loop here repeating, say x times. Should it look like that:
>
> y="Wanna more. "
> x=1
> x=x+d:
> d=<100
> print d+y
>
> How to c
> def __init__(self, time, mods=[], dur=None, format='%1.2f'):
> :
> The mods that were added to the first instance of oneStim also appear in the
> second, newly created instance!
>
> It appears that what is happening here is that the __init__() method is
> being parsed by the interpreter
> I am going through someone's python script and I am seeing a lot of the
> following boolean checks.
>
> if not s == ""
> if not n == 0
> if b == True
> if not b == True
> etc..
>
> All of these can be written without the == notation like "if n", "if s"
> etc.Now in this case where it is only used
On Mon, Oct 5, 2009 at 2:24 PM, Nick Hird wrote:
> What is the best version of python to start out with? I see some
> discussions on the net about not going to 3.1 but staying with the 2.x
> releases. But then i see that 3.1 is better if your just starting.
greetings nick!
ironically, i just ga
> Thanks all for the informative discussion. To re-confirm it was mostly
> for boolean checks like "if b == True".
wow, as the OP, you must have been surprised to see how far we have
taken your (seemingly) simple question. we went from boolean checks to
interning! commenting on my previous reply,
> I've been studying python now for a few weeks and I've recently come
> into list comprehensions. [...]
> Those make sense to me. The way I understand them is:
> do something to x for each x in list, with an optional qualifier.
that's pretty much correct.
> On the other hand I've seen a few exa
hey gang, not sure i made the original announcement on this list a few
months ago, but if you're on this list because you need to learn
Python as quickly and as in-depth as possible for an immediate need, i
have few more openings in my upcoming course in San Francisco, and
below is the reminder i'v
>> My brother in law is learning python. He's downloaded 3.1 for
>> Windows, and is having a play. It's already confused him that print
>> "hello world" gives a syntax error
>>
>> He's an absolute beginner with no programming experience at all. I
>> think he might be following 'Python Progra
>> i get asked this question a lot, esp. when it pertains to my book,
>> "Core Python Programming." which should i learn? is your book
>> obsolete? etc. i basically tell them that even though they are
>> backwards-incompatible, it's not like Python 2 and 3 are so
>> different that you wouldn't
>> Should I advise him to
>> stick with 2.6 for a bit, since most of the material out there will
>> be for 2.x? Or since he's learning from scratch, should he jump
>> straight to 3.x In which case what can you recommend for him to work
>> through - I must stress he has absolutely no clue at all
On Wed, Nov 18, 2009 at 1:51 PM, GoodPotatoes wrote:
> I'm dealing with bigger lists than I have been, and noticed this is getting
> really slow. Is there a faster way to do this?
>
> for x in list1:
> if x not in list2:
> list3.append(x)
>
> My search is taking up to 5 minutes to com
On Tue, Nov 24, 2009 at 2:42 PM, Bo Li wrote:
>
> I am new to Python and having questions about its usage. Currently I have to
> read two .csv files INCT and INMRI which are similar to this:
> [...]
> I was a MATLAB user and am really confused by what happens with me. I wish
> someone could help
>> I have the first edition of your book. What is the difference between
>> two editions?
i believe the 1st ed is 3.0 and the 2nd ed is 3.1 but haven't
confirmed with him yet.
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2
> I wan't to buy some books about python 3. Do you have any recommendations?
> I started with no previous programming experience, and I've finished a few
> tutorials and I guess I can be considered a beginner.
greetings khalid, and welcome to Python!
based on your background, i would like you s
> - learning to program by gauld http://www.freenetpages.co.uk/hp/alan.gauld/
update: alan's latest tutorial lives here: http://www.alan-g.me.uk/tutor/
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Python Web Development with Django", Addison Wesley, (c) 2009
http://w
> I'm stumped. This silly bit of code doesn't work. I expect the
> output to be 8, not 18. What am I missing?
>
> class Under10(int):
> def __init__(self, number):
> number %= 10
> int.__init__(self, number)
marilyn,
i agree with most of the earlier replies... you need to u
1 - 100 of 334 matches
Mail list logo