dictionary and list

2007-10-30 Thread Beema shafreen
hi everbody, I have a file, a b c d e 2722316 2722360A_16_P03641972150-44 2722510 2722554A_16_P2136023916-44 2722570 2722614A_16_P0364197344-44 2722658

Re: parse text file

2007-10-30 Thread Pradeep Jindal
On Tuesday 30 Oct 2007 12:06:57 pm william paul wrote: Hi: I am new to this list and new to Python. I have a text file that looks like: values 4 50 values 3 900 values] 7 400 ... values} 9 70 I want to be able to remove from each line everything up to or ] sign. For example: 4 50 3

Re: and and or on every item in a list

2007-10-30 Thread GHZ
Thanks for the answers, I suspected something like any(), all() existed. Also got me thinking about generator expressions, my code is full of list comprehensions for lists I don't keep. -- http://mail.python.org/mailman/listinfo/python-list

Re: A class question

2007-10-30 Thread Gabriel Genellina
En Tue, 30 Oct 2007 02:51:39 -0300, Donn Ingle [EMAIL PROTECTED] escribió: 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. I come from Z80A/GWBASIC/VB and a

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 = 1

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-30 Thread Gabriel Genellina
En Tue, 30 Oct 2007 01:46:19 -0300, Dick Moores [EMAIL PROTECTED] escribió: At 06:34 PM 10/29/2007, Gabriel Genellina wrote: The underlying function in Windows is Sleep (or SleepEx) which takes an argument in milliseconds. 0.0001s = 0.1ms and it's rounded to 0. Ah, useful information. Thank

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: def table(func,

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

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, just like

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 and the

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 list(),

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 are more than

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 Python

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 seems

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... import random

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 old style.

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, generating

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 inconsistent.

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 ability

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 30. How can I

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. We recently had to

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 list

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 writing

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

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 uplink 4

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 does

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 readline it

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

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

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('values') That's a lot faster than regex. -- 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 programming.

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 = lambda n

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 readline it

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 taught

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 out

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

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 serve Bob now? Let

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 not at all.

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

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 out!)

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 Ed pg.

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 thread,

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 what the

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 = lambda n

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

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.1310

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 Python 3:

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

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

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 don't think you can, until Python 3:

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:51:08) [MSC

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: nothing

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 return

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. Here is what

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 http://ccnuma.anu.edu.au/~wpc/blog/programming/building- python.html worked just fine on Ultra 20 Opteron machine. The test result summary is below. /Jean Brouwers 249 tests OK. 2 tests failed:

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 http://docs.python.org/whatsnew/pep-353.html. /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 from

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) Help on class int in module

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_P03641973

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

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

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 from

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 these days

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 iteration and not

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 am trying

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

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: Py-Fun

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 and

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(Bowrpg abg sbhaq

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 trying to parse a xml

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. before

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 for foo.

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 such a way

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 file

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 beautiful

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 solution to this problem. Run my

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 objects allocated

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:38PM +0100, Boris

_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

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

  1   2   >