Re: Built-in functions and keyword arguments

2007-10-30 Thread Marc 'BlackJack' Rintsch
On Tue, 30 Oct 2007 07:28:07 +0200, Hendrik van Rooyen wrote: > yes - the point I am trying to make is that the intention of the OP > was to use an assignment as an argument, and you can't do that, > as the interpreter thinks its a keyword. Hence the gotcha. Then you must have misunderstand his

Re: Iteration for Factorials

2007-10-30 Thread Anurag
What about this no map, reduce, mutiplication or even addition Its truly interative and You will need to interate till infinity if you want correct answer ;) def factorial(N): """ Increase I ...and go on increasing... """ import random myNumer = range(N) count = 0 I =

Re: A Python 3000 Question

2007-10-30 Thread Marc 'BlackJack' Rintsch
On Mon, 29 Oct 2007 19:50:14 -0700, George Sakkis wrote: > On Oct 29, 5:49 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >> | why not a_string.len()? >> >> You are free to bypass builtins and call methods directly if you like: >> a_string.__len__(). >> >> But consider rewriting the following: >>

Re: A Python 3000 Question

2007-10-30 Thread Thomas Wittek
Bjoern Schliessmann: > Is there any particular reason why it should be a method? > > [..] > > To make a long story short: Most methods do specific things with > objects; but len is a common function to get a simple property of > an object. You said it. IMHO it really could be a *property*, say `

Re: How python writes text into another windows application

2007-10-30 Thread Laurent Pointal
Le Mon, 29 Oct 2007 21:53:47 +, Meitham a écrit : > Hi, > > I am trying to write a simple program that reads data from a source file > (Excel sheet, XML file or text file) and then write the data into > another application by pasting the data into the applications fields, > and jumps from one

Re: A Python 3000 Question

2007-10-30 Thread Bruno Desthuilliers
brad a écrit : > Will len(a_string) become a_string.len()? I was just reading > > http://docs.python.org/dev/3.0/whatsnew/3.0.html > > One of the criticisms of Python compared to other OO languages is that > it isn't OO enough Really ? IIRC, Python doesn't have primitive types, functions are o

Re: A class question

2007-10-30 Thread Hrvoje Niksic
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> While Java's variable declarations bear a superficial (syntactical) >> similarity to C, their semantics is in fact equivalent to the >> object-reference semantics we know in Python. They implicitly refer >> to objects allocated on the heap and,

Retrieving all open applications ...

2007-10-30 Thread Ajay Deshpande
Hi everyone: I need to retrieve all currently open applications using a python program. So my output should be a list of window handles. Is there a module which I can use? Thanks for any help. -Ajay -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Bruno Desthuilliers
Fuzzyman a écrit : > On Oct 22, 6:43 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: (snip) >> # Inherit from object. There's no reason to create old-style classes. > > > We recently had to change an object pipeline from new style classes to > old style. A lot of these objects were being created an

Re: A Python 3000 Question

2007-10-30 Thread Bruno Desthuilliers
brad a écrit : > Rob Wolfe wrote: > >> I wonder why people always complain about `len` function but never >> about `iter` or `pprint.pprint`? :) > > Not complaining. len is simple and understandable and IMO fits nicely > with split(), strip(), etc... that's why I used it as an example, but > li

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > >>> It seems to me that in recent times more Python beginners come from >>> a Java background than from a C one. >> Java does have "container" variables for primitive types, and even >> for "references", Java's variables

Re: Help ctypes on arm linux not compile

2007-10-30 Thread Thomas Heller
Samuel M. Smith schrieb: > I have built python 1.5.1 from source for an embedded ARM9 debian > linux Sarge distribution but > ctypes doesn't build. Anybody have any idea what the problem is? Do > I have to have the libffi package > installed. > See my errors below. ctypes won't work with Pyth

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Hrvoje Niksic
Fuzzyman <[EMAIL PROTECTED]> writes: > We recently had to change an object pipeline from new style classes > to old style. A lot of these objects were being created and the > *extra overhead* of new style classes was killing us. :-) Can you please expand on this? What extra overhead of new-style

Re: How python writes text into another windows application

2007-10-30 Thread Wolfgang Draxinger
Meitham wrote: > My question is, how do I write the data into another > application fields. My target application is the TNT > consignment manager. I asked TNT for their API to make my life > easier but they refused to release it :(. You know what the word "market" means? Just tell TNT, that it s

Re: Iteration for Factorials

2007-10-30 Thread Nick Craig-Wood
Anurag <[EMAIL PROTECTED]> wrote: > What about this no map, reduce, mutiplication or even addition > Its truly interative and You will need to interate till infinity if > you want correct answer ;) > > def factorial(N): > """ > Increase I ...and go on increasing... > """ >

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Fuzzyman
On Oct 29, 11:35 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > > On Oct 22, 6:43 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >> # Inherit from object. There's no reason to create old-style classes. > > > We recently had to change an object pipeline from new style classes to

Re: Iteration for Factorials

2007-10-30 Thread Marco Mariani
Nick Craig-Wood wrote: > Note you can write your middle loop as > > for i in range(I): > number = myNumer[:] > random.shuffle(number) > if number == myNumer: > count+=1 Nice. Try 'em all, then count 'em. Another wtfery would be a SQLAlchemy solution, gene

Re: A Python 3000 Question

2007-10-30 Thread Eduardo O. Padoan
On 10/29/07, brad <[EMAIL PROTECTED]> wrote: > Will len(a_string) become a_string.len()? I was just reading > > http://docs.python.org/dev/3.0/whatsnew/3.0.html > > One of the criticisms of Python compared to other OO languages is that > it isn't OO enough or as OO as others or that it is inconsist

Re: A Python 3000 Question

2007-10-30 Thread Dustan
On Oct 29, 7:59 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann wrote: > > The inconsistencies arise, IMHO, if an OO language introduces > > non-object types for performance reasons, after that gets wrapper > > classes to wrap those primitives, and even later gets the abi

Re: Need some help...

2007-10-30 Thread Boris Borcic
[EMAIL PROTECTED] wrote: > I want to create a program that I type in a word. > > for example... > > chaos > > each letter equals a number > > A=1 > B=20 > > and so on. > > So Chaos would be > > C=13 H=4 A=1 O=7 S=5 > > I want to then have those numbers > 13+4+1+7+5 added together to be

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Chris Mellon
On Oct 30, 2007 5:52 AM, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Oct 29, 11:35 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Fuzzyman wrote: > > > On Oct 22, 6:43 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > >> # Inherit from object. There's no reason to create old-style classes. > > > >

redundancy_check

2007-10-30 Thread Beema shafreen
hi everbody, I have a file, a b c 1454VALTGLTVAEYFR8.9954e-07 1454VALTGLTVAEYFR0.00404626 1498STLTDSLVSK0.00404626 1505TIAMDGTEGLVR1.50931e-05 1528GAEISAILEER0.00055542 1528GAEISAILEER0.00055542 1538

Re: Iteration for Factorials

2007-10-30 Thread Boris Borcic
Py-Fun wrote: > I'm stuck trying to write a function that generates a factorial of a > number using iteration and not recursion. Any simple ideas would be > appreciated. > fact = lambda n : len(map([1].__imul__,range(1,n+1))[0]) hth :) BB -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration for Factorials

2007-10-30 Thread auzaar
On Oct 30, 3:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Anurag <[EMAIL PROTECTED]> wrote: > > What about this no map, reduce, mutiplication or even addition > > Its truly interative and You will need to interate till infinity if > > you want correct answer ;) > > > deffactorial(N): > >

Readline and record separator

2007-10-30 Thread Johny
Is it possible to change record separator when using readline? As far as I know readline reads characters until found '\n' and it is the end of record for readline. My problem is that my record consits several '\n' and when I use readline it does NOT read the whole my record. So If I could change '

Re: appending into a list

2007-10-30 Thread c james
Beema shafreen wrote: > 2721520 2721569A_16_P21360235199-49 > 2721768 2721821A_16_P03641971139-53 > 2721960 2722004A_16_P21360237312-44 > I need to append the column D and E into a list: > in such a way that the li

Re: appending into a list; dictionary and list

2007-10-30 Thread Tim Chase
>A B C D E [snipped yet another column of random data] > I need to append the column D and E into a list: > in such a way that the list should have > [D,E,D,E,D,E] > How do i do it. You start by writ

Re: Readline and record separator

2007-10-30 Thread Jeff
If it's a short file you could slurp the entire file and then split it however you like using regular expressions. I'm not sure if you can alter it, but os.linesp holds the value that is accessed when file.readlines() splits lines. Conceivably, if it were set to 'FOO', 'FOO' would be used to dete

Proxying downloads

2007-10-30 Thread Martin Marcher
Hello, more a recipe question. I'm working on a proxy that will download a file for a client. The thing that doesn't yield problems is: Alice (Client) Bob (Client) Sam (Server) 1 Alice asks Sam for "foobar.iso" 2 Sam can't find "foobar.iso" in "cachedir" 3 Sam requests "foobar.iso" from the upli

Re: Readline and record separator

2007-10-30 Thread A.T.Hofkamp
On 2007-10-30, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readline it

Re: Readline and record separator

2007-10-30 Thread clbr
On Oct 30, 12:21 pm, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readl

Re: Proxying downloads

2007-10-30 Thread Jeff
You use a temp directory to store the file while downloading, then move it to the cache so the addition of the complete file is atomic. The file name of the temp file should be checked to validate that you don't overwrite another process' download. Currently downloading urls should be registered w

Re: A Python 3000 Question

2007-10-30 Thread brad
Eduardo O. Padoan wrote: > This is a FAQ: > http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm Thanks to all for the feedback. I'm no language designer. I just see and hear these criticisms and I wanted to think thro

Re: parse text file

2007-10-30 Thread Jeff
You can also use strip() if it's the same possibilities every time: line_of_text.lstrip('http://mail.python.org/mailman/listinfo/python-list

Re: python in academics?

2007-10-30 Thread Jeff
Yes, Python is used in many CS programs. In fact, I read that Guido van Rossum often polls profs about their needs when thinking about new features and the direction of the language. -- http://mail.python.org/mailman/listinfo/python-list

۩۞۩๑█ TAMIL SEX FREE LIVE๑۩۞۩๑█

2007-10-30 Thread [EMAIL PROTECTED]
๑۩۞۩๑█ TAMIL SEX FREE LIVE๑۩۞۩๑█ NOTBIOTECHNOLOGEY ONLY SEX FREE SEX LIVE SHOW FREE ROMANCE SEX LIVE INDIAN SEX ๑۩۞۩๑█ TAMIL SEX FREE LIVE๑۩۞۩๑█ http://TAMIL-GIRLS-SEX-STILL.notlong.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python in academics?

2007-10-30 Thread kyosohma
On Oct 29, 10:39 pm, sandipm <[EMAIL PROTECTED]> wrote: > seeing posts from students on group. I am curious to know, Do they > teach python in academic courses in universities? > > in undergrad comp science courses, We had scheme language as scheme > is neat and beautiful language to learn program

Re: Iteration for Factorials

2007-10-30 Thread J. Clifford Dyer
On Tue, Oct 30, 2007 at 01:09:38PM +0100, Boris Borcic wrote regarding Re: Iteration for Factorials: > > Py-Fun wrote: > > I'm stuck trying to write a function that generates a factorial of a > > number using iteration and not recursion. Any simple ideas would be > > appreciated. > > > > fact

Re: Readline and record separator

2007-10-30 Thread George Sakkis
On Oct 30, 8:21 am, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readli

Re: python in academics?

2007-10-30 Thread BartlebyScrivener
On Oct 29, 10:39 pm, sandipm <[EMAIL PROTECTED]> wrote: > seeing posts from students on group. I am curious to know, Do they > teach python in academic courses in universities? This came up a while back. See: http://tinyurl.com/2pjjua If that doesn't work, search the Google group for "Python tau

Re: getting serialized data into and out of a database

2007-10-30 Thread Michael Pelz Sherman
THANK YOU! I needed to use tostring() in this case but the key was realizing what kind of data I was dealing with. Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Mon, 29 Oct 2007 19:07:18 -0300, Michael Pelz Sherman escribió: > I'm having a devil of a time getting serialized data into and o

Re: python2.5 and mysqldb

2007-10-30 Thread BartlebyScrivener
On Oct 29, 2:30 pm, brad <[EMAIL PROTECTED]> wrote: > or get a > more flexible OS that easily allows for this sort of thing (like Debian) Second that. Etch came with 2.3 and 2.4, and I added 2.5 and they never bother each other. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: coverage.py: "Statement coverage is the weakest measure of code coverage"

2007-10-30 Thread Ned Batchelder
I don't know how to extend coverage.py to do more extensive checking, but I know it would be both difficult and fascinating. To help spur some thought, I've sketched out some problems with statement coverage: http://nedbatchelder.com/blog/20071030T084100.html --Ned. On Oct 28, 6:56 pm, Ben Finne

Re: Proxying downloads

2007-10-30 Thread Martin Sand Christensen
> But I can't figure out how I would solve the following: > > 1 Alice asks Sam for "foobar.iso" > 2 Sam can't find "foobar.iso" in "cachedir" > 3 Sam requests "foobar.iso" from uplink > 4 Sam saves and forwards to Alice > 5 At about 30 % of the download Bob asks Sam for "foobar.iso" > 6 How do I se

Re: A Python 3000 Question

2007-10-30 Thread Steven D'Aprano
On Tue, 30 Oct 2007 00:11:58 +, Marc 'BlackJack' Rintsch wrote: >>> And to answer the question. In OO programming generic functions are no >>> less important than classes and objects. >> >> Do they not take away from the OOness of the overall language and >> introduce inconsistencies? > > No

Hide comments in emacs python mode?

2007-10-30 Thread Charles Fox
Hi guys, I'm playing with Python in emacs, with python mode. I'd like to be able to press a key to toggle the code comments on and off -- to switch between beautiful clean Python code, and the full text that tells me what's going in in English. Is this currently possible? I know there is a hide

Earn Up To 100's of $ per Day with Ease!

2007-10-30 Thread jhon
Tired of business opportunities that do not deliver what they promise? Get Free Advice & a Honest Review on Internet Opportunities that Work! MOre details http://powerfulmoneymakingideas.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

logic programming in python (was something about py3k)

2007-10-30 Thread Jean-Paul Calderone
On Tue, 30 Oct 2007 14:09:39 -, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > [snip] > >(Aside: I think it a shame that there is one major paradigm that Python >doesn't have *any* support for at all: logic programming, like Prolog. I >don't quite know what it is good for, but I'd like to find

Re: Readline and record separator

2007-10-30 Thread BartlebyScrivener
On Oct 30, 7:21 am, Johny <[EMAIL PROTECTED]> wrote: > My problem is that my record consits several '\n' and when I use > readline it does NOT read the whole my record. > So If I could change '\n' as a record separator for readline, it > would solve my problem. Python Cookbook (great book!) 2nd E

Re: Event for multithread help advice

2007-10-30 Thread Aahz
In article <[EMAIL PROTECTED]>, JoeSox <[EMAIL PROTECTED]> wrote: > >I have two threads going >class guiThread(threading.Thread) >class mainThread(threading.Thread) > >Within the guiThread, I have an instance of class GUIFramework(Frame) >in this Tkinter instance I have a ListBox. > >The second th

Re: Help ctypes on arm linux not compile

2007-10-30 Thread Samuel M. Smith
Sorry, thats a typo. Its python 2.5.1. as the error messages indicate. On 30 Oct 2007, at 02:55 , Thomas Heller wrote: > Samuel M. Smith schrieb: >> I have built python 1.5.1 from source for an embedded ARM9 debian >> linux Sarge distribution but >> ctypes doesn't build. Anybody have any idea wh

Re: Iteration for Factorials

2007-10-30 Thread J. Clifford Dyer
On Tue, Oct 30, 2007 at 01:09:38PM +0100, Boris Borcic wrote regarding Re: Iteration for Factorials: > > Py-Fun wrote: > > I'm stuck trying to write a function that generates a factorial of a > > number using iteration and not recursion. Any simple ideas would be > > appreciated. > > > > fact

SQLObject 0.8.6

2007-10-30 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.6 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wi

Re: A Python 3000 Question

2007-10-30 Thread Neil Cerutti
On 2007-10-30, Eduardo O. Padoan <[EMAIL PROTECTED]> wrote: > This is a FAQ: > http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm Holy Airy Persiflage Batman! Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.13

Re: setting variables in outer functions

2007-10-30 Thread Neil Cerutti
On 2007-10-29, Steven Bethard <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: >> Tommy Nordgren <[EMAIL PROTECTED]> writes: >> >>> Given the following: >>> def outer(arg) >>> avar = '' >>> def inner1(arg2) >>> # How can I set 'avar' here ? >> >> I don't think you can, until

SQLObject 0.9.2

2007-10-30 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.9.2 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wi

SQLObject 0.7.9

2007-10-30 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.7.9 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wit

Re: A Python 3000 Question

2007-10-30 Thread Jean-Paul Calderone
On Tue, 30 Oct 2007 15:25:54 GMT, Neil Cerutti <[EMAIL PROTECTED]> wrote: >On 2007-10-30, Eduardo O. Padoan <[EMAIL PROTECTED]> wrote: >> This is a FAQ: >> http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm > >Holy Airy

Re: setting variables in outer functions

2007-10-30 Thread Steven Bethard
Neil Cerutti wrote: > On 2007-10-29, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Hrvoje Niksic wrote: >>> Tommy Nordgren <[EMAIL PROTECTED]> writes: >>> Given the following: def outer(arg) avar = '' def inner1(arg2) # How can I set 'avar' here ? >>> I d

Re: A Python 3000 Question

2007-10-30 Thread George Sakkis
On Oct 30, 11:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-10-30, Eduardo O. Padoan <[EMAIL PROTECTED]> wrote: > > > This is a FAQ: > >http://effbot.org/pyfaq/why-does-python-use-methods-for-some-function... > > Holy Airy Persiflage Batman! > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:

Re: A Python 3000 Question

2007-10-30 Thread Paul Boddie
On 30 Okt, 15:09, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > [Language "OOness", hand-waving] > I disagree. I think they *do* take away from the overall Object-Oriented > nature of the language, and that is A Very Good Thing Indeed. But everything is an object in Python: not

Re: setting variables in outer functions

2007-10-30 Thread Duncan Booth
Neil Cerutti <[EMAIL PROTECTED]> wrote: > It's allows a standard programming idiom which provides a > primitive form of object oriented programming using closures to > represent state. > > def account(opening_balance): > balance = opening_balance > def get_balance(): > nonlocal balance >

Re: statvfs

2007-10-30 Thread Korthrun
At 2007-10-29, [EMAIL PROTECTED] expressed thier undying love for me by saying: > On Mon, 29 Oct 2007 16:52:12 -0500, Korthrun wrote: > >> I'm writing some scripts to populate RRD's, mainly for practicing python. >> >> As such I've decided to play with statvfs in order to build disk >> graphs. Her

Python Instructor Needed for GIS Symposium in April 2008

2007-10-30 Thread Eric . Foster
I am involved with MAGIC http://www.magicgis.org/ an organization to encourage GIS development, sharing, cooperation, etc. and educate practitioners in GIS. We hold a symposium every two years in April (next is April 2008) and provide speakers and workshops in relevant GIS subjects. ESRI's

Re: Solaris 10 + Sun Studio 12 Pyrhon 2.4.4 64-bit build problem

2007-10-30 Thread MrJean1
Building 64-bit Python 2.4.4 on Solaris 10 and SUC C/C++ using the instructions from worked just fine on Ultra 20 Opteron machine. The test result summary is below. /Jean Brouwers 249 tests OK. 2 tests failed: te

Re: Solaris 10 + Sun Studio 12 Pyrhon 2.4.4 64-bit build problem

2007-10-30 Thread MrJean1
On final comment. For 64-bit usage, Python 2.5.1 is the better choice. More on that here . /Jean Brouwers On Oct 30, 10:15 am, MrJean1 <[EMAIL PROTECTED]> wrote: > Building 64-bit Python 2.4.4 on Solaris 10 and SUC C/C++ using the > instructions f

Re: Built-in functions and keyword arguments

2007-10-30 Thread Duncan Booth
"J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: >> How do you interpret: >> >> >>> help(__import__) >> Help on built-in function __import__ in module __builtin__: >> >> __import__(...) >> __import__(name, globals={}, locals={}, fromlist=[], level=-1) -> >> module >> ... >> >>> help(int) >> Hel

Re: dictionary and list

2007-10-30 Thread Gerardo Herzig
Beema shafreen wrote: >hi everbody, > I have a file, > a b c d e > 2722316 2722360A_16_P03641972150-44 > 2722510 2722554A_16_P2136023916-44 > 2722570 2722614A_16_P0364197

choose from a list

2007-10-30 Thread barronmo
I'm new to programming and even newer to Python and would be grateful for some help on what has been a tough problem for me. The project I am working on is an electronic medical record using MySQL/Python. I'm currrently working on a module that looks up a patient's name based on input from the us

Python Interview Questions

2007-10-30 Thread Krypto
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying to catch up again with Python. I am now appearing for Job Interviews these days and I am wondering if

Parsing xml file in python

2007-10-30 Thread amjadcsu
I am a newbie in python I am trying to parse a xml file and write its content in a txt file. The txt contains null elements. Any reason what iam doing wrong here Here is the code that i wrote import sys,os import xml.sax import xml.sax.handler from xml.sax.handler import ContentHandler from xml

Re: Parsing xml file in python

2007-10-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am a newbie in python > I am trying to parse a xml file and write its content in a txt file. > The txt contains null elements. Any reason what iam doing wrong here > > > Here is the code that i wrote > > import sys,os > import xml.sax > import xml.sax.handler > fr

Re: Python Interview Questions

2007-10-30 Thread sndive
Krypto wrote: > Hi, > > I have used Python for a couple of projects last year and I found it > extremely useful. I could write two middle size projects in 2-3 months > (part time). Right now I am a bit rusty and trying to catch up again > with Python. > > I am now appearing for Job Interviews thes

Re: Iteration for Factorials

2007-10-30 Thread [EMAIL PROTECTED]
On Oct 30, 10:25 am, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 30, 2007 at 01:09:38PM +0100, Boris Borcic wrote regarding Re: > Iteration for Factorials: > > > > > Py-Fun wrote: > > > I'm stuck trying to write a function that generates a factorial of a > > > number using iteratio

Re: Parsing xml file in python

2007-10-30 Thread amjadcsu
That XML is just a snapshot I am not getting into the xml parser. The error is not generated but also the /root/yhpc-2.0/ganglia.txt does not contain anything. On Oct 30, 12:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > I am a newbie in python > > I

simple? embedding question

2007-10-30 Thread sndive
suppose i have imported two modules foo and bar with foo=PyImport_ImportModule("foo") and bar=PyImport_ImportModule("bar") respectively. Now suppose I have an artitrary python expression to evaluate. Do I need to parse that thring and check for foo. and bar. before jumping the usual PyModule_GetDi

Re: Iteration for Factorials

2007-10-30 Thread J. Clifford Dyer
On Tue, Oct 30, 2007 at 11:37:57AM -0700, [EMAIL PROTECTED] wrote regarding Re: Iteration for Factorials: > > On Oct 30, 10:25 am, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > > On Tue, Oct 30, 2007 at 01:09:38PM +0100, Boris Borcic wrote regarding Re: > > Iteration for Factorials: > > > > >

Re: choose from a list

2007-10-30 Thread [EMAIL PROTECTED]
On Oct 30, 1:03 pm, barronmo <[EMAIL PROTECTED]> wrote: > I'm new to programming and even newer to Python and would be grateful > for some help on what has been a tough problem for me. The project I > am working on is an electronic medical record using MySQL/Python. I'm > currrently working on a

Re: Parsing xml file in python

2007-10-30 Thread Marc 'BlackJack' Rintsch
On Tue, 30 Oct 2007 11:45:17 -0700, amjadcsu wrote: > I am not getting into the xml parser. What does this mean!? > The error is not generated but also the /root/yhpc-2.0/ganglia.txt does > not contain anything. Maybe because… >> > def endElement(self,name): >> > if name=="HOST" an

Re: Python Interview Questions

2007-10-30 Thread Tim Chase
> I have used Python for a couple of projects last year and > I found it extremely useful. I could write two middle size > projects in 2-3 months (part time). Right now I am a bit > rusty and trying to catch up again with Python. > > I am now appearing for Job Interviews these days and I am

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Donn Ingle a écrit : >>vzcbeg vafcrpg >> >>qrs _svaq(senzr, bow): >>sbe anzr, inyhr va senzr.s_ybpnyf.vgrevgrzf(): >>vs inyhr vf bow: >>erghea anzr >>sbe anzr, inyhr va senzr.s_tybonyf.vgrevgrzf(): >>vs inyhr vf bow: >>erghea anzr >>envfr XrlReebe

Re: Parsing xml file in python

2007-10-30 Thread J. Clifford Dyer
On Tue, Oct 30, 2007 at 11:45:17AM -0700, [EMAIL PROTECTED] wrote regarding Re: Parsing xml file in python: Top-posting corrected > > > > On Oct 30, 12:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] schrieb: > > > > > > > > > I am a newbie in python > > > I am

Re: simple? embedding question

2007-10-30 Thread Farshid Lashkari
[EMAIL PROTECTED] wrote: > suppose i have imported two modules foo and bar with > foo=PyImport_ImportModule("foo") and bar=PyImport_ImportModule("bar") > respectively. > > Now suppose I have an artitrary python expression to evaluate. > Do I need to parse that thring and check for foo. and bar. be

parsing ast nodes help to get callfunc values.

2007-10-30 Thread Glich
""" Hi! This is my code so far: This code analyzes a python file. How can I separate CallFunc from the est of the ast node? file.py is as follows: _ def fun1(): print "Hi" fun2() fun4() def fun2(): pass def fun4(): pass fun1() _

Re: choose from a list

2007-10-30 Thread Bruno Desthuilliers
barronmo a écrit : > I'm new to programming and even newer to Python and would be grateful > for some help on what has been a tough problem for me. The project I > am working on is an electronic medical record using MySQL/Python. I'm > currrently working on a module that looks up a patient's name

Re: simple? embedding question

2007-10-30 Thread kyosohma
On Oct 30, 1:31 pm, [EMAIL PROTECTED] wrote: > suppose i have imported two modules foo and bar with > foo=PyImport_ImportModule("foo") and bar=PyImport_ImportModule("bar") > respectively. > > Now suppose I have an artitrary python expression to evaluate. > Do I need to parse that thring and check f

Re: appending into a list

2007-10-30 Thread Bruno Desthuilliers
c james a écrit : > Beema shafreen wrote: > >> 2721520 2721569A_16_P21360235199-49 >> 2721768 2721821A_16_P03641971139-53 >> 2721960 2722004A_16_P21360237312-44 >>I need to append the column D and E into a list: >>in

Re: Readline and record separator

2007-10-30 Thread Bruno Desthuilliers
Johny a écrit : > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. This is not a "record" separator, but a newline. As the name implies, file.readline is about reading a text fi

Re: Readline and record separator

2007-10-30 Thread Bruno Desthuilliers
Jeff a écrit : > If it's a short file you could slurp the entire file and then split it > however you like using regular expressions. My my my... > I'm not sure if you can alter it, You can. But it hopefully won't alter your binary-compiled system libs. IOW : it's so (obviously) useless that no

Re: python in academics?

2007-10-30 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Oct 29, 10:39 pm, sandipm <[EMAIL PROTECTED]> wrote: > >>seeing posts from students on group. I am curious to know, Do they >>teach python in academic courses in universities? >> >>in undergrad comp science courses, We had scheme language as scheme >>is neat and b

Re: setting variables in outer functions

2007-10-30 Thread Bruno Desthuilliers
brad a écrit : > Tommy Nordgren wrote: > >>> def outer(avar=False): >>> print avar >>> if avar == True: >>> return >>> >>> def inner(avar=True): >>> print avar >>> return avar >>> >>> outer(inner()) >>> >>> outer() > > >> This is not a general s

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > > >>>While Java's variable declarations bear a superficial (syntactical) >>>similarity to C, their semantics is in fact equivalent to the >>>object-reference semantics we know in Python. They implicitly refer >>>to ob

Re: Iteration for Factorials

2007-10-30 Thread [EMAIL PROTECTED]
On Oct 30, 1:52 pm, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 30, 2007 at 11:37:57AM -0700, [EMAIL PROTECTED] wrote regarding > Re: Iteration for Factorials: > > > > > > > > > On Oct 30, 10:25 am, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > > > On Tue, Oct 30, 2007 at 01:09:3

_tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-30 Thread wyleu
I'm running on Mandriva 2007 (2.6.17-5mdv) and thus have python2.4.3 installed by default, I'm running code requiring yield(), so need python2.5 and have installed this sucessfully, and linked appropriately to allow me to start python2.5 by typing python2.5. However I'd like to use idle so requir

Re: Python Interview Questions

2007-10-30 Thread Krypto
> Good luck with your interviewing and hope this helped, > > -tkc Well, I was looking exactly for this. Many thanks to you Tim. After going through your list I came to know that I know nothing in Python and have to catch up a whole lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: python in academics?

2007-10-30 Thread kyosohma
On Oct 30, 2:55 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > On Oct 29, 10:39 pm, sandipm <[EMAIL PROTECTED]> wrote: > > >>seeing posts from students on group. I am curious to know, Do they > >>teach python in academic courses in universities? > > >>in unde

Arp request to get MAc Adress with IP address

2007-10-30 Thread amjadcsu
Hello, I have a network on same subnet. I have an ip address of a machine. but i need to get its MAC Adress. Sendingf ARP request is the way i am taking. IS there any other way to get this MAC Adress in python.?? Also does python go down to level 2 of TCP/IP model?? Sorry if i am to naive. Just

Re: A class question

2007-10-30 Thread George Sakkis
On Oct 28, 6:01 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > Is there a way I can, for debugging, access the instance variable name from > within a class? Shouldn't this be in a FAQ somewhere? It's the second time (at least!) it comes up this week. George -- http://mail.python.org/mailman/listi

Re: parsing ast nodes help to get callfunc values.

2007-10-30 Thread Peter Otten
Glich wrote: > If some one could show me how to use something called "visitor"? import compiler module = """ def fun1(): print "Hi" fun2() fun4() def fun2(): pass def fun4(): pass fun1() fun3(fun2()) """ class Visitor: def visitCallFunc(self, node): print nod

why did these companies choose Tcl over Python

2007-10-30 Thread chewie54
Hello, As an electronics engineer I use some very expensive EDA CAD tool programs that are scriptable using Tcl. I was wondering why these companies have choose to use Tcl instead of Python. Some of these are: Mentor Graphics ModelTech VHDL and Verilog simulator Synopsys Design Compiler

  1   2   >