Re: python beginner

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, cna <[EMAIL PROTECTED]> wrote: > Hi all and one, > how may i learn python. is there any other website except python.org Yes, there are several millions web-sites, all across the world. They cover every possible topic you may and may not imagine. If you mean a website that tries to

Re: yo...

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, abhishek <[EMAIL PROTECTED]> wrote: > hey guys...me nu 2 python yo...help me...by da way...jus joined > inthanks Ask a specific question and you may get an answer. If you want an answer from me, it helps *a lot* if you write full english sentences (starting with a capital lette

Re: I am looking for svn library(module)

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking fo svn library(module) which is used in the svn- > mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody > know where can I find it(download url)? This is information which I > received from python err

Re: Newbie question

2008-07-09 Thread A.T.Hofkamp
On 2008-07-09, |e0 <[EMAIL PROTECTED]> wrote: > So, i can't use wmi module on linux? > > On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris <[EMAIL PROTECTED]> wrote: >> I think the win32 module is only for windows. >> Welcome to the world outside MS. Many python modules don't actually do anything th

Re: start reading from certain line

2008-07-09 Thread A.T.Hofkamp
On 2008-07-09, antar2 <[EMAIL PROTECTED]> wrote: > I am a starter in python and would like to write a program that reads > lines starting with a line that contains a certain word. > For example the program starts reading the program when a line is > encountered that contains 'item 1' > > > The weat

Re: socket-module: different behaviour on windows / unix when a timeout is set

2008-07-09 Thread A.T.Hofkamp
On 2008-07-09, Mirko Vogt <[EMAIL PROTECTED]> wrote: > Is that behaviour common or even documented? Found nothing. Second sentence in the socket module documentation: Note: Some behavior may be platform dependent, since calls are made to the operating system socket APIs. So yes, what you found i

Re: TypeError, I know why but not how!?

2008-07-09 Thread A.T.Hofkamp
On 2008-07-10, ssecorp <[EMAIL PROTECTED]> wrote: > > def validate(placed): > student = round(random.random()*401) > if student in placed: > validate(placed) > else: > placed.append(student) > return student, placed > > def pair(incompatibles, placed): > stud

Re: Weird lambda rebinding/reassignment without me doing it

2008-07-10 Thread A.T.Hofkamp
Python doesn't use value semantics for variables but reference semantics: a = [1] b = a In many languages, you'd now have 2 lists. In Python you still have one list, and both a and b refer to it. Now if you modify the data (the list), both variables will change a.append(2) # in-place modificat

Re: Cannot understand the detailedly the following code

2008-04-08 Thread A.T.Hofkamp
On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: [deleted a long piece of text by our BDFL about recursive graph path-finding algorithm] > after first writing the inductive part ... for node in > graph[start] > and then by trial and error put square brackets around path in the >

Re: Cannot understand the detailedly the following code

2008-04-09 Thread A.T.Hofkamp
On 2008-04-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Apr 8, 5:45 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > Ok following these instructions one gets > > def find_all_paths(graph, start, end, path=[]): > path= path+ [start] > > for

Re: is file open in system ? - other than lsof

2008-04-16 Thread A.T.Hofkamp
On 2008-04-16, bvidinli <[EMAIL PROTECTED]> wrote: > is there a way to find out if file open in system ? - > please write if you know a way other than lsof. because lsof if slow for me. > i need a faster way. > i deal with thousands of files... so, i need a faster / python way for this. > thanks.

Re: Fwd: is file open in system ? - other than lsof

2008-04-18 Thread A.T.Hofkamp
On 2008-04-17, bvidinli <[EMAIL PROTECTED]> wrote: > is there another way, any python command sequence that i can check if > a file is open at the time of "before i process file" > > i am not interested in " the file may be written after i access it.." > the important point is " the time at i first

Re: [Python 2.4/2.5] subprocess module is sorely deficient?

2008-04-22 Thread A.T.Hofkamp
On 2008-04-22, Harishankar <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry to start off on a negative note in the list, but I feel that the Python > subprocess module is sorely deficient because it lacks a mechanism to: > > 1. Create non-blocking pipes which can be read in a separate thread (I am I d

Re: Unix Device File Emulation

2008-04-24 Thread A.T.Hofkamp
On 2008-04-23, blaine <[EMAIL PROTECTED]> wrote: > On Apr 23, 2:01 pm, "Martin Blume" <[EMAIL PROTECTED]> wrote: >> "blaine" schrieb >> No, >> while 1: >> r = self.fifodev.readline() >> if r: print r >> else: time.sleep(0.1) >> is ok (note the "if r:" clause). >> >> Martin > >

Re: Comparing strings - akin to Perl's "=~"

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello gurus, Hello fellow-guru, > I am grabbing the output from a SQL statement (using PyGreSQL 'pg' > module), and when it returns the result, I am pulling it out as such: > > try: > sc=pg.connect(dbname='mydb',host='dbhost',user=

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > Studying OOP and noticed that Python does not have Interfaces. Is > that correct? Is my schooling for nought on these OOP concepts if I Depends on your definition of 'Python does not have Interfaces'. They are not in the official language, bu

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread A.T.Hofkamp
On 2008-05-06, jmDesktop <[EMAIL PROTECTED]> wrote: > > I would imagine this is why I haven't found any schools teaching > Python in their basic programming classes too. On the dynamic typing, I don't understand your reasoning. What part does 'this' refer to? Also, you are wrong. We teach 2nd yea

Re: open filename with spaces in path

2008-05-07 Thread A.T.Hofkamp
On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: os.chdir('C:\temp\my test') > Traceback (most recent call last): > File "", line 1, in > WindowsError: [Error 123] The filename, directory name, or volume > label syntax is incorrect: 'C:\temp\\my test' Python strings have \ escapes, such as

Re: Newbie to python --- why should i learn !

2008-05-08 Thread A.T.Hofkamp
On 2008-05-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > i was reading/learning some hello world program in python. > I think its very simillar to Java/C++/C#. What's different (except > syntax) ? Yes, and all programs that people write typically look like the hello world program. Loo

<    1   2