Re: [Tutor] How to get homework help (was need to hire a tutor... )

2009-09-21 Thread Tim Bowden
ass by getting others to solve your programming problems for you, get some spine and do it properly or fail graciously. The alternative is to be a fraud, and that never gets respect. Tim Bowden ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to get homework help (was need to hire a tutor... )

2009-09-22 Thread Tim Bowden
other tech lists. > > Absolutely so, and well summarised. > > Alan G. > http://www.alan-g.me.uk/ And the off list reply was pretty much what you'd expect. Funny old thing life. Tim Bowden -- Mapforge Geospatial Open Source Spatial Consulting http://www.mapforge.com.au _

Re: [Tutor] Challenge

2009-09-22 Thread Tim Bowden
ontext). #!/usr/bin/python import random i=0 for flip in range(100): i += random.choice((0,1)) print "Heads: %d, Tails: %d" % (i, 100-i) # Tim bowden ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 2.3.5 question

2009-09-23 Thread Tim Bowden
x27;ll have to get used to it. Start with the next section of the book, 'Learning the Jargon'. HTH, Tim Bowden ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help!

2009-09-29 Thread Tim Bowden
ng on here; First, 'myVar + 1' gets evaluated, then myVar = (result of previous evaluation) gets evaluated. Given 'myVar' is in both evaluations, smart programmers get lazy (lazy like a fox, not sloth like lazy) and decide not to repeat the variable name.

[Tutor] using easy_install to download eggs

2009-10-04 Thread Tim Michelsen
Hello, I would like to use easy_install to cache packages registered at PyPi locally. How can I do this for packages? I tried the hints from: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-on-un-networked-machines It worked for some packages. But for others, the command easy_ins

Re: [Tutor] using easy_install to download eggs

2009-10-05 Thread Tim Michelsen
Hi, thanks for the hint. > pip (http://pypi.python.org/pypi/pip/) is a drop-in replacement for the > easy_install tool and can do that. > > Just run easy_install pip and set an environment variable > PIP_DOWNLOAD_CACHE to the path you want pip to store the files. Note > that the cache won't work

Re: [Tutor] Sleep

2009-10-08 Thread Tim Golden
Hristos Giannopoulos wrote: Is it possible for a python script to make a windows computer sleep or wake from sleep? Preferably in windows? Nothing built in to the language. You'll need in invoke the relevant Windows API[1] either via pywin32[2] or ctypes[3]: [1] http://msdn.microsoft.com/en-us

Re: [Tutor] Finding and Inserting missing dates in a date range.

2009-10-09 Thread Tim Golden
Glen Zangirolami wrote: If i have a list of dates:date_list = ['2008-12-29','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-01-05'] How do I find the missing dates in the range of dates and insert them into the list so I get? date_list = ['2008-12-29','2008-12-30','2008-12-31','2008-01

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-13 Thread Tim Golden
Dave Angel wrote: You will also need to get comfortable with the DOS box (Command Prompt, whatever Vista calls it. It's probably in Start->Accessories). In a DOS box, you could do a DIR of that directory, and see exactly what the file is called. You also could invoke python or pythonw expli

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Katt wrote: Is it possible to change text color on a WinXP system by just using the Ansi escape codes. I have tried, but it just shows the start and end text of the code, but it doesn't change the color. No. ANSI escapes don't work on Windows. Depending on where you want to go, you can look a

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there? The help system says you should load it in config.nt with:

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Mark Tolonen wrote: "Tim Golden" wrote in message news:4ad471e6.7050...@timgolden.me.uk... Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load AN

Re: [Tutor] PyWin32 - Library of functions to interact with windows?

2009-10-15 Thread Tim Golden
Katt wrote: Hello all, I am currently using WinXP and python 2.6.2 I just installed PyWin32 v214 for python 2.6 from the following link: [... snip lots of advice from other people ...] Hi, Katt. Thanks for posting back over here. I must admit, I hadn't realised you were posting to the tutor l

Re: [Tutor] introspecting an object for method's name?

2009-10-19 Thread Tim Golden
Kent Johnson wrote: On Sunday, October 18, 2009, Serdar Tumgoren wrote: Hi everyone, I'm trying to create a generic logging function, and I'm able to get at the name of the module and class using the built-in attributes __module__, __class__, and __name__. But I wasn't sure how to also grab th

Re: [Tutor] New to Python

2009-10-29 Thread Tim Golden
asteri...@petlover.com wrote: I am running Windows Vista. OK. Definite points for giving useful info up front. Do you know what remote desktop is? Yes. This is the tool I use to connect to my other severs on the network or alternatively I use my "Run" option (Start/Run) where you add in

Re: [Tutor] trouble using 2to3.py

2009-11-03 Thread Tim Golden
Richard D. Moores wrote: On Tue, Nov 3, 2009 at 05:30, Dave Angel wrote: (Erasing entire history, since you both top-posted, and it's too confusing) When you run a xxx.py on Windows, it locates the python.exe using the registry entries set up by assoc and ftype. But when you run "python" it

Re: [Tutor] trouble using 2to3.py

2009-11-04 Thread Tim Golden
Dave Angel wrote: I've thought of using hard links (using fsutil.exe, in case anyone else is interested), but I keep my scripts and batch files, as well as small utilities on a separate drive partition from the one that has my OS and installed programs. And hard links don't work across separa

Re: [Tutor] Classes that do operator overloading

2009-11-07 Thread Tim Golden
Hugo Arts wrote: On Sat, Nov 7, 2009 at 12:25 PM, C.T. Matsumoto wrote: class indexer(): def ___getitem__(self, index): return index ** 2 I thought I was missing some special style, or rule. The class above is take from Learning Python, and there are several other examples too. fo

Re: [Tutor] Unexpected Result in Test Sequence

2009-11-16 Thread Tim Peters
[kb1...@aim.com] > I'm running a test to find what the experimental average of a d20 is, I don't know what "a d20" is, but your code is picking integers uniformly at random between 1 and 18 inclusive. The expected value is therefore (1+18)/2.0 = 9.5. > and came across a strange bug in my code. >

Re: [Tutor] Use of 'or'

2009-11-17 Thread Tim Golden
Stephen Nelson-Smith wrote: A friend of mine mentioned what he called the 'pythonic' idiom of: print a or b Isn't this a 'clever' kind or ternary - an if / else kind of thing? I would say it's perfectly idiomatic in Python, but not as a ternary. If you want a ternary use the (relatively) rece

Re: [Tutor] Faster list searching?

2009-11-18 Thread Tim Peters
[Luke Paireepinart] >> This is really just a round-about way of using sets. >> I don't really want to give a code-sample unless he's confirmed he's not >> doing this as homework, but the set version is much more simple (shorter >> code that makes more sense) and extremely quick as well.  If you're

[Tutor] Difficulty with csv files - line breaks

2009-11-24 Thread Tim Goddard
What I'm trying to do is store a bunch of information into a .csv file. Each row will contain a date, webpage, etc of a job application. My difficulty is that it seems something I am doing is not recording the line breaks. I've read that \r\n are default in the csv module but so far I can not se

Re: [Tutor] Difficulty with csv files - line breaks

2009-11-25 Thread Tim Goddard
> Date: Tue, 24 Nov 2009 15:01:38 -0800 > From: Albert Sweigart > To: tutor@python.org > Subject: Re: [Tutor] Difficulty with csv files - line breaks > Message-ID: >        <716dd5b60911241501y57db5c62r358b1a9859a3a...@mail.gmail.com> > Content-Type: text/plain;

Re: [Tutor] Equivalent exception of os.path.exists()

2009-11-30 Thread Tim Golden
biboy mendz wrote: http://pastebin.ca/1693849 This is end-of-chapter3 exercise of the book Core Python Programming. I'm reading/searching in the book and other materials but is unsuccessful. There are at least 50 exceptions listed but I can't find anything close. I commented out my modified

Re: [Tutor] Equivalent exception of os.path.exists()

2009-11-30 Thread Tim Golden
biboy mendz wrote: Lie and Tim's input are true that raw_input doesnt do anything or you cant catch exception error from it. And i'm wrong in placing the try-except clause, it should be on the fobj-open line. But im still looking for the exception that will be raised when i input a filename an

[Tutor] Python equivalent to Matlab keyboard function

2009-12-04 Thread Tim Goddard
This is probably an easy one. When I was writing Matlab m-files, I really enjoyed the ability to stop the code to check how values were being stored or to 'step' into a function with the keyboard function. I have numerous 'environments'? as part of Python (x,y) including IDLE, Eclipse, and Spyder

Re: [Tutor] Python equivalent to Matlab keyboard function

2009-12-04 Thread Tim Goddard
> > Message: 6 > Date: Fri, 4 Dec 2009 11:57:45 -0500 > From: Kent Johnson > To: Tim Goddard > Cc: tutor@python.org > Subject: Re: [Tutor] Python equivalent to Matlab keyboard function > Message-ID: >        <1c2a2c590912040857nacae64jcd9feab87af58...@mail.gmail.c

Re: [Tutor] Question : Creating cribbage game

2009-12-07 Thread Tim Goddard
> Message: 2 > Date: Mon, 7 Dec 2009 02:30:30 -0400 > From: Christopher schueler > To: > Subject: [Tutor] Question : Creating cribbage game > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > My name is Chris Schueler and i am having some troubles with my Python > programming >

Re: [Tutor] What books do you recommend?

2009-12-09 Thread Tim Goddard
I just finished Michael Dawson's Python Programming for the absolute beginner. I thought it was pretty good, with only a few minor nit picks. My programming background was limited to MATLAB and some Visual Basic scripting for excel, access etc making me the target audience. I liked the examples,

[Tutor] Sound problems

2009-12-09 Thread Tim Goddard
I'm still learning, and this may be better served on a pygame mailing list but I thought I'd try here first. I'm following the python programming for absolute beginners which uses livewires and pygame to do some simple games. My difficulty comes from not using the module versions used in the book

Re: [Tutor] faster substring replacement

2009-12-15 Thread Tim Golden
Luhmann wrote: Hi folks, I'm trying to do something like this: evildict= {'good' : 'bad' , 'love' : 'hate' , 'God': 'Satan'} def make_evil(text) ...for a in evildict: ... text=text.replace(a, evildict[a]) ... return text This works fine, but it soon

Re: [Tutor] What is URL to online Python interpreter?

2009-12-18 Thread Tim Golden
Scott Nelson wrote: On Thu, Dec 17, 2009 at 09:32:44PM -0800, Benjamin Castillo wrote: What is URL to online Python interpreter? There is also http://codepad.org/ which also supports lots of languages (Python, Ruby, Perl, PHP, C/C++...). Pretty slick. You can also use it as a public pastebi

Re: [Tutor] O.T.

2004-12-30 Thread Tim Johnson
ugh I have no intentions of giving up python and vim. I run both linux and windows concurrently on my work station so I guess I "swing both ways" when it comes to OS'es. Hobbies are gardening, landscaping, brewing beer, hiking and generally puttering 'round my property. H

[Tutor] Recommended SOAP libraries

2005-01-07 Thread Tim Johnson
What SOAP libraries might be recommended for python? -- thanks tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Faster procedure to filter two lists . Please help

2005-01-15 Thread Tim Peters
[Gonçalo Rodrigues] > It this correct? Python lists are not linked-lists (as in Scheme, for > example). They are more like arrays (or vectors in C++/Java) with a > little more sofistication built into them to allow, for example, to > amortize over time a sequence of append operations. But in a nuts

Re: [Tutor] Faster procedure to filter two lists . Please help

2005-01-15 Thread Tim Peters
[Alan Gauld] > OK, The timbot's word is good enough for me, I won't bother > looking at the code, I'll revert to my previous assumption! :-) It's educational to look at the code anyway . Here it is, from Python's listobject.c: static int list_length(PyListObject *a) { return a->ob_size;

Re: [Tutor] Unexpected result from decimal

2005-01-19 Thread Tim Peters
[Jacob S.] >I'm having a problem that is ticking me off. (to put it lightly) > Why does decimal do this -- I thought that getcontext().prec > was number of decimal places? It's unclear what you mean by "decimal places". From context, you _appear_ to mean "number of decimal digits after the r

[Tutor] Problems with test cgi script on windows XP/Apache

2005-02-13 Thread Tim Johnson
I'm attempting to run a test cgi script on windows xp with apache as the http server. I keep getting a not found error from IE, and the error log shows the following error message. No such file or directory: script not found or unable to stat: c:/program files/apache group/apache/cgi-bin/test.py A

Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-13 Thread Tim Johnson
to the above: the mime-type string ("Content-type: text/html\n") is consistant with what I am used to providing in linux. I am out of ideas for the time being. Does anyone else have any? TIA tim ___ Tutor maillist - Tutor@python.org

Fwd: Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Tim Johnson
Date: Mon, 14 Feb 2005 10:25:28 -0900 From: Tim Johnson <[EMAIL PROTECTED]> Subject: Re: [Tutor] Problems with test cgi script on windows XP/Apache To: Tim Johnson <[EMAIL PROTECTED]> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 At 12:22 PM 2/13/2005, you wrote: I'm attempt

[Tutor] Attaching an uploaded file to an email

2005-02-19 Thread Tim Wilson
except ValueError: pass msg.preamble = "Tech order request" msg.epilogue = "" # Attach the uploaded file msg.attach(attachment) # Send the message server = smtplib.SMTP('localhost') server.sendmail(fromaddr, toaddr, msg.as_string(0)) server.quit() In this progr

Re: [Tutor] str.split and quotes

2005-04-07 Thread Tim Peters
[Tony Meyer] ... >> Somewhat ironically, one of the tenets of Python is "there should be one-- >> and preferably only one --obvious way to do it." (type "import this" at an [Marilyn Davis] > In this case, there is: regular expressions. :^) > > "Obvious" doesn't mean we can, necessarily, all see i

[Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Hello Pythonmeisters: Is it possible to dynamically compose a module name for import? Pointers to documentation or other discussions would be sufficient at this time. thanks -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutio

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
ing the auto modules (which isn't necessarily written in python). but like I said, I'm just thinking about this now, and am open to alternatives. Thanks Alan tim -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Appreciate the replies. Also found this link: http://diveintopython.org/functional_programming/dynamic_import.html See Example 16.15. :-) Very pythonesque! Methinks. thanks tj -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutio

Re: [Tutor] Subract Month From Date

2005-05-03 Thread Tim Peters
[Gooch, John] > Thank you for the idea, I could have been more clear that days part of the > date isn't important. Here is what I came up with: > >currentDate = datetime.datetime.fromtimestamp( time.time() ) Easier: today = datetime.date.today() >archMonth = 0 >archYear = 0 >

[Tutor] Class and Scope Question

2005-05-05 Thread Tim Johnson
The following test script is kind of got me baffled: #!/usr/local/bin/python class Eval: def __getitem__(self,key): return eval(key) ##def test(): ## i = 100 ## b = ["My", "name", "is", "Tim"] ## test = "this is number %(str(i))s fo

Re: [Tutor] Class and Scope Question

2005-05-06 Thread Tim Johnson
* Karl Pflästerer <[EMAIL PROTECTED]> [050506 10:40]: >Karl > -- > Please do *not* send copies of replies to me. > I read the list My Thanks to both Karl and Rich for help me to understand this problem. I also appreciate the documentation reference. cheers tim -- T

Re: [Tutor] python challenges

2005-05-06 Thread Tim Peters
[Max Noel] ... > In fact, I am (and will probably give up) at number 9. I was > able to do #7 without using PIL, but it seems that it is once again > necessary for #9, and I'm not gonna be able to use a workaround this > time. What do you have against PIL ? Processing images has played no par

Re: [Tutor] Python riddles

2005-05-08 Thread Tim Peters
[Jacob S.] > Ok, I'm stuck on #4 > > I tried using urllib like the source hints... but, when I run my automation > of the process of typing in the new nothing, I run through about 15 pages, > then I notice that they add an extra number in the text. > 60167 or something like that > This is encouragi

Re: [Tutor] character format

2005-05-11 Thread Tim Peters
[D. Hartley] > Max - yep, and the hint was "BUSY" (... BZ...)... > > Unfortunately that hint doesnt lead me anywhere (except to bz2, which > involves compression, and didnt seem very likely). > > I went through and removed all the \x## 's that represented > 'unprintable'/carraigereturn/etc characte

Re: [Tutor] (no subject). Ord and Chr query

2005-05-26 Thread Tim Johnson
mester and the book that we used was "Learn to Program Using Python", by Alan Gauld. I'm going to recommend it, even tho' many features have been added to python since (2001), it does a good job on the basics. -- tj -- Tim Johnson <[EMAIL PROTECTED]>

Re: [Tutor] quick PIL question

2005-06-02 Thread Tim Peters
[Max Noel] > ... > This is where the palette comes into play. Each 256-color image > has a palette, which is basically an array of length 256, where each > element is a (24-bit RGB) color. The color data for each pixel in the > image is actually an index in this array. Adding a bit of detail,

Re: [Tutor] screen scraping web-based email (Alan Gauld)

2007-04-19 Thread Tim Golden
Kent Johnson wrote: > FWIW most real-world HTML parsers (including Beautiful Soup) seem to be > based directly on SMTPlib, not htmllib or HTMLParser. I'm assuming you mean sgmllib here? TJG ___ Tutor maillist - Tutor@python.org http://mail.python.org

Re: [Tutor] Truncating a Table

2007-05-11 Thread Tim Golden
Leon Keylin wrote: > Why would this not work? > > import pymssql > > con = pymssql.connect(host='server > name',user='username',password='pwd',database='Database') > cur = con.cursor() > > > query="TRUNCATE TABLE Consolidatedmsgs;" > cur.execute(query) > print "Table Truncated: %d rows deleted"

Re: [Tutor] Truncating a Table

2007-05-11 Thread Tim Golden
Leon Keylin wrote: > Thanks Tim for a fast reply. > > The return gives me 0 Rows Truncated message and when I look at the table, > every record is still there. > There are no foreign keys on the table and no errors. > > Andreas asked if I should commit after, should I? I did

Re: [Tutor] Truncating a Table

2007-05-11 Thread Tim Golden
Leon Keylin wrote: > Yep, works if I do it manually, under the same user. And on other tables? (Just trying to narrow down). Does this work: import pymssql db = pymssql (...) q = db.cursor () q.execute ("CREATE TABLE #a (i INT)") q.execute ("INSERT INTO #a (i) VALUES (1)") q.execute ("SELECT

Re: [Tutor] Truncating a Table

2007-05-11 Thread Tim Golden
Leon Keylin wrote: > Same result. I think the problem maybe with the > extension module. It could be (try using the more recent pyodbc instead?) but in fact it worked for me, albeit in the toy example I posted. However, there's only so much mileage in working round a module's possible inadequaci

Re: [Tutor] (no subject)

2007-05-18 Thread Tim Golden
Richard Henderson wrote: > Hello, > I am a rank beginner, as I'm sure my question will show. After I enter > and save a script using Notepad, it is not recognized by DOS and will > not run. What might I be doing wrong. I am using PythonWin and Windows XP. Often the case that Notepad will (sile

Re: [Tutor] example of spawn

2007-06-06 Thread Tim Golden
Martin Walsh wrote: > '/dev/null' is a special file in a *nix environment that discards any > data written to it: http://en.wikipedia.org/wiki//dev/null > I can't think of a windows parallel to /dev/null. Merely for completeness, the windows (sort of) equivalent is the little-known NUL special fil

Re: [Tutor] [OT] Urgent Help Needed

2007-06-06 Thread Tim Golden
Stephen Nelson-Smith wrote: > Hello friends, > > I urgently need to get hold of someone who can help me with the > closing stages of a database project - porting data from an old system > to a completely rewritten schema. > > My lead developer has suffered a bereavement, and I need a SQL expert,

Re: [Tutor] Invoking Python from Vim

2007-06-07 Thread Tim Johnson
nd execute whole files. You can also test simple python code snippets from ex as in :python help(dict) and I've barely begun to scratch the surface . Tim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Automating Windows (Maintenance)

2007-07-02 Thread Tim Golden
Daniel McQuay wrote: > I wondering if any one uses Python to do such things as defragment, > clean up temp files, check for hard drive errors, check for unusual > processes running, and so on. I am in charge of maintaining a lot of > Windows PC's and it would make life so much easier if i could

Re: [Tutor] Automating Windows (Maintenance)

2007-07-02 Thread Tim Golden
Daniel McQuay wrote: > I wondering if any one uses Python to do such things as defragment, > clean up temp files, check for hard drive errors, check for unusual > processes running, and so on. I am in charge of maintaining a lot of > Windows PC's and it would make life so much easier if i could

Re: [Tutor] How can I escape a pound symbol in my script?

2007-07-06 Thread Tim Golden
ron wrote: > in the US, # is a symbol for weight, not currency. I didn't know that; I assumed it was only used for ordinal numbering (as in Item #3). # How do you write out, with a quick symbol, "I'm going to > buy 3# of potatoes? Assuming that "you" is us Brits, then: 3lb (that's lowerca

Re: [Tutor] ADO problem

2007-07-16 Thread Tim Golden
János Juhász wrote: > while not rs.EOF: > print rs.Fields[0].Value, rs.Fields[1].Value > rs.MoveNext() > > It print the next result: > IT (u'\xc1kos Szab\xf3',) > IT (u'Szabolcs K\xe1m\xe1n',) > ... > > So rs.Fields[1] is a tuple. Well, here's the most obvious thing: By the look of it

Re: [Tutor] adapting a converter openoffice

2007-07-26 Thread Tim Michelsen
> When you say nothing happemed I assume you mean the script > never terminated? Yes, you are right. it does not terminate and only blocks the screen. As stated on the site the script needs some special parameters of Openoffice. Therefore, until I step further, I wrap it around a shell script

[Tutor] adapting a converter openoffice

2007-07-26 Thread Tim Michelsen
Hello, I am Python learning in an early stage. I am currently trying to code a converter for openoffice based on PyODConverter: http://www.artofsolving.com/opensource/pyodconverter My goal is to be able to run my script from anywhere in the system (put it in Path) and then convert a file from/t

[Tutor] How to parse and extract data from a log file?

2007-08-07 Thread Tim Finley
I'm a newbie to programming and am trying to learn Python. Maybe I'm wrong, but I thought a practical way of learning it would be to create a script. I want to automate the gathering of mailbox statistics for users in a post office. There are two lines containing this information for each use

[Tutor] FAQ [Was Re: Python Book Recommendations [Was:....]]

2007-08-14 Thread Tim Michelsen
Hello, is there a FAQ for this list where we could put all these recommendations? Thanks, Timmie ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-15 Thread Tim Michelsen
should be fun! Therefore I am consindering to buy "Python Programming for the Absolute Beginner". Did anyone here use this book for leaning? Is it easy enough for a non-programmer while not being too light? Kind regards, Tim ___ Tutor maill

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread Tim Michelsen
Hey bhaaluu and list, > Have you seen this site yet? > > http://osl.iu.edu/~lums/swc/ Many many thanks for this link. Although it should be the most obvious to head to the source (python.org) I didn't go there. The above mentioned tutorial seem to cover exactly what I need and where I want do

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-19 Thread Tim Michelsen
Hello, >> Univ of Toronto, Indiana Univ, and Caltech. Dr. Wilson wrote about it in >> the magazine of Sigma Xi: >> >> http://www.americanscientist.org/template/AssetDetail/assetid/48548 >> >> It has moved around a lot. It's current official home is on scipy.org: >> >> http://www.swc.scipy.org/ >>

[Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-23 Thread Tim Johnson
e opinions on this matter. Thanks Tim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-24 Thread Tim Johnson
n't know wherethat is for > you). On *nix systems, I think it is generally var/lib/python/site-packages > Updating Python will still require copying the .pth file to the new > site-packages folder but no editing. Great! Thanks Kent Tim

Re: [Tutor] HOWTO: adding to sys.path the simplest way.

2007-08-24 Thread Tim Johnson
On Friday 24 August 2007, Tim Johnson wrote: > On Thursday 23 August 2007, Kent Johnson wrote: > > > I would welcome some opinions on this matter. > > > > Make a file called mylibraries.pth with contents > > /path/to/mylibraries > > Aha! User-defined .pth fi

[Tutor] Trouble with script not parsing out text

2007-08-29 Thread Tim Finley
   """, re.VERBOSE)    line.search('Audit report for user () User reported as inactive')    log2.write(line)   log.close() log2.close()   Thank you,   Tim FinleyNovell IT Services EngineerNovell Technical ServicesNovell timaudit.log Description: Binary data __

[Tutor] input file encoding

2007-09-10 Thread Tim Michelsen
Thanks in advance, Tim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] input file encoding

2007-09-11 Thread Tim Golden
Tim Michelsen wrote: > Hello, > I want to process some files encoded in latin-1 (iso-8859-1) in my > python script that I write on Ubuntu which has UTF-8 as standard encoding. Not sure what you mean by "standard encoding" (is this an Ubuntu thing?) but essentially whenever y

Re: [Tutor] input file encoding

2007-09-11 Thread Tim Golden
Kent Johnson wrote: > Tim Golden wrote: >> Not sure what you mean by "standard encoding" (is this an Ubuntu >> thing?) > > Probably referring to the encoding the terminal application expects - > writing latin-1 chars when the terminal expects utf-8 will not

Re: [Tutor] input file encoding

2007-09-11 Thread Tim Michelsen
> Not sure what you mean by "standard encoding" (is this an Ubuntu > thing?) but essentially whenever you're pulling stuff into Python As it was lined out by others I was printing to a linux terminal which had the encoding set to UTF-8. Therefore and for further processing of the data I had to ope

Re: [Tutor] Disable keyboard/mouse input on windows?

2007-10-01 Thread Tim Golden
Trey Keown wrote: > Hey everybody, > I was wondering, how could I disable all keyboard/mouse input for the > whole windows system while I have a video playing? So the user can't > press, for example, the super key [one with windows logo on it], and have > the windows menu pop up? > Could this be ac

Re: [Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread Tim Golden
Dave Kuhlman wrote: > On Mon, Oct 01, 2007 at 04:51:53PM +0200, J?nos Juh?sz wrote: >> Dear Tutors, >> >> I would like to make a new class instance, where >> the intance attributes coming from the kwargs hash. >> >> class ADUser: >> def __init__(self, **kwargs): >> for key in kwargs.key

Re: [Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-09 Thread Tim Golden
Tony Cappellini wrote: > Using Windows XP, SP2 and Python 2.3 > > I've written a script which walks through a bunch of directories and > replaces characters which are typically illegals as filenames, with an > '_' character. [...] > When my script encounters a directory with the unwanted charact

Re: [Tutor] internet access

2007-10-11 Thread Tim Golden
Kirk Vander Meulen wrote: > I'd like to write a script that limits internet access to certain hours of > the day. This seems like it should be simple. That's a very optimistic point of view! > Can someone point me in the right direction on this- I'm sure I can > figure out how to use a calend

Re: [Tutor] internet access

2007-10-11 Thread Tim Golden
shawn bright wrote: > i did something very similar to this. My daughter would stay on her instant > messenger (gaim) all night if i didn't. i have a cron script that checks the > hour of day, if later than x pm. does > os.system("/etc/init.d/network stop") > os.system("chmod a-x /etc/init.d/network

Re: [Tutor] internet access

2007-10-11 Thread Tim Golden
Michael Langford wrote: > While I don't know how to do it in a platform independent way, WSH > appears to have all the net functions you'd need (I've only looked at > Vistabut I assume Xp is the same). > > http://en.wikipedia.org/wiki/Windows_Script_Host > > If you find python bindings for

[Tutor] symbol encoding and processing problem

2007-10-16 Thread Tim Michelsen
Dear list, I have encountered a problem with encoding of user input and variables. I want to read in user defined coordinates as a string like: 121° 55' 5.55'' Furthermore I would like to extract the degrees (integer number before the " ° " sign), the minutes (integer number before the " ' " sign)

Re: [Tutor] symbol encoding and processing problem

2007-10-16 Thread Tim Michelsen
> How do you get this output? The print is after the statement causing the > traceback. Are you showing the same code as you ran? Yes. I created this file in PythonWin and run it with IPython. > It displays correctly for me (on MacOS X). Are you sure your source is > actually encoded in utf-8? N

Re: [Tutor] Regex parsing and writing to file

2007-10-16 Thread Tim Golden
Peter Mexbacher wrote: > Hello, > > first post here :-) > > I have the following task: > > 1) read in a file line by line > 2) parse each line with a regular expression, and substitute certain > patterns > 3) end result: the old file with the substituted stuff (and of course > everything which

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Tim Golden
Timmie wrote: >>> from easygui import easygui >>> raw = unicode("121ø 55' 5.55''", 'utf-8') >>> => gets a encoding error >> Then your source file is not really in UTF-8. > This really helped! > > >> Get an editor on Windows that can edit UTF-8 text files and file >> transfer software that doesn

Re: [Tutor] OT [Re: symbol encoding and processing problem]

2007-10-17 Thread Tim Golden
Timmie wrote: >> I'm sure there'll be lots of other suggestions, but the SciTE >> editor (whose name I'm never sure how to prononunce without >> blushing) understands the same encoding directive as Python. >> It's quite lightweight, and also allows you to run Python scripts >> directly, although th

Re: [Tutor] symbol encoding and processing problem

2007-10-19 Thread Tim Golden
Timmie wrote: > I am totally lost: > * python has ascii as default encoding > * my linux uses UTF-8 (therefore all files created on linux are UTF-8) > * windows uses cp1250 > * IPtyhon something else: on the machine where I am currently on stdin is set > to > cp850 > > So what encoding to I use t

Re: [Tutor] how to read from a csv file?

2007-10-22 Thread Tim Golden
pierre cutellic wrote: > Hi, this is a module i wrote to catch some data from a csv file: > > ## > #module csv data reader > # open a csv file and return its data > > import csv > import sys > > def __init__(self): > Stop right there. You're confusing modules and classes. A class has a

Re: [Tutor] XP environment variables (was: Wrong version of Python being executed)

2007-11-12 Thread Tim Golden
Marc Tompkins wrote: > In W2K and XP (not sure about NT), changes to environment variables made via > the Control Panel will affect any NEW environments instantiated from the > moment you click OK in the Environment Variables dialog. ... > Something to be aware of, though - if CMD is being starte

[Tutor] detecting a change in a iterable object (list, array, etc.)

2007-11-26 Thread Tim Michelsen
Example data: Yearmonth volume 19971 2 19972 2 19973 2 19974 5 19975 2 19977 1 19981 2 19982 6 19983 3 19984 3 19985 3 19986 1 Thanks and kind regards, Tim

Re: [Tutor] detecting a change in a iterable object (list, array, etc.)

2007-11-27 Thread Tim Michelsen
Hello, > If you show us what you have done so far it would be easier to make > suggestions. The thing is that I am working a lot with time series data and need to write criteria based filters for that data. There's already a start in SciPy Time Series package: http://www.scipy.org/SciPyPackages/Tim

[Tutor] lstrip removes '/' unexpectedly

2007-11-30 Thread Tim Johnson
7; was unexpectedly removed Any comments or corrective measures are welcome thanks Tim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Problems with List Server?

2007-12-03 Thread Tim Johnson
very frustrating turn of events and I am hoping that it will be corrected soon. I wonder if anyone else is having similar problems? I suspect that this email will be delivered, but I might not be able to send another on the same thread. Any ideas? tim

<    1   2   3   4   5   6   >