xlrd and cPickle.dump

2008-03-31 Thread patrick . waldo
Hi all, I have to work with a very large excel file and I have two questions. First, the documentation says that cPickle.dump would be the best way to work with it. However, I keep getting: Traceback (most recent call last): File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework \script

Re: troll poll

2008-03-31 Thread Grant Edwards
On 2008-03-31, Carl Banks <[EMAIL PROTECTED]> wrote: > On Mar 31, 1:41 pm, Paul Rubin wrote: >> "Daniel Fetchinson" <[EMAIL PROTECTED]> writes: >> > [ ] - Xah Lee >> > [ ] - castironpi >> >> I've lost track but has it been established that they are not the same >> perso

Re: why does socket.makefile require non-blocking mode?

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 14:15:56 -0300, Forest <[EMAIL PROTECTED]> escribió: > My main concern is this: A brief look at the existing socket._fileobject > shows that its read() method calls recv() in a loop, appending to a > temporary buffer on each pass, and finally returning the buffer when > recv()

Elementtree to parse xml

2008-03-31 Thread Doran, Harold
I received some help on list with sample code on how to parse through an xml file using element tree. I now have this working using toy examples nicely. However, when I work to apply this to my actual xml file, I am hitting a roadblock. Is anyone on the list able to look at an xml file that I can

Re: [OT] troll poll

2008-03-31 Thread Gary Herron
Duncan Booth wrote: > Paul Rubin wrote: > > >> "Daniel Fetchinson" <[EMAIL PROTECTED]> writes: >> >>> [ ] - Xah Lee >>> [ ] - castironpi >>> >> I've lost track but has it been established that they are not the same >> person? >> >> > Has it actually

Re: troll poll

2008-03-31 Thread George Sakkis
On Mar 31, 1:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > More specifically, who can create a bigger mess on c.l.py? (check one) > > > [ ] - Xah Lee > > [X] - castironpi > > Xah Lee's postings might be trolls but sometimes they spark some really > interesting and serious subthrea

Re: Why prefer != over <> for Python 3.0?

2008-03-31 Thread Terry Reedy
"Bjoern Schliessmann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | > However, I'm quite sure that when Unicode has arrived almost | > everywhere, some languages will start considering such characters | > in their core syntax. | | This should be the time when there are widespread

Re: Beginner advice

2008-03-31 Thread Gary Herron
Paul Scott wrote: > I have been tasked to come up with an audio recorder desktop (cross > platform if possible - but linux only is OK) that: > > 1. records a lecture as an MP3 file (pymedia?) > 2. Provides a login form for server credentials > 3. Uploads via XMLRPC (pyxmlrpclib) to the server as a

Re: Newbie Question - Overloading ==

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 20:09, Duncan Booth <[EMAIL PROTECTED]> wrote: > xkenneth <[EMAIL PROTECTED]> wrote: > > Now obviously, if I test an instance of either class equal to each > > other, an attribute error will be thrown, how do I handle this? I > > could rewrite every __eq__ function and catch attribute er

Re: License of Python

2008-03-31 Thread Roger Miller
Is there any legal problem with including licenses for languages you don't use? (But I agree with the other posters that any competitor worthy of concern will figure it out in short order if they care.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for indent advice howto in emacs python-mode

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 18:32, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > Here's what I want to do: > > if ( ( v == 1 ) >or ( v == 2 ) >or ( v == 3 ) ): > pass Why the parens ? if a == 1 \ or b == 2 \ or c == 3: pass -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a python c-module: passing double arrays to c functions. segmentation fault. swig

2008-03-31 Thread sturlamolden
On 31 Mar, 20:52, kim <[EMAIL PROTECTED]> wrote: > array_pointer_t = ndpointer(dtype=c_double) This one is wrong. The dtype should be the datatype kept in the array, which is 'float' (Python doubles) or 'numpy.float64'. array_pointer_t = ndpointer(dtype=numpy.float64) I'd take a good look at t

Command line input

2008-03-31 Thread hexusnexus
How do I receive input from the command line in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good time to start learning python?

2008-03-31 Thread Terry Reedy
"Rui Maciel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Recently I woke up inclined to take up the task of learning another | programming language. I've already dipped my toes in Perl (I've read online | tutorials and wrote a couple of irrelevant pet projects) but, as the | co

Re: Command line input

2008-03-31 Thread Marc 'BlackJack' Rintsch
On Mon, 31 Mar 2008 12:39:54 -0700, hexusnexus wrote: > How do I receive input from the command line in Python? Direct way `sys.argv`, comfortable way `optparse`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: python scripts to standalone executable

2008-03-31 Thread Amit Gupta
On Mar 31, 11:45 am, John Henry <[EMAIL PROTECTED]> wrote: > Not sure. I use it on windows. > > > I haven't looked at pyinstall.. Is it for linux? > > It appears so - according tohttp://www.pyinstaller.org/ Thanks! It does show support for Linux. The documentation says it works for python until

Re: Problem with method overriding from base class

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 11:05, <[EMAIL PROTECTED]> wrote: > Hello everyone > > I have defined some sort of 'interface class' and a factory function that > creates instance objects of specific classes, which implement that interface: > > Interface definition: > **

Re: Newbie Question - Overloading ==

2008-03-31 Thread Amit Gupta
On Mar 31, 11:00 am, xkenneth <[EMAIL PROTECTED]> wrote: > Yeah, this is what I'm talking about: > > > def __eq__(self, other) : > > try : > > return <> > > except AttributeError: > > return False > > That seems a bit nasty to me. One thing about python (IMO); you can't just say this

Re: Newbie Question - Overloading ==

2008-03-31 Thread xkenneth
On Mar 31, 3:42 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > On Mar 31, 11:00 am, xkenneth <[EMAIL PROTECTED]> wrote: > > > Yeah, this is what I'm talking about: > > > > def __eq__(self, other) : > > >   try : > > >      return <> > > >   except AttributeError: > > >      return False > > > That see

Re: Python and Db

2008-03-31 Thread David Anderson
I would like to use sqlite, But I also wanted a tutorial with the basis of the sql and etc, I never dealed with dbs before On Mon, Mar 31, 2008 at 3:42 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 31 Mar 2008 14:50:27 -0300, David Anderson <[EMAIL PROTECTED]> > escribió: > > > Hi! I

import multiple modules with same name

2008-03-31 Thread Christian Bird
Is it possible to import multiple modules with the same name from different locations? I'm using two different pieces of software, both of which have a module named util.py. I know that I can modify sys.path to fix which util gets imported when I do: import util I'd like to be able to do someth

Re: python scripts to standalone executable

2008-03-31 Thread Mike Driscoll
On Mar 31, 12:24 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > Hi > > I am looking for a some tool that can convert python scripts to > executable on Linux. > > I found freeeze.py as the only option so far. Couple of queries on > freeze: > > 1. Have anyone used the freeze utility and any experiences

Re: License of Python

2008-03-31 Thread roee shlomo
On 30/03/2008, iu2 <[EMAIL PROTECTED]> wrote: > > The problem is that including Python's license in the binary, which as > I understand is a must do I think you only need to include the PSF license if you modify python itself. from http://www.python.org/psf/license/: > There is no GPL-like "cop

Re: Python and Db

2008-03-31 Thread David Anderson
It's DB = DataBase, I typed wrong on the text, but right at the subject =) On Mon, Mar 31, 2008 at 5:50 PM, David Anderson <[EMAIL PROTECTED]> wrote: > I would like to use sqlite, But I also wanted a tutorial with the basis of > the sql and etc, I never dealed with dbs before > > > On Mon, Mar 31

Re: import multiple modules with same name

2008-03-31 Thread Gary Herron
Christian Bird wrote: > Is it possible to import multiple modules with the same name from > different locations? I'm using two different pieces of software, both > of which have a module named util.py. I know that I can modify > sys.path to fix which util gets imported when I do: > > import util

Question about overloading of binary operators

2008-03-31 Thread Raj Bandyopadhyay
Hi Here's a simple class example I've defined # class myInt(int): def __add__(self,other): return 0 print 5 + myInt(4) #prints 9 print myInt(4) + 5 #prints 0 # The Python binary operation function (binary_op1() in Objects/a

Re: CTypes, 64 bit windows, 32 bit dll

2008-03-31 Thread Martin v. Löwis
> Crap, no way to make a 32 bit load, even using the wowexec? With WoW64, you can run 32-bit processes on a 64-bit system (as you do all the time). That's all it does. You cannot load a 64-bit DLL into a 32-bit application, or vice versa. If you want to load a 32-bit DLL on Win64, use the 32-bit

Re: python scripts to standalone executable

2008-03-31 Thread Amit Gupta
On Mar 31, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > What about creating a setup.py and using the distutils command to > build rpms or tarballs? > > http://docs.python.org/dist/built-dist.html > > Mike My quick look: The link you sent is under the header "Distributing Python Modules".

Re: Is this a good time to start learning python?

2008-03-31 Thread Ant
On Mar 31, 5:40 pm, Rui Maciel <[EMAIL PROTECTED]> wrote: ... > So far the decision seems to be a no brainer. Yet, Python 3000 will arrive > in a few months. As it isn't backwards compatible with today's Python, > there is the risk that no matter what I learn until then, I will end up > having to r

Re: PyQT / QDate / QTableWidget

2008-03-31 Thread wrightee
That worked! Thank you; I had given up on QDate but changing the format worked perfectly. -- http://mail.python.org/mailman/listinfo/python-list

Problem with mod_python/3.3.1 and apache

2008-03-31 Thread NccWarp9
Hello, im using Apache HTTPD 2.2.8 with mod_python/3.3.1 Python/2.4.3 on Windows and having truble starting pythone, any help would be appreciated . Im getting this error: [Mon Mar 31 23:53:03 2008] [error] make_obcallback: could not import mod_python.apache.\n 'import site' failed; use -v for tr

Re: why does socket.makefile require non-blocking mode?

2008-03-31 Thread Forest
Bryan Olson wrote: >Looking at the code for the existing _fileobject's read method, it >will loose data it has already read if a socket.recv() call raises >an exception. The function keeps buffers in a local variable that >will be lost if an exception exits the scope. That much could be >fixed wit

Re: Question about overloading of binary operators

2008-03-31 Thread gigs
Raj Bandyopadhyay wrote: > Hi > > Here's a simple class example I've defined > > # > class myInt(int): >def __add__(self,other): > return 0 > > print 5 + myInt(4) #prints 9 > print myInt(4) + 5 #prints 0 > # > > The Python bi

PyQt - How to prevent a dialog being resized?

2008-03-31 Thread Kelie
Hello, My question is as subject. I tried something like this and it doesn't work. def resizeEvent(self, event): self.size = event.oldSize() Any hint? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with mod_python/3.3.1 and apache

2008-03-31 Thread Graham Dumpleton
On Apr 1, 8:03 am, NccWarp9 <[EMAIL PROTECTED]> wrote: > Hello, > > im using Apache HTTPD 2.2.8 with mod_python/3.3.1 Python/2.4.3 on > Windows and having truble starting pythone, any help would be > appreciated > . > Im getting this error: > > [Mon Mar 31 23:53:03 2008] [error] make_obcallback: co

class super method

2008-03-31 Thread gigs
is there any tutorial for super method (when/how to use it)? or maybe someone could explain me how it works? thx -- http://mail.python.org/mailman/listinfo/python-list

Re: standard input, for s in f, and buffering

2008-03-31 Thread Jorgen Grahn
On 31 Mar 2008 06:54:29 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sun, 30 Mar 2008 21:02:44 +, Jorgen Grahn wrote: > >> I realize this has to do with the extra read-ahead buffering documented for >> file.next() and that I can work around it by using file.readline() >> instea

Re: Command line input

2008-03-31 Thread Jorgen Grahn
On 31 Mar 2008 20:13:05 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 31 Mar 2008 12:39:54 -0700, hexusnexus wrote: > >> How do I receive input from the command line in Python? > > Direct way `sys.argv`, comfortable way `optparse`. I have a feeling he doesn't mean command-line

Re: class super method

2008-03-31 Thread George Sakkis
On Mar 31, 6:25 pm, gigs <[EMAIL PROTECTED]> wrote: > is there any tutorial for super method (when/how to use it)? > > or maybe someone could explain me how it works? > > thx Super is one of the dark corners of the language [1,2]... a good rule of thumb is to stay away from it, or at least stick t

Re: Command line input

2008-03-31 Thread Rick Dooling
On Mar 31, 2:39 pm, [EMAIL PROTECTED] wrote: > How do I receive input from the command line in Python? As long as we are all guessing, do you perhaps mean raw_input? my_name = raw_input("What is your name? ") What is your name? Rick >>> my_name 'Rick' -- http://mail.python.org/mailman/listinfo

RE: troll poll

2008-03-31 Thread Delaney, Timothy (Tim)
George Sakkis wrote: > On Mar 31, 1:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >>> More specifically, who can create a bigger mess on c.l.py? (check >>> one) >> >>> [ ] - Xah Lee >>> [X] - castironpi >> >> Xah Lee's postings might be trolls but sometimes they spark some >> re

Re: class super method

2008-03-31 Thread castironpi
On Mar 31, 5:58 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Mar 31, 6:25 pm, gigs <[EMAIL PROTECTED]> wrote: > > > is there any tutorial for super method (when/how to use it)? > > > or maybe someone could explain me how it works? > > > thx > > Super is one of the dark corners of the language

python persistence

2008-03-31 Thread castironpi
Can you have a Python object stored entirely on disk? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt - How to prevent a dialog being resized?

2008-03-31 Thread hdante
On Mar 31, 7:12 pm, Kelie <[EMAIL PROTECTED]> wrote: > Hello, > > My question is as subject. I tried something like this and it doesn't > work. > > def resizeEvent(self, event): > self.size = event.oldSize() > > Any hint? > > Thank you. You should preset size hints: http://doc.trolltech.com/

Re: python persistence

2008-03-31 Thread 7stud
On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > Can you have a Python object stored entirely on disk? import cPickle as cp class Dog(object): def __init__(self, name): self.name = name d = Dog("Spot") f = open("data.txt", "w") cp.dump(d, f) f.close() f = open("data.txt") stored_obj

RE: Automatically fill in forms on line

2008-03-31 Thread Ryan Ginstrom
> On Behalf Of Jackie Wang > I want to automatically complete the following task: > > 1. Go to http://www.ffiec.gov/Geocode/default.aspx; ... > > Can Python realize these steps? Can these steps be done > witout openning and IE windows? Especially, I dont know how > to write code for step 2, 4 a

Re: python scripts to standalone executable

2008-03-31 Thread Mike Driscoll
On Mar 31, 4:53 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > On Mar 31, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > What about creating a setup.py and using the distutils command to > > build rpms or tarballs? > > >http://docs.python.org/dist/built-dist.html > > > Mike > > My quick l

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > Can you have a Python object stored entirely on disk? > > import cPickle as cp > > class Dog(object): >     def __init__(self, name): >         self.name = name > > d = Dog("Spot") > > f = open

Re: Command line input

2008-03-31 Thread hexusnexus
On Mar 31, 4:04 pm, Rick Dooling <[EMAIL PROTECTED]> wrote: > On Mar 31, 2:39 pm, [EMAIL PROTECTED] wrote: > > > How do I receive input from the command line in Python? > > As long as we are all guessing, do you perhaps mean raw_input? > > my_name = raw_input("What is your name? ") > What is your n

Stuck in a loop

2008-03-31 Thread hexusnexus
I wrote a simple algorithm and it keeps getting stuck in a loop. I guess I'm just to tired to figure it out: compcount=[5,4,2,2] suitrank=[0,0,0,0] trump=2 l,lt=0,0 while l<4: while lt<4: if l==trump: l+=1 if l>3: break if lt==trump:

Re: Using QSystemTrayIcon with PyQt

2008-03-31 Thread Alex Teiche
On Mar 31, 11:49 am, Alex Teiche <[EMAIL PROTECTED]> wrote: > On Mar 30, 3:50 pm, Benjamin <[EMAIL PROTECTED]> wrote: > > > > > On Mar 29, 11:02 pm, Alex Teiche <[EMAIL PROTECTED]> wrote:> Hello, > > > > I am pretty new to Python, and have never learned C++. I am trying to > > > implement the foll

Re: Using QSystemTrayIcon with PyQt

2008-03-31 Thread Alex Teiche
On Mar 31, 6:40 pm, Alex Teiche <[EMAIL PROTECTED]> wrote: > On Mar 31, 11:49 am, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > > On Mar 30, 3:50 pm, Benjamin <[EMAIL PROTECTED]> wrote: > > > > On Mar 29, 11:02 pm, Alex Teiche <[EMAIL PROTECTED]> wrote:> Hello, > > > > > I am pretty new to Python,

Re: Stuck in a loop

2008-03-31 Thread Dan Bishop
On Mar 31, 8:22 pm, [EMAIL PROTECTED] wrote: > I wrote a simple algorithm and it keeps getting stuck in a loop. I > guess I'm just to tired to figure it out: > > compcount=[5,4,2,2] > suitrank=[0,0,0,0] > > trump=2 > l,lt=0,0 > while l<4: > while lt<4: > if l==trump: > l+=1

Re: Question about overloading of binary operators

2008-03-31 Thread Dan Bishop
On Mar 31, 5:03 pm, gigs <[EMAIL PROTECTED]> wrote: > Raj Bandyopadhyay wrote: > > Hi > > > Here's a simple class example I've defined > > > # > > class myInt(int): > >def __add__(self,other): > > return 0 > > > print 5 + myInt(4) #prints 9 > > print myInt(4)

Re: Looking for indent advice howto in emacs python-mode

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 16:36:13 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On 31 mar, 18:32, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: >> Here's what I want to do: >> >> if ( ( v == 1 ) >>or ( v == 2 ) >>or ( v == 3 ) ): >> pass > > Why the parens ? > > if a == 1 \ >

Re: python persistence

2008-03-31 Thread George Sakkis
On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > Can you have a Python object stored entirely on disk? > > > import cPickle as cp > > > class Dog(object): > > def __init__(self, nam

Re: socket error when loading the shell?

2008-03-31 Thread vokinloksar
i mean vpython(www.vpython.org). tried wi5th the normal IDLE too and it worked later after i posted this but now it doesnt work again. and i havent chnaged my firewall in between. python.exe works but i want the idle not the dos-interpreter. -- http://mail.python.org/mailman/listinfo/python-li

Re: Python and Db

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 17:50:42 -0300, David Anderson <[EMAIL PROTECTED]> escribió: > I would like to use sqlite, But I also wanted a tutorial with the basis > of > the sql and etc, I never dealed with dbs before Then any database tutorial covering SQL will do. Of course there are differences

Re: What motivates all unpaid volunteers at Pycon?

2008-03-31 Thread Aahz
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >I was impressed and humbled by all the unpaid volunteers at Pycon. What about the unpaid volunteers who weren't at PyCon? ;-) >I was wondering what motivated so many people to give so much to the >Python community.

Re: class super method

2008-03-31 Thread Ed Leafe
On Mar 31, 2008, at 5:58 PM, George Sakkis wrote: >> is there any tutorial for super method (when/how to use it)? >> >> or maybe someone could explain me how it works? >> >> thx > > Super is one of the dark corners of the language [1,2]... a good rule > of thumb is to stay away from it, or at leas

Re: Using QSystemTrayIcon with PyQt

2008-03-31 Thread Benjamin
On Mar 31, 8:41 pm, Alex Teiche <[EMAIL PROTECTED]> wrote: > On Mar 31, 6:40 pm, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 11:49 am, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > On Mar 30, 3:50 pm, Benjamin <[EMAIL PROTECTED]> wrote: > > > > > On Mar 29, 11:02 pm, Alex Teiche <[

Re: socket error when loading the shell?

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 23:28:13 -0300, <[EMAIL PROTECTED]> escribió: > tried wi5th the normal IDLE too and it worked later after i posted > this but now it doesnt work again. and i havent chnaged my firewall in > between. Perhaps any other running process has opened the port that IDLE uses to comm

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 9:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > > Can you have a Python object stored entirely on disk? > > > > import cP

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 10:28 pm, [EMAIL PROTECTED] wrote: > On Mar 31, 9:27 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 31, 8:51 pm, [EMAIL PROTECTED] wrote: > > > On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > > > > Can y

Re: Using QSystemTrayIcon with PyQt

2008-03-31 Thread Alex Teiche
On Mar 31, 7:53 pm, Benjamin <[EMAIL PROTECTED]> wrote: > On Mar 31, 8:41 pm, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > > On Mar 31, 6:40 pm, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > On Mar 31, 11:49 am, Alex Teiche <[EMAIL PROTECTED]> wrote: > > > > > On Mar 30, 3:50 pm, Benjamin <[EMAI

Re: python persistence

2008-03-31 Thread castironpi
On Mar 31, 7:14 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Mar 31, 5:31 pm, [EMAIL PROTECTED] wrote: > > > Can you have a Python object stored entirely on disk? > > import cPickle as cp > > class Dog(object): >     def __init__(self, name): >         self.name = name > > d = Dog("Spot") > > f = open

Re: Command line input

2008-03-31 Thread Paul Scott
On Mon, 2008-03-31 at 12:39 -0700, [EMAIL PROTECTED] wrote: > How do I receive input from the command line in Python? I have used: sys.argv[ 1 ] I have been doing Python for around 2 days now, so please do double check that! --Paul All Email originating from UWC is covered by disclaimer http

Re: deleting a line from a file

2008-03-31 Thread Paddy
On Mar 31, 7:10 pm, Mark Wooding <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > You could do it "in place" in all those systems afaik, either opening > > the file for both reading and writing, or using something like mmap. > > Basically you'd leave the file unchanged up to line N, then copy li

Re: Looking for indent advice howto in emacs python-mode

2008-03-31 Thread 7stud
On Mar 31, 10:32 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > Here's what I want to do: > > if ( ( v == 1 ) >    or ( v == 2 ) >    or ( v == 3 ) ): >      pass > python indenting = 4 spaces -- http://mail.python.org/mailman/listinfo/python-list

Re: python persistence

2008-03-31 Thread Gabriel Genellina
En Tue, 01 Apr 2008 00:48:35 -0300, <[EMAIL PROTECTED]> escribió: > We do have, but on Windows, file is not locked to multi-tasking, > shelve. But why don't we have types in there, or non-string > primitives in keys? > c= shelve.open( 'temp', 'c' ) c['0']= 'a' c.sync() del c >

Re: Stuck in a loop

2008-03-31 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I wrote a simple algorithm and it keeps getting stuck in a loop. I | guess I'm just to tired to figure it out: The easiest way to figure out somethinglike this is to print your variables from inside the loop to see things stick, or if

Re: standard input, for s in f, and buffering

2008-03-31 Thread Paddy
On Mar 31, 11:47 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On 31 Mar 2008 06:54:29 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> > wrote: > > > > > On Sun, 30 Mar 2008 21:02:44 +, Jorgen Grahn wrote: > > >> I realize this has to do with the extra read-ahead buffering documented for > >

Re: Looking for indent advice howto in emacs python-mode

2008-03-31 Thread Carl Banks
On Mar 31, 12:32 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > Here's what I want to do: > > if ( ( v == 1 ) >or ( v == 2 ) >or ( v == 3 ) ): > pass > > but emacs (left to its own devices, does this. > > if ( ( v == 1 ) > or ( v == 2 ) > or ( v == 3 ) ): > pass > >

Re: Why prefer != over <> for Python 3.0?

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 16:17:39 -0300, Terry Reedy <[EMAIL PROTECTED]> escribió: > "Bjoern Schliessmann" <[EMAIL PROTECTED]> > wrote > in message news:[EMAIL PROTECTED] > | > However, I'm quite sure that when Unicode has arrived almost > | > everywhere, some languages will start considering such c

Re: Rubik's cube translation

2008-03-31 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >What if this is connected: > D >array([[1, 2, 3], > [4, 5, 6], > [6, 7, 8]]) E >array([[6, 7, 8], > [0, 0, 0], > [0, 0, 0]]) > >--> > D >array([[1, 2, 3], > [4, 5, 6], > [6, 7, 8]]) E >array([[6, 7, 8], > [0,

Re: CTypes, 64 bit windows, 32 bit dll

2008-03-31 Thread Tim Roberts
rdahlstrom <[EMAIL PROTECTED]> wrote: >On Mar 31, 12:53 pm, "mimi.vx" <[EMAIL PROTECTED]> wrote: >> On Mar 31, 4:22 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: >> >> > So I have a 64 bit Windows 2003 system, running python 2.5.1.1. >> >> > I can import a Windows .dll (msvcrt or whatever) using ctypes

<    1   2